var e=e=>typeof e==`string`,t=e=>typeof e==`function`,n=new Map,r=`en`;function i(e){return[...Array.isArray(e)?e:[e],r]}function a(t,n,r){let a=i(t);r||=`default`;let o;if(typeof r==`string`)switch(o={day:`numeric`,month:`short`,year:`numeric`},r){case`full`:o.weekday=`long`;case`long`:o.month=`long`;break;case`short`:o.month=`numeric`}else o=r;return l(()=>u(`date`,a,r),()=>new Intl.DateTimeFormat(a,o)).format(e(n)?new Date(n):n)}function o(e,t,n){let r;if(n||=`default`,typeof n==`string`)switch(r={second:`numeric`,minute:`numeric`,hour:`numeric`},n){case`full`:case`long`:r.timeZoneName=`short`;break;case`short`:delete r.second}else r=n;return a(e,t,r)}function s(e,t,n){let r=i(e);return l(()=>u(`number`,r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function c(e,t,n,{offset:r=0,...a}){let o=i(e),s=t?l(()=>u(`plural-ordinal`,o),()=>new Intl.PluralRules(o,{type:`ordinal`})):l(()=>u(`plural-cardinal`,o),()=>new Intl.PluralRules(o,{type:`cardinal`}));return a[n]??a[s.select(n-r)]??a.other}function l(e,t){let r=e(),i=n.get(r);return i||(i=t(),n.set(r,i)),i}function u(e,t,n){return`${e}-${t.join(`-`)}-${JSON.stringify(n)}`}var d=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,f=e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return String.fromCharCode(e)}{let e=parseInt(n,16);return String.fromCharCode(e)}}),ee=`%__lingui_octothorpe__%`,te=(e,t,n={})=>{let r=t||e,i=e=>typeof e==`object`?e:n[e],l=(e,t)=>{let a=Object.keys(n).length?i(`number`):void 0,o=s(r,e,a);return t.replace(new RegExp(ee,`g`),o)};return{plural:(e,t)=>{let{offset:n=0}=t,i=c(r,!1,e,t);return l(e-n,i)},selectordinal:(e,t)=>{let{offset:n=0}=t,i=c(r,!0,e,t);return l(e-n,i)},select:p,number:(e,t)=>s(r,e,i(t)||{style:t}),date:(e,t)=>a(r,e,i(t)||t),time:(e,t)=>o(r,e,i(t)||t)}},p=(e,t)=>(Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0)??t.other;function ne(n,r,i){return(a={},o,s)=>{let c=te(r,i,o),l=e=>{let n=s?.[e];return a[e]??(t(n)?n():n)},u=(t,n=!1)=>Array.isArray(t)?t.reduce((t,r)=>{if(r===`#`&&n)return t+ee;if(e(r))return t+r;let[i,a,o]=r,s={};a===`plural`||a===`selectordinal`||a===`select`?Object.entries(o).forEach(([e,t])=>{s[e]=u(t,a===`plural`||a===`selectordinal`)}):s=o;let d;if(a){let e=c[a];d=e(l(i),s)}else d=l(i);return d==null?t:t+d},``):t,p=u(n);return e(p)&&d.test(p)?f(p):e(p)?p:p?String(p):``}}var re=class{_events={};on(e,t){return this._events[e]??=new Set,this._events[e].add(t),()=>this.removeListener(e,t)}removeListener(e,t){let n=this._events[e];n?.delete(t),n?.size===0&&delete this._events[e]}emit(e,...t){let n=this._events[e];if(n)for(let e of[...n])e.apply(this,t)}},ie=class extends re{_locale=``;_locales;_messages={};_variables={};_missing;_messageCompiler;constructor(e){super(),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.variables!=null&&(this._variables={...e.variables}),(typeof e.locale==`string`||e.locales)&&this.activate(e.locale??r,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get variables(){return this._variables}setVariable(e,t){return t===void 0?delete this._variables[e]:this._variables[e]=t,this.emit(`change`),this}setVariables(e){return this._variables={...t(e)?e(this._variables):e},this.emit(`change`),this}setMessagesCompiler(e){return this._messageCompiler=e,this}_load(e,t){let n=Object.prototype.hasOwnProperty.call(this._messages,e)?this._messages[e]:void 0;n?Object.assign(n,t):this._messages[e]=t}load(e,t){typeof e==`string`&&typeof t==`object`?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit(`change`)}loadAndActivate({locale:e,locales:t,messages:n}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=n,this.emit(`change`)}activate(e,t){this._locale=e,this._locales=t,this.emit(`change`)}_(n,r,i){if(!this.locale)throw Error(`Lingui: Attempted to call a translation function without setting a locale.
Make sure to call \`i18n.activate(locale)\` before using Lingui functions.
This issue may also occur due to a race condition in your initialization logic.`);let a=i?.message;n||=``,e(n)||(r=n.values||r,a=n.message,n=n.id);let o=this.messages,s=Object.prototype.hasOwnProperty.call(o,n)?o[n]:void 0,c=s===void 0,l=this._missing;if(l&&c)return t(l)?l(this._locale,n):l;c&&this.emit(`missing`,{id:n,locale:this._locale});let u=s||a||n;return e(u)&&(this._messageCompiler?u=this._messageCompiler(u):console.warn(`Uncompiled message detected! Message:

> ${u}

That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
ICU features such as interpolation and plurals will not work properly for that message.

Please compile your catalog first.
`)),e(u)&&d.test(u)?f(u):e(u)?u:ne(u,this._locale,this._locales)(r,i?.formats,this._variables)}t=this._.bind(this);date(e,t){return a(this._locales||this._locale,e,t)}number(e,t){return s(this._locales||this._locale,e,t)}};function ae(e={}){return new ie(e)}var m=ae();function h(e,t=m.locale||`en`){typeof e==`object`&&e&&!Array.isArray(e)&&m.load(t,e)}var g=globalThis.__BG3_DATA__?.locale||globalThis.document?.documentElement?.lang||`en`,oe=globalThis._F_VIEWER_GRAMMATICAL_GENDER||`other`;m.setVariable(`__gender`,oe),m.load(g,{}),m.activate(g),globalThis.__linguiLoad=h;var _=globalThis.__linguiQueue;if(globalThis.__linguiQueue=void 0,Array.isArray(_))for(let e of _)h(e[0],e[1]);function se(e){let t;try{t=new URL(e)}catch{return`https:`}return t.protocol}var ce=[`data:`,`http:`,`https:`,`mailto:`,`ftp:`],le=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;function ue(e){return!le.test(e)}function de(e){if(!ue(e))return e}function v(e){return de(e)}function fe(e){let t=se(e);return t!==void 0&&ce.indexOf(t.toLowerCase())!==-1?e:`about:invalid#zClosurez`}function pe(e,t){let n=v(t);n!==void 0&&(e.href=n)}var y=`google#safe`,b=globalThis.trustedTypes,x=b,S;function me(){let e=null;if(y===``||!x)return e;try{let t=e=>e;e=x.createPolicy(y,{createHTML:t,createScript:t,createScriptURL:t})}catch{}return e}function C(){return S===void 0&&(S=me()),S}var w={},T=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedResourceUrl=t}toString(){return this.privateDoNotAccessOrElseWrappedResourceUrl+``}},he=T;function ge(e){return new he(w,e)}function E(e){let t=e,n=C();return ge(n?n.createScriptURL(t):t)}function D(e){return e instanceof T}function O(e){if(D(e))return e.privateDoNotAccessOrElseWrappedResourceUrl;throw Error(``)}function k(e){return{valueOf:e}.valueOf()}var A=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedHtml=t}toString(){return this.privateDoNotAccessOrElseWrappedHtml+``}},_e=A;function j(e){return new _e(w,e)}function M(e){let t=e,n=C();return j(n?n.createHTML(t):t)}var ve=k(()=>j(b?b.emptyHTML:``));function ye(e){return e instanceof A}function N(e){if(ye(e))return e.privateDoNotAccessOrElseWrappedHtml;throw Error(``)}var P=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedScript=t}toString(){return this.privateDoNotAccessOrElseWrappedScript+``}},be=P;function xe(e){return new be(w,e)}function F(e){let t=e,n=C();return xe(n?n.createScript(t):t)}function Se(e){return e instanceof P}function I(e){if(Se(e))return e.privateDoNotAccessOrElseWrappedScript;throw Error(``)}function Ce(e,t,n,r){let i=v(t);return i===void 0?null:e.open(i,n,r)}function we(e){return Te(`script`,e)}function Te(e,t=document){let n=t.querySelector?.call(t,`${e}[nonce]`);return n==null?``:n.nonce||n.getAttribute(`nonce`)||``}function L(e){let t=we(e.ownerDocument);t&&e.setAttribute(`nonce`,t)}function Ee(e,t,n){e.textContent=I(t),!n?.omitNonce&&L(e)}function De(e,t,n){e.src=O(t),!n?.omitNonce&&L(e)}function Oe(e,t){Ae(e)&&ke(e),e.innerHTML=N(t)}function ke(e){let t=e.tagName;if(/^(script|style)$/i.test(t))throw Error(``)}function Ae(e){return e.nodeType===1}var je=[`alternate`,`author`,`bookmark`,`canonical`,`cite`,`help`,`icon`,`license`,`modulepreload`,`next`,`prefetch`,`dns-prefetch`,`prerender`,`preconnect`,`preload`,`prev`,`search`,`subresource`];function Me(e,t,n){if(D(t)){R(e,t,n);return}{if(je.indexOf(n)===-1)throw Error(`TrustedResourceUrl href attribute required with rel="${n}"`);let r=v(t);if(r===void 0)return;e.href=r}e.rel=n}function R(e,t,n){e.href=O(t).toString(),e.rel=n}var z=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedStyleSheet=t}toString(){return this.privateDoNotAccessOrElseWrappedStyleSheet}},Ne=z;function Pe(e){return new Ne(w,e)}function Fe(e){return e instanceof z}function Ie(e){if(Fe(e))return e.privateDoNotAccessOrElseWrappedStyleSheet;throw Error(``)}function Le(e,t){e.textContent=Ie(t)}function Re(e,t,n){let r=String(t),i=n;return r.toLowerCase()===`inserthtml`&&(i=N(n)),e.execCommand(r,!1,i)}function ze(e,t,n){return e.parseFromString(N(t),n)}function Be(e,t){return e.createContextualFragment(N(t))}function Ve(e,t){t.appendChild(e);let n=new XMLSerializer().serializeToString(t);return n=n.slice(n.indexOf(`>`)+1,n.lastIndexOf(`</`)),M(n)}var B;(function(e){e[e.STYLE_ELEMENT=0]=`STYLE_ELEMENT`,e[e.STYLE_ATTRIBUTE=1]=`STYLE_ATTRIBUTE`,e[e.HTML_ATTRIBUTE=2]=`HTML_ATTRIBUTE`})(B||={});function V(e){try{return new URL(e,window.document.baseURI)}catch{return new URL(`about:invalid`)}}var He=`:host{display:inline-block;clip-path:inset(0);overflow:hidden;vertical-align:top;text-decoration:inherit}`;function Ue(e,t){let n=t.createRange();return n.selectNode(t.body),Be(n,M(e))}function H(e){let t=e.nodeName;return typeof t==`string`?t:`FORM`}function U(e){return e.nodeType===3}function W(e){let t=e.nodeType;return t===1||typeof t!=`number`}var G=class{constructor(e,t,n,r,i){this.allowedElements=e,this.elementPolicies=t,this.allowedGlobalAttributes=n,this.globalAttributePolicies=r,this.globallyAllowedAttributePrefixes=i}isAllowedElement(e){return e!==`FORM`&&(this.allowedElements.has(e)||this.elementPolicies.has(e))}getAttributePolicy(e,t){let n=this.elementPolicies.get(t);return n?.has(e)?n.get(e):this.allowedGlobalAttributes.has(e)?{policyAction:K.KEEP}:this.globalAttributePolicies.get(e)||(this.globallyAllowedAttributePrefixes&&[...this.globallyAllowedAttributePrefixes].some(t=>e.indexOf(t)===0)?{policyAction:K.KEEP}:{policyAction:K.DROP})}},K;(function(e){e[e.DROP=0]=`DROP`,e[e.KEEP=1]=`KEEP`,e[e.KEEP_AND_SANITIZE_URL=2]=`KEEP_AND_SANITIZE_URL`,e[e.KEEP_AND_NORMALIZE=3]=`KEEP_AND_NORMALIZE`,e[e.KEEP_AND_SANITIZE_STYLE=4]=`KEEP_AND_SANITIZE_STYLE`,e[e.KEEP_AND_USE_RESOURCE_URL_POLICY=5]=`KEEP_AND_USE_RESOURCE_URL_POLICY`,e[e.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET=6]=`KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET`})(K||={});var We=new Set([`ANNOTATION-XML`,`COLOR-PROFILE`,`FONT-FACE`,`FONT-FACE-SRC`,`FONT-FACE-URI`,`FONT-FACE-FORMAT`,`FONT-FACE-NAME`,`MISSING-GLYPH`]);function Ge(e){return!We.has(e.toUpperCase())&&/^[a-z][-_.a-z0-9]*-[-_.a-z0-9]*$/i.test(e)}var Ke=`ARTICLE.SECTION.NAV.ASIDE.H1.H2.H3.H4.H5.H6.HEADER.FOOTER.ADDRESS.P.HR.PRE.BLOCKQUOTE.OL.UL.LH.LI.DL.DT.DD.FIGURE.FIGCAPTION.MAIN.DIV.EM.STRONG.SMALL.S.CITE.Q.DFN.ABBR.RUBY.RB.RT.RTC.RP.DATA.TIME.CODE.VAR.SAMP.KBD.SUB.SUP.I.B.U.MARK.BDI.BDO.SPAN.BR.WBR.NOBR.INS.DEL.PICTURE.PARAM.TRACK.MAP.TABLE.CAPTION.COLGROUP.COL.TBODY.THEAD.TFOOT.TR.TD.TH.SELECT.DATALIST.OPTGROUP.OPTION.OUTPUT.PROGRESS.METER.FIELDSET.LEGEND.DETAILS.SUMMARY.MENU.DIALOG.SLOT.CANVAS.FONT.CENTER.ACRONYM.BASEFONT.BIG.DIR.HGROUP.STRIKE.TT`.split(`.`),qe=[[`A`,new Map([[`href`,{policyAction:K.KEEP_AND_SANITIZE_URL}]])],[`AREA`,new Map([[`href`,{policyAction:K.KEEP_AND_SANITIZE_URL}]])],[`LINK`,new Map([[`href`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY,conditions:new Map([[`rel`,new Set([`alternate`,`author`,`bookmark`,`canonical`,`cite`,`help`,`icon`,`license`,`next`,`prefetch`,`dns-prefetch`,`prerender`,`preconnect`,`preload`,`prev`,`search`,`subresource`])]])}]])],[`SOURCE`,new Map([[`src`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY}],[`srcset`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],[`IMG`,new Map([[`src`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY}],[`srcset`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],[`VIDEO`,new Map([[`src`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY}]])],[`AUDIO`,new Map([[`src`,{policyAction:K.KEEP_AND_USE_RESOURCE_URL_POLICY}]])]],Je=`title.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-current.aria-disabled.aria-dropeffect.aria-expanded.aria-haspopup.aria-hidden.aria-invalid.aria-label.aria-level.aria-live.aria-multiline.aria-multiselectable.aria-orientation.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.alt.align.autocapitalize.autocomplete.autocorrect.autofocus.autoplay.bgcolor.border.cellpadding.cellspacing.checked.cite.color.cols.colspan.controls.controlslist.datetime.disabled.download.draggable.enctype.face.formenctype.frameborder.height.hreflang.hidden.ismap.label.lang.loop.max.maxlength.media.minlength.min.multiple.muted.nonce.open.placeholder.poster.preload.rel.required.reversed.role.rows.rowspan.selected.shape.size.sizes.slot.span.spellcheck.start.step.summary.translate.type.valign.value.width.wrap.itemscope.itemtype.itemid.itemprop.itemref`.split(`.`),Ye=[[`dir`,{policyAction:K.KEEP_AND_NORMALIZE,conditions:k(()=>new Map([[`dir`,new Set([`auto`,`ltr`,`rtl`])]]))}],[`async`,{policyAction:K.KEEP_AND_NORMALIZE,conditions:k(()=>new Map([[`async`,new Set([`async`])]]))}],[`loading`,{policyAction:K.KEEP_AND_NORMALIZE,conditions:k(()=>new Map([[`loading`,new Set([`eager`,`lazy`])]]))}],[`target`,{policyAction:K.KEEP_AND_NORMALIZE,conditions:k(()=>new Map([[`target`,new Set([`_self`,`_blank`])]]))}]],q=new G(new Set(Ke),new Map(qe),new Set(Je),new Map(Ye),void 0),J=class{constructor(e,t,n,r,i,a){this.sanitizerTable=e,this.styleElementSanitizer=n,this.styleAttributeSanitizer=r,this.resourceUrlPolicy=i,this.openShadow=a,this.changes=[]}sanitizeAssertUnchanged(e){return this.sanitize(e)}sanitize(e){let t=document.implementation.createHTMLDocument(``);return Ve(this.sanitizeToFragmentInternal(e,t),t.body)}sanitizeToFragment(e){let t=document.implementation.createHTMLDocument(``);return this.styleElementSanitizer&&this.styleAttributeSanitizer?this.sanitizeWithCssToFragment(e,t):this.sanitizeToFragmentInternal(e,t)}sanitizeWithCssToFragment(e,t){let n=document.createElement(`safevalues-with-css`),r=this.openShadow?`open`:`closed`,i=n.attachShadow({mode:r}),a=this.sanitizeToFragmentInternal(e,t),o=document.createElement(`style`);o.textContent=He,o.id=`safevalues-internal-style`,i.appendChild(o),i.appendChild(a);let s=t.createDocumentFragment();return s.appendChild(n),s}sanitizeToFragmentInternal(e,t){let n=Ue(e,t),r=document.createTreeWalker(n,5,e=>this.nodeFilter(e)),i=r.nextNode(),a=t.createDocumentFragment(),o=a;for(;i!==null;){let e;if(U(i)){if(this.styleElementSanitizer&&o.nodeName===`STYLE`){let t=this.styleElementSanitizer(i.data);e=this.createTextNode(t)}else e=this.sanitizeTextNode(i)}else if(W(i))e=this.sanitizeElementNode(i,t);else throw Error(``);if(o.appendChild(e),i=r.firstChild(),i)o=e;else for(;!(i=r.nextSibling())&&(i=r.parentNode());)o=o.parentNode}return a}createTextNode(e){return document.createTextNode(e)}sanitizeTextNode(e){return this.createTextNode(e.data)}sanitizeElementNode(e,t){let n=H(e),r=t.createElement(n),i=e.attributes;for(let{name:e,value:t}of i){let a=this.sanitizerTable.getAttributePolicy(e,n);if(!this.satisfiesAllConditions(a.conditions,i)){this.recordChange(`Not all conditions satisfied for attribute: ${e}.`);continue}switch(a.policyAction){case K.KEEP:Y(r,e,t);break;case K.KEEP_AND_SANITIZE_URL:let i=fe(t);i!==t&&this.recordChange(`Url in attribute ${e} was modified during sanitization. Original url:"${t}" was sanitized to: "${i}"`),Y(r,e,i);break;case K.KEEP_AND_NORMALIZE:Y(r,e,t.toLowerCase());break;case K.KEEP_AND_SANITIZE_STYLE:this.styleAttributeSanitizer?Y(r,e,this.styleAttributeSanitizer(t)):Y(r,e,t);break;case K.KEEP_AND_USE_RESOURCE_URL_POLICY:if(this.resourceUrlPolicy){let i={type:B.HTML_ATTRIBUTE,attributeName:e,elementName:n},a=V(t),o=this.resourceUrlPolicy(a,i);o&&Y(r,e,o.toString())}else Y(r,e,t);break;case K.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET:if(this.resourceUrlPolicy){let i={type:B.HTML_ATTRIBUTE,attributeName:e,elementName:n},a=Xe(t),o={parts:[]};for(let e of a.parts){let t=V(e.url),n=this.resourceUrlPolicy(t,i);n&&o.parts.push({url:n.toString(),descriptor:e.descriptor})}Y(r,e,Ze(o))}else Y(r,e,t);break;case K.DROP:this.recordChange(`Attribute: ${e} was dropped`)}}return r}nodeFilter(e){if(U(e))return 1;if(!W(e))return 2;let t=H(e);return t===null?(this.recordChange(`Node name was null for node: ${e}`),2):this.sanitizerTable.isAllowedElement(t)?1:(this.recordChange(`Element: ${t} was dropped`),2)}recordChange(e){}satisfiesAllConditions(e,t){if(!e)return!0;for(let[n,r]of e){let e=t.getNamedItem(n)?.value;if(e&&!r.has(e))return!1}return!0}};function Y(e,t,n){e.setAttribute(t,n)}function Xe(e){let t=[];for(let n of e.split(`,`)){let[e,r]=n.trim().split(/\s+/,2);t.push({url:e,descriptor:r})}return{parts:t}}function Ze(e){return e.parts.map(e=>{let{url:t,descriptor:n}=e;return`${t}${n?` ${n}`:``}`}).join(` , `)}var Qe=k(()=>new J(q,w));function X(e){return Qe.sanitizeToFragment(e)}var $e=class{constructor(){this.calledBuild=!1,this.sanitizerTable=q}onlyAllowElements(e){let t=new Set,n=new Map;for(let r of e){if(r=r.toUpperCase(),!this.sanitizerTable.isAllowedElement(r))throw Error(`Element: ${r}, is not allowed by html5_contract.textpb`);let e=this.sanitizerTable.elementPolicies.get(r);e===void 0?t.add(r):n.set(r,e)}return this.sanitizerTable=new G(t,n,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies,this.sanitizerTable.globallyAllowedAttributePrefixes),this}allowCustomElement(e,t){let n=new Set(this.sanitizerTable.allowedElements),r=new Map(this.sanitizerTable.elementPolicies);if(e=e.toUpperCase(),!Ge(e))throw Error(`Element: ${e} is not a custom element`);if(t){let n=new Map;for(let e of t)n.set(e.toLowerCase(),{policyAction:K.KEEP});r.set(e,n)}else n.add(e);return this.sanitizerTable=new G(n,r,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies,this.sanitizerTable.globallyAllowedAttributePrefixes),this}onlyAllowAttributes(e){let t=new Set,n=new Map,r=new Map;for(let r of e)this.sanitizerTable.allowedGlobalAttributes.has(r)&&t.add(r),this.sanitizerTable.globalAttributePolicies.has(r)&&n.set(r,this.sanitizerTable.globalAttributePolicies.get(r));for(let[t,n]of this.sanitizerTable.elementPolicies.entries()){let i=new Map;for(let[t,r]of n.entries())e.has(t)&&i.set(t,r);r.set(t,i)}return this.sanitizerTable=new G(this.sanitizerTable.allowedElements,r,t,n,this.sanitizerTable.globallyAllowedAttributePrefixes),this}allowDataAttributes(e){if(e===void 0){let e=new Set(this.sanitizerTable.globallyAllowedAttributePrefixes);return e.add(`data-`),this.sanitizerTable=new G(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies,e),this}let t=new Set(this.sanitizerTable.allowedGlobalAttributes);for(let n of e){if(n.indexOf(`data-`)!==0)throw Error(`data attribute: ${n} does not begin with the prefix "data-"`);t.add(n)}return this.sanitizerTable=new G(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,t,this.sanitizerTable.globalAttributePolicies,this.sanitizerTable.globallyAllowedAttributePrefixes),this}allowStyleAttributes(){let e=new Map(this.sanitizerTable.globalAttributePolicies);return e.set(`style`,{policyAction:K.KEEP_AND_SANITIZE_STYLE}),this.sanitizerTable=new G(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,this.sanitizerTable.allowedGlobalAttributes,e,this.sanitizerTable.globallyAllowedAttributePrefixes),this}allowClassAttributes(){let e=new Set(this.sanitizerTable.allowedGlobalAttributes);return e.add(`class`),this.sanitizerTable=new G(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies,this.sanitizerTable.globallyAllowedAttributePrefixes),this}allowIdAttributes(){let e=new Set(this.sanitizerTable.allowedGlobalAttributes);return e.add(`id`),this.sanitizerTable=new G(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies,this.sanitizerTable.globallyAllowedAttributePrefixes),this}allowIdReferenceAttributes(){let e=new Set(this.sanitizerTable.allowedGlobalAttributes);return e.add(`aria-activedescendant`).add(`aria-controls`).add(`aria-labelledby`).add(`aria-owns`).add(`for`).add(`list`),this.sanitizerTable=new G(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies,this.sanitizerTable.globallyAllowedAttributePrefixes),this}withResourceUrlPolicy(e){return this.resourceUrlPolicy=e,this}},et=class extends $e{build(){if(this.calledBuild)throw Error(`this sanitizer has already called build`);return this.calledBuild=!0,new J(this.sanitizerTable,w,void 0,void 0,this.resourceUrlPolicy)}};function tt(e){let t=e.split(/[?#]/),n=/[?]/.test(e)?`?`+t[1]:``,r=/[#]/.test(e)?`#`+(n?t[2]:t[1]):``;return{urlPath:t[0],params:n,fragment:r}}function nt(e,...t){if(t.length===0)return E(e[0]);e[0].toLowerCase();let n=e[0];for(let r=0;r<t.length;r++)n+=encodeURIComponent(t[r])+e[r+1];return E(n)}function rt(e,t){let n=tt(O(e).toString());return it(n.urlPath,n.params,n.fragment,t)}function it(e,t,n,r){let i=t.length?`&`:`?`;function a(e,n){e!=null&&(Z(e)?e.forEach(e=>a(e,n)):(t+=i+encodeURIComponent(n)+`=`+encodeURIComponent(e),i=`&`))}return at(r)&&(r=Object.entries(r)),Z(r)?r.forEach(e=>a(e[1],e[0])):r.forEach(a),E(e+t+n)}function Z(e){return Array.isArray(e)}function at(e){return e.constructor===Object}function ot(e){let t=I(e).toString(),n=new Blob([t],{type:`text/javascript`});return E(URL.createObjectURL(n))}function st(e,...t){return F(e.join(``))}function ct(e){let t=e[0];return Pe(t)}function lt(e){let t=X(e);return{text:t.textContent??``,strikethrough:t.querySelector(`s`)!==null}}var Q=`gemini:`,$=`app`,ut=`/media`,dt=/^[A-Za-z0-9_-]+={0,2}$/;function ft(e){if(e)try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.toString():void 0}catch{return}}function pt(e){let t=ft(e);if(t||!e)return t;try{let t=new URL(e);return _t(t)?t.toString():void 0}catch{return}}function mt(){let e=globalThis.location;return e?.protocol===Q&&e.host===$}function ht(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`||t.protocol===`file:`?t.href:void 0}catch{return}}function gt(e){if(dt.test(e))try{let t=e.replace(/=+$/,``).replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return new TextDecoder(`utf-8`,{fatal:!0}).decode(i)}catch{return}}function _t(e){if(!mt()||e.protocol!==Q||e.host!==$||e.username!==``||e.password!==``||e.pathname!==ut)return!1;let t=e.searchParams.get(`url`),n=e.searchParams.get(`url_b64`);if(t===null&&n===null)return!1;let r=t===null?void 0:ht(t.trim());if(t!==null&&!r)return!1;if(n===null)return!0;let i=gt(n.trim()),a=i===void 0?void 0:ht(i);return a?r===void 0||r===a:!1}function vt(e){try{let t=new URL(e);return t.protocol!==`http:`&&t.protocol!==`https:`?``:t.hostname.replace(/^www\./,``)}catch{return e.replace(/^www\./,``)}}function yt(e,t){return M(e)}function bt(e,t){return F(e)}export{ve as C,m as D,g as E,Ce as S,pe as T,Me as _,pt as a,De as b,st as c,nt as d,et as f,Le as g,Re as h,ft as i,rt as l,ze as m,bt as n,lt as o,X as p,vt as r,ct as s,yt as t,ot as u,R as v,O as w,Ee as x,Oe as y};