import{r as E,a as _e}from"./vendor-react-AgJGJ0jt.js";var ie={};const g=r=>typeof r=="string",B=()=>{let r,e;const t=new Promise((s,i)=>{r=s,e=i});return t.resolve=r,t.reject=e,t},ge=r=>r==null?"":""+r,Be=(r,e,t)=>{r.forEach(s=>{e[s]&&(t[s]=e[s])})},Je=/###/g,me=r=>r&&r.indexOf("###")>-1?r.replace(Je,"."):r,ye=r=>!r||g(r),J=(r,e,t)=>{const s=g(e)?e.split("."):e;let i=0;for(;i{const{obj:s,k:i}=J(r,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let n=e[e.length-1],o=e.slice(0,e.length-1),a=J(r,o,Object);for(;a.obj===void 0&&o.length;)n=`${o[o.length-1]}.${n}`,o=o.slice(0,o.length-1),a=J(r,o,Object),a?.obj&&typeof a.obj[`${a.k}.${n}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${n}`]=t},We=(r,e,t,s)=>{const{obj:i,k:n}=J(r,e,Object);i[n]=i[n]||[],i[n].push(t)},X=(r,e)=>{const{obj:t,k:s}=J(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},qe=(r,e,t)=>{const s=X(r,t);return s!==void 0?s:X(e,t)},De=(r,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in r?g(r[s])||r[s]instanceof String||g(e[s])||e[s]instanceof String?t&&(r[s]=e[s]):De(r[s],e[s],t):r[s]=e[s]);return r},U=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ye={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Qe=r=>g(r)?r.replace(/[&<>"'\/]/g,e=>Ye[e]):r;class Ge{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const Ze=[" ",",","?","!",";"],Xe=new Ge(20),et=(r,e,t)=>{e=e||"",t=t||"";const s=Ze.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(s.length===0)return!0;const i=Xe.getRegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let n=!i.test(r);if(!n){const o=r.indexOf(t);o>0&&!i.test(r.substring(0,o))&&(n=!0)}return n},ue=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const s=e.split(t);let i=r;for(let n=0;n-1&&lr?.replace(/_/g,"-"),tt={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){console?.[r]?.apply?.(console,e)}};class ee{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||tt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(g(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ee(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ee(this.logger,e)}}var T=new ee;class se{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(t)||0;this.observers[s].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,n])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(t,1)}getResource(e,t,s,i={}){const n=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],s&&(Array.isArray(s)?a.push(...s):g(s)&&n?a.push(...s.split(n)):a.push(s)));const l=X(this.data,a);return!l&&!t&&!s&&e.indexOf(".")>-1&&(e=a[0],t=a[1],s=a.slice(2).join(".")),l||!o||!g(s)?l:ue(this.data?.[e]?.[t],s,n)}addResource(e,t,s,i,n={silent:!1}){const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),xe(this.data,a,i),n.silent||this.emit("added",e,t,s,i)}addResources(e,t,s,i={silent:!1}){for(const n in s)(g(s[n])||Array.isArray(s[n]))&&this.addResource(e,t,n,s[n],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,n,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),i=s,s=t,t=a[1]),this.addNamespaces(t);let l=X(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?De(l,s,n):l={...l,...s},xe(this.data,a,l),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var Ae={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,s,i){return r.forEach(n=>{e=this.processors[n]?.process(e,t,s,i)??e}),e}};const Ue=Symbol("i18next/PATH_KEY");function st(){const r=[],e=Object.create(null);let t;return e.get=(s,i)=>(t?.revoke?.(),i===Ue?r:(r.push(i),t=Proxy.revocable(s,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function M(r,e){const{[Ue]:t}=r(st()),s=e?.keySeparator??".",i=e?.nsSeparator??":";if(t.length>1&&i){const n=e?.ns,o=Array.isArray(n)?n:null;if(o&&o.length>1&&o.slice(1).includes(t[0]))return`${t[0]}${i}${t.slice(1).join(s)}`}return t.join(s)}const ve={},ne=r=>!g(r)&&typeof r!="boolean"&&typeof r!="number";class te extends se{constructor(e,t={}){super(),Be(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=T.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const i=this.resolve(e,s);if(i?.res===void 0)return!1;const n=ne(i.res);return!(s.returnObjects===!1&&n)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let n=t.ns||this.options.defaultNS||[];const o=s&&e.indexOf(s)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!et(e,s,i);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:g(n)?[n]:n};const u=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(u[0])>-1)&&(n=u.shift()),e=u.join(i)}return{key:e,namespaces:g(n)?[n]:n}}translate(e,t,s){let i=typeof t=="object"?{...t}:t;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=M(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(S=>typeof S=="function"?M(S,{...this.options,...i}):String(S));const n=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let f=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const c=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return h?n?{res:`${u}${f}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${f}${a}`:n?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:a;const p=this.resolve(e,i);let d=p?.res;const x=p?.usedKey||a,b=p?.exactUsedKey||a,P=["[object Number]","[object Function]","[object RegExp]"],w=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,O=i.count!==void 0&&!g(i.count),R=te.hasDefaultValue(i),F=O?this.pluralResolver.getSuffix(c,i.count,i):"",j=i.ordinal&&O?this.pluralResolver.getSuffix(c,i.count,{ordinal:!1}):"",Y=O&&!i.ordinal&&i.count===0,y=Y&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${F}`]||i[`defaultValue${j}`]||i.defaultValue;let m=d;k&&!d&&R&&(m=y);const v=ne(m),L=Object.prototype.toString.apply(m);if(k&&m&&v&&P.indexOf(L)<0&&!(g(w)&&Array.isArray(m))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,m,{...i,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return n?(p.res=S,p.usedParams=this.getUsedParamsDetails(i),p):S}if(o){const S=Array.isArray(m),C=S?[]:{},Q=S?b:x;for(const I in m)if(Object.prototype.hasOwnProperty.call(m,I)){const D=`${Q}${o}${I}`;R&&!d?C[I]=this.translate(D,{...i,defaultValue:ne(y)?y[I]:void 0,joinArrays:!1,ns:l}):C[I]=this.translate(D,{...i,joinArrays:!1,ns:l}),C[I]===D&&(C[I]=m[I])}d=C}}else if(k&&g(w)&&Array.isArray(d))d=d.join(w),d&&(d=this.extendTranslation(d,e,i,s));else{let S=!1,C=!1;!this.isValidLookup(d)&&R&&(S=!0,d=y),this.isValidLookup(d)||(C=!0,d=a);const I=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:d,D=R&&y!==d&&this.options.updateMissing;if(C||S||D){if(this.logger.log(D?"updateKey":"missingKey",c,u,a,D?y:d),o){const $=this.resolve(a,{...i,keySeparator:!1});$&&$.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let $=0;${const pe=R&&_!==d?_:I;this.options.missingKeyHandler?this.options.missingKeyHandler($,u,A,pe,D,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing($,u,A,pe,D,i),this.emit("missingKey",$,u,A,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?z.forEach($=>{const A=this.pluralResolver.getSuffixes($,i);Y&&i[`defaultValue${this.options.pluralSeparator}zero`]&&A.indexOf(`${this.options.pluralSeparator}zero`)<0&&A.push(`${this.options.pluralSeparator}zero`),A.forEach(_=>{de([$],a+_,i[`defaultValue${_}`]||y)})}):de(z,a,y))}d=this.extendTranslation(d,e,i,p,s),C&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${u}${f}${a}`),(C||S)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${f}${a}`:a,S?d:void 0,i))}return n?(p.res=d,p.usedParams=this.getUsedParamsDetails(i),p):d}extendTranslation(e,t,s,i,n){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const l=g(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const c=e.match(this.interpolator.nestingRegexp);u=c&&c.length}let f=s.replace&&!g(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,s.lng||this.language||i.usedLng,s),l){const c=e.match(this.interpolator.nestingRegexp),h=c&&c.length;un?.[0]===c[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`),null):this.translate(...c,t),s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,a=g(o)?[o]:o;return e!=null&&a?.length&&s.applyPostProcessor!==!1&&(e=Ae.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,i,n,o,a;return g(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?M(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),f=u.key;i=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const h=t.count!==void 0&&!g(t.count),p=h&&!t.ordinal&&t.count===0,d=t.context!==void 0&&(g(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(b=>{this.isValidLookup(s)||(a=b,!ve[`${x[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(ve[`${x[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(P=>{if(this.isValidLookup(s))return;o=P;const w=[f];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(w,f,P,b,t);else{let O;h&&(O=this.pluralResolver.getSuffix(P,t.count,t));const R=`${this.options.pluralSeparator}zero`,F=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(t.ordinal&&O.indexOf(F)===0&&w.push(f+O.replace(F,this.options.pluralSeparator)),w.push(f+O),p&&w.push(f+R)),d){const j=`${f}${this.options.contextSeparator||"_"}${t.context}`;w.push(j),h&&(t.ordinal&&O.indexOf(F)===0&&w.push(j+O.replace(F,this.options.pluralSeparator)),w.push(j+O),p&&w.push(j+R))}}let k;for(;k=w.pop();)this.isValidLookup(s)||(n=k,s=this.getResource(P,b,k,t))}))})}),{res:s,usedKey:i,exactUsedKey:n,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!g(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const n of t)delete i[n]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}class be{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=T.create("languageUtils")}getScriptPartFromCode(e){if(e=q(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=q(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(g(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const i=this.getScriptPartFromCode(s);if(this.isSupportedCode(i))return t=i;const n=this.getLanguagePartFromCode(s);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(o=>{if(o===n)return o;if(!(o.indexOf("-")<0&&n.indexOf("-")<0)&&(o.indexOf("-")>0&&n.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===n||o.indexOf(n)===0&&n.length>1))return o})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),g(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),i=[],n=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return g(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&n(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&n(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&n(this.getLanguagePartFromCode(e))):g(e)&&n(this.formatLanguageCode(e)),s.forEach(o=>{i.indexOf(o)<0&&n(this.formatLanguageCode(o))}),i}}const we={zero:0,one:1,two:2,few:3,many:4,other:5},Oe={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class it{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=T.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=q(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:s,type:i});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let o;try{o=new Intl.PluralRules(s,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Oe;if(!e.match(/-|_/))return Oe;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,t)}return this.pluralRulesCache[n]=o,o}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(i=>`${t}${i}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((i,n)=>we[i]-we[n]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,t,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Le=(r,e,t,s=".",i=!0)=>{let n=qe(r,e,t);return!n&&i&&g(t)&&(n=ue(r,t,s),n===void 0&&(n=ue(e,t,s))),n},re=r=>r.replace(/\$/g,"$$$$");class Ce{constructor(e={}){this.logger=T.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:n,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:d,nestingSuffixEscaped:x,nestingOptionsSeparator:b,maxReplaces:P,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:Qe,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=n?U(n):o||"{{",this.suffix=a?U(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=h?U(h):p||U("$t("),this.nestingSuffix=d?U(d):x||U(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=P||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t?.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let n,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const P=Le(t,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(P,void 0,s,{...i,...t,interpolationkey:p}):P}const d=p.split(this.formatSeparator),x=d.shift().trim(),b=d.join(this.formatSeparator).trim();return this.format(Le(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),b,s,{...i,...t,interpolationkey:x})};this.resetRegExp();const f=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>re(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?re(this.escape(p)):re(p)}].forEach(p=>{for(a=0;n=p.regex.exec(e);){const d=n[1].trim();if(o=u(d),o===void 0)if(typeof f=="function"){const b=f(e,n,i);o=g(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,d))o="";else if(c){o=n[0];continue}else this.logger.warn(`missed to pass in variable ${d} for interpolating ${e}`),o="";else!g(o)&&!this.useRawValueToEscape&&(o=ge(o));const x=p.safeValue(o);if(e=e.replace(n[0],x),c?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=n[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,s={}){let i,n,o;const a=(l,u)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const c=l.split(new RegExp(`${U(f)}[ ]*{`));let h=`{${c[1]}`;l=c[0],h=this.interpolate(h,o);const p=h.match(/'/g),d=h.match(/"/g);((p?.length??0)%2===0&&!d||(d?.length??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,x),`${l}${f}${h}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...s},o=o.replace&&!g(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),n=t(a.call(this,i[1].trim(),o),o),n&&i[0]===e&&!g(n))return n;g(n)||(n=ge(n)),n||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),n=""),l.length&&(n=l.reduce((f,c)=>this.format(f,c,s.lng,{...s,interpolationkey:i[1].trim()}),n.trim())),e=e.replace(i[0],n),this.regexp.lastIndex=0}return e}}const nt=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const s=r.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=a.trim();t[f]||(t[f]=u),u==="false"&&(t[f]=!1),u==="true"&&(t[f]=!0),isNaN(u)||(t[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},ke=r=>{const e={};return(t,s,i)=>{let n=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(n={...n,[i.interpolationkey]:void 0});const o=s+JSON.stringify(n);let a=e[o];return a||(a=r(q(s),i),e[o]=a),a(t)}},rt=r=>(e,t,s)=>r(q(t),s)(e);class ot{constructor(e={}){this.logger=T.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?ke:rt;this.formats={number:s((i,n)=>{const o=new Intl.NumberFormat(i,{...n});return a=>o.format(a)}),currency:s((i,n)=>{const o=new Intl.NumberFormat(i,{...n,style:"currency"});return a=>o.format(a)}),datetime:s((i,n)=>{const o=new Intl.DateTimeFormat(i,{...n});return a=>o.format(a)}),relativetime:s((i,n)=>{const o=new Intl.RelativeTimeFormat(i,{...n});return a=>o.format(a,n.range||"day")}),list:s((i,n)=>{const o=new Intl.ListFormat(i,{...n});return a=>o.format(a)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ke(t)}format(e,t,s,i={}){const n=t.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find(a=>a.indexOf(")")>-1)){const a=n.findIndex(l=>l.indexOf(")")>-1);n[0]=[n[0],...n.splice(1,a)].join(this.formatSeparator)}return n.reduce((a,l)=>{const{formatName:u,formatOptions:f}=nt(l);if(this.formats[u]){let c=a;try{const h=i?.formatParams?.[i.interpolationkey]||{},p=h.locale||h.lng||i.locale||i.lng||s;c=this.formats[u](a,p,{...f,...i,...h})}catch(h){this.logger.warn(h)}return c}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const at=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class lt extends se{constructor(e,t,s,i={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=T.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,i.backend,i)}queueLoad(e,t,s,i){const n={},o={},a={},l={};return e.forEach(u=>{let f=!0;t.forEach(c=>{const h=`${u}|${c}`;!s.reload&&this.store.hasResourceBundle(u,c)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,f=!1,o[h]===void 0&&(o[h]=!0),n[h]===void 0&&(n[h]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(a[u]=!0)}),(Object.keys(n).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(n),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const i=e.split("|"),n=i[0],o=i[1];t&&this.emit("failedLoading",n,o,t),!t&&s&&this.store.addResourceBundle(n,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const a={};this.queue.forEach(l=>{We(l.loaded,[n],o),at(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{a[u][c]===void 0&&(a[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s,i=0,n=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:n,callback:o});return}this.readingCalls++;const a=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&i{this.read.call(this,e,t,s,i+1,n*2,o)},n);return}o(u,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(f=>a(null,f)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,t,a)}prepareLoading(e,t,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();g(e)&&(e=this.languageUtils.toResolveHierarchy(e)),g(t)&&(t=[t]);const n=this.queueLoad(e,t,s,i);if(!n.toLoad.length)return n.pending.length||i(),null;n.toLoad.forEach(o=>{this.loadOne(o)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),i=s[0],n=s[1];this.read(i,n,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`,o),!o&&a&&this.logger.log(`${t}loaded namespace ${n} for language ${i}`,a),this.loaded(e,o,a)})}saveMissing(e,t,s,i,n,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const l={...o,isUpdate:n},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,t,s,i,l):f=u(e,t,s,i),f&&typeof f.then=="function"?f.then(c=>a(null,c)).catch(a):a(null,f)}catch(f){a(f)}else u(e,t,s,i,a,l)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const oe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),g(r[1])&&(e.defaultValue=r[1]),g(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Re=r=>(g(r.ns)&&(r.ns=[r.ns]),g(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),g(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs?.indexOf?.("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r),Z=()=>{},ut=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})},Ke="__i18next_supportNoticeShown",ct=()=>!!(typeof globalThis<"u"&&globalThis[Ke]||typeof process<"u"&&ie&&ie.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&ie),ft=()=>{typeof globalThis<"u"&&(globalThis[Ke]=!0)},ht=r=>!!(r?.modules?.backend?.name?.indexOf("Locize")>0||r?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||r?.options?.backend?.backends&&r.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||r?.options?.backend?.projectId||r?.options?.backend?.backendOptions&&r.options.backend.backendOptions.some(e=>e?.projectId));class W extends se{constructor(e={},t){if(super(),this.options=Re(e),this.services={},this.logger=T,this.modules={external:[]},ut(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(g(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=oe();this.options={...s,...this.options,...Re(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!ht(this)&&!ct()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),ft());const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?T.init(i(this.modules.logger),this.options):T.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ot;const f=new be(this.options);this.store=new Se(this.options.resources,this.options);const c=this.services;c.logger=T,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new it(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(c.formatter=i(u),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Ce(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new lt(i(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.languageDetector&&(c.languageDetector=i(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=i(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new te(this.services,this.options),this.translator.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Z),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...f)=>this.store[u](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...f)=>(this.store[u](...f),this)});const a=B(),l=()=>{const u=(f,c)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(c),t(f,c)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,t=Z){let s=t;const i=g(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const n=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&n.indexOf(u)<0&&n.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload?.forEach?.(a=>o(a)),this.services.backendConnector.load(n,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(a)})}else s(null)}reloadResources(e,t,s){const i=B();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=Z),this.services.backendConnector.reload(e,t,n=>{i.resolve(),s(n)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Ae.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=B();this.emit("languageChanging",e);const i=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},n=(a,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(a,(...u)=>this.t(...u))},o=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);const l=g(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(g(a)?[a]:a);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,f=>{n(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,t,s){const i=(n,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([n,o].concat(a)):l={...o},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||s||i.keyPrefix);const u={...this.options,...l};typeof l.keyPrefix=="function"&&(l.keyPrefix=M(l.keyPrefix,u));const f=this.options.keySeparator||".";let c;return l.keyPrefix&&Array.isArray(n)?c=n.map(h=>(typeof h=="function"&&(h=M(h,u)),`${l.keyPrefix}${f}${h}`)):(typeof n=="function"&&(n=M(n,u)),c=l.keyPrefix?`${l.keyPrefix}${f}${n}`:n),this.t(c,l)};return g(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=s,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,n=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const a=t.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,e)&&(!i||o(n,e)))}loadNamespaces(e,t){const s=B();return this.options.ns?(g(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=B();g(e)&&(e=[e]);const i=this.options.preload||[],n=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return n.length?(this.options.preload=i.concat(n),this.loadResources(o=>{s.resolve(),t&&t(o)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const i=new Intl.Locale(e);if(i&&i.getTextInfo){const n=i.getTextInfo();if(n&&n.direction)return n.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services?.languageUtils||new be(oe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new W(e,t);return s.createInstance=W.createInstance,s}cloneInstance(e={},t=Z){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},n=new W(i);if((e.debug!==void 0||e.prefix!==void 0)&&(n.logger=n.logger.clone(e)),["store","services","language"].forEach(a=>{n[a]=this[a]}),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},s){const a=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((f,c)=>(f[c]={...l[u][c]},f),l[u]),l),{});n.store=new Se(a,i),n.services.resourceStore=n.store}if(e.interpolation){const l={...oe().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};n.services.interpolator=new Ce(u)}return n.translator=new te(n.services,i),n.translator.on("*",(a,...l)=>{n.emit(a,...l)}),n.init(i,t),n.translator.options=i,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const N=W.createInstance();N.createInstance;N.dir;N.init;N.loadResources;N.reloadResources;N.use;N.changeLanguage;N.getFixedT;N.t;N.exists;N.setDefaultNamespace;N.hasLoadedNamespace;N.loadNamespaces;N.loadLanguages;const dt=(r,e,t,s)=>{const i=[t,{code:e,...s||{}}];if(r?.services?.logger?.forward)return r.services.logger.forward(i,"warn","react-i18next::",!0);K(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),r?.services?.logger?.warn?r.services.logger.warn(...i):console?.warn&&console.warn(...i)},Ne={},ce=(r,e,t,s)=>{K(t)&&Ne[t]||(K(t)&&(Ne[t]=new Date),dt(r,e,t,s))},Ve=(r,e)=>()=>{if(r.isInitialized)e();else{const t=()=>{setTimeout(()=>{r.off("initialized",t)},0),e()};r.on("initialized",t)}},fe=(r,e,t)=>{r.loadNamespaces(e,Ve(r,t))},Pe=(r,e,t,s)=>{if(K(t)&&(t=[t]),r.options.preload&&r.options.preload.indexOf(e)>-1)return fe(r,t,s);t.forEach(i=>{r.options.ns.indexOf(i)<0&&r.options.ns.push(i)}),r.loadLanguages(e,Ve(r,s))},pt=(r,e,t={})=>!e.languages||!e.languages.length?(ce(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:t.lng,precheck:(s,i)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!i(s.isLanguageChangingTo,r))return!1}}),K=r=>typeof r=="string",gt=r=>typeof r=="object"&&r!==null,mt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yt={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},xt=r=>yt[r],St=r=>r.replace(mt,xt);let he={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:St,transDefaultProps:void 0};const vt=(r={})=>{he={...he,...r}},bt=()=>he;let He;const wt=r=>{He=r},Ot=()=>He,Yt={type:"3rdParty",init(r){vt(r.options.react),wt(r)}},Lt=E.createContext();class Ct{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ae={exports:{}},le={};var $e;function kt(){if($e)return le;$e=1;var r=_e();function e(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var t=typeof Object.is=="function"?Object.is:e,s=r.useState,i=r.useEffect,n=r.useLayoutEffect,o=r.useDebugValue;function a(c,h){var p=h(),d=s({inst:{value:p,getSnapshot:h}}),x=d[0].inst,b=d[1];return n(function(){x.value=p,x.getSnapshot=h,l(x)&&b({inst:x})},[c,p,h]),i(function(){return l(x)&&b({inst:x}),c(function(){l(x)&&b({inst:x})})},[c]),o(p),p}function l(c){var h=c.getSnapshot;c=c.value;try{var p=h();return!t(c,p)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return le.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:f,le}var Ee;function Rt(){return Ee||(Ee=1,ae.exports=kt()),ae.exports}var Nt=Rt();const Pt=(r,e)=>{if(K(e))return e;if(gt(e)&&K(e.defaultValue))return e.defaultValue;if(typeof r=="function")return"";if(Array.isArray(r)){const t=r[r.length-1];return typeof t=="function"?"":t}return r},$t={t:Pt,ready:!1},Et=()=>()=>{},Qt=(r,e={})=>{const{i18n:t}=e,{i18n:s,defaultNS:i}=E.useContext(Lt)||{},n=t||s||Ot();n&&!n.reportNamespaces&&(n.reportNamespaces=new Ct),n||ce(n,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=E.useMemo(()=>({...bt(),...n?.options?.react,...e}),[n,e]),{useSuspense:a,keyPrefix:l}=o,u=i||n?.options?.defaultNS,f=K(u)?[u]:u||["translation"],c=E.useMemo(()=>f,f);n?.reportNamespaces?.addUsedNamespaces?.(c);const h=E.useRef(0),p=E.useCallback(y=>{if(!n)return Et;const{bindI18n:m,bindI18nStore:v}=o,L=()=>{h.current+=1,y()};return m&&n.on(m,L),v&&n.store.on(v,L),()=>{m&&m.split(" ").forEach(S=>n.off(S,L)),v&&v.split(" ").forEach(S=>n.store.off(S,L))}},[n,o]),d=E.useRef(),x=E.useCallback(()=>{if(!n)return $t;const y=!!(n.isInitialized||n.initializedStoreOnce)&&c.every(Q=>pt(Q,n,o)),m=e.lng||n.language,v=h.current,L=d.current;if(L&&L.ready===y&&L.lng===m&&L.keyPrefix===l&&L.revision===v)return L;const C={t:n.getFixedT(m,o.nsMode==="fallback"?c:c[0],l),ready:y,lng:m,keyPrefix:l,revision:v};return d.current=C,C},[n,c,l,o,e.lng]),[b,P]=E.useState(0),{t:w,ready:k}=Nt.useSyncExternalStore(p,x,x);E.useEffect(()=>{if(n&&!k&&!a){const y=()=>P(m=>m+1);e.lng?Pe(n,e.lng,c,y):fe(n,c,y)}},[n,e.lng,c,k,a,b]);const O=n||{},R=E.useRef(null),F=E.useRef(),j=y=>{const m=Object.getOwnPropertyDescriptors(y);m.__original&&delete m.__original;const v=Object.create(Object.getPrototypeOf(y),m);if(!Object.prototype.hasOwnProperty.call(v,"__original"))try{Object.defineProperty(v,"__original",{value:y,writable:!1,enumerable:!1,configurable:!1})}catch{}return v},Y=E.useMemo(()=>{const y=O,m=y?.language;let v=y;y&&(R.current&&R.current.__original===y?F.current!==m?(v=j(y),R.current=v,F.current=m):v=R.current:(v=j(y),R.current=v,F.current=m));const L=!k&&!a?(...C)=>(ce(n,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(...C)):w,S=[L,v,k];return S.t=L,S.i18n=v,S.ready=k,S},[w,O,k,O.resolvedLanguage,O.language,O.languages]);if(n&&a&&!k)throw new Promise(y=>{const m=()=>y();e.lng?Pe(n,e.lng,c,m):fe(n,c,m)});return Y},{slice:Ft,forEach:It}=[];function Tt(r){return It.call(Ft.call(arguments,1),e=>{if(e)for(const t in e)r[t]===void 0&&(r[t]=e[t])}),r}function jt(r){return typeof r!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(r))}const Fe=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Dt=function(r,e){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let n=`${r}=${i}`;if(s.maxAge>0){const o=s.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");n+=`; Max-Age=${Math.floor(o)}`}if(s.domain){if(!Fe.test(s.domain))throw new TypeError("option domain is invalid");n+=`; Domain=${s.domain}`}if(s.path){if(!Fe.test(s.path))throw new TypeError("option path is invalid");n+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");n+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(n+="; HttpOnly"),s.secure&&(n+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(n+="; Partitioned"),n},Ie={create(r,e,t,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+t*60*1e3)),s&&(i.domain=s),document.cookie=Dt(r,e,i)},read(r){const e=`${r}=`,t=document.cookie.split(";");for(let s=0;s-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const n=s.substring(1).split("&");for(let o=0;o0&&n[o].substring(0,a)===e&&(t=n[o].substring(a+1))}}return t}},Kt={name:"hash",lookup(r){let{lookupHash:e,lookupFromHashIndex:t}=r,s;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const n=i.substring(1);if(e){const o=n.split("&");for(let a=0;a0&&o[a].substring(0,l)===e&&(s=o[a].substring(l+1))}}if(s)return s;if(!s&&t>-1){const o=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return s}};let V=null;const Te=()=>{if(V!==null)return V;try{if(V=typeof window<"u"&&window.localStorage!==null,!V)return!1;const r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{V=!1}return V};var Vt={name:"localStorage",lookup(r){let{lookupLocalStorage:e}=r;if(e&&Te())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(r,e){let{lookupLocalStorage:t}=e;t&&Te()&&window.localStorage.setItem(t,r)}};let H=null;const je=()=>{if(H!==null)return H;try{if(H=typeof window<"u"&&window.sessionStorage!==null,!H)return!1;const r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{H=!1}return H};var Ht={name:"sessionStorage",lookup(r){let{lookupSessionStorage:e}=r;if(e&&je())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(r,e){let{lookupSessionStorage:t}=e;t&&je()&&window.sessionStorage.setItem(t,r)}},Mt={name:"navigator",lookup(r){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:s,language:i}=navigator;if(t)for(let n=0;n0?e:void 0}},zt={name:"htmlTag",lookup(r){let{htmlTag:e}=r,t;const s=e||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(t=s.getAttribute("lang")),t}},_t={name:"path",lookup(r){let{lookupFromPathIndex:e}=r;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof e=="number"?e:0]?.replace("/",""):void 0}},Bt={name:"subdomain",lookup(r){let{lookupFromSubdomainIndex:e}=r;const t=typeof e=="number"?e+1:1,s=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[t]}};let Me=!1;try{document.cookie,Me=!0}catch{}const ze=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Me||ze.splice(1,1);const Jt=()=>({order:ze,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:r=>r});class Wt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Tt(t,this.options||{},Jt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(At),this.addDetector(Ut),this.addDetector(Vt),this.addDetector(Ht),this.addDetector(Mt),this.addDetector(zt),this.addDetector(_t),this.addDetector(Bt),this.addDetector(Kt)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(s=>{if(this.detectors[s]){let i=this.detectors[s].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(t=t.concat(i))}}),t=t.filter(s=>s!=null&&!jt(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(e,this.options)}))}}Wt.type="languageDetector";export{Wt as B,Yt as a,N as i,Rt as r,Nt as s,Qt as u};