import{K as lt}from"./Mgz3HV5C.js";const ut={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,t){console&&console[r]&&console[r].apply(console,t)}};class T{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||ut,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,s,n){return n&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new T(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new T(this.logger,t)}}var O=new T;class H{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(e)||0;this.observers[s].set(e,n+1)}),this}off(t,e){if(this.observers[t]){if(!e){delete this.observers[t];return}this.observers[t].delete(e)}}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[i,l]=o;for(let a=0;a<l;a++)i(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[i,l]=o;for(let a=0;a<l;a++)i.apply(i,[t,...s])})}}function F(){let r,t;const e=new Promise((s,n)=>{r=s,t=n});return e.resolve=r,e.reject=t,e}function _(r){return r==null?"":""+r}function gt(r,t,e){r.forEach(s=>{t[s]&&(e[s]=t[s])})}const ht=/###/g;function A(r,t,e){function s(l){return l&&l.indexOf("###")>-1?l.replace(ht,"."):l}function n(){return!r||typeof r=="string"}const o=typeof t!="string"?t:t.split(".");let i=0;for(;i<o.length-1;){if(n())return{};const l=s(o[i]);!r[l]&&e&&(r[l]=new e),Object.prototype.hasOwnProperty.call(r,l)?r=r[l]:r={},++i}return n()?{}:{obj:r,k:s(o[i])}}function Q(r,t,e){const{obj:s,k:n}=A(r,t,Object);if(s!==void 0||t.length===1){s[n]=e;return}let o=t[t.length-1],i=t.slice(0,t.length-1),l=A(r,i,Object);for(;l.obj===void 0&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),l=A(r,i,Object),l&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=e}function pt(r,t,e,s){const{obj:n,k:o}=A(r,t,Object);n[o]=n[o]||[],n[o].push(e)}function K(r,t){const{obj:e,k:s}=A(r,t);if(e)return e[s]}function ct(r,t,e){const s=K(r,e);return s!==void 0?s:K(t,e)}function rt(r,t,e){for(const s in t)s!=="__proto__"&&s!=="constructor"&&(s in r?typeof r[s]=="string"||r[s]instanceof String||typeof t[s]=="string"||t[s]instanceof String?e&&(r[s]=t[s]):rt(r[s],t[s],e):r[s]=t[s]);return r}function C(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var dt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function ft(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,t=>dt[t]):r}class mt{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(e!==void 0)return e;const s=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,s),this.regExpQueue.push(t),s}}const yt=[" ",",","?","!",";"],vt=new mt(20);function bt(r,t,e){t=t||"",e=e||"";const s=yt.filter(i=>t.indexOf(i)<0&&e.indexOf(i)<0);if(s.length===0)return!0;const n=vt.getRegExp(`(${s.map(i=>i==="?"?"\\?":i).join("|")})`);let o=!n.test(r);if(!o){const i=r.indexOf(e);i>0&&!n.test(r.substring(0,i))&&(o=!0)}return o}function B(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[t])return r[t];const s=t.split(e);let n=r;for(let o=0;o<s.length;){if(!n||typeof n!="object")return;let i,l="";for(let a=o;a<s.length;++a)if(a!==o&&(l+=e),l+=s[a],i=n[l],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&a<s.length-1)continue;o+=a-o+1;break}n=i}return n}function M(r){return r&&r.indexOf("_")>0?r.replace("_","-"):r}class G extends H{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,i=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,e],s&&(Array.isArray(s)?l.push(...s):typeof s=="string"&&o?l.push(...s.split(o)):l.push(s)));const a=K(this.data,l);return!a&&!e&&!s&&t.indexOf(".")>-1&&(t=l[0],e=l[1],s=l.slice(2).join(".")),a||!i||typeof s!="string"?a:B(this.data&&this.data[t]&&this.data[t][e],s,o)}addResource(t,e,s,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,e];s&&(l=l.concat(i?s.split(i):s)),t.indexOf(".")>-1&&(l=t.split("."),n=e,e=l[1]),this.addNamespaces(e),Q(this.data,l,n),o.silent||this.emit("added",t,e,s,n)}addResources(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in s)(typeof s[o]=="string"||Array.isArray(s[o]))&&this.addResource(t,e,o,s[o],{silent:!0});n.silent||this.emit("added",t,e,s)}addResourceBundle(t,e,s,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,e];t.indexOf(".")>-1&&(l=t.split("."),n=s,s=e,e=l[1]),this.addNamespaces(e);let a=K(this.data,l)||{};i.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?rt(a,s,o):a={...a,...s},Q(this.data,l,a),i.silent||this.emit("added",t,e,s)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return this.getResource(t,e)!==void 0}getResourceBundle(t,e){return e||(e=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find(s=>e[s]&&Object.keys(e[s]).length>0)}toJSON(){return this.data}}var ot={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,t,e,s,n){return r.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,e,s,n))}),t}};const X={};class z extends H{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),gt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=e,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=O.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const s=this.resolve(t,e);return s&&s.res!==void 0}extractFromKey(t,e){let s=e.nsSeparator!==void 0?e.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=e.keySeparator!==void 0?e.keySeparator:this.options.keySeparator;let o=e.ns||this.options.defaultNS||[];const i=s&&t.indexOf(s)>-1,l=!this.options.userDefinedKeySeparator&&!e.keySeparator&&!this.options.userDefinedNsSeparator&&!e.nsSeparator&&!bt(t,s,n);if(i&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:o};const u=t.split(s);(s!==n||s===n&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(n)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,e,s){if(typeof e!="object"&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),typeof e=="object"&&(e={...e}),e||(e={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const n=e.returnDetails!==void 0?e.returnDetails:this.options.returnDetails,o=e.keySeparator!==void 0?e.keySeparator:this.options.keySeparator,{key:i,namespaces:l}=this.extractFromKey(t[t.length-1],e),a=l[l.length-1],u=e.lng||this.language,h=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(h){const y=e.nsSeparator||this.options.nsSeparator;return n?{res:`${a}${y}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:`${a}${y}${i}`}return n?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:i}const p=this.resolve(t,e);let g=p&&p.res;const c=p&&p.usedKey||i,d=p&&p.exactUsedKey||i,v=Object.prototype.toString.apply(g),S=["[object Number]","[object Function]","[object RegExp]"],k=e.joinArrays!==void 0?e.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&g&&typeof g!="string"&&typeof g!="boolean"&&typeof g!="number"&&S.indexOf(v)<0&&!(typeof k=="string"&&Array.isArray(g))){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(c,g,{...e,ns:l}):`key '${i} (${this.language})' returned an object instead of string.`;return n?(p.res=y,p.usedParams=this.getUsedParamsDetails(e),p):y}if(o){const y=Array.isArray(g),f=y?[]:{},w=y?d:c;for(const x in g)if(Object.prototype.hasOwnProperty.call(g,x)){const $=`${w}${o}${x}`;f[x]=this.translate($,{...e,joinArrays:!1,ns:l}),f[x]===$&&(f[x]=g[x])}g=f}}else if(b&&typeof k=="string"&&Array.isArray(g))g=g.join(k),g&&(g=this.extendTranslation(g,t,e,s));else{let y=!1,f=!1;const w=e.count!==void 0&&typeof e.count!="string",x=z.hasDefaultValue(e),$=w?this.pluralResolver.getSuffix(u,e.count,e):"",it=e.ordinal&&w?this.pluralResolver.getSuffix(u,e.count,{ordinal:!1}):"",q=w&&!e.ordinal&&e.count===0&&this.pluralResolver.shouldUseIntlApi(),P=q&&e[`defaultValue${this.options.pluralSeparator}zero`]||e[`defaultValue${$}`]||e[`defaultValue${it}`]||e.defaultValue;!this.isValidLookup(g)&&x&&(y=!0,g=P),this.isValidLookup(g)||(f=!0,g=i);const at=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&f?void 0:g,j=x&&P!==g&&this.options.updateMissing;if(f||y||j){if(this.logger.log(j?"updateKey":"missingKey",u,a,i,j?P:g),o){const L=this.resolve(i,{...e,keySeparator:!1});L&&L.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 E=[];const D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(let L=0;L<D.length;L++)E.push(D[L]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(e.lng||this.language):E.push(e.lng||this.language);const W=(L,R,I)=>{const Y=x&&I!==g?I:at;this.options.missingKeyHandler?this.options.missingKeyHandler(L,a,R,Y,j,e):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(L,a,R,Y,j,e),this.emit("missingKey",L,a,R,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?E.forEach(L=>{const R=this.pluralResolver.getSuffixes(L,e);q&&e[`defaultValue${this.options.pluralSeparator}zero`]&&R.indexOf(`${this.options.pluralSeparator}zero`)<0&&R.push(`${this.options.pluralSeparator}zero`),R.forEach(I=>{W([L],i+I,e[`defaultValue${I}`]||P)})}):W(E,i,P))}g=this.extendTranslation(g,t,e,p,s),f&&g===i&&this.options.appendNamespaceToMissingKey&&(g=`${a}:${i}`),(f||y)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,y?g:void 0):g=this.options.parseMissingKeyHandler(g))}return n?(p.res=g,p.usedParams=this.getUsedParamsDetails(e),p):g}extendTranslation(t,e,s,n,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const u=typeof t=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(u){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let p=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,s.lng||this.language,s),u){const g=t.match(this.interpolator.nestingRegexp),c=g&&g.length;h<c&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&n&&n.res&&(s.lng=n.usedLng),s.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,c=new Array(g),d=0;d<g;d++)c[d]=arguments[d];return o&&o[0]===c[0]&&!s.context?(i.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${e[0]}`),null):i.translate(...c,e)},s)),s.interpolation&&this.interpolator.reset()}const l=s.postProcess||this.options.postProcess,a=typeof l=="string"?[l]:l;return t!=null&&a&&a.length&&s.applyPostProcessor!==!1&&(t=ot.handle(a,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),t}resolve(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,n,o,i,l;return typeof t=="string"&&(t=[t]),t.forEach(a=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(a,e),h=u.key;n=h;let p=u.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const g=e.count!==void 0&&typeof e.count!="string",c=g&&!e.ordinal&&e.count===0&&this.pluralResolver.shouldUseIntlApi(),d=e.context!==void 0&&(typeof e.context=="string"||typeof e.context=="number")&&e.context!=="",v=e.lngs?e.lngs:this.languageUtils.toResolveHierarchy(e.lng||this.language,e.fallbackLng);p.forEach(S=>{this.isValidLookup(s)||(l=S,!X[`${v[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(X[`${v[0]}-${S}`]=!0,this.logger.warn(`key "${n}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),v.forEach(k=>{if(this.isValidLookup(s))return;i=k;const b=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(b,h,k,S,e);else{let f;g&&(f=this.pluralResolver.getSuffix(k,e.count,e));const w=`${this.options.pluralSeparator}zero`,x=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(b.push(h+f),e.ordinal&&f.indexOf(x)===0&&b.push(h+f.replace(x,this.options.pluralSeparator)),c&&b.push(h+w)),d){const $=`${h}${this.options.contextSeparator}${e.context}`;b.push($),g&&(b.push($+f),e.ordinal&&f.indexOf(x)===0&&b.push($+f.replace(x,this.options.pluralSeparator)),c&&b.push($+w))}}let y;for(;y=b.pop();)this.isValidLookup(s)||(o=y,s=this.getResource(k,S,y,e))}))})}),{res:s,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,s,n):this.resourceStore.getResource(t,e,s,n)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&typeof t.replace!="string";let n=s?t.replace:t;if(s&&typeof t.count<"u"&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const o of e)delete n[o]}return n}static hasDefaultValue(t){const e="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e===s.substring(0,e.length)&&t[s]!==void 0)return!0;return!1}}function J(r){return r.charAt(0).toUpperCase()+r.slice(1)}class Z{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=O.create("languageUtils")}getScriptPartFromCode(t){if(t=M(t),!t||t.indexOf("-")<0)return null;const e=t.split("-");return e.length===2||(e.pop(),e[e.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(e.join("-"))}getLanguagePartFromCode(t){if(t=M(t),!t||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let s=t.split("-");return this.options.lowerCaseLng?s=s.map(n=>n.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=J(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),e.indexOf(s[1].toLowerCase())>-1&&(s[1]=J(s[1].toLowerCase())),e.indexOf(s[2].toLowerCase())>-1&&(s[2]=J(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach(s=>{if(e)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(e=n)}),!e&&this.options.supportedLngs&&t.forEach(s=>{if(e)return;const n=this.getLanguagePartFromCode(s);if(this.isSupportedCode(n))return e=n;e=this.options.supportedLngs.find(o=>{if(o===n||!(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})}),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if(typeof t=="function"&&(t=t(e)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let s=t[e];return s||(s=t[this.getScriptPartFromCode(e)]),s||(s=t[this.formatLanguageCode(e)]),s||(s=t[this.getLanguagePartFromCode(e)]),s||(s=t.default),s||[]}toResolveHierarchy(t,e){const s=this.getFallbackCodes(e||this.options.fallbackLng||[],t),n=[],o=i=>{i&&(this.isSupportedCode(i)?n.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),s.forEach(i=>{n.indexOf(i)<0&&o(this.formatLanguageCode(i))}),n}}let xt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],St={1:function(r){return+(r>1)},2:function(r){return+(r!=1)},3:function(r){return 0},4:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},5:function(r){return r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5},6:function(r){return r==1?0:r>=2&&r<=4?1:2},7:function(r){return r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2},8:function(r){return r==1?0:r==2?1:r!=8&&r!=11?2:3},9:function(r){return+(r>=2)},10:function(r){return r==1?0:r==2?1:r<7?2:r<11?3:4},11:function(r){return r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3},12:function(r){return+(r%10!=1||r%100==11)},13:function(r){return+(r!==0)},14:function(r){return r==1?0:r==2?1:r==3?2:3},15:function(r){return r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2},16:function(r){return r%10==1&&r%100!=11?0:r!==0?1:2},17:function(r){return r==1||r%10==1&&r%100!=11?0:1},18:function(r){return r==0?0:r==1?1:2},19:function(r){return r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3},20:function(r){return r==1?0:r==0||r%100>0&&r%100<20?1:2},21:function(r){return r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0},22:function(r){return r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3}};const kt=["v1","v2","v3"],Lt=["v4"],tt={zero:0,one:1,two:2,few:3,many:4,other:5};function Ot(){const r={};return xt.forEach(t=>{t.lngs.forEach(e=>{r[e]={numbers:t.nr,plurals:St[t.fc]}})}),r}class wt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=O.create("pluralResolver"),(!this.options.compatibilityJSON||Lt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Ot()}addRule(t,e){this.rules[t]=e}getRule(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(M(t==="dev"?"en":t),{type:e.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(t,e);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,s).map(n=>`${e}${n}`)}getSuffixes(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(t,e);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((n,o)=>tt[n]-tt[o]).map(n=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${n}`):s.numbers.map(n=>this.getSuffix(t,n,e)):[]}getSuffix(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=this.getRule(t,s);return n?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(e)}`:this.getSuffixRetroCompatible(n,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){const s=t.noAbs?t.plurals(e):t.plurals(Math.abs(e));let n=t.numbers[s];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(n===2?n="plural":n===1&&(n=""));const o=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return this.options.compatibilityJSON==="v1"?n===1?"":typeof n=="number"?`_plural_${n.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!kt.includes(this.options.compatibilityJSON)}}function et(r,t,e){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=ct(r,t,e);return!o&&n&&typeof e=="string"&&(o=B(r,e,s),o===void 0&&(o=B(t,e,s))),o}class $t{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=O.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(e=>e),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:s,useRawValueToEscape:n,prefix:o,prefixEscaped:i,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:h,unescapePrefix:p,nestingPrefix:g,nestingPrefixEscaped:c,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:S,maxReplaces:k,alwaysFormat:b}=t.interpolation;this.escape=e!==void 0?e:ft,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=o?C(o):i||"{{",this.suffix=l?C(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?C(g):c||C("$t("),this.nestingSuffix=d?C(d):v||C(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=k||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(e,s)=>e&&e.source===s?(e.lastIndex=0,e):new RegExp(s,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,e,s,n){let o,i,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(c){return c.replace(/\$/g,"$$$$")}const h=c=>{if(c.indexOf(this.formatSeparator)<0){const k=et(e,a,c,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,s,{...n,...e,interpolationkey:c}):k}const d=c.split(this.formatSeparator),v=d.shift().trim(),S=d.join(this.formatSeparator).trim();return this.format(et(e,a,v,this.options.keySeparator,this.options.ignoreJSONStructure),S,s,{...n,...e,interpolationkey:v})};this.resetRegExp();const p=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,g=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:c=>u(c)},{regex:this.regexp,safeValue:c=>this.escapeValue?u(this.escape(c)):u(c)}].forEach(c=>{for(l=0;o=c.regex.exec(t);){const d=o[1].trim();if(i=h(d),i===void 0)if(typeof p=="function"){const S=p(t,o,n);i=typeof S=="string"?S:""}else if(n&&Object.prototype.hasOwnProperty.call(n,d))i="";else if(g){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${d} for interpolating ${t}`),i="";else typeof i!="string"&&!this.useRawValueToEscape&&(i=_(i));const v=c.safeValue(i);if(t=t.replace(o[0],v),g?(c.regex.lastIndex+=i.length,c.regex.lastIndex-=o[0].length):c.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,o,i;function l(a,u){const h=this.nestingOptionsSeparator;if(a.indexOf(h)<0)return a;const p=a.split(new RegExp(`${h}[ ]*{`));let g=`{${p[1]}`;a=p[0],g=this.interpolate(g,i);const c=g.match(/'/g),d=g.match(/"/g);(c&&c.length%2===0&&!d||d.length%2!==0)&&(g=g.replace(/'/g,'"'));try{i=JSON.parse(g),u&&(i={...u,...i})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${h}${g}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,a}for(;n=this.nestingRegexp.exec(t);){let a=[];i={...s},i=i.replace&&typeof i.replace!="string"?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){const h=n[1].split(this.formatSeparator).map(p=>p.trim());n[1]=h.shift(),a=h,u=!0}if(o=e(l.call(this,n[1].trim(),i),i),o&&n[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=_(o)),o||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),o=""),u&&(o=a.reduce((h,p)=>this.format(h,p,s.lng,{...s,interpolationkey:n[1].trim()}),o.trim())),t=t.replace(n[0],o),this.regexp.lastIndex=0}return t}}function Rt(r){let t=r.toLowerCase().trim();const e={};if(r.indexOf("(")>-1){const s=r.split("(");t=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);t==="currency"&&n.indexOf(":")<0?e.currency||(e.currency=n.trim()):t==="relativetime"&&n.indexOf(":")<0?e.range||(e.range=n.trim()):n.split(";").forEach(o=>{if(o){const[i,...l]=o.split(":"),a=l.join(":").trim().replace(/^'+|'+$/g,""),u=i.trim();e[u]||(e[u]=a),a==="false"&&(e[u]=!1),a==="true"&&(e[u]=!0),isNaN(a)||(e[u]=parseInt(a,10))}})}return{formatName:t,formatOptions:e}}function N(r){const t={};return function(e,s,n){const o=s+JSON.stringify(n);let i=t[o];return i||(i=r(M(s),n),t[o]=i),i(e)}}class Ct{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=O.create("formatter"),this.options=t,this.formats={number:N((e,s)=>{const n=new Intl.NumberFormat(e,{...s});return o=>n.format(o)}),currency:N((e,s)=>{const n=new Intl.NumberFormat(e,{...s,style:"currency"});return o=>n.format(o)}),datetime:N((e,s)=>{const n=new Intl.DateTimeFormat(e,{...s});return o=>n.format(o)}),relativetime:N((e,s)=>{const n=new Intl.RelativeTimeFormat(e,{...s});return o=>n.format(o,s.range||"day")}),list:N((e,s)=>{const n=new Intl.ListFormat(e,{...s});return o=>n.format(o)})},this.init(t)}init(t){const e=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=N(e)}format(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return e.split(this.formatSeparator).reduce((o,i)=>{const{formatName:l,formatOptions:a}=Rt(i);if(this.formats[l]){let u=o;try{const h=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},p=h.locale||h.lng||n.locale||n.lng||s;u=this.formats[l](o,p,{...a,...n,...h})}catch(h){this.logger.warn(h)}return u}else this.logger.warn(`there was no format function for ${l}`);return o},t)}}function Nt(r,t){r.pending[t]!==void 0&&(delete r.pending[t],r.pendingCount--)}class Pt extends H{constructor(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=O.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,n.backend,n)}queueLoad(t,e,s,n){const o={},i={},l={},a={};return t.forEach(u=>{let h=!0;e.forEach(p=>{const g=`${u}|${p}`;!s.reload&&this.store.hasResourceBundle(u,p)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?i[g]===void 0&&(i[g]=!0):(this.state[g]=1,h=!1,i[g]===void 0&&(i[g]=!0),o[g]===void 0&&(o[g]=!0),a[p]===void 0&&(a[p]=!0)))}),h||(l[u]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,e,s){const n=t.split("|"),o=n[0],i=n[1];e&&this.emit("failedLoading",o,i,e),s&&this.store.addResourceBundle(o,i,s,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2;const l={};this.queue.forEach(a=>{pt(a.loaded,[o],i),Nt(a,t),e&&a.errors.push(e),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const h=a.loaded[u];h.length&&h.forEach(p=>{l[u][p]===void 0&&(l[u][p]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:e,fcName:s,tried:n,wait:o,callback:i});return}this.readingCalls++;const l=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(u&&h&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,t,e,s,n+1,o*2,i)},o);return}i(u,h)},a=this.backend[s].bind(this.backend);if(a.length===2){try{const u=a(t,e);u&&typeof u.then=="function"?u.then(h=>l(null,h)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,e,l)}prepareLoading(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof e=="string"&&(e=[e]);const o=this.queueLoad(t,e,s,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(t,e,s){this.prepareLoading(t,e,{},s)}reload(t,e,s){this.prepareLoading(t,e,{reload:!0},s)}loadOne(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=t.split("|"),n=s[0],o=s[1];this.read(n,o,"read",void 0,void 0,(i,l)=>{i&&this.logger.warn(`${e}loading namespace ${o} for language ${n} failed`,i),!i&&l&&this.logger.log(`${e}loaded namespace ${o} for language ${n}`,l),this.loaded(t,i,l)})}saveMissing(t,e,s,n,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)){this.logger.warn(`did not save key "${s}" as the namespace "${e}" 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&&this.backend.create){const a={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let h;u.length===5?h=u(t,e,s,n,a):h=u(t,e,s,n),h&&typeof h.then=="function"?h.then(p=>l(null,p)).catch(l):l(null,h)}catch(h){l(h)}else u(t,e,s,n,l,a)}!t||!t[0]||this.store.addResource(t[0],e,s,n)}}}function st(){return{debug:!1,initImmediate:!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:function(r){let t={};if(typeof r[1]=="object"&&(t=r[1]),typeof r[1]=="string"&&(t.defaultValue=r[1]),typeof r[2]=="string"&&(t.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const e=r[3]||r[2];Object.keys(e).forEach(s=>{t[s]=e[s]})}return t},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function nt(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function U(){}function jt(r){Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})}class V extends H{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(super(),this.options=nt(t),this.services={},this.logger=O,this.modules={external:[]},jt(this),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout(()=>{this.init(t,e)},0)}}init(){var t=this;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof e=="function"&&(s=e,e={}),!e.defaultNS&&e.defaultNS!==!1&&e.ns&&(typeof e.ns=="string"?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=st();this.options={...n,...this.options,...nt(e)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);function o(a){return a?typeof a=="function"?new a:a:null}if(!this.options.isClone){this.modules.logger?O.init(o(this.modules.logger),this.options):O.init(null,this.options);let a;this.modules.formatter?a=this.modules.formatter:typeof Intl<"u"&&(a=Ct);const u=new Z(this.options);this.store=new G(this.options.resources,this.options);const h=this.services;h.logger=O,h.resourceStore=this.store,h.languageUtils=u,h.pluralResolver=new wt(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(h.formatter=o(a),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new $t(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Pt(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(p){for(var g=arguments.length,c=new Array(g>1?g-1:0),d=1;d<g;d++)c[d-1]=arguments[d];t.emit(p,...c)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new z(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,c=new Array(g>1?g-1:0),d=1;d<g;d++)c[d-1]=arguments[d];t.emit(p,...c)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,s||(s=U),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&a[0]!=="dev"&&(this.options.lng=a[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(a=>{this[a]=function(){return t.store[a](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(a=>{this[a]=function(){return t.store[a](...arguments),t}});const i=F(),l=()=>{const a=(u,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),i.resolve(h),s(u,h)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return a(null,this.t.bind(this));this.changeLanguage(this.options.lng,a)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),i}loadResources(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return e();const n=[],o=i=>{!i||i==="cimode"||this.services.languageUtils.toResolveHierarchy(i).forEach(l=>{l!=="cimode"&&n.indexOf(l)<0&&n.push(l)})};s?o(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(i=>o(i)),this.options.preload&&this.options.preload.forEach(i=>o(i)),this.services.backendConnector.load(n,this.options.ns,i=>{!i&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),e(i)})}else e(null)}reloadResources(t,e,s){const n=F();return t||(t=this.languages),e||(e=this.options.ns),s||(s=U),this.services.backendConnector.reload(t,e,o=>{n.resolve(),s(o)}),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&ot.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let e=0;e<this.languages.length;e++){const s=this.languages[e];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(t,e){var s=this;this.isLanguageChangingTo=t;const n=F();this.emit("languageChanging",t);const o=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve(function(){return s.t(...arguments)}),e&&e(a,function(){return s.t(...arguments)})},l=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const u=typeof a=="string"?a:this.services.languageUtils.getBestMatchFromCodes(a);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,h=>{i(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),n}getFixedT(t,e,s){var n=this;const o=function(i,l){let a;if(typeof l!="object"){for(var u=arguments.length,h=new Array(u>2?u-2:0),p=2;p<u;p++)h[p-2]=arguments[p];a=n.options.overloadTranslationOptionHandler([i,l].concat(h))}else a={...l};a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs,a.ns=a.ns||o.ns,a.keyPrefix=a.keyPrefix||s||o.keyPrefix;const g=n.options.keySeparator||".";let c;return a.keyPrefix&&Array.isArray(i)?c=i.map(d=>`${a.keyPrefix}${g}${d}`):c=a.keyPrefix?`${a.keyPrefix}${g}${i}`:i,n.t(c,a)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=e,o.keyPrefix=s,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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=e.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const i=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===2};if(e.precheck){const l=e.precheck(this,i);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(s,t)&&(!n||i(o,t)))}loadNamespaces(t,e){const s=F();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),e&&e(n)}),s):(e&&e(),Promise.resolve())}loadLanguages(t,e){const s=F();typeof t=="string"&&(t=[t]);const n=this.options.preload||[],o=t.filter(i=>n.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=n.concat(o),this.loadResources(i=>{s.resolve(),e&&e(i)}),s):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const e=["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&&this.services.languageUtils||new Z(st());return e.indexOf(s.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new V(t,e)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:U;const s=t.forkResourceStore;s&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},o=new V(n);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(i=>{o[i]=this[i]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},s&&(o.store=new G(this.store.data,n),o.services.resourceStore=o.store),o.translator=new z(o.services,n),o.translator.on("*",function(i){for(var l=arguments.length,a=new Array(l>1?l-1:0),u=1;u<l;u++)a[u-1]=arguments[u];o.emit(i,...a)}),o.init(n,e),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const m=V.createInstance();m.createInstance=V.createInstance;m.createInstance;m.dir;m.init;m.loadResources;m.reloadResources;m.use;m.changeLanguage;m.getFixedT;m.t;m.exists;m.setDefaultNamespace;m.hasLoadedNamespace;m.loadNamespaces;m.loadLanguages;(async function(){await m.init({fallbackLng:"nl",defaultNS:"standard",ns:["standard","stratech","rental"],resources:lt},r=>{if(r)return console.log("something went wrong loading",r)})})();const It=r=>m.changeLanguage(r),Ft=m.t;export{Ft as A,It as j};
