vendor: 5,060 bytes, line 1
1const d=o=>typeof o=="string",D=()=>{let o,e;const t=new Promise((s,i)=>{o=s,e=i});return t.resolve=o,t.reject=e,t},se=o=>o==null?"":String(o),Se=(o,e,t)=>{o.forEach(s=>{e[s]&&(t[s]=e[s])})},be=/###/g,ie=o=>o&&o.includes("###")?o.replace(be,"."):o,ne=o=>!o||d(o),H=(o,e,t)=>{const s=d(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(ne(o))return{};const n=ie(s[i]);!o[n]&&t&&(o[n]=new t),Object.prototype.hasOwnProperty.call(o,n)?o=o[n]:o={},++i}return ne(o)?{}:{obj:o,k:ie(s[i])}},re=(o,e,t)=>{const{obj:s,k:i}=H(o,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let n=e[e.length-1],r=e.slice(0,e.length-1),a=H(o,r,Object);for(;a.obj===void 0&&r.length;)n=`${r[r.length-1]}.${n}`,r=r.slice(0,r.length-1),a=H(o,r,Object),a?.obj&&typeof a.obj[`${a.k}.${n}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${n}`]=t},Le=(o,e,t,s)=>{const{obj:i,k:n}=H(o,e,Object);i[n]=i[n]||[],i[n].push(t)},J=(o,e)=>{const{obj:t,k:s}=H(o,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},Oe=(o,e,t)=>{const s=J(o,t);return s!==void 0?s:J(e,t)},pe=(o,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(Object.prototype.hasOwnProperty.call(o,s)?d(o[s])||o[s]instanceof String||d(e[s])||e[s]instanceof String?t&&(o[s]=e[s]):pe(o[s],e[s],t):o[s]=e[s]);return o},N=o=>o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ve={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},we=o=>d(o)?o.replace(/[&<>"'\/]/g,e=>ve[e]):o;class $e{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 Ce=[" ",",","?","!",";"],Re=new $e(20),Pe=(o,e,t)=>{e=e||"",t=t||"";const s=Ce.filter(r=>!e.includes(r)&&!t.includes(r));if(s.length===0)return!0;const i=Re.getRegExp(`(${s.map(r=>r==="?"?"\\?":r).join("|")})`);let n=!i.test(o);if(!n){const r=o.indexOf(t);r>0&&!i.test(o.substring(0,r))&&(n=!0)}return n},Z=(o,e,t=".")=>{if(!o)return;if(o[e])return Object.prototype.hasOwnProperty.call(o,e)?o[e]:void 0;const s=e.split(t);let i=o;for(let n=0;n<s.length;){if(!i||typeof i!="object")return;let r,a="";for(let l=n;l<s.length;++l)if(l!==n&&(a+=t),a+=s[l],r=i[a],r!==void 0){if(["string","number","boolean"].includes(typeof r)&&l<s.length-1)continue;n+=l-n+1;break}i=r}return i},M=o=>o?.replace(/_/g,"-"),Ne={type:"logger",log(o){this.output("log",o)},warn(o){this.output("warn",o)},error(o){this.output("error",o)},output(o,e){console?.[o]?.apply?.(console,e)}};class W{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ne,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:(e=e.map(n=>d(n)?n.replace(/[\r\n\x00-\x1F\x7F]/g," "):n),d(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new W(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new W(this.logger,e)}}var P=new W;class Y{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)}}once(e,t){const s=(...i)=>{t(...i),this.off(e,s)};return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,n])=>{for(let r=0;r<n;r++)i(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,n])=>{for(let r=0;r<n;r++)i(e,...t)})}}class ae extends Y{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,i={}){const n=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,r=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.includes(".")?a=e.split("."):(a=[e,t],s&&(Array.isArray(s)?a.push(...s):d(s)&&n?a.push(...s.split(n)):a.push(s)));const l=J(this.data,a);return!l&&!t&&!s&&e.includes(".")&&(e=a[0],t=a[1],s=a.slice(2).join(".")),l||!r||!d(s)?l:Z(this.data?.[e]?.[t],s,n)}addResource(e,t,s,i,n={silent:!1}){const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(r?s.split(r):s)),e.includes(".")&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),re(this.data,a,i),n.silent||this.emit
1("added",e,t,s,i)}addResources(e,t,s,i={silent:!1}){for(const n in s)(d(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,r={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(a=e.split("."),i=s,s=t,t=a[1]),this.addNamespaces(t);let l=J(this.data,a)||{};r.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?pe(l,s,n):l={...l,...s},re(this.data,a,l),r.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 ge={processors:{},addPostProcessor(o){this.processors[o.name]=o},handle(o,e,t,s,i){return o.forEach(n=>{e=this.processors[n]?.process(e,t,s,i)??e}),e}};const me=Symbol("i18next/PATH_KEY");function Fe(){const o=[],e=Object.create(null);let t;return e.get=(s,i)=>(t?.revoke?.(),i===me?o:(o.push(i),t=Proxy.revocable(s,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function I(o,e){const{[me]:t}=o(Fe()),s=e?.keySeparator??".",i=e?.nsSeparator??":",n=e?.enableSelector==="strict";if(t.length>1&&i){const r=e?.ns,a=n?Array.isArray(r)?r:r?[r]:null:Array.isArray(r)?r:null;if(a&&(n?a:a.length>1?a.slice(1):[]).includes(t[0]))return`${t[0]}${i}${t.slice(1).join(s)}`}return t.join(s)}const Q=o=>!d(o)&&typeof o!="boolean"&&typeof o!="number";class _ extends Y{constructor(e,t={}){super(),Se(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
1i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P.create("translator"),this.checkedLoadedFor={}}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=Q(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 r=s&&e.includes(s),a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Pe(e,s,i);if(r&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:d(n)?[n]:n};const u=e.split(s);(s!==i||s===i&&this.options.ns.includes(u[0]))&&(n=u.shift()),e=u.join(i)}return{key:e,namespaces:d(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=I(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(S=>typeof S=="function"?I(S,{...this.options,...i}):String(S));const n=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=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 c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return f?n?{res:`${u}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${a}`:n?{res:a,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:a;const g=this.resolve(e,i);let p=g?.res;const m=g?.usedKey||a,x=g?.exactUsedKey||a,v=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,L=i.count!==void 0&&!d(i.count),F=_.hasDefaultValue(i),T=L?this.pluralResolver.getSuffix(h,i.count,i):"",V=i.ordinal&&L?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",X=L&&!i.ordinal&&i.count===0,k=X&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${T}`]||i[`defaultValue${V}`]||i.defaultValue;let $=p;j&&!p&&F&&($=k);const ye=Q($),xe=Object.prototype.toString.apply($);if(j&&$&&ye&&!v.includes(xe)&&!(d(y)&&Array.isArray($))){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(m,$,{...i,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return n?(g.res=S,g.usedParams=this.getUsedParamsDetails(i),g):S}if(r){const S=Array.isArray($),w=S?[]:{},q=S?x:m;for(const C in $)if(Object.prototype.hasOwnProperty.call($,C)){const R=`${q}${r}${C}`;F&&!p?w[C]=this.translate(R,{...i,defaultValue:Q(k)?k[C]:void 0,joinArrays:!1,ns:l}):w[C]=this.translate(R,{...i,joinArrays:!1,ns:l}),w[C]===R&&(w[C]=$[C])}p=w}}else if(j&&d(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,e,i,s));else{let S=!1,w=!1;!this.isValidLookup(p)&&F&&(S=!0,p=k),this.isValidLookup(p)||(w=!0,p=a);const C=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:p,R=F&&k!==p&&this.options.updateMissing;if(w||S||R){if(this.logger.log(R?"updateKey":"missingKey",h,u,L&&!R?`${a}${this.pluralResolver.getSuffix(h,i.count,i)}`:a,R?k:p),r){const O=this.resolve(a,{...i,keySeparator:!1});O&&O.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 K=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let O=0;O<B.length;O++)K.push(B[O]);else this.options.saveMissingTo==="all"?K=this.languageUtils.toResolveHierarchy(i.lng||this.language):K.push(i.lng||this.language);const ee=(O,E,A)=>{const te=F&&A!==p?A:C;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,E,te,R,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(O,u,E,te,R,i),this.emit
1("missingKey",O,u,E,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&L?K.forEach(O=>{const E=this.pluralResolver.getSuffixes(O,i);X&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!E.includes(`${this.options.pluralSeparator}zero`)&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(A=>{ee([O],a+A,i[`defaultValue${A}`]||k)})}):ee(K,a,k))}p=this.extendTranslation(p,e,i,g,s),w&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${u}${c}${a}`),(w||S)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${a}`:a,S?p:void 0,i))}return n?(g.res=p,g.usedParams=this.getUsedParamsDetails(i),g):p}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=d(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const h=e.match(this.interpolator.nestingRegexp);u=h&&h.length}let c=s.replace&&!d(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,s.lng||this.language||i.usedLng,s),l){const h=e.match(this.interpolator.nestingRegexp),f=h&&h.length;u<f&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>n?.[0]===h[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${t[0]}`),null):this.translate(...h,t),s)),s.interpolation&&this.interpolator.reset()}const r=s.postProcess||this.options.postProcess,a=d(r)?[r]:r;return e!=null&&a?.length&&s.applyPostProcessor!==!1&&(e=ge.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,r,a;return d(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?I(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),c=u.key;i=c;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=t.count!==void 0&&!d(t.count),g=f&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(d(t.context)||typeof t.context=="number")&&t.context!=="",m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(x=>{this.isValidLookup(s)||(a=x,!this.checkedLoadedFor[`${m[0]}-${x}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(this.checkedLoadedFor[`${m[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${m.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!!!")),m.forEach(v=>{if(this.isValidLookup(s))return;r=v;const y=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,v,x,t);else{let L;f&&(L=this.pluralResolver.getSuffix(v,t.count,t));const F=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(t.ordinal&&L.startsWith(T)&&y.push(c+L.replace(T,this.options.pluralSeparator)),y.push(c+L),g&&y.push(c+F)),p){const V=`${c}${this.options.contextSeparator||"_"}${t.context}`;y.push(V),f&&(t.ordinal&&L.startsWith(T)&&y.push(V+L.replace(T,this.options.pluralSeparator)),y.push(V+L),g&&y.push(V+F))}}let j;for(;j=y.pop();)this.isValidLookup(s)||(n=j,s=this.getResource(v,x,j,t))}))})}),{res:s,usedKey:i,exactUsedKey:n,usedLng:r,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)}
1getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!d(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i={...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)&&s.startsWith(t)&&e[s]!==void 0)return!0;return!1}}class oe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=M(e),!e||!e.includes("-"))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=M(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(d(e)&&e.includes("-")){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.includes(e)}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(r=>r===n?!0:!r.includes("-")&&!n.includes("-")?!1:!!(r.includes("-")&&!n.includes("-")&&r.slice(0,r.indexOf("-"))===n||r.startsWith(n)&&n.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),d(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.options.fallbackLng,i=Array.isArray(s)?s.join("|"):s;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const n=t===void 0||t===!1||d(t),r=t===void 0&&typeof this.options.fallbackLng=="function",a=d(e)&&n&&!r;let l=null;if(a){let f;t===void 0?f="undefined":t===!1?f="boolean:false":f=`string:${t}`,l=`${e.length}:${e}|${f}`}if(l!==null){const f=this.resolveHierarchyCache[l];if(f!==void 0)return f.slice()}const u=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),c=[],h=f=>{f&&(this.isSupportedCode(f)?c.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return d(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(e))):d(e)&&h(this.formatLanguageCode(e)),u.forEach(f=>{c.includes(f)||h(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=c,c.slice()):c}}const le={zero:0,one:1,two:2,few:3,many:4,other:5},ue={select:o=>o===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ke{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=M(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 r;try{r=new Intl.PluralRules(s,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl pol
1yfill!"),ue;if(!e.match(/-|_/))return ue;const l=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(l,t)}return this.pluralRulesCache[n]=r,r}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)=>le[i]-le[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 ce=(o,e,t,s=".",i=!0)=>{let n=Oe(o,e,t);return!n&&i&&d(t)&&(n=Z(o,t,s),n===void 0&&(n=Z(e,t,s))),n},je=o=>o.replace(/\$/g,"$$$$");class he{constructor(e={}){this.logger=P.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:r,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:g,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:v,alwaysFormat:y}=e.interpolation;this.escape=t!==void 0?t:we,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=n?N(n):r||"{{",this.suffix=a?N(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":h?N(h):"-",this.unescapeSuffix=this.unescapePrefix?"":c?N(c):"",this.nestingPrefix=f?N(f):g||N("$t("),this.nestingSuffix=p?N(p):m||N(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=v||1e3,this.alwaysFormat=y!==void 0?y:!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,r,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const v=ce(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,s,{...i,...t,interpolationkey:g}):v}const p=g.split(this.formatSeparator),m=p.shift().trim(),x=p.join(this.formatSeparator).trim();return this.format(ce(t,l,m,this.options.keySeparator,this.options.ignoreJSONStructure),x,s,{...i,...t,interpolationkey:m})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false â if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(a=0;n=g.regex.exec(e);){const p=n[1].trim();if(r=u(p),r===void 0)if(typeof c=="function"){const x=c(e,n,i);r=d(x)?x:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))r="";else if(h){r=n[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),r="";else!d(r)&&!this.useRawValueToEscape&&(r=se(r));const m=g.safeValue(r);if(e=e.replace(n[0],je(m)),h?(g.regex.lastIndex+=m.length,g.regex.lastIndex-=n[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,s={}){let i,n,r;const a=(l,u)=>{const c=this.nestingOptionsSeparator;if(!l.includes(c))return l;const h=l.split(new RegExp(`${N(c)}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,r);const g=f.match(/'/g),p=f.match(/"/g);((g?.length??0)%2===0&&!p||(p?.length??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{r=JSON.parse(f),u&&(r={...u,...r})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${c}${f}`}return r.defaultValue&&r.defaultValue.includes(this.prefix)&&delete r.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];r={...s},r=r.replace&&!d(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(c=>
vendor: 14,692 bytes, line 1
1c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),n=t(a.call(this,i[1].trim(),r),r),n&&i[0]===e&&!d(n))return n;d(n)||(n=se(n)),n||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),n=""),l.length&&(n=l.reduce((c,h)=>this.format(c,h,s.lng,{...s,interpolationkey:i[1].trim()}),n.trim())),e=e.replace(i[0],n),this.regexp.lastIndex=0}return e}}const Ee=o=>{let e=o.toLowerCase().trim();const t={};if(o.includes("(")){const s=o.split("(");e=s[0].toLowerCase().trim();const i=s[1].slice(0,-1);e==="currency"&&!i.includes(":")?t.currency||(t.currency=i.trim()):e==="relativetime"&&!i.includes(":")?t.range||(t.range=i.trim()):i.split(";").forEach(r=>{if(r){const[a,...l]=r.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();t[c]||(t[c]=u),u==="false"&&(t[c]=!1),u==="true"&&(t[c]=!0),isNaN(u)||(t[c]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},fe=o=>{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 r=s+JSON.stringify(n);let a=e[r];return a||(a=o(M(s),i),e[r]=a),a(t)}},Te=o=>(e,t,s)=>o(M(t),s)(e);class Ve{constructor(e={}){this.logger=P.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?fe:Te;this.formats={number:s((i,n)=>{const r=new Intl.NumberFormat(i,{...n});return a=>r.format(a)}),currency:s((i,n)=>{const r=new Intl.NumberFormat(i,{...n,style:"currency"});return a=>r.format(a)}),datetime:s((i,n)=>{const r=new Intl.DateTimeFormat(i,{...n});return a=>r.format(a)}),relativetime:s((i,n)=>{const r=new Intl.RelativeTimeFormat(i,{...n});return a=>r.format(a,n.range||"day")}),list:s((i,n)=>{const r=new Intl.ListFormat(i,{...n});return a=>r.format(a)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=fe(t)}format(e,t,s,i={}){if(!t||e==null)return e;const n=t.split(this.formatSeparator),r=[];for(let l=0;l<n.length;l++){let u=n[l];for(;u.indexOf("(")>-1&&!u.includes(")")&&l+1<n.length;)u=`${u}${this.formatSeparator}${n[++l]}`;r.push(u)}return r.reduce((l,u)=>{const{formatName:c,formatOptions:h}=Ee(u);if(this.formats[c]){let f=l;try{const g=i?.formatParams?.[i.interpolationkey]||{},p=g.locale||g.lng||i.locale||i.lng||s;f=this.formats[c](l,p,{...h,...i,...g})}catch(g){this.logger.warn(g)}return f}else this.logger.warn(`there was no format function for ${c}`);return l},e)}}const Ie=(o,e)=>{o.pending[e]!==void 0&&(delete o.pending[e],o.pendingCount--)};class Ke extends Y{constructor(e,t,s,i={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=P.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={},r={},a={},l={};return e.forEach(u=>{let c=!0;t.forEach(h=>{const f=`${u}|${h}`;!s.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?r[f]===void 0&&(r[f]=!0):(this.state[f]=1,c=!1,r[f]===void 0&&(r[f]=!0),n[f]===void 0&&(n[f]=!0),l[h]===void 0&&(l[h]=!0)))}),c||(a[u]=!0)}),(Object.keys(n).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(n),pending:Object.keys(r),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const i=e.split("|"),n=i[0],r=i[1];t&&this.emit("failedLoading",n,r,t),!t&&s&&this.store.addResourceBundle(n,r,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=>{Le(l.loaded,[n],r),Ie(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const c=l.loaded[u];c.length&&c.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!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,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:n,callback:r});return}this.readingCalls++;const a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read(e,t,s,i+1,n*2,r)},n);return}r(u,c)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(c=>a(null,c)).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();d(e)&&(e=this.languageUtils.toResolveHierarchy(e)),d(t)&&(t=[t]);const n=this.queueLoad(e,t,s,i);if(!n.toLoad.length)return n.pending.length||i(),null;n.toLoad.forEach(r=>{this.loadOne(r)})}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,(r,a)=>{r&&this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`,r),!r&&a&&this.logger.log(`${t}loaded namespace ${n} for language ${i}`,a),this.loaded(e,r,a)})}saveMissing(e,t,s,i,n,r={},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={...r,isUpdate:n},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,t,s,i,l):c=u(e,t,s,i),c&&typeof c.then=="function"?c.then(h=>a(null,h)).catch(a):a(null,c)}catch(c){a(c)}else u(e,t,s,i,a,l)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const G=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:o=>{let e={};if(typeof o[1]=="object"&&(e=o[1]),d(o[1])&&(e.defaultValue=o[1]),d(o[2])&&(e.tDescription=o[2]),typeof o[2]=="object"||typeof o[3]=="object"){const t=o[3]||o[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),de=o=>(d(o.ns)&&(o.ns=[o.ns]),d(o.fallbackLng)&&(o.fallbackLng=[o.fallbackLng]),d(o.fallbackNS)&&(o.fallbackNS=[o.fallbackNS]),o.supportedLngs&&!o.supportedLngs.includes("cimode")&&(o.supportedLngs=o.supportedLngs.concat(["cimode"])),o),z=()=>{},Ae=o=>{Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(t=>{typeof o[t]=="function"&&(o[t]=o[t].bind(o))})};class U extends Y{constructor(e={},t){if(super(),this.options=de(e),this.services={},this.logger=P,this.modules={external:[]},Ae(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&&(d(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const s=G();this.options={...s,...this.options,...de(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);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?P.init(i(this.modules.logger),this.options):P.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Ve;const c=new oe(this.options);this.store=new ae(this.options.resources,this.options);const h=this.services;h.logger=P,h.resourceStore=this.store,h.languageUtils=c,h.pluralResolver=new ke(c,{prepend:this.options.pluralSeparator}),u&&(h.formatter=i(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new he(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Ke(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(f,...g)=>{this.emit(f,...g)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new _(this.services,this.options),this.translator.on("*",(f,...g)=>{this.emit(f,...g)}),this.modules.external.forEach(f=>{f.init&&f.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]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const a=D(),l=()=>{const u=(c,h)=>{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(h),t(c,h)};if((this.languages||this.isLanguageChangingTo)&&!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=d(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=[],r=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&(n.includes(u)||n.push(u))})};i?r(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>r(l)),this.options.preload?.forEach?.(a=>r(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=D();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"&&ge.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"].includes(e)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=D();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))},r=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);const l=d(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(d(a)?[a]:a);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,c=>{n(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?r(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e),s}getFixedT(e,t,s,i){const n=i?.scopeNs,r=(a,l,...u)=>{let c;typeof l!="object"?c=this.options.overloadTranslationOptionHandler([a,l].concat(u)):c={...l},c.lng=c.lng||r.lng,c.lngs=c.lngs||r.lngs;const h=c.ns!==void 0&&c.ns!==null;c.ns=c.ns||r.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||s||r.keyPrefix);const f={...this.options,...c};
1Array.isArray(n)&&!h&&(f.ns=n),typeof c.keyPrefix=="function"&&(c.keyPrefix=I(c.keyPrefix,f));const g=this.options.keySeparator||".";let p;return c.keyPrefix&&Array.isArray(a)?p=a.map(m=>(typeof m=="function"&&(m=I(m,f)),`${c.keyPrefix}${g}${m}`)):(typeof a=="function"&&(a=I(a,f)),p=c.keyPrefix?`${c.keyPrefix}${g}${a}`:a),this.t(p,c)};return d(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=s,r}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 r=(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,r);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(s,e)&&(!i||r(n,e)))}loadNamespaces(e,t){const s=D();return this.options.ns?(d(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=D();d(e)&&(e=[e]);const i=this.options.preload||[],n=e.filter(r=>!i.includes(r)&&this.services.languageUtils.isSupportedCode(r));return n.length?(this.options.preload=i.concat(n),this.loadResources(r=>{s.resolve(),t&&t(r)}),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 oe(G());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(s.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new U(e,t);return s.createInstance=U.createInstance,s}cloneInstance(e={},t=z){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},n=new U(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((c,h)=>(c[h]={...l[u][h]},c),l[u]),l),{});n.store=new ae(a,i),n.services.resourceStore=n.store}if(e.interpolation){const l={...G().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};n.services.interpolator=new he(u)}return n.translator=new _(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 b=U.createInstance();b.createInstance;b.dir;b.init;b.loadResources;b.reloadResources;b.use;b.changeLanguage;b.getFixedT;b.t;b.exists;b.setDefaultNamespace;b.hasLoadedNamespace;b.loadNamespaces;b.loadLanguages;export{b as i,I as k};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.