(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,321562,250225,e=>{"use strict";var t=e.i(811277);e.s(["f",()=>t.u],250225);var t=t,r=e.i(359742);let{getConditionStore:i,setConditionStore:n,isConditionStoreInitialized:a}=(0,t.u)((0,r.f)({source:"@generaltranslation/react-core",severity:"Error",whatHappened:"Cannot read GT runtime context before it has been initialized",why:"the internal ConditionStore is unavailable",fix:"Call initializeGT() during setup (gt-next runs this automatically) and add a at the root of your component tree."}));e.s(["m",0,i,"J",0,a],321562)},251773,e=>{"use strict";var t=e.i(905462),r=e.i(887857),i=e.i(359742),n=e.i(16043);let a=(0,r.f)({namespace:"reactCore",key:"gtContext",source:"@generaltranslation/react-core",notInitialized:()=>(0,i.f)({source:"@generaltranslation/react-core",severity:"Error",whatHappened:"Cannot read GTContext before it has been initialized",why:"the internal GTContext singleton is unavailable",fix:"Add a at the root of your component tree."})});function o(){return a.isInitialized()||a.set((0,n.createContext)(void 0)),a.get()}e.s(["d",0,o,"u",0,function(){let e=(0,n.useContext)(o());if(e||"SPA"===(0,t.n)().getRenderStrategy())return e;throw Error((0,i.f)({source:"@generaltranslation/react-core",severity:"Error",whatHappened:"GT runtime context could not be read",why:"GTContext was accessed outside of a ",fix:"Add a at the root of your component tree."}))}])},537339,e=>{"use strict";var t=e.i(321562),r=e.i(251773);e.s(["i",0,function(){let e=(0,r.u)();return e?e.enableI18n:(0,t.m)().getEnableI18n()},"X",0,function(){let e=(0,r.u)();return e?e.locale:(0,t.m)().getLocale()},"E",0,function(){let e=(0,r.u)();return e?e.region:(0,t.m)().getRegion()},"W",0,function(){let e=(0,r.u)();return e?e.setEnableI18n:(0,t.m)().setEnableI18n},"h",0,function(){let e=(0,r.u)();return e?e.setLocale:(0,t.m)().setLocale},"b",0,function(){let e=(0,r.u)();return e?e.setRegion:(0,t.m)().setRegion}])},110630,e=>{"use strict";e.i(16043),e.s(["f",0,()=>{}])},782672,e=>{"use strict";var t=e.i(217646),r=e.i(721852),i=e.i(110630),n=e.i(51861);e.i(627553);var a=e.i(494418),o=e.i(16043);e.s(["f",0,function(e=[],s,l){var c,u,h,f;let d,p,g,m,y=(0,t.h)(),b=(0,t.C)(),v=(0,r.e)(l),x=(0,o.useRef)(null);return x.current??=new Set,c=e,u=x,h=s,f=l,d=(0,t.C)(),p=(0,t.h)(),g=(0,o.useMemo)(()=>c?.length>0&&f&&!1,[c,f,!1]),m=(0,o.useMemo)(()=>g?c.map(({message:e,...t})=>{let r=t.$locale??h,i={locale:r,message:e,options:(0,n.f)(r,t,"ICU")};return[i,(0,a.T)(i)]}):[],[h,g,c]),g&&m.forEach(([,e])=>{u.current.add(e)}),(0,o.useEffect)(()=>{g&&m.filter(([e])=>null==d.getTranslateSnapshot(e,p)).forEach(([e])=>d.translate(e))},[g,d,m,p]),(0,i.f)(x,b.subscribeToTranslationEvents,a.T),(0,o.useCallback)(e=>{(0,a.T)(e);let t=b.getTranslateSnapshot(e,y);return t},[b,y,v,!1])}])},457278,e=>{"use strict";var t=e.i(627553),r=e.i(16043);e.s(["R",0,function(){return(0,r.useMemo)(()=>(0,t.f)().getCustomMapping(),[])},"S",0,function(){return(0,r.useMemo)(()=>(0,t.f)().getDefaultLocale(),[])},"T",0,function(){return(0,r.useMemo)(()=>(0,t.f)().getLocales(),[])}])},288265,e=>{"use strict";var t=e.i(457278),r=e.i(93696),i=e.i(782672),n=e.i(51861),a=e.i(398286),o=e.i(16043);e.s(["f",0,function(e){let{locale:s,shouldTranslate:l}=(0,r.X)(),c=(0,t.S)(),u=(0,i.f)(e,s,l);return(0,o.useCallback)((e,t={})=>{let r=(0,n.f)(t.$locale??s,t,"ICU");return(0,a.f)(l?{source:e,target:u({locale:r.$locale,message:e,options:r}),options:r,sourceLocale:c}:{options:r,source:e,sourceLocale:c})},[c,s,l,u])}])},93696,e=>{"use strict";var t=e.i(14875),r=e.i(537339),i=e.i(627553),n=e.i(16043);let a=[];e.s(["R",0,function(e=a){let i=(0,r.X)(),o=(0,r.i)();return(0,n.useMemo)(()=>(0,t.f)({locale:i,enableI18n:o,localesProp:e}),[i,o,e])},"y",0,function(e){let t=(0,r.X)(),a=e??t;return(0,n.useMemo)(()=>(0,i.f)().getGTClass().getLocaleDirection(a),[a])},"D",0,function(e){return(0,n.useMemo)(()=>(0,i.f)().getGTClass().getLocaleProperties(e),[e])},"I",0,function(){let e=(0,r.i)(),t=(0,r.X)();return e&&(0,i.f)().requiresTranslation(t)},"X",0,function(){let e=(0,r.X)();return{locale:e,shouldTranslate:(0,r.i)()&&(0,i.f)().requiresTranslation(e)}}])},14875,e=>{"use strict";var t=e.i(627553);let r=[];e.s(["f",0,function({locale:e,enableI18n:i,localesProp:n=r}){let a=(0,t.f)().getDefaultLocale();return i&&(0,t.f)().requiresTranslation(e)?[...n,e,a]:[a]}])},721852,e=>{"use strict";e.i(251773),e.i(93696),e.i(217646),e.i(494418),e.i(627553),e.i(16043);let t=()=>{},r=()=>{},i=()=>{};function n(){return t}e.s(["G",0,function(){return r},"C",0,function(){return i},"k",0,n,"e",0,n])},451858,e=>{"use strict";var t=e.i(905462),r=e.i(887857),i=e.i(359742);let n=(0,r.f)({namespace:"reactCore",key:"i18nStore",source:"@generaltranslation/react-core",notInitialized:()=>Error((0,i.f)({source:"@generaltranslation/react-core",severity:"Error",whatHappened:"Cannot access I18nStore before it is initialized.",fix:"SPA"===(0,t.n)().getRenderStrategy()?"Initialize GT before reading GT runtime context.":"Add a at the root of your component tree."}))}),a=n.get,o=n.set;n.isInitialized,e.s(["s",0,a,"B",0,o])},217646,e=>{"use strict";var t=e.i(451858),r=e.i(251773);e.s(["s",0,function(){return(0,r.u)()?.dictionariesSnapshot||{}},"C",0,function(){return(0,r.u)()?.i18nStore||(0,t.s)()},"h",0,function(){return(0,r.u)()?.translationsSnapshot||{}}])},905462,e=>{"use strict";var t=e.i(782441),r=e.i(830642),i=e.i(627553),n=e.i(811277),n=n,a=e.i(359742);let o="server-render",s=Symbol.for("generaltranslation.react-core.ReactI18nConfig");var l=class extends r.f{renderStrategy;localeCookieName;regionCookieName;enableI18nCookieName;constructor(e={},r=o){super(e),function(e){if("SPA"!==e&&"server-render"!==e)throw Error((0,a.f)({source:"@generaltranslation/react-core",severity:"Error",whatHappened:"Invalid React render strategy.",why:`the render strategy must be "SPA" or "server-render", but received "${String(e)}"`,fix:"Initialize GT through gt-react or pass a valid render strategy."}))}(r),Object.defineProperty(this,s,{value:!0}),this.renderStrategy=r,this.localeCookieName=e.localeCookieName??t.C,this.regionCookieName=e.regionCookieName??t.s,this.enableI18nCookieName=e.enableI18nCookieName??t.a}getRenderStrategy(){return this.renderStrategy}getLocaleCookieName(){return this.localeCookieName}getRegionCookieName(){return this.regionCookieName}getEnableI18nCookieName(){return this.enableI18nCookieName}isIdTaggingEnabled(){return!0===this.runtimeConfig._tagIds}};e.s(["n",0,function(){var e;let t=(0,i.f)();if((e=t)instanceof l||!0===e[s]&&"function"==typeof e.getRenderStrategy&&"function"==typeof e.getLocaleCookieName&&"function"==typeof e.getRegionCookieName&&"function"==typeof e.getEnableI18nCookieName)return t;throw Error((0,a.f)({source:"@generaltranslation/react-core",severity:"Error",whatHappened:"Cannot read ReactI18nConfig after base I18nConfig setup.",why:"the internal I18nConfig singleton was initialized without react-core render strategy support",fix:"Initialize GT through gt-react or @generaltranslation/react-core/pure."}))},"x",0,function(e={},t=o){let r=new l(e,t);return(0,n.C)(r),r}],905462)},821080,75584,675658,902292,300553,477369,449281,e=>{"use strict";var t=e.i(167182),r=e.i(169798),i=e.i(117317);let n=BigInt(0xffffffff),a=BigInt(32);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}let s=e=>e?`"${e}" `:"";function l(e,t,r=""){if(o(e)&&(void 0===t||e.length===t))return e;void 0!==t&&function(e,t=""){if("number"!=typeof e)throw TypeError(s(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(s(t)+"expected integer >= 0, got "+e)}(t,"length");let i=o(e),n=void 0!==t?` of length ${t}`:"",a=i?`length=${e.length}`:`type=${typeof e}`,c=s(r)+"expected Uint8Array"+n+", got "+a;if(!i)throw TypeError(c);throw RangeError(c)}let c=(e,t)=>{if(null===e||"object"!=typeof e||Array.isArray(e))throw TypeError(("object"===t?"":`"${t}" `)+"expected object, got type="+typeof e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&null!==r)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw TypeError(`"${t}.__proto__" is not allowed`)};function u(e,t=!0){if(e.destroyed)throw Error("hash was destroyed");if(t&&e.finished)throw Error("digest() was already called")}function h(...e){for(let t=0;t>>t}let p="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,g=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));class m{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,i){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=f(this.buffer)}update(e){u(this),l(e);let{view:t,buffer:r,blockLen:i}=this,n=e.length,a=!1;for(let o=0;o=s))throw RangeError('"output" expected length >= '+s);this.finished=!0;let{buffer:c,view:h,blockLen:d,isLE:p}=this,{pos:g}=this;c[g++]=128,c.fill(0,g),this.padOffset>d-g&&(this.process(h,0),c.fill(0)),t=h,r=d-8,i=8*this.length,n=p,a=i/0x100000000|0,o=i>>>0,t.setUint32(r,n?o:a,n),t.setUint32(r+4,n?a:o,n),this.process(h,0),this.roundClean();let m=e===c?h:f(e),y=this.outputLen,b=y/4,v=this.get();if(y%4||b>v.length)throw Error("invalid outputLen");for(let e=0;e>>3,n=d(r,17)^d(r,19)^r>>>10;w[e]=n+w[e-7]+i+w[e-16]|0}let{A:r,B:i,C:n,D:a,E:o,F:s,G:l,H:c}=this;for(let e=0;e<64;e++){var u,h,f,p;let t=c+(d(o,6)^d(o,11)^d(o,25))+((u=o)&s^~u&l)+C[e]+w[e]|0,g=(d(r,2)^d(r,13)^d(r,22))+((h=r)&(f=i)^h&(p=n)^f&p)|0;c=l,l=s,s=o,o=a+t|0,a=n,n=i,i=r,r=t+g|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,i,n,a,o,s,l,c)}roundClean(){h(w)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),h(this.buffer)}}class L extends T{constructor(){super(32,y)}}let E=function(e,t=!1){let r=e.length,i=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s>a&n)}:{h:0|Number(e>>a&n),l:0|Number(e&n)}}(e[s],t);[i[s],o[s]]=[r,l]}return[i,o]}(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),S=E[0],I=E[1],A=new Uint32Array(80),M=new Uint32Array(80);let N=function(e,t={}){if("function"!=typeof e)throw TypeError('"hashCons" expected function, got type='+typeof e);t=function(e,t,r="opts"){return c(e,"defaults"),void 0!==t&&c(t,r),Object.assign(Object.create(null),e,t)}({},t,"info");let r=(t,r)=>e(r).update(t).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}(()=>new L,{oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,1])});function $(e){if(e&&"object"==typeof e&&"string"==typeof e.k){let t=Object.keys(e);if(1===t.length||2===t.length&&("number"==typeof e.i||"string"==typeof e.v)||3===t.length&&"string"==typeof e.v&&"number"==typeof e.i)return!0}return!1}function j(e){return(function(e){if(l(e),p)return e.toHex();let t="";for(let r=0;r{if(e&&"object"==typeof e){let t={};if("c"in e&&e.c&&(t.c=O(e.c)),"d"in e){let r=e?.d;r?.b&&(t.b=Object.fromEntries(Object.entries(r.b).map(([e,t])=>[e,O(t)]))),r?.t&&(t.t=r.t)}return $(e)?{k:e.k,...e.v&&{v:e.v}}:t}return e};function O(e){return Array.isArray(e)?e.map(D):D(e)}e.s(["r",0,$,"t",0,R],75584);let _=e=>e.client.get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/projects",...e}),k=e=>e.client.get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/orgs",...e}),P=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]),F=e=>new Promise(t=>setTimeout(t,e));function G(e){if(!e)return;let t=Number(e.split(",")[0].split(";")[0].trim());return Number.isFinite(t)&&t>=0?1e3*t:void 0}async function U(e,t,r={}){if(0===e.length)return{complete:!0,jobs:[]};let i=(r.pollingIntervalSeconds??5)*1e3,n=(r.timeoutSeconds??600)*1e3,a=Date.now()+n,o=new Map(e.map(e=>[e,{jobId:e,status:"unknown"}])),s=new Set(e);for(;s.size>0&&Date.now()=a)break;throw e}if(Date.now()>=a)break;r.onPoll?.(e);let n=new Set(e.map(({jobId:e})=>e));for(let t of e)o.set(t.jobId,t),("completed"===t.status||"failed"===t.status||"unknown"===t.status)&&s.delete(t.jobId);for(let e of s)n.has(e)||(o.set(e,{jobId:e,status:"unknown"}),s.delete(e));s.size>0&&await new Promise(e=>setTimeout(e,Math.min(i,a-Date.now())))}return{complete:0===s.size,jobs:[...o.values()]}}async function z(e,t,{batchSize:r=100,parallel:i=!0}={}){let n=function(e,t=100){let r=[];for(let i=0;iJSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t)},q=({allowReserved:e,explode:t,name:r,style:i,value:n})=>{if(!t){let t=(e?n:n.map(e=>encodeURIComponent(e))).join((e=>{switch(e){case"form":default:return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20"}})(i));switch(i){case"label":return`.${t}`;case"matrix":return`;${r}=${t}`;case"simple":return t;default:return`${r}=${t}`}}let a=(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}})(i),o=n.map(t=>"label"===i||"simple"===i?e?t:encodeURIComponent(t):H({allowReserved:e,name:r,value:t})).join(a);return"label"===i||"matrix"===i?a+o:o},H=({allowReserved:e,name:t,value:r})=>{if(null==r)return"";if("object"==typeof r)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},V=({allowReserved:e,explode:t,name:r,style:i,value:n,valueOnly:a})=>{if(n instanceof Date)return a?n.toISOString():`${r}=${n.toISOString()}`;if("deepObject"!==i&&!t){let t=[];Object.entries(n).forEach(([r,i])=>{t=[...t,r,e?i:encodeURIComponent(i)]});let a=t.join(",");switch(i){case"form":return`${r}=${a}`;case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;default:return a}}let o=(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}})(i),s=Object.entries(n).map(([t,n])=>H({allowReserved:e,name:"deepObject"===i?`${r}[${t}]`:t,value:n})).join(o);return"label"===i||"matrix"===i?o+s:s},K=/\{[^{}]+\}/g,W=async(e,t)=>{let r="function"==typeof t?await t(e):t;if(r)return"bearer"===e.scheme?`Bearer ${r}`:"basic"===e.scheme?`Basic ${btoa(r)}`:r},X=({parameters:e={},...t}={})=>r=>{let i=[];if(r&&"object"==typeof r)for(let n in r){let a=r[n];if(null==a)continue;let o=e[n]||t;if(Array.isArray(a)){let e=q({allowReserved:o.allowReserved,explode:!0,name:n,style:"form",value:a,...o.array});e&&i.push(e)}else if("object"==typeof a){let e=V({allowReserved:o.allowReserved,explode:!0,name:n,style:"deepObject",value:a,...o.object});e&&i.push(e)}else{let e=H({allowReserved:o.allowReserved,name:n,value:a});e&&i.push(e)}}return i.join("&")},J=(e,t)=>!!t&&!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)),Y=async({security:e,...t})=>{for(let r of e){if(J(t,r.name))continue;let e=await W(r,t.auth);if(!e)continue;let i=r.name??"Authorization";switch(r.in){case"query":t.query||(t.query={}),t.query[i]=e;break;case"cookie":t.headers.append("Cookie",`${i}=${e}`);break;default:t.headers.set(i,e)}}},Z=e=>(({baseUrl:e,path:t,query:r,querySerializer:i,url:n})=>{let a=(e??"")+(n.startsWith("/")?n:`/${n}`);t&&(a=(({path:e,url:t})=>{let r=t,i=t.match(K);if(i)for(let t of i){let i=!1,n=t.substring(1,t.length-1),a="simple";n.endsWith("*")&&(i=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),a="label"):n.startsWith(";")&&(n=n.substring(1),a="matrix");let o=e[n];if(null==o)continue;if(Array.isArray(o)){r=r.replace(t,q({explode:i,name:n,style:a,value:o}));continue}if("object"==typeof o){r=r.replace(t,V({explode:i,name:n,style:a,value:o,valueOnly:!0}));continue}if("matrix"===a){r=r.replace(t,`;${H({name:n,value:o})}`);continue}let s=encodeURIComponent("label"===a?`.${o}`:o);r=r.replace(t,s)}return r})({path:t,url:a}));let o=r?i(r):"";return o.startsWith("?")&&(o=o.substring(1)),o&&(a+=`?${o}`),a})({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:"function"==typeof e.querySerializer?e.querySerializer:X(e.querySerializer),url:e.url}),Q=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=et(e.headers,t.headers),r},ee=e=>{let t=[];return e.forEach((e,r)=>{t.push([r,e])}),t},et=(...e)=>{let t=new Headers;for(let r of e)if(r)for(let[e,i]of r instanceof Headers?ee(r):Object.entries(r))if(null===i)t.delete(e);else if(Array.isArray(i))for(let r of i)t.append(e,r);else void 0!==i&&t.set(e,"object"==typeof i?JSON.stringify(i):i);return t};var er=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return"number"==typeof e?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let r=this.getInterceptorIndex(e);return!!this.fns[r]&&(this.fns[r]=t,e)}use(e){return this.fns.push(e),this.fns.length-1}};let ei=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),en={"Content-Type":"application/json"};var ea=class e extends Error{code;message;constructor(e,t,r){super(e),this.name="ApiError",this.code=t,this.message=r}static fromResponse(t,r){let i=function(e,t){if("string"==typeof e){let r=t.headers.get("content-type")??"";return/^text\/html/i.test(r)?void 0:e}if("object"==typeof e&&null!==e&&"error"in e)return"string"==typeof e.error?e.error:void 0}(t,r)||r.statusText||`HTTP ${r.status}`;return new e(i,r.status,i)}};let eo=Object.values({"2025_01_01_V0":"2025-01-01.v0","2025_11_03_V1":"2025-11-03.v1","2026_02_18_V1":"2026-02-18.v1","2026_03_06_V1":"2026-03-06.v1"}).pop();function es(e){var t;let r=new Headers({"gt-api-version":e.apiVersion??eo});e.apiKey&&r.set("Authorization",`Bearer ${e.apiKey}`),e.projectId&&r.set("gt-project-id",e.projectId);let i=function({fetch:e=globalThis.fetch,retryPolicy:t="exponential"}={}){return async(r,i)=>{let n=new Request(r,i),a=3*("none"!==t),o=P.has(n.method);for(let r=0;r<=a;r++){var s,l;let i;try{i=await e(n.clone())}catch(e){if(n.signal.aborted||r===a||!o)throw e}if(i&&429!==i.status&&(i.status<500||!o)||i&&r===a)return i;if(n.signal.aborted){if(i)return i;throw n.signal.reason}i?.body?.cancel(),await F((s=i,l=r,s?.status===429?function(e){let t=G(e);if(void 0!==t)return t;if(!e)return;let r=Date.parse(e);return Number.isNaN(r)?void 0:Math.max(r-Date.now(),0)}(s.headers.get("Retry-After"))??G(s.headers.get("RateLimit-Reset"))??6e4:500*("linear"===t?l+1:2**l)))}throw Error("Max retries exceeded")}}({fetch:function({fetch:e=globalThis.fetch,timeoutMs:t=6e4}={}){return async(r,i)=>{if(!1===t)return e(r,i);let n=new Request(r,i),a=new AbortController,o=()=>a.abort(n.signal.reason);n.signal.aborted?o():n.signal.addEventListener("abort",o,{once:!0});let s=setTimeout(()=>a.abort(),t);try{return await e(new Request(n,{signal:a.signal}))}catch(e){if(a.signal.aborted&&!n.signal.aborted)throw Error(`Request timed out after ${t}ms`);throw e}finally{clearTimeout(s),n.signal.removeEventListener("abort",o)}}}({fetch:e.fetch,timeoutMs:e.timeoutMs}),retryPolicy:e.retryPolicy}),n=((e={})=>{let t=Q(((e={})=>({...B,headers:en,parseAs:"auto",querySerializer:ei,...e}))(),e),r=()=>({...t}),i={error:new er,request:new er,response:new er},n=async e=>{let r={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:et(t.headers,e.headers),serializedBody:void 0};return r.security&&await Y({...r,security:r.security}),r.requestValidator&&await r.requestValidator(r),void 0!==r.body&&r.bodySerializer&&(r.serializedBody=r.bodySerializer(r.body)),(void 0===r.body||""===r.serializedBody)&&r.headers.delete("Content-Type"),{opts:r,url:Z(r)}},a=async e=>{var t;let r,a,o,{opts:s,url:l}=await n(e),c=new Request(l,{redirect:"follow",...s,body:(r=void 0!==(t=s).body)&&t.bodySerializer?"serializedBody"in t?void 0!==t.serializedBody&&""!==t.serializedBody?t.serializedBody:null:""!==t.body?t.body:null:r?t.body:void 0});for(let e of i.request.fns)e&&(c=await e(c,s));let u=s.fetch;try{a=await u(c)}catch(t){let e=t;for(let r of i.error.fns)r&&(e=await r(t,void 0,c,s));if(e=e||{},s.throwOnError)throw e;return"data"===s.responseStyle?void 0:{error:e,request:c,response:void 0}}for(let e of i.response.fns)e&&(a=await e(a,c,s));let h={request:c,response:a};if(a.ok){let e,t=("auto"===s.parseAs?(e=>{if(!e)return"stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if("multipart/form-data"===t)return"formData";if(["application/","audio/","image/","video/"].some(e=>t.startsWith(e)))return"blob";if(t.startsWith("text/"))return"text"}})(a.headers.get("Content-Type")):s.parseAs)??"json";if(204===a.status||"0"===a.headers.get("Content-Length")){let e;switch(t){case"arrayBuffer":case"blob":case"text":e=await a[t]();break;case"formData":e=new FormData;break;case"stream":e=a.body;break;default:e={}}return"data"===s.responseStyle?e:{data:e,...h}}switch(t){case"arrayBuffer":case"blob":case"formData":case"json":case"text":e=await a[t]();break;case"stream":return"data"===s.responseStyle?a.body:{data:a.body,...h}}return"json"===t&&(s.responseValidator&&await s.responseValidator(e),s.responseTransformer&&(e=await s.responseTransformer(e))),"data"===s.responseStyle?e:{data:e,...h}}let f=await a.text();try{o=JSON.parse(f)}catch{}let d=o??f,p=d;for(let e of i.error.fns)e&&(p=await e(d,a,c,s));if(p=p||{},s.throwOnError)throw p;return"data"===s.responseStyle?void 0:{error:p,...h}},o=e=>t=>a({...t,method:e}),s=e=>async t=>{let{opts:r,url:a}=await n(t);return(({onRequest:e,onSseError:t,onSseEvent:r,responseTransformer:i,responseValidator:n,sseDefaultRetryDelay:a,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:l,url:c,...u})=>{let h,f=l??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let l=a??3e3,d=0,p=u.signal??new AbortController().signal;for(;!p.aborted;){d++;let a=u.headers instanceof Headers?u.headers:new Headers(u.headers);void 0!==h&&a.set("Last-Event-ID",h);try{let t={redirect:"follow",...u,body:u.serializedBody,headers:a,signal:p},o=new Request(c,t);e&&(o=await e(c,t));let s=await (u.fetch??globalThis.fetch)(o);if(!s.ok)throw Error(`SSE failed: ${s.status} ${s.statusText}`);if(!s.body)throw Error("No body in SSE response");let f=s.body.pipeThrough(new TextDecoderStream).getReader(),d="",g=()=>{try{f.cancel()}catch{}};p.addEventListener("abort",g);try{for(;;){let{done:e,value:t}=await f.read();if(e)break;let a=(d+=t).split("\n\n");for(let e of(d=a.pop()??"",a)){let t,a,o=e.split("\n"),s=[];for(let e of o)if(e.startsWith("data:"))s.push(e.replace(/^data:\s*/,""));else if(e.startsWith("event:"))t=e.replace(/^event:\s*/,"");else if(e.startsWith("id:"))h=e.replace(/^id:\s*/,"");else if(e.startsWith("retry:")){let t=Number.parseInt(e.replace(/^retry:\s*/,""),10);Number.isNaN(t)||(l=t)}let c=!1;if(s.length){let e=s.join("\n");try{a=JSON.parse(e),c=!0}catch{a=e}}c&&(n&&await n(a),i&&(a=await i(a))),r?.({data:a,event:t,id:h,retry:l}),s.length&&(yield a)}}}finally{p.removeEventListener("abort",g),f.releaseLock()}break}catch(e){if(t?.(e),void 0!==o&&d>=o)break;await f(Math.min(l*2**(d-1),s??3e4))}}}()}})({...r,body:r.body,headers:r.headers,method:e,onRequest:async(e,t)=>{let n=new Request(e,t);for(let e of i.request.fns)e&&(n=await e(n,r));return n},url:a})};return{buildUrl:Z,connect:o("CONNECT"),delete:o("DELETE"),get:o("GET"),getConfig:r,head:o("HEAD"),interceptors:i,options:o("OPTIONS"),patch:o("PATCH"),post:o("POST"),put:o("PUT"),request:a,setConfig:e=>(t=Q(t,e),r()),sse:{connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),head:s("HEAD"),options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),trace:s("TRACE")},trace:o("TRACE")}})({baseUrl:e.baseUrl,fetch:e.apiKey||!e.userTokenProvider?i:(t=e.userTokenProvider,async(e,r)=>{let n=new Request(e,r);if(n.headers.has("Authorization"))return i(n);n.headers.set("Authorization",`Bearer ${await t.getAccessToken()}`);let a=await i(n.clone());if(401!==a.status)return a;let o=await t.refreshAccessToken();return o?(await a.body?.cancel(),n.headers.set("Authorization",`Bearer ${o}`),i(n)):a}),headers:r});return n.interceptors.error.use((e,t,r,i)=>i.throwOnError&&t?ea.fromResponse(e,t):e),n}async function*el(e,t){let r=t.query?.cursor;do{let{data:i}=await e({...t,query:{...t.query,cursor:r},throwOnError:!0});yield*i.items,r=i.nextCursor??void 0}while(r)}let ec="DEFAULT_TERMINATOR_KEY",eu={ellipsis:{fr:{terminator:"…",separator:" "},zh:{terminator:"……",separator:void 0},ja:{terminator:"……",separator:void 0},[ec]:{terminator:"…",separator:void 0}},none:{[ec]:{terminator:void 0,separator:void 0}}};var eh=class e{static resolveLocale(e){try{let t=e?Array.isArray(e)?e.map(String):[String(e)]:["en"],[r]=Intl.getCanonicalLocales(t);return r??"en"}catch{return"en"}}constructor(t,r={}){this.locale=e.resolveLocale(t);let i=r.style??"ellipsis";if(!eu[i])throw Error(`generaltranslation Formatting Error: Invalid cutoff style: ${i}.`);let n=void 0===r.maxChars?void 0:eu[i][new Intl.Locale(this.locale).language]||eu[i].DEFAULT_TERMINATOR_KEY,a=r.terminator??n?.terminator,o=null!=a?r.separator??n?.separator:void 0;this.additionLength=(a?.length??0)+(o?.length??0),void 0!==r.maxChars&&Math.abs(r.maxChars)=e.length?t:t>=0?Math.max(0,t-this.additionLength):Math.min(0,t+this.additionLength),a=void 0!==n&&n>-1?e.slice(0,n):e.slice(n);return null==t||null==n||0===n||null==r||e.length<=Math.abs(t)?[a]:n>0?null!=i?[a,i,r]:[a,r]:null!=i?[r,i,a]:[r,a]}resolvedOptions(){return this.options}};let ef={Collator:Intl.Collator,DateTimeFormat:Intl.DateTimeFormat,DisplayNames:Intl.DisplayNames,ListFormat:Intl.ListFormat,Locale:Intl.Locale,NumberFormat:Intl.NumberFormat,PluralRules:Intl.PluralRules,RelativeTimeFormat:Intl.RelativeTimeFormat,Segmenter:Intl.Segmenter,CutoffFormat:eh},ed=new class{constructor(){this.cache={}}generateKey(e,t={}){return`${!e?"undefined":Array.isArray(e)?e.map(e=>String(e)).join(","):String(e)}:${t?JSON.stringify(t,Object.keys(t).sort()):"{}"}`}get(e,...t){let[r="en",i={}]=t,n=this.generateKey(r,i),a=this.cache[e];void 0===a&&(a={},this.cache[e]=a);let o=a[n];return void 0===o&&(o=new ef[e](...t),a[n]=o),o}};e.s(["t",0,{pl:"placeholder",ti:"title",alt:"alt",arl:"aria-label",arb:"aria-labelledby",ard:"aria-describedby"}],675658);let ep=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/,eg=/^@+(\+|#+)?[rs]?$/,em=/^(?:(?:\+|#+)[rs]?|[rs])$/,ey=/(\*)(0+)|(#+)(0+)|(0+)/g,eb=/[\t-\r \x85\u200E\u200F\u2028\u2029]+/u,ev=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F|[abB]{1,5}|[hHkK]{1,2}|w{1,2}|W|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g,ex={floor:"floor",ceiling:"ceil",down:"trunc",up:"expand","half-even":"halfEven","half-down":"halfTrunc","half-up":"halfExpand"},eC={h:"h12",H:"h23",K:"h11",k:"h24"};function ew(e){if(!e.options[0])throw SyntaxError(`${e.stem} requires an option.`)}function eT(e,t){switch(t){case"sign-auto":return e.signDisplay="auto",!0;case"sign-accounting":case"()":return e.currencySign="accounting",!0;case"sign-always":case"+!":return e.signDisplay="always",!0;case"sign-accounting-always":case"()!":return e.signDisplay="always",e.currencySign="accounting",!0;case"sign-except-zero":case"+?":return e.signDisplay="exceptZero",!0;case"sign-accounting-except-zero":case"()?":return e.signDisplay="exceptZero",e.currencySign="accounting",!0;case"sign-never":case"+_":return e.signDisplay="never",!0;default:return!1}}function eL(e){let t={};if(e.endsWith("r")&&(t.roundingPriority="morePrecision"),e.endsWith("s")&&(t.roundingPriority="lessPrecision"),em.test(e))throw SyntaxError("Significant precision must start with @.");if(!eg.test(e))return t;let r=e.replace(/[rs]$/u,""),i=r.match(/^@+/u)?.[0]??"",n=r.slice(i.length);return i&&(t.minimumSignificantDigits=i.length),"+"===n||("#"===n[0]?t.maximumSignificantDigits=i.length+n.length:i&&(t.maximumSignificantDigits=i.length)),t}function eE(e,t){return RangeError(`Unsupported ${t} skeleton field: ${e}.`)}let eS=/^[A-Za-z]$/u,eI=/^[-.0-9_A-Za-z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]$/u;function eA(e){return eS.test(e??"")}let eM=/[\t-\r \x85\u200E\u200F\u2028\u2029]/u,eN=/[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\x21-\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7E\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E-\uFD3F\uFE45-\uFE46]/u;var e$=class{constructor(e,t){this.message=e,this.options=t,this.index=0}parse(){return this.parseMessage(!1,!1,!1)}parseMessage(e,t,r){let i=[];for(;!this.atEnd();){let n=this.current();if("{"===n)i.push(this.parseArgument(r));else if("}"===n&&e)break;else if("#"===n&&t){let e=this.index;this.index+=1,i.push(this.withLocation({type:7},e,this.index))}else if("<"!==n||this.options.ignoreTag||"/"!==this.peek())"<"===n&&!this.options.ignoreTag&&eA(this.peek())?i.push(this.parseTag(t)):i.push(this.parseLiteral(e,t));else{if(r)break;this.fail("UNMATCHED_CLOSING_TAG")}}return i}parseLiteral(e,t){let r=this.index,i="";for(;!this.atEnd();){let r=this.tryParseQuote(t);if(null!==r){i+=r;continue}let n=this.current();if("{"===n||"}"===n&&e||"#"===n&&t||"<"===n&&!this.options.ignoreTag&&(eA(this.peek())||"/"===this.peek()))break;i+=n,this.index+=n.length}return this.withLocation({type:0,value:i},r,this.index)}tryParseQuote(e){if("'"!==this.current())return null;let t=this.peek();if("'"===t)return this.index+=2,"'";if(!"{}<>".includes(t)&&("#"!==t||!e))return null;this.index+=1;let r="";for(;!this.atEnd();){let e=this.current();if("'"===e){if("'"===this.peek()){r+="'",this.index+=2;continue}this.index+=1;break}r+=e,this.index+=e.length}return r}parseTag(e){let t=this.index;this.index+=1;let r=this.readTagName();if(this.skipSpace(),this.consume("/>"))return this.withLocation({type:0,value:`<${r}/>`},t,this.index);this.consume(">")||this.fail("INVALID_TAG",t);let i=this.parseMessage(!0,e,!0),n=this.index;this.consume("")||this.failAt("INVALID_TAG",n,this.index),this.withLocation({type:8,value:r,children:i},t,this.index)}readTagName(){var e;let t=this.index;for(eA(this.current())||this.fail("INVALID_TAG",t),this.index+=1;!this.atEnd()&&(e=this.current(),eI.test(e));)this.index+=this.current().length;return this.message.slice(t,this.index)}parseArgument(e){let t=this.index;this.index+=1,this.skipSpace(),this.atEnd()&&this.fail("EXPECT_ARGUMENT_CLOSING_BRACE",t),"}"===this.current()&&(this.index+=1,this.fail("EMPTY_ARGUMENT",t));let r=this.readIdentifier();if(r||this.fail("MALFORMED_ARGUMENT",t),this.skipSpace(),this.consume("}"))return this.withLocation({type:1,value:r},t,this.index);this.atEnd()&&this.fail("EXPECT_ARGUMENT_CLOSING_BRACE",t),this.consume(",")||this.fail("MALFORMED_ARGUMENT",t),this.skipSpace(),this.atEnd()&&this.fail("EXPECT_ARGUMENT_CLOSING_BRACE",t);let i=this.index,n=this.readIdentifier(),a=this.index;switch(!n&&this.fail("EXPECT_ARGUMENT_TYPE",i),n){case"number":case"date":case"time":return this.parseSimpleArgument(t,r,n);case"plural":case"selectordinal":case"select":return this.parseChoiceArgument(t,r,n,a,e);default:this.fail("INVALID_ARGUMENT_TYPE",i)}}parseSimpleArgument(e,t,r){let i;this.skipSpace();let n=null,a=0,o=0;if(this.consume(",")&&(this.skipSpace(),a=this.index,(i=this.readSimpleStyle().replace(/\s+$/u,""))||this.fail("EXPECT_ARGUMENT_STYLE"),o=this.index),this.consume("}")||this.fail("EXPECT_ARGUMENT_CLOSING_BRACE",e),i)if("::"===i.slice(0,2)){let t=i.slice(2).replace(/^\s+/u,""),s=this.location(a,o);if("number"===r){let e;try{e=function(e){let t=e.split(eb).filter(Boolean);if(0===t.length)throw SyntaxError("Number skeleton cannot be empty.");return t.map(e=>{let[t,...r]=e.split("/");if(r.some(e=>0===e.length))throw SyntaxError(`Invalid number skeleton token: ${e}.`);return{stem:t,options:r}})}(t)}catch{this.failAt("INVALID_NUMBER_SKELETON",a,o)}n={type:0,tokens:e,...s?{location:s}:{},parsedOptions:this.options.shouldParseSkeletons?function(e){let t={};for(let r of e){if(!r.stem)throw SyntaxError("Number skeleton token stem cannot be empty.");let e=r.options[0];switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=e;continue;case"group-off":case",_":t.useGrouping=!1;continue;case"group-auto":case"group-min2":case"group-on-aligned":case",!":continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":ew(r),t.style="unit",t.unit=e.replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":case"engineering":for(let e of(t.notation=r.stem,r.options))eT(t,e);continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(e??"");continue;case"integer-width":if(ew(r),r.options.length>1)throw RangeError("integer-width stems only accept a single optional option");!function(e,t){t.replace(ey,(t,r,i,n,a,o)=>{if(r&&i)e.minimumIntegerDigits=i.length;else if(n&&a)throw Error("We currently do not support maximum integer digits");else if(o)throw Error("We currently do not support exact integer digits");return""})}(t,e);continue}if("rounding-mode-"===r.stem.slice(0,14)){let e=ex[r.stem.slice(14)];"string"==typeof e&&(t.roundingMode=e);continue}if(/^0+$/u.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(!function(e,t){let r=ep.exec(t.stem);if(!r)return!1;if(t.options.length>1)throw SyntaxError("Fraction precision accepts at most one option.");let[,i,n,a,o,s]=r;return"*"===n?e.minimumFractionDigits=i.length:a?e.maximumFractionDigits=a.length:o&&s?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+s.length):(e.minimumFractionDigits=i.length,e.maximumFractionDigits=i.length),"w"===t.options[0]?e.trailingZeroDisplay="stripIfInteger":t.options[0]&&Object.assign(e,eL(t.options[0])),!0}(t,r)){if(eg.test(r.stem)){Object.assign(t,eL(r.stem));continue}if(em.test(r.stem))throw SyntaxError("Significant precision must start with @.");if(!eT(t,r.stem)&&function(e,t){if("E"!==t[0])return!1;let r=/^(E{1,2})(\+!|\+\?)?(0+)$/u.exec(t);if(!r)throw SyntaxError("Malformed concise eng/scientific notation");return e.notation="EE"===r[1]?"engineering":"scientific",r[2]&&eT(e,r[2]),e.minimumIntegerDigits=r[3].length,!0}(t,r.stem))continue}}return t}(e):{}}}else{t||this.failAt("EXPECT_DATE_TIME_SKELETON",e,this.index);let r=function(e,t){if(!t||!/[jJ]/u.test(e))return e;let r=function(e){switch(e.hourCycle??e.hourCycles?.[0]??new Intl.DateTimeFormat(e.toString(),{hour:"numeric"}).resolvedOptions().hourCycle){case"h11":return"K";case"h12":return"h";case"h24":return"k";default:return"H"}}(t),i="";for(let t=0;t>1);i=r.repeat(o)+i+"a".repeat(s)}else"J"===n?i+="H":i+=n}return i}(t,this.options.locale);n={type:1,pattern:r,...s?{location:s}:{},parsedOptions:this.options.shouldParseSkeletons?function(e){let t={};for(let[r]of e.matchAll(ev)){let e=r.length;switch(r[0]){case"G":t.era=4===e?"long":5===e?"narrow":"short";break;case"y":t.year=2===e?"2-digit":"numeric";break;case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][e-1];break;case"d":t.day=2===e?"2-digit":"numeric";break;case"E":t.weekday=4===e?"long":5===e?"narrow":"short";break;case"e":case"c":if(e<4)throw eE(r,"weekday");t.weekday=["short","long","narrow","short"][e-4];break;case"a":t.hour12=!0;break;case"h":case"H":case"K":case"k":t.hourCycle=eC[r[0]],t.hour=2===e?"2-digit":"numeric";break;case"m":t.minute=2===e?"2-digit":"numeric";break;case"s":t.second=2===e?"2-digit":"numeric";break;case"z":t.timeZoneName=e<4?"short":"long";break;default:throw eE(r,"date/time")}}return t}(r):{}}}}else n=i;return this.withLocation({type:"number"===r?2:"date"===r?3:4,value:t,style:n},e,this.index)}readSimpleStyle(){let e=this.index;for(;!this.atEnd();){let e=this.current();if("'"===e){this.index+=1;let e=this.index;for(;!this.atEnd()&&"'"!==this.current();)this.index+=this.current().length;this.atEnd()&&this.fail("UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e),this.index+=1}else if("}"===e)break;else this.index+=e.length}return this.message.slice(e,this.index)}parseChoiceArgument(e,t,r,i,n){this.skipSpace(),this.consume(",")||this.failAt("EXPECT_SELECT_ARGUMENT_OPTIONS",i,i),this.skipSpace();let a=0,o=this.index,s=this.readIdentifier();"select"!==r&&"offset"===s&&(this.consume(":")||this.fail("EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"),this.skipSpace(),a=Number(this.readIntegerToken("EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE","INVALID_PLURAL_ARGUMENT_OFFSET_VALUE")),this.skipSpace(),s=this.readIdentifier());let l=Object.create(null),c=!1,u=o;for(;s||"select"!==r&&"="===this.current();){!s&&this.consume("=")&&(s=`=${this.readIntegerToken("EXPECT_PLURAL_ARGUMENT_SELECTOR","INVALID_PLURAL_ARGUMENT_SELECTOR")}`),s in l&&this.failAt("select"===r?"DUPLICATE_SELECT_ARGUMENT_SELECTOR":"DUPLICATE_PLURAL_ARGUMENT_SELECTOR",u,this.index),this.skipSpace();let e=this.index;this.consume("{")||this.fail("select"===r?"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT":"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT");let t=this.parseMessage(!0,"select"!==r,n);this.consume("}")||this.fail("EXPECT_ARGUMENT_CLOSING_BRACE",e);let i=this.location(e,this.index);l[s]={value:t,...i?{location:i}:{}},c=!0,this.skipSpace(),u=this.index,s=this.readIdentifier()}return(c||this.fail("select"===r?"EXPECT_SELECT_ARGUMENT_SELECTOR":"EXPECT_PLURAL_ARGUMENT_SELECTOR"),!this.options.requiresOtherClause||"other"in l||this.fail("MISSING_OTHER_CLAUSE",u),this.consume("}")||this.fail("EXPECT_ARGUMENT_CLOSING_BRACE",e),Object.setPrototypeOf(l,Object.prototype),"select"===r)?this.withLocation({type:5,value:t,options:l},e,this.index):this.withLocation({type:6,value:t,options:l,offset:a,pluralType:"plural"===r?"cardinal":"ordinal"},e,this.index)}readIntegerToken(e,t){let r=this.index;("+"===this.current()||"-"===this.current())&&(this.index+=1);let i=this.index;for(;/\d/u.test(this.current());)this.index+=1;i===this.index&&this.fail(e,r);let n=this.message.slice(r,this.index);return Math.abs(Number(n))>0x1fffffffffffff&&this.fail(t,r),n}readIdentifier(){let e=this.index;for(;!this.atEnd()&&!eN.test(this.current());)this.index+=this.current().length;return this.message.slice(e,this.index)}skipSpace(){for(;!this.atEnd()&&eM.test(this.current());)this.index+=this.current().length}consume(e){return this.message.slice(this.index,this.index+e.length)===e&&(this.index+=e.length,!0)}current(){return ej(this.message,this.index)}peek(){let e=this.current();return ej(this.message,this.index+e.length)}atEnd(){return this.index>=this.message.length}withLocation(e,t,r){let i=this.location(t,r);return i?{...e,location:i}:e}location(e,t){if(this.options.captureLocation)return{start:this.position(e),end:this.position(t)}}position(e){let t=this.positions??=function(e){let t=new Uint32Array(e.length+1),r=new Uint32Array(e.length+1),i=0,n=1,a=1;for(;i=e.length)return"\0";let r=e.charCodeAt(t);if(r<55296||r>56319||t+1>=e.length)return e.charAt(t);let i=e.charCodeAt(t+1);return i>=56320&&i<=57343?e.slice(t,t+2):e.charAt(t)}function eR(e,t={}){return new e$(e,{shouldParseSkeletons:!0,requiresOtherClause:!0,...t}).parse()}let eD={integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},eO={short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},e_={hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},ek={short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:e_,full:e_};function eP(e,t){if(!(t in e))throw Error(`The ICU message variable "${t}" was not provided.`);return e[t]}function eF(e,t={}){return eG(e.numberFormats??=new Map,JSON.stringify(t),()=>new Intl.NumberFormat(e.locales,t))}function eG(e,t,r){let i=e.get(t);if(i)return i;let n=r();return e.set(t,n),n}function eU(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function ez(e,t,r){return RangeError(`The ICU variable "${e}" value ${JSON.stringify(String(t))} did not match any of: ${Object.keys(r).join(", ")}.`)}function eB(e,t,r){return e.map((i,n)=>{switch(i.type){case 0:return function({value:e},t,r,i){return!function(e){if("<"!==e[0]||"/>"!==e.slice(-2))return!1;let t=e.slice(1,-2);if(!eA(t[0]))return!1;for(let e of t.slice(1))if(!eI.test(e))return!1;return!0}(e)?function(e,t,r,i){let n=[];function a(t,r){let i=n[n.length-1];i&&(t===i[1]||/^'+$/u.test(e.slice(i[1],t)))?i[1]=r:n.push([t,r])}for(let r=0;r",r+1),i=-1===t?e.length:t+1;a(r,i),r=i-1}else t&&"#"===i&&a(r,r+1)}let o="",s=0;for(let[i,a]of n)o+=eq(e.slice(s,i),t,0!==s,0===s&&r,!0),o+=`'${e.slice(i,a).replace(/'/g,"''")}'`,s=a;return o+eq(e.slice(s),t,0!==s,0===s&&r,i)}(e,t,r,i):e}(i,t,n>0,ne+t.map(e=>`/${e}`).join("")).join(" ")}`}`:""}}`;case 5:return`{${i.value},select,${eH(i.options,!1)}}`;case 6:{let e="cardinal"===i.pluralType?"plural":"selectordinal",t=i.offset?`offset:${i.offset} `:"";return`{${i.value},${e},${t}${eH(i.options,!0)}}`}case 7:return"#";case 8:return`<${i.value}>${eB(i.children,t,!0)}`}}).join("")}function eq(e,t,r,i,n){let a="",o=0;for(;o".includes(c)||t&&"#"===c,h=0===s&&r||o===e.length&&n||u,f=0===s&&i;a+=1!==l||h||f?"'".repeat(h?2*l:1===l&&f?2:2*l-1):"'"}return a}function eH(e,t){return Object.entries(e).map(([e,r])=>`${e}{${eB(r.value,t,!0)}}`).join(" ")}function eV(e,t="en",r={}){return(function(e,t="en",r={}){let i=function e(t,r,i){let n=[],a=e=>{let t=n[n.length-1];"string"==typeof t&&"string"==typeof e?n[n.length-1]=t+e:n.push(e)};for(let n of t)switch(n.type){case 0:a(n.value);break;case 7:void 0!==i&&a(eF(r).format(i));break;case 1:{let e=eP(r.variables,n.value);a("string"==typeof e||"number"==typeof e?String(e):e||"");break}case 2:{let e=eP(r.variables,n.value),{scale:t,...i}="string"==typeof n.style?eD[n.style]??{}:n.style?.type===0?n.style.parsedOptions:{},o=function(e,t){if(!t)return e;if("bigint"==typeof e){if(!Number.isInteger(t))throw RangeError(`Cannot apply fractional scale ${t} to a bigint value.`);return e*BigInt(t)}return Number(e)*t}(e,t);a(eF(r,i).format(o));break}case 3:case 4:{let e=eP(r.variables,n.value),t=3===n.type?eO:ek;a((function(e,t){return eG(e.dateTimeFormats??=new Map,t?JSON.stringify(t):"",()=>new Intl.DateTimeFormat(e.locales,t))})(r,"string"==typeof n.style?t[n.style]:n.style?.type===1?n.style.parsedOptions:4===n.type?ek.medium:void 0).format(e));break}case 5:{let t=String(eP(r.variables,n.value)),i=eU(n.options,t)??n.options.other;if(!i)throw ez(n.value,t,n.options);e(i.value,r).forEach(a);break}case 6:{let t=eP(r.variables,n.value),i=`=${String(t)}`,o=eU(n.options,i),s="bigint"==typeof t?t:Number(t),l="bigint"==typeof s?s-BigInt(n.offset):s-n.offset;if(!o&&Object.keys(n.options).some(e=>"other"!==e&&"="!==e[0])){let e=(function(e,t){if("function"!=typeof Intl.PluralRules){let t=Error('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n');throw t.code="MISSING_INTL_API",t.originalMessage=e.message,t}return eG(e.pluralRules??=new Map,t,()=>new Intl.PluralRules(e.locales,{type:t}))})(r,n.pluralType??"cardinal").select(function(e){let t=Number(e);if("bigint"==typeof e&&Math.abs(t)>0x1fffffffffffff)throw RangeError(`Cannot select a plural category for bigint ${e} outside the safe integer range.`);return t}(l));o=eU(n.options,e)}if(!(o??=n.options.other))throw ez(n.value,t,n.options);e(o.value,r,l).forEach(a);break}case 8:{let t=eP(r.variables,n.value);if("function"!=typeof t)throw TypeError(`The ICU tag variable "${n.value}" must be a function.`);let o=t(e(n.children,r,i));Array.isArray(o)?o.forEach(a):a(o)}}return n}(eR(e,{locale:function(e){if(void 0===Intl.Locale)return;let t=Intl.NumberFormat.supportedLocalesOf(e)[0],r="string"==typeof e?e:e[0];return new Intl.Locale(t??r)}(t)}),{message:e,locales:t,variables:r});return 1===i.length?i[0]:i.length?i:""})(e,t,r)?.toString()??""}function eK({value:e,unit:t,locales:r=["en"],options:i={}}){return ed.get("RelativeTimeFormat",r,{style:"long",numeric:"auto",...i}).format(e,t)}function eW(e){try{return ed.get("Locale",e).language}catch{return}}let eX=(e,t,r)=>{let i=e?.[t];if(i)return"string"==typeof i?"name"===r?i:void 0:i[r]},eJ=(e,t)=>{let r=e?.[t];return"object"==typeof r&&null!==r&&"string"==typeof r.code?r.code:void 0},eY=new Set(["Cham","Jamo","Kawi","Lisu","Toto","Thai"]),eZ=(e,t)=>{e=eJ(t,e)||e;try{let t=ed.get("Locale",e),{language:r,region:i,script:n}=t,a=1+Number(!!i)+Number(!!n);if(e.split("-").length!==a&&t.toString().split("-").length!==a||ed.get("DisplayNames",["en"],{type:"language"}).of(r)===r&&!(r>="qaa"&&r<="qtz")||i&&ed.get("DisplayNames",["en"],{type:"region"}).of(i)===i||n&&ed.get("DisplayNames",["en"],{type:"script"}).of(n)===n&&!eY.has(n))return!1;return!0}catch{return!1}},eQ=e=>{try{return Intl.getCanonicalLocales(e)[0]}catch{return e}};function e0(e,t){let r=!0,i=new Set,n=new Map;for(let a of e){if(!eZ(a,t)){r=!1;continue}let e=eW(a);if(void 0===e)continue;i.add(e);let o=n.get(e);void 0===o&&(o=new Set,n.set(e,o)),o.add(eQ(a))}return{allValid:r,languages:i,byLanguage:n}}function e1(...e){try{let t=e.flat().map(e=>ed.get("Locale",eQ(e))),[r]=t,i=new Set(t.map(({region:e})=>e).filter(Boolean)),n=new Set(t.map(({script:e})=>e).filter(Boolean));return t.every(({language:e})=>e===r?.language)&&i.size<=1&&n.size<=1}catch(e){return console.error(e),!1}}function e2(e,t,r,i){if(r&&!r.allValid||!eZ(e,i)||!eZ(t,i)||e1(e,t))return!1;if(!r)return!0;let n=eW(t);return void 0!==n&&r.languages.has(n)}function e8(e,t){if(t.has(e))return e;let{languageCode:r,regionCode:i,scriptCode:n,minimizedCode:a}=function(e){try{let t=ed.get("Locale",e),r=t.language,i=t.region||"",n=t.script||"";if(!i||!n){let e=t.maximize();i||=e.region||"",n||=e.script||""}return{languageCode:r,regionCode:i,scriptCode:n,minimizedCode:t.minimize().toString()}}catch{let t=eZ(e)?eQ(e):e,r=t.split("-");return{languageCode:r[0]||t,regionCode:r.length>2?r[2]:r[1]||"",scriptCode:r[3]||"",minimizedCode:t}}}(e),o=`${r}-${i}`;if(t.has(o))return o;let s=`${r}-${n}`;return t.has(s)?s:t.has(a)?a:void 0}function e3(e,t){let r=eJ(t,e);return r&&eZ(r)?r:e}function e7(e,t){let r=e;e=e3(e,t);try{let i=eQ(e),n=ed.get("Locale",i),{language:a,region:o}=n;if(t)for(let n of[r,e,i,a]){let e=eX(t,n,"emoji");if(e)return e}let s=o&&ti(o);if(s)return s;let l=n.maximize();return e9[l.language]||tr(l.region||"")}catch{return e4}}let e5="🌍",e6="🌏",e4=e5,e9={ca:e5,eu:e5,ku:e5,bo:e6,ug:e6,gd:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",cy:"🏴󠁧󠁢󠁷󠁬󠁳󠁿",gv:"🇮🇲",grc:"🏺"},te={EU:"🇪🇺",419:"🌎"},tt=new Set(["AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","CV","KH","CM","CA","KY","CF","TD","CL","CN","CX","CC","CO","KM","CD","CG","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","SZ","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MK","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW"]);function tr(e){return ti(e)||"🌍"}function ti(e){let t=e.toUpperCase(),r=te[t];return r||(tt.has(t)?String.fromCodePoint(t.charCodeAt(0)+127397,t.charCodeAt(1)+127397):void 0)}function tn(e,t){if(!t)return;let r={};for(let i of e){let e=t[i];e&&("string"==typeof e?r.name||=e:r={...e,...r})}return r}function ta(e,t="en",r){let i=e;e=e3(e,r),t||="en";try{let n=eQ(e),a=ed.get("Locale",e),o=a.language,s=tn([i,e,n,o],r),l=a.region,c=a.maximize(),u=c.toString(),h=a.region||s?.regionCode||c.region||"",f=a.script||s?.scriptCode||c.script||"",d=a.minimize().toString(),p=[t,e,"en"],g=[e,t,"en"],m=ed.get("DisplayNames",p,{type:"language"}),y=ed.get("DisplayNames",g,{type:"language"}),b=s?.name,v=s?.nativeName||s?.name,x=b||m.of(e)||e,C=v||y.of(e)||e,w=s?.maximizedName||b||m.of(u)||e,T=s?.nativeMaximizedName||v||y.of(u)||e,L=s?.minimizedName||b||m.of(d)||e,E=s?.nativeMinimizedName||v||y.of(d)||e,S=s?.languageName||b||m.of(o)||e,I=s?.nativeLanguageName||v||y.of(o)||e,A=s?.nameWithRegionCode||(l?`${S} (${l})`:x),M=s?.nativeNameWithRegionCode||(l?`${I} (${l})`:C)||A,N=ed.get("DisplayNames",p,{type:"region"}),$=ed.get("DisplayNames",g,{type:"region"}),j=s?.regionName||(h?N.of(h):"")||"",R=s?.nativeRegionName||(h?$.of(h):"")||"",D=ed.get("DisplayNames",p,{type:"script"}),O=ed.get("DisplayNames",g,{type:"script"});return{code:n,name:x,nativeName:C,maximizedCode:u,maximizedName:w,nativeMaximizedName:T,minimizedCode:d,minimizedName:L,nativeMinimizedName:E,languageCode:o,languageName:S,nativeLanguageName:I,nameWithRegionCode:A,nativeNameWithRegionCode:M,regionCode:h,regionName:j,nativeRegionName:R,scriptCode:f,scriptName:s?.scriptName||(f?D.of(f):"")||"",nativeScriptName:s?.nativeScriptName||(f?O.of(f):"")||"",emoji:s?.emoji||e7(n,r)}}catch{let t=eZ(e)?eQ(e):e,i=t.split("-"),n=i[0]||t,a=i.length>2?i[2]:i[1]||"",o=i[3]||"",s=tn([t,n],r);t=s?.code||t;let l=s?.name||t,c=s?.nativeName||l,u=s?.maximizedCode||t,h=s?.maximizedName||l,f=s?.nativeMaximizedName||c,d=s?.minimizedCode||t,p=s?.minimizedName||l,g=s?.nativeMinimizedName||c;n=s?.languageCode||n;let m=s?.languageName||l,y=s?.nativeLanguageName||c;a=s?.regionCode||a;let b=s?.regionName||"",v=s?.nativeRegionName||"";o=s?.scriptCode||o;let x=s?.scriptName||"",C=s?.nativeScriptName||"",w=s?.nameWithRegionCode||(b?`${m} (${b})`:l),T=s?.nativeNameWithRegionCode||(v?`${y} (${v})`:c);return{code:t,name:l,nativeName:c,maximizedCode:u,maximizedName:h,nativeMaximizedName:f,minimizedCode:d,minimizedName:p,nativeMinimizedName:g,languageCode:n,languageName:m,nativeLanguageName:y,nameWithRegionCode:w,nativeNameWithRegionCode:T,regionCode:a,regionName:b,nativeRegionName:v,scriptCode:o,scriptName:x,nativeScriptName:C,emoji:s?.emoji||"🌍"}}}let to=new Set(["arab","adlm","hebr","nkoo","rohg","samr","syrc","thaa","yezi"]),ts=new Set(["ar","arc","ckb","dv","fa","he","iw","ku","lrc","nqo","ps","pnb","sd","syr","ug","ur","yi"]);function tl(e,t){return t?Object.keys(t).find(r=>eJ(t,r)===e)??e:e}var tc=class{getResolutionScope(){if(this.resolutionScope&&this.isResolutionScopeCurrent(this.resolutionScope))return this.resolutionScope;let e=this.buildResolutionScope(this.locales);return Object.defineProperty(this,"resolutionScope",{configurable:!0,value:e,writable:!0}),e}isResolutionScopeCurrent(e){if(e.approvedLocalePairs.length!==this.locales.length)return!1;for(let t=0;t{let t=this.resolveCanonicalLocale(e);return{locale:e,canonicalLocale:t,standardizedLocale:eQ(t)}}),r=e0(t.map(({canonicalLocale:e})=>e),this.customMapping),i=new Set(Array.from(r.byLanguage.values()).flatMap(e=>Array.from(e)));return{configuredLocales:new Set(t.filter(({standardizedLocale:e})=>i.has(e)).map(({locale:e})=>e)),approvedLocalePairs:t,canonicalMappingCodes:t.map(({canonicalLocale:e})=>eJ(this.customMapping,e)),approved:r}}constructor({defaultLocale:e="en",locales:t=[],customMapping:r}={}){this.defaultLocale=e,this.locales=t,this.customMapping=r}getFormattingLocales(e,t){return(void 0===t?[e,this.defaultLocale,"en"]:Array.isArray(t)?t:[t]).filter(e=>!!e).map(e=>this.resolveCanonicalLocale(e))}formatNum(e,t,r={}){let{locales:i,...n}=r;return function({value:e,locales:t=["en"],options:r={}}){return ed.get("NumberFormat",t,{numberingSystem:"latn",...r}).format(e)}({value:e,locales:this.getFormattingLocales(t,i),options:n})}formatDateTime(e,t,r={}){let{locales:i,...n}=r;return function({value:e,locales:t=["en"],options:r={}}){return ed.get("DateTimeFormat",t,{calendar:"gregory",numberingSystem:"latn",...r}).format(e)}({value:e,locales:this.getFormattingLocales(t,i),options:n})}formatCurrency(e,t,r,i={}){let{locales:n,...a}=i;return function({value:e,locales:t=["en"],currency:r="USD",options:i={}}){return ed.get("NumberFormat",t,{style:"currency",currency:r,numberingSystem:"latn",...i}).format(e)}({value:e,currency:t,locales:this.getFormattingLocales(r,n),options:a})}formatRelativeTime(e,t,r,i={}){let{locales:n,...a}=i;return eK({value:e,unit:t,locales:this.getFormattingLocales(r,n),options:a})}formatRelativeTimeFromDate(e,t,r={}){let i,n,a,o,s,l,c,u,h,f,d,{locales:p,baseDate:g,...m}=r,{value:y,unit:b}=(i=(g??new Date).getTime(),a=Math.abs(n=e.getTime()-i),o=n<0?-1:1,s=Math.floor(a/1e3),l=Math.floor(a/6e4),c=Math.floor(a/36e5),u=Math.floor(a/864e5),h=Math.floor(a/6048e5),f=Math.floor(a/2592e6),d=Math.floor(a/31536e6),s<60?{value:o*s,unit:"second"}:l<60?{value:o*l,unit:"minute"}:c<24?{value:o*c,unit:"hour"}:u<7?{value:o*u,unit:"day"}:u<28||f<1?{value:o*h,unit:"week"}:f<12||d<1?{value:o*f,unit:"month"}:{value:o*d,unit:"year"});return eK({value:y,unit:b,locales:this.getFormattingLocales(t,p),options:m})}formatCutoff(e,t,r={}){let{locales:i,...n}=r;return ed.get("CutoffFormat",this.getFormattingLocales(t,i),n).format(e)}formatMessage(e,t,r={}){let{locales:i,variables:n,dataFormat:a}=r;return"STRING"===a?e:eV(e,this.getFormattingLocales(t,i),n)}formatList(e,t,r={}){let{locales:i,...n}=r;return function({value:e,locales:t=["en"],options:r={}}){return ed.get("ListFormat",t,{type:"conjunction",style:"long",...r}).format(e.map(String))}({value:e,locales:this.getFormattingLocales(t,i),options:n})}formatListToParts(e,t,r={}){let{locales:i,...n}=r;return function({value:e,locales:t=["en"],options:r={}}){let i=ed.get("ListFormat",t,{type:"conjunction",style:"long",...r}).formatToParts(e.map(()=>"1")),n=0;return i.map(t=>"element"===t.type?e[n++]:t.value)}({value:e,locales:this.getFormattingLocales(t,i),options:n})}getLocaleName(e){return function(e,t="en",r){let i=e;e=e3(e,r),t||="en";try{let n=eQ(e);if(r)for(let t of[i,e,n,ed.get("Locale",n).language]){let e=eX(r,t,"name");if(e)return e}return ed.get("DisplayNames",[t,n,"en"],{type:"language"}).of(n)||""}catch{return""}}(e,this.defaultLocale,this.customMapping)}getLocaleEmoji(e){return e7(e,this.customMapping)}getLocaleProperties(e){return ta(e,this.defaultLocale,this.customMapping)}requiresTranslation(e,t=this.defaultLocale,r=this.locales.length?this.locales:void 0){let i=r?r===this.locales?this.getResolutionScope().approved:e0(r.map(e=>this.resolveCanonicalLocale(e)),this.customMapping):void 0;return e2(this.resolveCanonicalLocale(t),this.resolveCanonicalLocale(e),i,this.customMapping)}determineLocale(e,t=this.locales){let{configuredLocales:r,approvedLocalePairs:i,approved:n}=t===this.locales?this.getResolutionScope():this.buildResolutionScope(t);for(let t of Array.isArray(e)?e:[e]){if(r.has(t))return t;let e=function(e,t,r){for(let i of Array.isArray(e)?e:[e]){if(!eZ(i,r))continue;let e=eQ(i),n=eW(e);if(void 0===n)continue;let a=t.byLanguage.get(n);if(void 0===a)continue;let o=e8(e,a)||e8(n,a);if(o)return o}}(this.resolveCanonicalLocale(t),n,this.customMapping);if(e)return(i.find(({canonicalLocale:t})=>t===e)??i.find(({standardizedLocale:t})=>t===e))?.locale??this.resolveAliasLocale(e)}}getLocaleDirection(e){return function(e){try{var t;let r,i=(t=ed.get("Locale",e),r="textInfo"in t&&"object"==typeof t.textInfo&&null!==t.textInfo&&"direction"in t.textInfo?t.textInfo.direction:void 0,"rtl"===r||"ltr"===r?r:void 0);if(i)return i}catch{}let{scriptCode:r,languageCode:i}=ta(e);return r?to.has(r.toLowerCase())?"rtl":"ltr":i&&ts.has(i.toLowerCase())?"rtl":"ltr"}(this.resolveCanonicalLocale(e))}isValidLocale(e){return eZ(e,this.customMapping)}resolveCanonicalLocale(e){return e3(e,this.customMapping)}resolveAliasLocale(e){return tl(e,this.customMapping)}standardizeLocale(e){return eQ(e)}isSameDialect(...e){return e1(...e.map(e=>Array.isArray(e)?e.map(e=>this.resolveCanonicalLocale(e)):this.resolveCanonicalLocale(e)))}isSameLanguage(...e){return function(...e){try{let t=e.flat().map(e=>ed.get("Locale",e).language);return t.every(e=>e===t[0])}catch(e){return console.error(e),!1}}(...e.map(e=>Array.isArray(e)?e.map(e=>this.resolveCanonicalLocale(e)):this.resolveCanonicalLocale(e)))}isSupersetLocale(e,t){return function(e,t){try{let{language:r,region:i,script:n}=ed.get("Locale",eQ(e)),{language:a,region:o,script:s}=ed.get("Locale",eQ(t));if(r!==a||i&&i!==o||n&&n!==s)return!1;return!0}catch(e){return console.error(e),!1}}(this.resolveCanonicalLocale(e),this.resolveCanonicalLocale(t))}};function tu(e,t){return e3(e,t)}function th(e){return eQ(e)}function tf(e,t){return tl(e,t)}e.s(["l",0,tc,"i",0,function(e,t){let{locales:r,...i}=t??{};return ed.get("CutoffFormat",r,i).format(e)},"x",0,function(e,t){return t?.dataFormat==="STRING"?e:eV(e,t?.locales,t?.variables)},"e",0,function(e,t,r){return ta(e,t,r)},"W",0,function(e,t="en",r){t||="en";let i=e,n=e4;try{i=ed.get("DisplayNames",[t,"en"],{type:"region"}).of(e)||e,n=tr(e)}catch{}return{code:e,name:i,emoji:n,...r?.[e]}},"b",0,function(e,t){return eZ(e,t)},"Z",0,function(e,t,r,i){return e2(e,t,r?e0(r,i):void 0,i)},"n",0,tf,"P",0,tu,"$",0,th],902292);let td=e=>(0,i.t)({source:"GT",severity:"Error",whatHappened:`Cannot call \`${e}\` without a specified locale`,fix:`Pass a locale to \`${e}\` or specify targetLocale in the GT constructor`}),tp={debug:0,info:1,warn:2,error:3,off:4},tg={debug:"\x1b[36m",info:"\x1b[32m",warn:"\x1b[33m",error:"\x1b[31m",off:""};function tm(){if(void 0!==r.default&&r.default.env?._GT_LOG_LEVEL){let e=r.default.env._GT_LOG_LEVEL.toLowerCase();if(e in tp)return e}return"warn"}var ty=class{constructor(e){this.config=e}handle(e){let t=[];this.config.includeTimestamp&&t.push(`[${e.timestamp.toISOString()}]`);let r=tg[e.level],i=`[${e.level.toUpperCase()}]`;t.push(`${r}${i}\x1b[0m`),this.config.prefix&&t.push(`[${this.config.prefix}]`),this.config.includeContext&&e.context&&t.push(`[${e.context}]`),t.push(e.message),e.metadata&&Object.keys(e.metadata).length>0&&t.push(` Metadata: ${JSON.stringify(e.metadata,null,2)}`);let n=t.join(" ");switch(e.level){case"debug":console.debug(n);break;case"info":console.info(n);break;case"warn":console.warn(n);break;case"error":console.error(n)}}},tb=class e{constructor(e,t){this.logger=e,this.context=t}debug(e,t){this.logger.debug(e,this.context,t)}info(e,t){this.logger.info(e,this.context,t)}warn(e,t){this.logger.warn(e,this.context,t)}error(e,t){this.logger.error(e,this.context,t)}child(t){return new e(this.logger,`${this.context}:${t}`)}};let tv=(new class{constructor(e={}){this.config={level:tm(),includeTimestamp:!0,includeContext:!0,enableConsole:!0,handlers:[],...e},this.handlers=[...this.config.handlers||[]],this.config.enableConsole&&this.handlers.push(new ty(this.config))}addHandler(e){this.handlers.push(e)}removeHandler(e){let t=this.handlers.indexOf(e);t>-1&&this.handlers.splice(t,1)}configure(e){this.config={...this.config,...e}}shouldLog(e){return tp[e]>=tp[this.config.level]}log(e,t,r,i){if(!this.shouldLog(e))return;let n={level:e,message:t,timestamp:new Date,context:r,metadata:i};this.handlers.forEach(e=>{try{e.handle(n)}catch(e){console.error("Error in log handler:",e)}})}debug(e,t,r){this.log("debug",e,t,r)}info(e,t,r){this.log("info",e,t,r)}warn(e,t,r){this.log("warn",e,t,r)}error(e,t,r){this.log("error",e,t,r)}child(e){return new tb(this,e)}getConfig(){return{...this.config}}}({level:tm(),includeTimestamp:!0,includeContext:!0,prefix:"GT"})).child("GT instance"),tx=Object.values({ANTHROPIC:"ANTHROPIC",OPENAI:"OPENAI",XAI:"XAI",GOOGLE:"GOOGLE",HYPERCLOVA:"HYPERCLOVA"});function tC(e){return tx.includes(e)}async function tw(e,t,r=6e4,n=globalThis.fetch){let a=new AbortController,o=[a.signal];t.signal&&o.push(t.signal),e instanceof Request&&o.push(e.signal);let s=AbortSignal.any(o),l=!1,c=!1===r?null:setTimeout(()=>{l=!s.aborted,a.abort()},r);try{return await n(e,{...t,signal:s})}catch(e){if(l&&!1!==r&&e===a.signal.reason)throw(0,i.t)({source:"GT",severity:"Error",whatHappened:`Translation request timed out after ${r}ms`,fix:"Try again, or increase the request timeout if the source content is large"});throw e}finally{c&&clearTimeout(c)}}function tT(e){if(void 0!==e.data)return e.data;if(e.response)throw ea.fromResponse(e.error,e.response);throw e.error}function tL(e,t,r,n={}){"string"==typeof t&&(t={targetLocale:t});let a=[];if(r.apiKey||r.userTokenProvider||a.push((0,i.t)({source:"GT",severity:"Error",whatHappened:`Cannot call \`${e}\` without a specified API key`,fix:`Pass an API key to \`${e}\` or specify apiKey in the GT constructor`})),r.projectId||a.push((0,i.t)({source:"GT",severity:"Error",whatHappened:`Cannot call \`${e}\` without a specified project ID`,fix:`Pass a project ID to \`${e}\` or specify projectId in the GT constructor`})),a.length)throw Error(a.join("\n"));let o=t?.targetLocale||n.targetLocale;if(!o){let t=td(e);throw tv.error(t),Error(t)}let{customMapping:s,...l}=r;return{options:{...t,targetLocale:th(tu(o,s)),sourceLocale:th(tu(t?.sourceLocale||n.sourceLocale||"en",s))},config:l}}async function tE(e,t,r,i){let n=tL("translate",t,r,i);return(await tN([e],n.options,n.config))[0]}async function tS(e,t,r,i){let n=tL("translateMany",t,r,i);return await tN(e,n.options,n.config)}function tI(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function tA(e){var t,r;return"string"==typeof e||!!tI(t=e)&&(void 0===t.t||"string"==typeof t.t)&&(void 0===t.i||"number"==typeof t.i)&&(void 0===t.d||!(!tI(r=t.d)||void 0!==r.t&&"p"!==r.t&&"b"!==r.t||["pl","ti","alt","arl","arb","ard"].some(e=>void 0!==r[e]&&"string"!=typeof r[e]))&&(void 0===r.b||tI(r.b)&&Object.values(r.b).every(tM)))&&(void 0===t.c||tM(t.c))}function tM(e){return null===e||"boolean"==typeof e||tA(e)||Array.isArray(e)&&e.every(tA)}async function tN(e,t,r){let n,a=Array.isArray(e),o=a?[]:void 0,s={};for(let[t,r]of a?e.map(e=>[void 0,e]):Object.entries(e)){let{source:e,metadata:i}="string"==typeof r?{source:r}:r,n=t??i?.hash??R({source:e,...i?.context&&{context:i.context},...i?.maxChars!=null&&{maxChars:i.maxChars},...i?.fileFormat&&{fileFormat:i.fileFormat},dataFormat:i?.dataFormat??"STRING"});o?.push(n),s[n]={source:e,metadata:i}}if(void 0!==t.modelProvider&&!tC(t.modelProvider))throw Error((0,i.t)({source:"generaltranslation",severity:"Error",whatHappened:"The configured model provider is not supported",details:String(t.modelProvider),fix:`Use one of: ${tx.join(", ")}`}));let l=es({apiKey:r.apiKey,apiVersion:r.apiVersion,userTokenProvider:r.userTokenProvider,baseUrl:r.baseUrl||"https://api.gtx.dev",fetch:(e,t)=>tw(e,t??{},r.timeoutMs,r.fetch),projectId:r.projectId,retryPolicy:"none",timeoutMs:!1}),c=Object.fromEntries(Object.entries(tT(await (n={body:{requests:s,targetLocale:t.targetLocale,sourceLocale:t.sourceLocale,metadata:{...t,modelProvider:t.modelProvider}},client:l}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/translate",...n,headers:{"Content-Type":"application/json",...n.headers}}))).map(([e,t])=>[e,t.success?"JSX"===t.dataFormat&&tM(t.translation)||"JSX"!==t.dataFormat&&"string"==typeof t.translation?{success:!0,translation:t.translation,dataFormat:t.dataFormat,locale:t.locale}:{success:!1,error:"Invalid translation returned",code:500}:t]));return o?o.map(e=>c[e]??{success:!1,error:"No translation returned",code:500}):c}e.s(["a",0,tT,"d",0,e=>(0,i.t)({source:"GT",severity:"Error",whatHappened:`Cannot call \`${e}\` without a specified locale`,fix:`Pass a locale to \`${e}\` or specify sourceLocale in the GT constructor`}),"f",0,td,"g",0,"en","h",0,"https://api.gtx.dev","i",0,function(e){return"object"==typeof e&&null!==e&&"error"in e&&"string"==typeof e.error},"l",0,e=>(0,i.t)({source:"GT",severity:"Error",whatHappened:`Locale "${e}" is not valid`,fix:"Use a valid BCP 47 locale code or add a custom mapping"}),"m",0,"https://cdn.gtx.dev","n",0,tS,"o",0,tC,"p",0,"https://api.gtx.dev","s",0,tx,"t",0,tE,"u",0,e=>(0,i.t)({source:"GT",severity:"Error",whatHappened:`These locales are not valid: ${e.join(", ")}`,fix:"Use valid BCP 47 locale codes or add custom mappings"})],300553);let t$=new Set(["LOTTIE"]);function tj(e){if(void 0!==t.Buffer)return t.Buffer.from(e,"utf8").toString("base64");let r=new TextEncoder().encode(e),i="";for(let e=0;e ${e.transformFormat}`:`fileFormat is required when transformFormat is provided for ${t}`}(t);if(e)throw Error(e)}}async function tF(e){let t=[];for await(let r of e)t.push(r);return t}function tG(e){return{jobId:e.jobId,status:e.status,..."failed"===e.status?{error:{message:e.error.message??""}}:{}}}function tU({icuString:e,shouldVisit:t,visitor:r,options:{recurseIntoVisited:i=!0,...n}}){let a=eR(e,n);return o(a),a;function o(e){e.map(s)}function s(e){let n=!1;t(e)&&(r(e),n=!0),(!n||i)&&(5===e.type||6===e.type?Object.values(e.options).map(e=>e.value).map(o):8===e.type&&o(e.children))}}let tz="_gt_",tB=RegExp(`^${tz}\\d+$`),tq=RegExp(`^${tz}$`);function tH(e){return 5===e.type&&tB.test(e.value)&&!!e.options.other&&(0===e.options.other.value.length||e.options.other.value.length>0&&e.options.other.value[0]?.type===0)}function tV(e){return 5===e.type&&tq.test(e.value)&&!!e.options.other&&(0===e.options.other.value.length||e.options.other.value.length>0&&e.options.other.value[0]?.type===0)}function tK(e){let t=e.replace(/'/g,"''"),r=/[{}<>]/,i=t.search(r);if(-1===i)return t;let n=-1;for(let e=t.length-1;e>=0;e--)if(r.test(t[e])){n=e;break}return t.slice(0,i)+"'"+t.slice(i,n+1)+"'"+t.slice(n+1)}e.s(["a",0,tV,"c",0,function(e){let t,r;function n(e){return th(tu(e,r?.customMapping))}function a(e){return e.locale?{...e,locale:tf(e.locale,r?.customMapping)}:e}function o(){if(!r)throw Error("API client not configured — call configureApiClient first");return r}function s(e){return void 0===e&&t?t:es({...o(),timeoutMs:e})}function l(e){t=es(e),r={...e}}async function c(e,t,r){return tE(e,t,{...o(),...void 0!==r&&{timeoutMs:r}})}async function u(e,t,r){return tS(e,t,{...o(),...void 0!==r&&{timeoutMs:r}})}async function h(e,t={}){let r;return tT(await (r={body:{jobIds:[...e]},client:s(t.timeoutMs),signal:t.signal}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/jobs/info",...r,headers:{"Content-Type":"application/json",...r.headers}}))}async function f(e,t){let r,i=e??o().projectId;if(!i)throw Error("Project ID is required to fetch project information");return tT(await (r={client:s(t),path:{projectId:i}}).client.get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/info/{projectId}",...r}))}return e&&l(e),{configure:l,getClient:s,resolveAliasLocale:e=>tf(e,r?.customMapping),resolveCanonicalLocale:e=>n(e),translate:c,translateMany:u,queryBranchData:async e=>{let t;return tT(await (t={body:e,client:s()}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/branches/info",...t,headers:{"Content-Type":"application/json",...t.headers}}))},createBranch:async e=>{let t;return tT(await (t={body:e,client:s()}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/branches/create",...t,headers:{"Content-Type":"application/json",...t.headers}}))},async processFileMoves(e,t={}){let r=await z(e,async e=>{let r;return tT(await (r={body:{branchId:t.branchId,moves:e},client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/moves",...r,headers:{"Content-Type":"application/json",...r.headers}})).results}),i=r.filter(({success:e})=>e).length;return{results:r,summary:{total:e.length,succeeded:i,failed:r.length-i}}},async getOrphanedFiles(e,t,r={}){let i=async t=>{let i;return tT(await (i={body:{branchId:e,fileIds:t},client:s(r.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/orphaned",...i,headers:{"Content-Type":"application/json",...i.headers}}))};if(0===t.length)return i([]);let n=await z(t,async e=>[await i(e)]),a=new Map(n[0].orphanedFiles.map(e=>[e.fileId,e]));for(let e of n.slice(1)){let t=new Set(e.orphanedFiles.map(e=>e.fileId));for(let e of Array.from(a.keys()))t.has(e)||a.delete(e)}return{orphanedFiles:Array.from(a.values())}},setupProject:async(e,t={})=>{let r;return tT(await (r={body:{files:e.map(({branchId:e,fileId:t,versionId:r})=>({branchId:e,fileId:t,versionId:r})),locales:t.locales?.map(e=>n(e)),force:t.force},client:s(t.timeoutMs)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/setup/generate",...r,headers:{"Content-Type":"application/json",...r.headers}}))},loadJobStatuses:h,checkJobStatus:async(e,t)=>(await h(e,{timeoutMs:t})).map(tG),async awaitJobs(e,t){let r=await U(e,(e,t)=>h(e,{signal:t}),t);return{...r,jobs:r.jobs.map(tG)}},async enqueueFiles(e,t){tP(e);let r=t.modelProvider;if(void 0!==r&&!tC(r))throw Error((0,i.t)({source:"generaltranslation",severity:"Error",whatHappened:`Unsupported model provider \`${r}\``,fix:`Use one of: ${tx.join(", ")}`}));let a=t.targetLocales.map(e=>n(e)),o=await z(e,async e=>{let i,o=tT(await (i={body:{files:e.map(({branchId:e,fileId:t,versionId:r,fileName:i,transformFormat:n})=>({branchId:e,fileId:t,versionId:r,fileName:i,transformFormat:n})),targetLocales:a,sourceLocale:t.sourceLocale?n(t.sourceLocale):void 0,modelProvider:r,force:t.force},client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/translations/enqueue",...i,headers:{"Content-Type":"application/json",...i.headers}}));return Object.entries("jobData"in o?o.jobData:o.data)});return{jobData:Object.fromEntries(o),locales:a,message:`Successfully enqueued ${o.length} file translation jobs in ${Math.ceil(e.length/100)} batch(es)`}},createTag:async e=>{let t;return tT(await (t={body:e,client:s()}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/tags/create",...t,headers:{"Content-Type":"application/json",...t.headers}}))},publishFiles:async e=>{let t;return tT(await (t={body:{files:e.map(({fileId:e,versionId:t,branchId:r,publish:i})=>({fileId:e,versionId:t,branchId:r,publish:i}))},client:s()}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/publish",...t,headers:{"Content-Type":"application/json",...t.headers}}))},submitUserEditDiffs:async(e,t={})=>z(e.diffs,async r=>{let i;return[tT(await (i={body:{projectId:e.projectId,diffs:r.map(({diff:e,branchId:t,versionId:r,fileId:i,localContent:a,locale:o})=>({diff:e,branchId:t,versionId:r,fileId:i,localContent:a,locale:n(o)}))},client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/diffs",...i,headers:{"Content-Type":"application/json",...i.headers}}))]}),createProject:async(e,t)=>{let r;return tT(await (r={path:{orgId:e},body:{...t,defaultLocale:n(t.defaultLocale)},client:s()}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/orgs/{orgId}/projects",...r,headers:{"Content-Type":"application/json",...r.headers}}))},listProjects:async()=>tF(el(_,{client:s()})),listOrgs:async()=>tF(el(k,{client:s()})),createProjectApiKey:async(e,t)=>{let r;return tT(await (r={path:{projectId:e},body:t,client:s()}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/projects/{projectId}/api-keys",...r,headers:{"Content-Type":"application/json",...r.headers}}))},loadProjectInfo:f,async getProjectInfo(e,t){let i=await f(e,t);return{...i,defaultLocale:tf(i.defaultLocale,r?.customMapping),currentLocales:i.currentLocales.map(e=>tf(e,r?.customMapping))}},async queryFileData(e,t){let i,a=tT(await (i={body:{...e,translatedFiles:e.translatedFiles?.map(e=>({...e,locale:n(e.locale)}))},client:s(t)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/info",...i,headers:{"Content-Type":"application/json",...i.headers}}));return{...a,translatedFiles:a.translatedFiles.map(e=>({...e,locale:tf(e.locale,r?.customMapping)})),sourceFiles:a.sourceFiles.map(e=>({...e,sourceLocale:tf(e.sourceLocale,r?.customMapping),locales:e.locales.map(e=>tf(e,r?.customMapping))}))}},async querySourceFile(e,t={},i){let n,a=tT(await (n={path:e,query:t,client:s(i)}).client.get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/translations/files/status/{fileId}",...n}));return{...a,translations:a.translations.map(e=>({...e,locale:tf(e.locale,r?.customMapping)})),sourceFile:{...a.sourceFile,sourceLocale:tf(a.sourceFile.sourceLocale,r?.customMapping),locales:a.sourceFile.locales.map(e=>tf(e,r?.customMapping))}}},async downloadFileBatch(e,t={}){let i=async e=>{let r;return tT(await (r={body:e.map(e=>({...e,locale:e.locale?n(e.locale):void 0})),client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/download",...r,headers:{"Content-Type":"application/json",...r.headers}}))},a=await z(e,async e=>[await i(e)]);return{files:a.flatMap(e=>e.files.map(e=>({...e,...e.locale&&{locale:tf(e.locale,r?.customMapping)},data:tO(e.data,e.fileFormat),metadata:e.metadata}))),count:a.reduce((e,t)=>e+t.count,0),pending:a.flatMap(e=>(e.pending??[]).map(e=>({...e,locale:tf(e.locale,r?.customMapping)})))}},async uploadSourceFiles(e,t){let r=n(t.sourceLocale);return{uploadedFiles:await z(e,async e=>{let i;return tT(await (i={body:{data:e.map(({source:e})=>({source:{...e,content:tD(e.content,e.fileFormat),locale:n(e.locale)}})),sourceLocale:r},client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/upload-files",...i,headers:{"Content-Type":"application/json",...i.headers}})).uploadedFiles.map(a)})}},async uploadFonts(e,t={}){let r=await z(e,async e=>{let r;return tT(await (r={body:{assets:e},client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/assets",...r,headers:{"Content-Type":"application/json",...r.headers}})).assets},{batchSize:50});return{assets:r,count:r.length}},uploadTranslations:async(e,t)=>(tP(e.map(({source:e})=>e)),{uploadedFiles:await z(e,async e=>{let r;return tT(await (r={body:{data:e.map(({source:e,translations:t})=>({source:{...e,content:tD(e.content,e.fileFormat),locale:n(e.locale)},translations:t.map(e=>({...e,locale:n(e.locale),content:tD(e.content,e.fileFormat)}))})),sourceLocale:n(t.sourceLocale)},client:s(t.timeout)}).client.post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v2/project/files/upload-translations",...r,headers:{"Content-Type":"application/json",...r.headers}})).uploadedFiles.map(a)})})}},"d",0,tO,"f",0,tj,"i",0,tH,"l",0,tk,"n",0,function(e,t){let r=` other {${tK(String(e??""))}}`,i="";return t?.$name&&(i=` _gt_var_name {${tK(t.$name)}}`),`{${tz}, select,${r}${i}}`},"o",0,tz,"p",0,tD,"r",0,function(e){if(!e.includes("_gt_"))return e;let t=[];tU({icuString:e,shouldVisit:tV,visitor:function(e){t.push({start:e.location?.start.offset??0,end:e.location?.end.offset??0,value:e.options.other.value.length>0?e.options.other.value[0].value:""})},options:{recurseIntoVisited:!1,captureLocation:!0}});let r=0,i=[];for(let n=0;n{"use strict";function t(e){let t=e.trim();return t?/[.!?)]$/.test(t)?t:`${t}.`:""}function r(e){let t=e.trim(),r=t.length;for(;r>0;){let e=t[r-1];if("."!==e&&"!"!==e&&"?"!==e)break;r-=1}return t.slice(0,r)}e.s(["n",0,function(e){if(null!=e)return String(e)},"t",0,function({source:e,severity:i,whatHappened:n,reassurance:a,why:o,fix:s,wayOut:l,details:c,docsUrl:u}){let h=e?i?`${e} ${i}:`:`${e}:`:i?`${i}:`:"",f=o?`${r(n)} because ${r(o)}`:n,d=!!s&&!!l&&/^[a-z]/.test(r(l)),p=[f,a,d?`${r(s)}, or ${r(l)}`:s,d?void 0:l,function(e){if(!e)return"";let r=Array.isArray(e)?e.join(", "):e;return r.trim()?t(`Details: ${r}`):""}(c)].filter(e=>!!e).map(t);u&&p.push(`Learn more: ${u}`);let g=p.join(" ");return h?`${h} ${g}`:g}])},359742,e=>{"use strict";var t=e.i(117317);e.s(["f",()=>t.t])},782441,506043,830642,e=>{"use strict";e.s(["n",0,function(e){return(Array.isArray(e)?e:[e]).flatMap(e=>e?.split(",")??[]).map((e,t)=>{let[r="",...i]=e.split(";").map(e=>e.trim()),n=i.find(e=>e.toLowerCase().startsWith("q="));return{locale:r,quality:Number(n?.slice(2)??1),index:t}}).filter(({locale:e,quality:t})=>""!==e&&"*"!==e&&t>0&&t<=1).sort((e,t)=>t.quality-e.quality||e.index-t.index).map(({locale:e})=>e)},"t",0,function(e,t){let r=`${t}=`,i=e?.split(";").map(e=>e.trim()).find(e=>e.startsWith(r));if(!i)return;let n=i.slice(r.length);try{return decodeURIComponent(n)}catch{return n}}],506043),e.s(["a",0,"generaltranslation.enable-i18n","C",0,"generaltranslation.locale","s",0,"generaltranslation.region","H",0,"generaltranslation.locale-reset"],782441);var t=e.i(811277);e.s(["f",()=>t.w],830642)},494418,e=>{"use strict";var t=e.i(811277);e.i(581865),e.i(506043);var r=e.i(359742),i=e.i(291831),n=e.i(478014),a=e.i(902292);function o(e){let t=e?e.split("."):[];for(let r of t)s(r,e);return t}function s(e,t){if("__proto__"===e||"constructor"===e||"prototype"===e)throw Error(`Dictionary path "${t}" contains an unsafe segment`)}function l(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function c(e){return void 0===e||"string"==typeof e?e:structuredClone(e)}function u(e,t){let r=e;for(let e of o(t)){if(!l(r))return;r=r[e]}return r}function h(e,t,r){let i=o(t);if(l(r)&&function e(t,r=""){for(let[i,n]of Object.entries(t)){let t=r?`${r}.${i}`:i;s(i,t),l(n)&&e(n,t)}}(r,t),0===i.length){l(r)&&function(e,t){for(let t of Object.keys(e))delete e[t];for(let r of Object.keys(t))e[r]=t[r]}(e,r);return}let n=e;for(let e of i.slice(0,-1))l(n[e])||(n[e]={}),n=n[e];n[i[i.length-1]]=r}function f(e){var t,r;if("string"==typeof(t=e)||Array.isArray(t)&&"string"==typeof t[0]&&(1===t.length||2===t.length&&!("object"!=typeof(r=t[1])||null==r||Array.isArray(r))&&(void 0===r.$context||"string"==typeof r.$context)&&(void 0===r.$format||p(r.$format))&&(void 0===r.$maxChars||"number"==typeof r.$maxChars)))return{entry:Array.isArray(e)?e[0]:e,options:Array.isArray(e)?e[1]??{}:{}}}function d(e){let{$format:t,...r}=e;return{...r,$format:p(t)?t:"ICU"}}function p(e){return"ICU"===e||"I18NEXT"===e||"STRING"===e}function g({sourceObject:e,targetObject:t,translate:r}){let i=f(t);if(void 0!==i)return i.entry;if(l(t))return l(e)?m({sourceObject:e,targetObject:t,translate:r}):g({sourceObject:t,targetObject:void 0,translate:r});let n=f(e);if(void 0!==n){let e=d(n.options);return r?.(n,e)??n.entry}if(l(e))return m({sourceObject:e,targetObject:void 0,translate:r});throw Error("Dictionary object cannot be rendered")}function m({sourceObject:e,targetObject:t,translate:r}){if(!l(e))return g({sourceObject:e,targetObject:t,translate:r});let i={};for(let n of Array.from(new Set([...Object.keys(e),...l(t)?Object.keys(t):[]]))){let a=g({sourceObject:e[n],targetObject:l(t)?t[n]:void 0,translate:r});void 0!==a&&(i[n]=a)}return i}async function y(e,r={}){let i=(0,t.l)();await (0,t.f)(function({locale:e,enableI18n:r,options:i}){return r?"string"==typeof i.$locale?i.$locale:e:(0,t.x)().getDefaultLocale()}({locale:i.getLocale(),enableI18n:i.getEnableI18n(),options:r}),e,{$format:"STRING",...r})}function b(e){let r=!1;return async i=>(r||(r=!0,t.T.warn("I18nCache: "+e)),{})}async function v(e,t,r){let i=e.get(t);i||(i=r(),e.set(t,i));try{return await i}finally{e.delete(t)}}var x=class{constructor({load:e,ttl:t}){this.cache=new Map,this.pendingLoads=new Map,this.loadResource=e,this.ttl=null===t?-1:t??6e4}get(e){let t=this.cache.get(e);if(!(!t||this.isExpired(t)))return t.value}set(e,t,{expiresAt:r=this.getExpiresAt()}={}){this.cache.set(e,{expiresAt:r,value:t})}async getOrLoad(e){return this.get(e)??await this.load(e)}load(e){return v(this.pendingLoads,e,()=>this.loadResource(e).then(t=>(this.set(e,t),t)))}getExpiresAt(){return this.ttl<=0?this.ttl:Date.now()+this.ttl}isExpired(e){return 0===e.expiresAt||e.expiresAt>0&&e.expiresAt0?i:t}var w=class{constructor({init:e,translateMany:t,onMiss:r,batchConfig:i}){this.pendingTranslations=new Map,this.queue=[],this.batchTimer=null,this.activeRequests=0,this.cache=structuredClone(e),this.translateMany=t,this.batchConfig={maxConcurrentRequests:C(i?.maxConcurrentRequests,100,!0),maxBatchSize:C(i?.maxBatchSize,25,!0),batchInterval:C(i?.batchInterval,50)},this.onMiss=r}get(e){let t=this.getCacheKey(e);return this.cache[t]}async miss(e){let t=this.getCacheKey(e),r=await v(this.pendingTranslations,t,()=>this.translate(e));return null!=r&&this.onMiss?.(t,r),r}getInternalCache(){return structuredClone(this.cache)}getCacheKey(e){return(0,t.n)(e.message,e.options)}translate(e){let t=this.enqueueTranslation(e);return this.queue.length>=this.batchConfig.maxBatchSize?this.flushNow():this.scheduleBatch(),t}update(e){this.cache={...this.cache,...e}}flushNow(){this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.drainQueue()}scheduleBatch(){this.batchTimer||(this.batchTimer=setTimeout(()=>{this.batchTimer=null,this.drainQueue()},this.batchConfig.batchInterval))}drainQueue(){for(;this.queue.length>0&&this.activeRequests0&&this.scheduleBatch()}enqueueTranslation(e){let t=this.getCacheKey(e),r=e.options;return new Promise((i,n)=>{this.queue.push({key:t,source:e.message,metadata:{hash:t,...r.$context&&{context:r.$context},...r.$id&&{id:r.$id},...null!=r.$maxChars&&{maxChars:Math.abs(r.$maxChars)},...!0===r.$requiresReview&&{requiresReview:!0},dataFormat:r.$format},resolve:e=>i(e),reject:n})})}async sendBatchRequest(e){this.activeRequests++;let t=e.reduce((e,t)=>(e[t.key]={source:t.source,metadata:t.metadata},e),{}),r=await this.sendBatchRequestWithErrorHandling(e,t);r&&this.handleTranslationResponse(e,r),this.activeRequests--}async sendBatchRequestWithErrorHandling(e,t){try{return await this.translateMany(t)}catch(t){for(let r of e)r.reject(t);return}}handleTranslationResponse(e,t){for(let r of e){let{key:e}=r,i=t[e];if(i&&i.success){let t=i.translation;this.cache[e]=t,r.resolve(t)}else r.reject(i?.error)}}},T=class extends Error{constructor(e){super(`I18nCache: source dictionary entry ${e} is not defined`),this.name="DictionarySourceNotFoundError"}};async function L({key:e,sourceValue:t,targetValue:r,translateEntry:i}){if(void 0!==f(r)||l(r)&&!l(t))return c(r);let n=f(t);if(void 0!==n)return await i(e,n);if(!l(t))throw new T(e);let a=l(r)?r:{},o=new Set([...Object.keys(t),...Object.keys(a)]);return Object.fromEntries(await Promise.all(Array.from(o).map(async r=>{let n=e?`${e}.${r}`:r;s(r,n);let o=t[r];return void 0===o?[r,c(a[r])]:[r,await L({key:n,sourceValue:o,targetValue:a[r],translateEntry:i})]})))}function E(e){return{entry:e.entry,options:structuredClone(e.options)}}var S=class{constructor({init:e,runtimeTranslate:t}){this.pendingTranslations=new Map,this.pendingMaterializations=new Map,this.cache=structuredClone(e),this.runtimeTranslate=t}getEntry(e){let t=f(u(this.cache,e));if(void 0!==t)return E(t)}getValue(e){let t=u(this.cache,e);if(void 0!==t)return c(t)}setValue(e,t){h(this.cache,e,c(t))}getInternalCache(){return c(this.cache)}update(e){!function e(t,r){for(let[i,n]of Object.entries(r)){let r=t[i];l(r)&&l(n)?e(r,n):t[i]=c(n)}}(this.cache,e)}async materializeValue(e,t,r=u(this.cache,e)){return v(this.pendingMaterializations,e,()=>L({key:e,sourceValue:t,targetValue:r,translateEntry:async(e,t)=>{var r;return 0===Object.keys((r=await this.materializeEntry(e,t)).options).length?r.entry:[r.entry,r.options]}}).then(t=>(this.setValue(e,t),t)))}async materializeEntry(e,t){return E(await v(this.pendingTranslations,e,()=>this.runtimeTranslate(e,t).then(t=>{h(this.cache,e,t);let r=f(t);if(void 0===r)throw Error("DictionaryCache materializeEntry did not return a DictionaryEntry");return E(r)})))}},I=class{constructor(e){(function(e){if(e.runtimeUrl&&e.runtimeUrl!==n.f&&(e.projectId||t.T.warn("I18nCache: "+(0,r.f)({whatHappened:"Runtime translation needs a projectId",fix:"Add projectId to the I18nCache config or disable runtime translation"})),e.devApiKey||e.apiKey||t.T.warn("I18nCache: "+(0,r.f)({whatHappened:"Runtime translation needs devApiKey or apiKey",fix:"Add credentials to the I18nCache config or disable runtime translation"}))),e.loadDictionary&&!e.dictionary)throw t.T.error("I18nCache: "+(0,r.f)({whatHappened:"loadDictionary needs a source dictionary",fix:"Provide dictionary so the default locale has source content"})),Error("Validation errors occurred")})(e),this.config={projectId:e.projectId,devApiKey:e.devApiKey,apiKey:e.apiKey,runtimeUrl:e.runtimeUrl,modelProvider:e.modelProvider,cacheExpiryTime:e.cacheExpiryTime,batchConfig:e.batchConfig,runtimeTranslation:e.runtimeTranslation,_versionId:e._versionId};let o=function({type:e,remoteTranslationLoaderParams:n,loadTranslations:o}){let{cacheUrl:s,projectId:l,_versionId:c,_branchId:u}=n;switch(e){case"remote":case"gt-remote":var h;let f;if(!l)return b((0,r.f)({whatHappened:"Loading translations from a remote store needs a projectId. No translations will be loaded.",fix:"Add projectId to the I18nCache config, or set cacheUrl to null to disable translation loading"}));return f=function(e){let{cacheUrl:t=i.f,projectId:r,_versionId:n,_branchId:a}=e;return`${t}/${r}/[locale]`+(n?`/${n}`:"")+(a?`?branchId=${a}`:"")}(h={cacheUrl:s,projectId:l,_versionId:c,_branchId:u,customMapping:(0,t.x)().getCustomMapping()}),async e=>{e=(0,a.$)((0,a.P)(e,h.customMapping));let t=f.replace("[locale]",e),r=await fetch(t);if(!r.ok)throw Error(`Failed to load translations from ${t}`);return await r.json()};case"custom":return o;case"disabled":if(null===s)return async()=>({});return b((0,r.f)({whatHappened:"No translation loader found. No translations will be loaded.",fix:"Add projectId to the I18nCache config (to load from the GT remote store), provide a loadTranslations function, or set cacheUrl to null to disable translation loading"}))}}({loadTranslations:e.loadTranslations,type:(0,t.D)(e),remoteTranslationLoaderParams:{cacheUrl:e.cacheUrl,projectId:e.projectId,_versionId:e._versionId,_branchId:e._branchId}}),s=e.loadDictionary??(()=>Promise.resolve({}));this.createTranslateMany=function(e,t,r={}){return i=>n=>e.translateMany(n,{...r,targetLocale:i},t)}((0,t.x)().getGTClass(),this.config.runtimeTranslation?.timeout??12e3,{...this.config.modelProvider&&{modelProvider:this.config.modelProvider},...this.config.runtimeTranslation?.metadata});let l=this.config.cacheExpiryTime;this.translations=new x({ttl:l,load:async e=>this.createTranslationsCache(e,await o(e))}),this.dictionaries=new x({ttl:l,load:async e=>this.createDictionaryCache(e,await s(e))});let c=(0,t.x)().getDefaultLocale();this.dictionaries.set(c,this.createDictionaryCache(c,e.dictionary??{}),{expiresAt:-1})}createTranslationsCache(e,t){return new w({init:t,translateMany:this.createTranslateMany(e),batchConfig:this.config.batchConfig,onMiss:(t,r)=>this.onTranslationsCacheMiss?.({locale:e,hash:t,translation:r})})}createDictionaryCache(e,t){return new S({init:t,runtimeTranslate:(t,r)=>this.translateDictionaryEntry(e,t,r)})}getVersionId(){return this.config._versionId}updateTranslations(e){for(let t in e){let r=this.translations.get(t);r?r.update(e[t]):this.translations.set(t,this.createTranslationsCache(t,e[t]))}}updateDictionaries(e){for(let t in e){let r=this.dictionaries.get(t);r?r.update(e[t]):this.dictionaries.set(t,this.createDictionaryCache(t,e[t]))}}async loadTranslations(e){return this.guardAsync({},async()=>{let t=this._resolveCacheLocale(e);return t?(await this.translations.getOrLoad(t)).getInternalCache():{}})}async loadDictionary(e){return this.guardAsync({},async()=>{let t=this._resolveCacheLocale(e);return t?(await this.dictionaries.getOrLoad(t)).getInternalCache():this.getDefaultDictionaryCache()?.getInternalCache()??{}})}lookupDictionary(e,t){return this.guard(void 0,()=>this.dictionaries.get(this.resolveDictionaryCacheLocale(e))?.getEntry(t))}lookupDictionaryObj(e,t){return this.guard(void 0,()=>this.dictionaries.get(this.resolveDictionaryCacheLocale(e))?.getValue(t))}async getLookupDictionary(e){return this.guardAsync({lookupDictionary:()=>void 0,lookupDictionaryObj:()=>void 0},async()=>{let t=this._resolveCacheLocale(e),r=t?await this.dictionaries.getOrLoad(t):this.getDefaultDictionaryCache();return{lookupDictionary:e=>r?.getEntry(e),lookupDictionaryObj:e=>r?.getValue(e)}})}async lookupDictionaryWithFallback(e,t){return this.guardAsync(void 0,async()=>{let r=this._resolveCacheLocale(e);if(!r)return this.getSourceDictionaryEntry(t);let i=await this.dictionaries.getOrLoad(r);return i.getEntry(t)??await i.materializeEntry(t,this.getSourceDictionaryEntry(t))})}async lookupDictionaryObjWithFallback(e,t){return this.guardAsync(void 0,async()=>{let r=this._resolveCacheLocale(e);if(!r)return this.getSourceDictionaryObject(t);let i=await this.dictionaries.getOrLoad(r),n=i.getValue(t),a=this.getSourceDictionaryObject(t,{throwOnMissing:!1});if(void 0===a){if(void 0!==n)return n;throw new T(t)}return await i.materializeValue(t,a,n)})}async translateDictionaryEntry(e,t,r){let i=await this.lookupTranslationWithFallbackResolved(e,r.entry,d(r.options));if("string"!=typeof i)throw Error(`Dictionary entry "${t}" could not be translated into a string. Check the source entry and translation loader output.`);return i}getSourceDictionaryEntry(e){let t=this.getDefaultDictionaryCache()?.getEntry(e);if(void 0===t)throw new T(e);return t}getSourceDictionaryObject(e,{throwOnMissing:t=!0}={}){let r=this.getDefaultDictionaryCache()?.getValue(e);if(void 0===r&&t)throw new T(e);return r}getDefaultDictionaryCache(){return this.dictionaries.get((0,t.x)().getDefaultLocale())}resolveDictionaryCacheLocale(e){return this._resolveCacheLocale(e)??(0,t.x)().getDefaultLocale()}lookupTranslation(e,t,r){return this.guard(void 0,()=>{let{translationLocale:i,options:n}=this.resolveLookupParams(e,r);return i?this.translations.get(i)?.get({message:t,options:n}):t})}async lookupTranslationWithFallback(e,t,r){return this.guardAsync(void 0,()=>this.lookupTranslationWithFallbackResolved(e,t,r))}async getLookupTranslation(e){return this.guardAsync(e=>e,async()=>{let t=this._resolveCacheLocale(e);if(!t)return e=>e;let r=await this.translations.getOrLoad(t),i=(e,i={})=>this.guard(void 0,()=>{let{translationLocale:n,options:a}=this.resolveLookupParams(i.$locale??t,i);return n?(n===t?r:this.translations.get(n))?.get({message:e,options:a}):e});return Object.assign(i,{prefetchEntries:async(e=[])=>{}}),i})}guard(e,t){try{return t()}catch(t){return this.handleError(t),e}}async guardAsync(e,t){try{return await t()}catch(t){return this.handleError(t),e}}handleError(e){if(e instanceof T||"development"===(0,t.E)())throw e;t.T.error("I18nCache: "+e)}_resolveLocale(e){let r=(0,t.x)(),i=r.determineLocale(e);if(!r.isValidLocale(e)||!i)throw Error(`Locale "${e}" is not valid. Use a valid BCP 47 locale code or add a custom mapping.`);return i}_resolveCacheLocale(e){let r=this._resolveLocale(e),i=(0,t.x)();if(i.requiresTranslation(r))return r;let n=i.resolveAliasLocale(i.standardizeLocale(e));if(i.requiresTranslation(n))return n}resolveLookupParams(e,t){let r=this._resolveCacheLocale(e);return{translationLocale:r,options:r?this.resolveLookupOptions(t,r):t}}resolveLookupOptions(e={},t){return e.$locale?{...e,$locale:t??this._resolveCacheLocale(e.$locale)??this._resolveLocale(e.$locale)}:e}async lookupTranslationWithFallbackResolved(e,t,r){let{translationLocale:i,options:n}=this.resolveLookupParams(e,r);if(!i)return t;let a=await this.translations.getOrLoad(i),o=a.get({message:t,options:n});return null==o&&(o=await a.miss({message:t,options:n})),o}};e.s(["n",0,(e,r={})=>(0,t.p)(r.$locale??(0,t.i)(),e,{$format:"JSX",...r}),"k",0,(e,t={})=>y(e,{$format:"ICU",...t}),"W",0,I,"C",0,f,"a",0,function({locale:e,id:t}){return`${e}:${t}`},"T",0,function(e){let r="hash"in e?e.hash:(0,t.n)(e.message,e.options);return`${e.locale}:${r}`},"V",0,l,"g",0,function({sourceLocale:e,targetLocale:r,sourceEntry:i,target:n,dictionaryOptions:a,options:o={}}){let s=(0,t.d)(r,{...a,...(0,t.b)(o)},a.$format);return(0,t._)({source:i.entry,target:n,options:s,sourceLocale:e})},"s",0,g,"h",0,d])},811277,291831,478014,682936,96247,581865,e=>{"use strict";var t=e.i(169798),r=e.i(821080),i=e.i(449281),n=e.i(359742),a=e.i(300553);e.s(["f",()=>a.m],291831);var a=a,o=a;e.s(["f",()=>o.h],478014);var o=a,s=a;e.s(["f",()=>s.g],682936);var s=a,l=e.i(902292),c=a,u=class{get localeConfig(){return this._localeConfig}constructor(e={}){void 0!==t.default&&(this.apiKey||=t.default.env?.GT_API_KEY,this.devApiKey||=t.default.env?.GT_DEV_API_KEY,this.projectId||=t.default.env?.GT_PROJECT_ID),this.setConfig(e)}setConfig({apiKey:e,devApiKey:t,sourceLocale:r,targetLocale:i,locales:n,projectId:a,customMapping:o,baseUrl:s,userTokenProvider:u}){let h=o??this.customMapping;if(e&&(this.apiKey=e),t&&(this.devApiKey=t),a&&(this.projectId=a),u&&(this.userTokenProvider=u),r&&(this.sourceLocale=r,!(0,l.b)(this.sourceLocale,h)))throw Error((0,c.l)(this.sourceLocale));if(i&&(this.targetLocale=i,!(0,l.b)(this.targetLocale,h)))throw Error((0,c.l)(this.targetLocale));if(n){let e=[],t=[];if(n.forEach(r=>{(0,l.b)(r,h)?e.push(r):t.push(r)}),t.length>0)throw Error((0,c.u)(t));this.locales=e}s&&(this.baseUrl=s),o&&(this.customMapping=o,this.reverseCustomMapping=Object.fromEntries(Object.entries(o).filter(([,e])=>e&&"object"==typeof e&&"code"in e).map(([e,t])=>[t.code,e]))),this._localeConfig=new l.l({defaultLocale:this.sourceLocale,locales:this.locales??[],customMapping:this.customMapping})}resolveServiceLocale(e){return this.standardizeLocale(this.resolveCanonicalLocale(e))}resolveServiceResponseLocale(e){let t=this.standardizeLocale(e);return[...this.locales??[],this.sourceLocale,this.targetLocale,...Object.keys(this.customMapping??{})].find(e=>e&&this.resolveServiceLocale(e)===t)??e}_getTranslationConfig(){return{baseUrl:this.baseUrl,apiKey:this.apiKey||this.devApiKey,projectId:this.projectId||"",userTokenProvider:this.userTokenProvider}}async translate(e,t,r){return(0,c.t)(e,t,{...this._getTranslationConfig(),customMapping:this.customMapping,timeoutMs:r||void 0},this)}async translateMany(e,t,r){return(0,c.n)(e,t,{...this._getTranslationConfig(),customMapping:this.customMapping,timeoutMs:r||void 0},this)}formatCutoff(e,t){return this.localeConfig.formatCutoff(e,this.targetLocale,t)}formatMessage(e,t){return this.localeConfig.formatMessage(e,this.targetLocale,t)}formatNum(e,t){return this.localeConfig.formatNum(e,this.targetLocale,t)}formatDateTime(e,t){return this.localeConfig.formatDateTime(e,this.targetLocale,t)}formatCurrency(e,t,r){return this.localeConfig.formatCurrency(e,t,this.targetLocale,r)}formatList(e,t){return this.localeConfig.formatList(e,this.targetLocale,t)}formatListToParts(e,t){return this.localeConfig.formatListToParts(e,this.targetLocale,t)}formatRelativeTime(e,t,r){return this.localeConfig.formatRelativeTime(e,t,this.targetLocale,r)}formatRelativeTimeFromDate(e,t){return this.localeConfig.formatRelativeTimeFromDate(e,this.targetLocale,t)}getLocaleName(e=this.targetLocale){if(!e)throw Error((0,c.f)("getLocaleName"));return this.localeConfig.getLocaleName(e)}getLocaleEmoji(e=this.targetLocale){if(!e)throw Error((0,c.f)("getLocaleEmoji"));return this.localeConfig.getLocaleEmoji(e)}getLocaleProperties(e=this.targetLocale){if(!e)throw Error((0,c.f)("getLocaleProperties"));return this.localeConfig.getLocaleProperties(e)}getRegionProperties(e=this.getLocaleProperties().regionCode,t){if(!t){if(this.customMapping&&!this.customRegionMapping){let e={};for(let[t,r]of Object.entries(this.customMapping))if(r&&"object"==typeof r&&r.regionCode&&!e[r.regionCode]){let{regionName:i,emoji:n}=r;e[r.regionCode]={locale:t,...i&&{name:i},...n&&{emoji:n}}}this.customRegionMapping=e}t=this.customRegionMapping}return(0,l.W)(e,this.targetLocale,t)}requiresTranslation(e=this.sourceLocale,t=this.targetLocale,r=this.locales,i=this.customMapping){if(!e)throw Error((0,c.d)("requiresTranslation"));if(!t)throw Error((0,c.f)("requiresTranslation"));return i===this.customMapping?this.localeConfig.requiresTranslation(t,e,r):(0,l.Z)(e,t,r,i)}determineLocale(e,t=this.locales||[],r=this.customMapping){return r===this.customMapping?this.localeConfig.determineLocale(e,t??[]):new l.l({customMapping:r}).determineLocale(e,t??[])}getLocaleDirection(e=this.targetLocale){if(!e)throw Error((0,c.f)("getLocaleDirection"));return this.localeConfig.getLocaleDirection(e)}isValidLocale(e=this.targetLocale,t=this.customMapping){if(!e)throw Error((0,c.f)("isValidLocale"));return t===this.customMapping?this.localeConfig.isValidLocale(e):(0,l.b)(e,t)}resolveCanonicalLocale(e=this.targetLocale,t=this.customMapping){if(!e)throw Error((0,c.f)("resolveCanonicalLocale"));return t===this.customMapping?this.localeConfig.resolveCanonicalLocale(e):(0,l.P)(e,t)}resolveAliasLocale(e,t=this.customMapping){if(!e)throw Error((0,c.f)("resolveAliasLocale"));return t===this.customMapping?this.localeConfig.resolveAliasLocale(e):(0,l.n)(e,t)}standardizeLocale(e=this.targetLocale){if(!e)throw Error((0,c.f)("standardizeLocale"));return this.localeConfig.standardizeLocale(e)}isSameDialect(...e){return this.localeConfig.isSameDialect(...e)}isSameLanguage(...e){return this.localeConfig.isSameLanguage(...e)}isSupersetLocale(e,t){return this.localeConfig.isSupersetLocale(e,t)}},h=e.i(75584);e.s(["f",()=>h.t],96247);var h=h,f={get url(){return e.F("node_modules/.bun/gt-i18n@1.0.38/node_modules/gt-i18n/dist/versionId-BDwkPmu8.mjs")},env:{DEV:!1,PROD:!0,MODE:"production",BASE_URL:"/",SSR:!1}};function d(){let e=function(){if("object"==typeof t.default)return t.default.env?._GENERALTRANSLATION_LOG_LEVEL}();return void 0!==e?e:function(e){try{return e()}catch{return}}(()=>f.env?._GENERALTRANSLATION_LOG_LEVEL)}function p(e){return e?.toUpperCase()==="DEBUG"}function g(e){let t=globalThis;return t.__generaltranslation??={},t.__generaltranslation[e]??={},t.__generaltranslation[e]}function m({namespace:e,key:t,source:r,notInitialized:i}){return{get:function(){let r=g(e)[t];if(null==r){let e=i();throw"string"==typeof e?Error(e):e}return r},set:function(i){let a=g(e);if(void 0!==a[t]&&a[t]!==i){var o;let e;("object"==typeof(o=e=globalThis.__generaltranslation?.i18n?.i18nConfig)&&null!==o&&"function"==typeof o.isDebugLoggingEnabled?e.isDebugLoggingEnabled():p(d()))&&console.warn((0,n.f)({source:r,severity:"Warning",whatHappened:`Global ${t} singleton instance was already initialized`}));return}a[t]=i},isInitialized:function(){return null!=g(e)[t]}}}let y=m({namespace:"i18n",key:"i18nCache",source:"gt-i18n",notInitialized:()=>(0,n.f)({source:"gt-i18n",severity:"Error",whatHappened:"Cannot read I18nCache before it has been initialized",why:"the internal I18nCache singleton is unavailable",fix:"Initialize GT before accessing I18nCache (call initializeGT() from your GT framework package)."})});function b(){return y.get()}function v(e){return e.loadTranslations?"custom":(void 0===e.cacheUrl||e.cacheUrl===a.m)&&e.projectId?"gt-remote":e.cacheUrl?"remote":"disabled"}function x(){t.default;let e=C(()=>f.env?.MODE);return e?"development"===e?"development":"production":!0===C(()=>f.env?.DEV)?"development":"production"}function C(e){try{return e()}catch{return}}var w={warn(e){console.warn(e)},error(e){console.error(e)},info(e){console.info(e)},debug(e){console.debug(e)}},T=class extends l.l{constructor(e={}){let t=function(e){let t;return"gt-remote"===v(e)||"gt"==((t=void 0===e.runtimeUrl||e.runtimeUrl===o.h)&&e.projectId&&(e.devApiKey||e.apiKey)?"gt":e.runtimeUrl&&!t?"custom":"disabled")}(e);super(function(e,t){let{defaultLocale:r=s.g,locales:i=[],customMapping:a}=e;return!function(e,t){if(!t)return;let r=[...function({defaultLocale:e,locales:t,customMapping:r}){return Array.from(new Set([...e?[e]:[],...t||[]])).filter(e=>!(0,l.b)(e,r))}(e),...function({customMapping:e}){return Object.values(e||{}).flatMap(e=>{let t="string"==typeof e?e:e.code;return t&&!(0,l.b)(t)?[t]:[]})}(e)];if(r.forEach(e=>{var t;w.error(`I18nConfig: ${(t=e,(0,n.f)({whatHappened:`Locale "${t}" is not valid`,fix:"Use a valid BCP 47 locale code or add a custom mapping"}))}`)}),r.length>0)throw Error((0,n.f)({source:"gt-i18n",severity:"Error",whatHappened:"Invalid I18nConfig locale configuration",details:r.map(e=>`Invalid locale: ${e}`),fix:"Use valid BCP 47 locale codes or add custom mappings."}))}({...e,defaultLocale:r,locales:i,customMapping:a},t),{defaultLocale:r,locales:Array.from(new Set([r,...i])),customMapping:a||{}}}(e,t)),this.runtimeConfig={projectId:e.projectId,devApiKey:e.devApiKey,apiKey:e.apiKey,runtimeUrl:e.runtimeUrl,_disableDevHotReload:e._disableDevHotReload,_tagIds:e._tagIds},this.gtServicesEnabled=t,this.logLevel=d()}getDefaultLocale(){return this.defaultLocale}getLocales(){return this.locales}getCustomMapping(){return this.customMapping||{}}getProjectId(){return this.runtimeConfig.projectId}getGTClass(e){return this.getGTClassClean(e?this.resolveLocale(e):void 0)}determineLocale(e,t=this.locales){if(!(null==e||Array.isArray(e)&&0===e.length))return super.determineLocale(e,t)}determineSupportedLocale(e,t){return this.determineSupportedLocaleWithConfig(e,this.getLocaleConfig(t))}resolveSupportedLocale(e,t){let r=this.getLocaleConfig(t);return this.determineSupportedLocaleWithConfig(e,r)||r.defaultLocale}resolveLocale(e){let t=this.determineSupportedLocale(e);if(!this.isValidLocale(e)||!t)throw Error(`Locale "${e}" is not valid. Use a valid BCP 47 locale code or add a custom mapping.`);return t}isDevHotReloadEnabled(){return!this.runtimeConfig._disableDevHotReload&&!!this.runtimeConfig.devApiKey&&!!this.runtimeConfig.projectId&&null!==this.runtimeConfig.runtimeUrl&&""!==this.runtimeConfig.runtimeUrl&&"development"===x()}isGTServicesEnabled(){return this.gtServicesEnabled}isDebugLoggingEnabled(){return p(this.logLevel)}getGTClassClean(e){return new u({sourceLocale:this.getDefaultLocale(),targetLocale:e,locales:this.getLocales(),customMapping:this.getCustomMapping(),projectId:this.runtimeConfig.projectId,baseUrl:this.runtimeConfig.runtimeUrl||void 0,apiKey:this.runtimeConfig.apiKey,devApiKey:this.runtimeConfig.devApiKey})}getLocaleConfig(e){var t;return e&&(void 0!==(t=e).defaultLocale||void 0!==t.locales||void 0!==t.customMapping)?new l.l(function({defaultLocale:e=s.g,locales:t=[],customMapping:r}={}){return{defaultLocale:e,locales:t?.length?t:[e],customMapping:r||{}}}(e)):this}determineSupportedLocaleWithConfig(e,t){if(!(null==e||Array.isArray(e)&&0===e.length))return t.determineLocale(e)}};let L=m({namespace:"i18n",key:"i18nConfig",source:"gt-i18n",notInitialized:()=>(0,n.f)({source:"gt-i18n",severity:"Error",whatHappened:"Cannot read I18nConfig before it has been initialized",why:"the internal I18nConfig singleton is unavailable",fix:"Initialize GT before reading locale config (call initializeGT() from your GT framework package)."})}),E=L.get,S=L.set,I=L.isInitialized;function A(e){return Object.fromEntries(Object.entries(e).filter(([e])=>"$id"!==e&&"$context"!==e&&"$maxChars"!==e&&"$hash"!==e&&"$_hash"!==e&&"$_source"!==e&&"$_fallback"!==e&&"$format"!==e&&"$locale"!==e&&"$requiresReview"!==e))}let M=e=>`String interpolation failed for message: "${e}".`;function N(e,t){if(!e)return e;let n=t.$_fallback,a=A(t);try{let o=(0,i.f)(n||"");return(0,l.i)(function(e,t,r,i){try{if(!I())return(0,l.x)(e,{variables:t,locales:r,dataFormat:i});return E().formatMessage(e,void 0,{variables:t,locales:r,dataFormat:i})}catch{return w.warn(M(e)),e}}(Object.keys(o).length?(0,i.B)(e):e,{...a,...o,[r.f]:"other"},t.$locale,t.$format),{maxChars:t.$maxChars})}catch{if(w.warn(M(e)),null!=t.$_fallback)return N(t.$_fallback,{...t,$_fallback:void 0});return(0,l.i)(e,{maxChars:t.$maxChars})}}function $({source:e,target:t,options:r,sourceLocale:i}){var n,a;return null!=t?j(t,{$_fallback:e,...r}):j(e,(n=r,(a=i)?{...n,$locale:a}:n))}function j(e,t){switch(t.$format??"STRING"){case"ICU":return N(e,t);case"I18NEXT":case"STRING":return(0,l.i)(e,{locales:t.$locale,maxChars:t.$maxChars});default:return e}}async function R(e,t,r={}){let i=b(),n=_(e,r,"JSX");return await i.lookupTranslationWithFallback(n.$locale,t,n)??t}async function D(e,t,r={}){let i=b(),n=_(e,r,"STRING");return $({source:t,target:await i.lookupTranslationWithFallback(n.$locale,t,n),options:n,sourceLocale:E().getDefaultLocale()})}async function O(e,t,r={}){let i=b(),n=_(e,r,"STRING");await i.lookupTranslationWithFallback(n.$locale,t,n)}function _(e,t,r){return{...t,$format:t.$format??r,$locale:e}}function k(e){let t=m({namespace:"i18n",key:"conditionStore",source:"gt-i18n",notInitialized:()=>e});return{getConditionStore:t.get,setConditionStore:t.set,isConditionStoreInitialized:t.isInitialized}}let{getConditionStore:P,setConditionStore:F}=k((0,n.f)({source:"gt-i18n",severity:"Error",whatHappened:"Cannot read the locale before GT has been initialized",why:"the internal ConditionStore singleton is unavailable",fix:"Initialize GT before calling translation functions (e.g. call initializeGT() from your GT framework package)."}));function G(){return P().getLocale()}e.s(["A",0,m,"C",0,S,"D",0,v,"E",0,x,"O",0,b,"S",0,function(e={}){let t=new T(e);return S(t),t},"T",0,w,"_",0,$,"a",0,function(e=G()){return E().getLocaleProperties(e)},"b",0,A,"c",0,function(e){return E().resolveCanonicalLocale(e)},"d",0,_,"f",0,O,"g",0,D,"h",0,function(e,t,r={}){let i=b(),n=_(e,r,"STRING");return $({source:t,target:i.lookupTranslation(n.$locale,t,n),options:n,sourceLocale:E().getDefaultLocale()})},"i",0,G,"k",0,function(e){y.set(e)},"l",0,P,"m",0,function(e,t,r={}){let i=b(),n=_(e,r,"STRING"),a=i.lookupTranslation(n.$locale,t,n);if(null!=a)return $({source:t,target:a,options:n,sourceLocale:E().getDefaultLocale()})},"n",0,function(e,t){return null!=t.$_hash?t.$_hash:(0,h.t)({source:"ICU"===t.$format?(0,i.p)(e):e,...t.$context&&{context:t.$context},...null!=t.$maxChars&&{maxChars:Math.abs(t.$maxChars)},...!0===t.$requiresReview&&{requiresReview:!0},dataFormat:t.$format})},"o",0,function(){return E().getLocales()},"p",0,R,"r",0,function(){return E().getDefaultLocale()},"s",0,function(){return P().getRegion()},"t",0,function(){return b().getVersionId()},"u",0,k,"v",0,N,"w",0,T,"x",0,E,"y",0,M],811277);var U=e.i(477369),U=U;e.s(["n",0,function(e){if(-1===e.lastIndexOf(":"))return null;let t=e.slice(e.lastIndexOf(":")+1);try{return JSON.parse((0,U.u)(t))}catch{return null}},"t",0,function(e){return"string"==typeof e.$_hash&&"string"==typeof e.$_source}],581865)},887857,e=>{"use strict";var t=e.i(811277);e.s(["f",()=>t.A])},398286,e=>{"use strict";var t=e.i(811277);e.s(["f",()=>t._])},51861,e=>{"use strict";var t=e.i(811277);e.s(["f",()=>t.d])},627553,e=>{"use strict";var t=e.i(811277);e.s(["f",()=>t.x])}]); //# sourceMappingURL=44lgt0r2ckagq.js.map