| 2 |
(()=>{"use strict";var e={15(e,t,n){var a=n(594);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=a.useState,i=a.useEffect,r=a.useLayoutEffect,l=a.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),a=s({inst:{value:n,getSnapshot:t}}),o=a[0].inst,u=a[1];return r(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),i(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),l(n),n};void 0!==a.useSyncExternalStore&&a.useSyncExternalStore},98(e,t,n){n(15)},594(e){e.exports=React}};const t={};function n(a){const o=t[a];if(void 0!==o)return o.exports;const s=t[a]={exports:{}};return e[a](s,s.exports,n),s.exports}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=a(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,o,s,i,r=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=s.call(n)).done)&&(r.push(a.value),r.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var l=n(594);const c=wp.components,u=e=>"string"==typeof e,p=()=>{let e,t;const n=new Promise((n,a)=>{e=n,t=a});return n.resolve=e,n.reject=t,n},d=e=>null==e?"":String(e),h=/###/g,g=e=>e&&e.includes("###")?e.replace(h,"."):e,f=e=>!e||u(e),m=(e,t,n)=>{const a=u(t)?t.split("."):t;let o=0;for(;o<a.length-1;){if(f(e))return{};const t=g(a[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return f(e)?{}:{obj:e,k:g(a[o])}},v=(e,t,n)=>{const{obj:a,k:o}=m(e,t,Object);if(void 0!==a||1===t.length)return void(a[o]=n);let s=t[t.length-1],i=t.slice(0,t.length-1),r=m(e,i,Object);for(;void 0===r.obj&&i.length;)s=`${i[i.length-1]}.${s}`,i=i.slice(0,i.length-1),r=m(e,i,Object),r?.obj&&void 0!==r.obj[`${r.k}.${s}`]&&(r.obj=void 0);r.obj[`${r.k}.${s}`]=n},y=(e,t)=>{const{obj:n,k:a}=m(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,a))return n[a]},b=(e,t,n)=>{for(const a in t)"__proto__"!==a&&"constructor"!==a&&(Object.prototype.hasOwnProperty.call(e,a)?u(e[a])||e[a]instanceof String||u(t[a])||t[a]instanceof String?n&&(e[a]=t[a]):b(e[a],t[a],n):e[a]=t[a]);return e},k=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),x={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},N=e=>u(e)?e.replace(/[&<>"'\/]/g,e=>x[e]):e;const S=[" ",",","?","!",";"],w=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),O=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const a=t.split(n);let o=e;for(let e=0;e<a.length;){if(!o||"object"!=typeof o)return;let t,s="";for(let i=e;i<a.length;++i)if(i!==e&&(s+=n),s+=a[i],t=o[s],void 0!==t){if(["string","number","boolean"].includes(typeof t)&&i<a.length-1)continue;e+=i-e+1;break}o=t}return o},E=e=>e?.replace(/_/g,"-"),j={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class L{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||j,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,n,a){return a&&!this.debug?null:(e=e.map(e=>u(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),u(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new L(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new L(this.logger,e)}}var P=new L;class ${constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){const n=(...a)=>{t(...a),this.off(e,n)};return this.on(e,n),this}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let a=0;a<n;a++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,a])=>{for(let o=0;o<a;o++)n(e,...t)})}}}class C extends ${constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(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,n,a={}){const o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,s=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.includes(".")?i=e.split("."):(i=[e,t],n&&(Array.isArray(n)?i.push(...n):u(n)&&o?i.push(...n.split(o)):i.push(n)));const r=y(this.data,i);return r||t||n||!e.includes(".")||(e=i[0],t=i[1],n=i.slice(2).join(".")),!r&&s&&u(n)?O(this.data?.[e]?.[t],n,o):r}addResource(e,t,n,a,o={silent:!1}){const s=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(s?n.split(s):n)),e.includes(".")&&(i=e.split("."),a=t,t=i[1]),this.addNamespaces(t),v(this.data,i,a),o.silent||this.emit("added",e,t,n,a)}addResources(e,t,n,a={silent:!1}){for(const a in n)(u(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});a.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,a,o,s={silent:!1,skipCopy:!1}){let i=[e,t];e.includes(".")&&(i=e.split("."),a=n,n=t,t=i[1]),this.addNamespaces(t);let r=y(this.data,i)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),a?b(r,n,o):r={...r,...n},v(this.data,i,r),s.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}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(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var R={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,a,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,a,o)??t}),t}};const T=Symbol("i18next/PATH_KEY");function A(e,t){const{[T]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(a,o)=>(n?.revoke?.(),o===T?e:(e.push(o),n=Proxy.revocable(a,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),a=t?.keySeparator??".",o=t?.nsSeparator??":",s="strict"===t?.enableSelector;if(n.length>1&&o){const e=t?.ns,i=s?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(i){if((s?i:i.length>1?i.slice(1):[]).includes(n[0]))return`${n[0]}${o}${n.slice(1).join(a)}`}}return n.join(a)}const _=e=>!u(e)&&"boolean"!=typeof e&&"number"!=typeof e;class I extends ${constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=P.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const a=this.resolve(e,n);if(void 0===a?.res)return!1;const o=_(a.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const s=n&&e.includes(n),i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const a=S.filter(e=>!t.includes(e)&&!n.includes(e));if(0===a.length)return!0;const o=w.getRegExp(`(${a.map(e=>"?"===e?"\\?":e).join("|")})`);let s=!o.test(e);if(!s){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(s=!0)}return s})(e,n,a));if(s&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:u(o)?[o]:o};const s=e.split(n);(n!==a||n===a&&this.options.ns.includes(s[0]))&&(o=s.shift()),e=s.join(a)}return{key:e,namespaces:u(o)?[o]:o}}translate(e,t,n){let a="object"==typeof t?{...t}:t;if("object"!=typeof a&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof a&&(a={...a}),a||(a={}),null==e)return"";"function"==typeof e&&(e=A(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?A(e,{...this.options,...a}):String(e));const o=void 0!==a.returnDetails?a.returnDetails:this.options.returnDetails,s=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,{key:i,namespaces:r}=this.extractFromKey(e[e.length-1],a),l=r[r.length-1];let c=void 0!==a.nsSeparator?a.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const p=a.lng||this.language,d=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return d?o?{res:`${l}${c}${i}`,usedKey:i,exactUsedKey:i,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(a)}:`${l}${c}${i}`:o?{res:i,usedKey:i,exactUsedKey:i,usedLng:p,usedNS:l,usedParams:this.getUsedParamsDetails(a)}:i;const h=this.resolve(e,a);let g=h?.res;const f=h?.usedKey||i,m=h?.exactUsedKey||i,v=void 0!==a.joinArrays?a.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==a.count&&!u(a.count),k=I.hasDefaultValue(a),x=b?this.pluralResolver.getSuffix(p,a.count,a):"",N=a.ordinal&&b?this.pluralResolver.getSuffix(p,a.count,{ordinal:!1}):"",S=b&&!a.ordinal&&0===a.count,w=S&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${x}`]||a[`defaultValue${N}`]||a.defaultValue;let O=g;y&&!g&&k&&(O=w);const E=_(O),j=Object.prototype.toString.apply(O);if(!(y&&O&&E)||["[object Number]","[object Function]","[object RegExp]"].includes(j)||u(v)&&Array.isArray(O))if(y&&u(v)&&Array.isArray(g))g=g.join(v),g&&(g=this.extendTranslation(g,e,a,n));else{let t=!1,o=!1;!this.isValidLookup(g)&&k&&(t=!0,g=w),this.isValidLookup(g)||(o=!0,g=i);const r=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:g,u=k&&w!==g&&this.options.updateMissing;if(o||t||u){if(this.logger.log(u?"updateKey":"missingKey",p,l,b&&!u?`${i}${this.pluralResolver.getSuffix(p,a.count,a)}`:i,u?w:g),s){const e=this.resolve(i,{...a,keySeparator:!1});e&&e.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 t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);const n=(e,t,n)=>{const o=k&&n!==g?n:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,u,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,u,a),this.emit("missingKey",e,l,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,a);S&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],i+t,a[`defaultValue${t}`]||w)})}):n(e,i,w))}g=this.extendTranslation(g,e,a,h,n),o&&g===i&&this.options.appendNamespaceToMissingKey&&(g=`${l}${c}${i}`),(o||t)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${i}`:i,t?g:void 0,a))}else{if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,O,{...a,ns:r}):`key '${i} (${this.language})' returned an object instead of string.`;return o?(h.res=e,h.usedParams=this.getUsedParamsDetails(a),h):e}if(s){const e=Array.isArray(O),t=e?[]:{},n=e?m:f;for(const e in O)if(Object.prototype.hasOwnProperty.call(O,e)){const o=`${n}${s}${e}`;t[e]=k&&!g?this.translate(o,{...a,defaultValue:_(w)?w[e]:void 0,joinArrays:!1,ns:r}):this.translate(o,{...a,joinArrays:!1,ns:r}),t[e]===o&&(t[e]=O[e])}g=t}}return o?(h.res=g,h.usedParams=this.getUsedParamsDetails(a),h):g}extendTranslation(e,t,n,a,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const s=u(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let i;if(s){const t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let r=n.replace&&!u(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),e=this.interpolator.interpolate(e,r,n.lng||this.language||a.usedLng,n),s){const t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&a&&a.res&&(n.lng=this.language||a.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,i=u(s)?[s]:s;return null!=e&&i?.length&&!1!==n.applyPostProcessor&&(e=R.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,a,o,s,i;return u(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?A(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;const r=this.extractFromKey(e,t),l=r.key;a=l;let c=r.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const p=void 0!==t.count&&!u(t.count),d=p&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(u(t.context)||"number"==typeof t.context)&&""!==t.context,g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(i=e,this.checkedLoadedFor[`${g[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(i)||(this.checkedLoadedFor[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${a}" for languages "${g.join(", ")}" won't get resolved as namespace "${i}" 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!!!")),g.forEach(a=>{if(this.isValidLookup(n))return;s=a;const i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,l,a,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(a,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&e.startsWith(o)&&i.push(l+e.replace(o,this.options.pluralSeparator)),i.push(l+e),d&&i.push(l+n)),h){const a=`${l}${this.options.contextSeparator||"_"}${t.context}`;i.push(a),p&&(t.ordinal&&e.startsWith(o)&&i.push(a+e.replace(o,this.options.pluralSeparator)),i.push(a+e),d&&i.push(a+n))}}let r;for(;r=i.pop();)this.isValidLookup(n)||(o=r,n=this.getResource(a,e,r,t))}))})}),{res:n,usedKey:a,exactUsedKey:o,usedLng:s,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,a={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,a):this.resourceStore.getResource(e,t,n,a)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!u(e.replace);let a=n?e.replace:e;if(n&&void 0!==e.count&&(a={...a,count:e.count}),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!n){a={...a};for(const e of t)delete a[e]}return a}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class F{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(e){if(!(e=E(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=E(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(u(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}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("languageOnly"===this.options.load||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(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const a=this.getLanguagePartFromCode(e);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(e=>e===a||!(!e.includes("-")&&!a.includes("-"))&&(!(!e.includes("-")||a.includes("-")||e.slice(0,e.indexOf("-"))!==a)||!!(e.startsWith(a)&&a.length>1)))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),u(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),a=[],o=e=>{e&&(this.isSupportedCode(e)?a.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return u(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):u(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{a.includes(e)||o(this.formatLanguageCode(e))}),a}}const V={zero:0,one:1,two:2,few:3,many:4,other:5},D={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class M{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=E("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(n,{type:a})}catch(n){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),D;if(!e.match(/-|_/))return D;const a=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(a,t)}return this.pluralRulesCache[o]=s,s}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>V[e]-V[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const a=this.getRule(e,n);return a?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const U=(e,t,n,a=".",o=!0)=>{let s=((e,t,n)=>{const a=y(e,n);return void 0!==a?a:y(t,n)})(e,t,n);return!s&&o&&u(n)&&(s=O(e,n,a),void 0===s&&(s=O(t,n,a))),s},K=e=>e.replace(/\$/g,"$$$$");class z{constructor(e={}){this.logger=P.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:a,prefix:o,prefixEscaped:s,suffix:i,suffixEscaped:r,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:h,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:N,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==a&&a,this.prefix=o?k(o):s||"{{",this.suffix=i?k(i):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u?k(u):"-",this.unescapeSuffix=this.unescapePrefix?"":c?k(c):"",this.nestingPrefix=p?k(p):d||k("$t("),this.nestingSuffix=h?k(h):g||k(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"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,n,a){let o,s,i;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){const o=U(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...a,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),s=o.shift().trim(),i=o.join(this.formatSeparator).trim();return this.format(U(t,r,s,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...a,...t,interpolationkey:s})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$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=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=void 0!==a?.interpolation?.skipOnVariables?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(i=0;o=t.regex.exec(e);){const n=o[1].trim();if(s=l(n),void 0===s)if("function"==typeof c){const t=c(e,o,a);s=u(t)?t:""}else if(a&&Object.prototype.hasOwnProperty.call(a,n))s="";else{if(p){s=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),s=""}else u(s)||this.useRawValueToEscape||(s=d(s));const r=t.safeValue(s);if(e=e.replace(o[0],K(r)),p?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let a,o,s;const i=(e,t)=>{const n=this.nestingOptionsSeparator;if(!e.includes(n))return e;const a=e.split(new RegExp(`${k(n)}[ ]*{`));let o=`{${a[1]}`;e=a[0],o=this.interpolate(o,s);const i=o.match(/'/g),r=o.match(/"/g);((i?.length??0)%2==0&&!r||(r?.length??0)%2!=0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,e};for(;a=this.nestingRegexp.exec(e);){let r=[];s={...n},s=s.replace&&!u(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const l=/{.*}/s.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(-1!==l&&(r=a[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),a[1]=a[1].slice(0,l)),o=t(i.call(this,a[1].trim(),s),s),o&&a[0]===e&&!u(o))return o;u(o)||(o=d(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),o=""),r.length&&(o=r.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:a[1].trim()}),o.trim())),e=e.replace(a[0],o),this.regexp.lastIndex=0}return e}}const H=e=>{const t={};return(n,a,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s={...s,[o.interpolationkey]:void 0});const i=a+JSON.stringify(s);let r=t[i];return r||(r=e(E(a),o),t[i]=r),r(n)}},B=e=>(t,n,a)=>e(E(n),a)(t);class q{constructor(e={}){this.logger=P.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?H:B;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=H(t)}format(e,t,n,a={}){if(!t)return e;if(null==e)return e;const o=t.split(this.formatSeparator),s=[];for(let e=0;e<o.length;e++){let t=o[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<o.length;)t=`${t}${this.formatSeparator}${o[++e]}`;s.push(t)}return s.reduce((e,t)=>{const{formatName:o,formatOptions:s}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const a=e.split("(");t=a[0].toLowerCase().trim();const o=a[1].slice(0,-1);"currency"!==t||o.includes(":")?"relativetime"!==t||o.includes(":")?o.split(";").forEach(e=>{if(e){const[t,...a]=e.split(":"),o=a.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();n[s]||(n[s]=o),"false"===o&&(n[s]=!1),"true"===o&&(n[s]=!0),isNaN(o)||(n[s]=parseInt(o,10))}}):n.range||(n.range=o.trim()):n.currency||(n.currency=o.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const i=a?.formatParams?.[a.interpolationkey]||{},r=i.locale||i.lng||a.locale||a.lng||n;t=this.formats[o](e,r,{...s,...a,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class J extends ${constructor(e,t,n,a={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=a,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,a.backend,a)}queueLoad(e,t,n,a){const o={},s={},i={},r={};return e.forEach(e=>{let a=!0;t.forEach(t=>{const i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===s[i]&&(s[i]=!0):(this.state[i]=1,a=!1,void 0===s[i]&&(s[i]=!0),void 0===o[i]&&(o[i]=!0),void 0===r[t]&&(r[t]=!0)))}),a||(i[e]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(r)}}loaded(e,t,n){const a=e.split("|"),o=a[0],s=a[1];t&&this.emit("failedLoading",o,s,t),!t&&n&&this.store.addResourceBundle(o,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const i={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:a,k:o}=m(e,t,Object);a[o]=a[o]||[],a[o].push(n)})(n.loaded,[o],s),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,a=0,o=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:a,wait:o,callback:s});this.readingCalls++;const i=(i,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&r&&a<this.maxRetries?setTimeout(()=>{this.read(e,t,n,a+1,2*o,s)},o):s(i,r)},r=this.backend[n].bind(this.backend);if(2!==r.length)return r(e,t,i);try{const n=r(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}}prepareLoading(e,t,n={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();u(e)&&(e=this.languageUtils.toResolveHierarchy(e)),u(t)&&(t=[t]);const o=this.queueLoad(e,t,n,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),a=n[0],o=n[1];this.read(a,o,"read",void 0,void 0,(n,s)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${a} failed`,n),!n&&s&&this.logger.log(`${t}loaded namespace ${o} for language ${a}`,s),this.loaded(e,n,s)})}saveMissing(e,t,n,a,o,s={},i=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const r={...s,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,a,r):l(e,t,n,a),o&&"function"==typeof o.then?o.then(e=>i(null,e)).catch(i):i(null,o)}catch(e){i(e)}else l(e,t,n,a,i,r)}e&&e[0]&&this.store.addResource(e[0],t,n,a)}}else this.logger.warn(`did not save key "${n}" 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!!!")}}const W=()=>({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:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),u(e[1])&&(t.defaultValue=e[1]),u(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),G=e=>(u(e.ns)&&(e.ns=[e.ns]),u(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),u(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),X=()=>{};class Y extends ${constructor(e={},t){var n;if(super(),this.options=G(e),this.services={},this.logger=P,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),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,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(u(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=W();this.options={...n,...this.options,...G(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const a=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?P.init(a(this.modules.logger),this.options):P.init(null,this.options),e=this.modules.formatter?this.modules.formatter:q;const t=new F(this.options);this.store=new C(this.options.resources,this.options);const n=this.services;n.logger=P,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new M(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=a(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new z(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new J(a(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=a(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=a(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new I(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=X),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const o=p(),s=()=>{const e=(e,n)=>{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),o.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),o}loadResources(e,t=X){let n=t;const a=u(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===a?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};if(a)t(a);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const a=p();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=X),this.services.backendConnector.reload(e,t,e=>{a.resolve(),n(e)}),a}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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&R.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;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 n=p();this.emit("languageChanging",e);const a=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,s)=>{s?this.isLanguageChangingTo===e&&(a(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},s=t=>{e||t||!this.services.languageDetector||(t=[]);const n=u(t)?t:t&&t[0],s=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(u(t)?[t]:t);s&&(this.language||a(s),this.translator.language||this.translator.changeLanguage(s),this.services.languageDetector?.cacheUserLanguage?.(s)),this.loadResources(s,e=>{o(e,s)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),n}getFixedT(e,t,n,a){const o=a?.scopeNs,s=(e,t,...a)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(a)):{...t},i.lng=i.lng||s.lng,i.lngs=i.lngs||s.lngs;const r=void 0!==i.ns&&null!==i.ns;i.ns=i.ns||s.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||s.keyPrefix);const l={...this.options,...i};Array.isArray(o)&&!r&&(l.ns=o),"function"==typeof i.keyPrefix&&(i.keyPrefix=A(i.keyPrefix,l));const c=this.options.keySeparator||".";let u;return i.keyPrefix&&Array.isArray(e)?u=e.map(e=>("function"==typeof e&&(e=A(e,l)),`${i.keyPrefix}${c}${e}`)):("function"==typeof e&&(e=A(e,l)),u=i.keyPrefix?`${i.keyPrefix}${c}${e}`:e),this.t(u,i)};return u(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}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 n=t.lng||this.resolvedLanguage||this.languages[0],a=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const s=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(n,e)||a&&!s(o,e)))}loadNamespaces(e,t){const n=p();return this.options.ns?(u(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=p();u(e)&&(e=[e]);const a=this.options.preload||[],o=e.filter(e=>!a.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=a.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(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 t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new F(W());return e.toLowerCase().indexOf("-latn")>1?"ltr":["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"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new Y(e,t);return n.createInstance=Y.createInstance,n}cloneInstance(e={},t=X){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},o=new Y(a);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,a)=>(n[a]={...e[t][a]},n),e[t]),e),{});o.store=new C(e,a),o.services.resourceStore=o.store}if(e.interpolation){const t={...W().interpolation,...this.options.interpolation,...e.interpolation},n={...a,interpolation:t};o.services.interpolator=new z(n)}return o.translator=new I(o.services,a),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(a,t),o.translator.options=a,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 Z=Y.createInstance();Z.createInstance,Z.dir,Z.init,Z.loadResources,Z.reloadResources,Z.use,Z.changeLanguage,Z.getFixedT,Z.t,Z.exists,Z.setDefaultNamespace,Z.hasLoadedNamespace,Z.loadNamespaces,Z.loadLanguages;function Q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,o(a.key),a)}}function te(e,t,n){return t&&ee(e.prototype,t),n&&ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var ne=[],ae=ne.forEach,oe=ne.slice,se=["__proto__","constructor","prototype"];function ie(e,t,n,a){var o=e.read.bind(e);if(2!==o.length)o(t,n,a);else try{var s=o(t,n);s&&"function"==typeof s.then?s.then(function(e){return a(null,e)}).catch(a):a(null,s)}catch(e){a(e)}}var re=function(){return te(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Q(this,e),this.backends=[],this.type="backend",this.allOptions=a,this.init(t,n)},[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return ae.call(oe.call(arguments,1),function(t){if(t)for(var n=0,a=Object.keys(t);n<a.length;n++){var o=a[n];se.indexOf(o)>-1||void 0===e[o]&&(e[o]=t[o])}}),e}(n,this.options||{},{handleEmptyResourcesAsFailed:!0,cacheHitMode:"none",retryOnFailure:!1}),this.allOptions=a,this.options.backends&&this.options.backends.length>1&&(this.allOptions.saveMissing||this.allOptions.updateMissing)&&this.services&&this.services.logger&&this.services.logger.warn("i18next-chained-backend: Using multiple backends in combination with saveMissing/updateMissing is not recommended, as it may trigger based on stale data."),this.options.backends&&this.options.backends.forEach(function(n,o){var s;t.backends[o]=t.backends[o]||((s=n)?"function"==typeof s?new s:s:null),t.backends[o].init(e,t.options.backendOptions&&t.options.backendOptions[o]||{},a)}),this.services&&this.options.reloadInterval&&setInterval(function(){return t.reload()},this.options.reloadInterval)}},{key:"read",value:function(e,t,n){var a=this,o=this.backends.length,s=function(r){if(r>=o)return n(new Error("non of the backend loaded data"),a.options.retryOnFailure);var l=r===o-1,c=a.options.handleEmptyResourcesAsFailed&&!l?0:-1,u=a.backends[r];u.read?ie(u,e,t,function(o,l,p){if(!o&&l&&Object.keys(l).length>c){if(n(null,l,r),i(r-1,l),u.save&&a.options.cacheHitMode&&["refresh","refreshAndUpdateStore"].indexOf(a.options.cacheHitMode)>-1){if(p&&a.options.refreshExpirationTime&&p+a.options.refreshExpirationTime>Date.now())return;var d=a.backends[r+1];d&&d.read&&ie(d,e,t,function(n,o){n||o&&(Object.keys(o).length<=c||(i(r,o),"refreshAndUpdateStore"===a.options.cacheHitMode&&a.services&&a.services.resourceStore&&a.services.resourceStore.addResourceBundle(e,t,o)))})}}else s(r+1)}):s(r+1)},i=function(n,o){if(!(n<0)){var s=a.backends[n];s.save?(s.save(e,t,o),i(n-1,o)):i(n-1,o)}};s(0)}},{key:"create",value:function(e,t,n,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backends.forEach(function(i){if(i.create){var r=i.create.bind(i);if(r.length<6)try{var l;(l=5===r.length?r(e,t,n,a,s):r(e,t,n,a))&&"function"==typeof l.then?l.then(function(e){return o(null,e)}).catch(o):o(null,l)}catch(e){o(e)}else r(e,t,n,a,o,s)}})}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,a=t.languageUtils,o=t.logger,s=n.language;if(!s||"cimode"!==s.toLowerCase()){var i=[],r=function(e){a.toResolveHierarchy(e).forEach(function(e){i.indexOf(e)<0&&i.push(e)})};r(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return r(e)}),i.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(a,s){a&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),a),!a&&s&&o.log("loaded namespace ".concat(e," for language ").concat(t),s),n.loaded("".concat(t,"|").concat(e),a,s)})})})}}}])}();re.type="backend";const le=["__proto__","constructor","prototype"];function ce(e){return"string"==typeof e&&(!(0===e.length||e.length>128)&&(!(le.indexOf(e)>-1)&&(!(e.indexOf("..")>-1)&&(!(e.indexOf("\\")>-1)&&(!/[?#%\s]/.test(e)&&!/[\x00-\x1F\x7F]/.test(e))))))}function ue(e){return!!ce(e)&&!(e.indexOf("/")>-1||e.indexOf("@")>-1)}const pe={lng:ue,ns:function(e){return ce(e)}};function de(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function he(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}const ge=/\{\{(.+?)\}\}/g;function fe(e,t){let n=!1;const a=e.replace(ge,(e,a)=>{const o=a.trim();if(le.indexOf(o)>-1)return e;const s=t[o];if(null==s)return e;const i=pe[o]||ue,r=String(s).split("+");for(const t of r)if(!i(t))return n=!0,e;return r.join("+")});return n?null:a}const me="undefined"!=typeof globalThis?globalThis:void 0!==n.g?n.g:"undefined"!=typeof window?window:void 0;let ve;"function"==typeof fetch?ve=fetch:me&&"function"==typeof me.fetch&&(ve=me.fetch);const ye=he()&&me?me.XMLHttpRequest:void 0,be="function"==typeof ActiveXObject&&me?me.ActiveXObject:void 0,ke=["__proto__","constructor","prototype"],xe=(e,t)=>{if(t&&"object"==typeof t){let n="";for(const e of Object.keys(t))ke.indexOf(e)>-1||(n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},Ne=(e,t,n,a)=>{const o=e=>{if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(a){const s=a(e,t);if(s instanceof Promise)return void s.then(o).catch(n)}"function"==typeof fetch?fetch(e,t).then(o).catch(n):ve(e,t).then(o).catch(n)},Se=(e,t,a,o)=>("function"==typeof a&&(o=a,a=void 0),o=o||(()=>{}),ve&&0!==t.indexOf("file:")?((e,t,a,o)=>{e.queryStringParams&&(t=xe(t,e.queryStringParams));const s={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"undefined"==typeof window&&void 0!==n.g&&void 0!==n.g.process&&n.g.process.versions&&n.g.process.versions.node&&(s["User-Agent"]=`i18next-http-backend (node/${n.g.process.version}; ${n.g.process.platform} ${n.g.process.arch})`),a&&(s["Content-Type"]="application/json");const i="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,r={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:s,...e._omitFetchOptions?{}:i},l="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Ne(t,r,o,l)}catch(n){if(!i||0===Object.keys(i).length||!n.message||n.message.indexOf("not implemented")<0)return o(n);try{Object.keys(i).forEach(e=>{delete r[e]}),Ne(t,r,o,l),e._omitFetchOptions=!0}catch(e){o(e)}}})(e,t,a,o):he()||"function"==typeof ActiveXObject?((e,t,n,a)=>{n&&"object"==typeof n&&(n=xe("",n).slice(1)),e.queryStringParams&&(t=xe(t,e.queryStringParams));try{const o=ye?new ye:new be("MSXML2.XMLHTTP.3.0");o.open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");let s=e.customHeaders;if(s="function"==typeof s?s():s,s)for(const e of Object.keys(s))ke.indexOf(e)>-1||o.setRequestHeader(e,s[e]);o.onreadystatechange=()=>{o.readyState>3&&a(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(e){console&&console.log(e)}})(e,t,a,o):void o(new Error("No fetch and no xhr implementation found!")));var we=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||""}),parseLoadPayload:(e,t)=>{},request:Se,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"},...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){const e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,a,o){let s=this.options.loadPath;var i;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i),s.then(s=>{if(!s)return o(null,{});const i=fe(s,{lng:e.join("+"),ns:n.join("+")});if(null==i){const t=e.map(de).join(", "),a=n.map(de).join(", ");return o(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+t+"] namespaces=["+a+"]"),!1)}this.loadUrl(i,o,t,a)})}loadUrl(e,t,n,a){const o="string"==typeof n?[n]:n,s="string"==typeof a?[a]:a,i=this.options.parseLoadPayload(o,s),r=de(function(e){if("string"!=typeof e||0===e.length)return e;try{const t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,i,(e,o)=>{if(o&&(o.status>=500&&o.status<600||!o.status))return t("failed loading "+r+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return t("failed loading "+r+"; status code: "+o.status,!1);if(!o&&e&&e.message){const n=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>n.indexOf(e)>-1))return t("failed loading "+r+": "+de(e.message),!0)}if(e)return t(e,!1);let s,i;try{s="string"==typeof o.data?this.options.parse(o.data,n,a):o.data}catch(e){i="failed parsing "+r+" to json"}if(i)return t(i,!1);t(null,s)})}create(e,t,n,a,o){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);const s=this.options.parsePayload(t,n,a);let i=0;const r=[],l=[];e.forEach(n=>{let a=this.options.addPath;"function"==typeof this.options.addPath&&(a=this.options.addPath(n,t));const c=fe(a,{lng:n,ns:t});if(null==c)return i+=1,void(o&&i===e.length&&o(r,l));this.options.request(this.options,c,s,(t,n)=>{i+=1,r.push(t),l.push(n),i===e.length&&"function"==typeof o&&o(r,l)})})}reload(){const{backendConnector:e,languageUtils:t,logger:n}=this.services,a=e.language;if(a&&"cimode"===a.toLowerCase())return;const o=[],s=e=>{t.toResolveHierarchy(e).forEach(e=>{o.indexOf(e)<0&&o.push(e)})};s(a),this.allOptions.preload&&this.allOptions.preload.forEach(e=>s(e)),o.forEach(t=>{this.allOptions.ns.forEach(a=>{e.read(t,a,"read",null,null,(o,s)=>{o&&n.warn(`loading namespace ${a} for language ${t} failed`,o),!o&&s&&n.log(`loaded namespace ${a} for language ${t}`,s),e.loaded(`${t}|${a}`,o,s)})})})}};function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}we.type="backend";var je=function(){return te(function e(t){Q(this,e),this.store=t.store},[{key:"setItem",value:function(e,t){if(this.store)try{this.store.setItem(e,t)}catch(e){}}},{key:"getItem",value:function(e,t){if(this.store)try{return this.store.getItem(e,t)}catch(e){}}}])}();var Le=function(){return te(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Q(this,e),this.init(t,n),this.type="backend"},[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.services=e,this.options=Ee(Ee(Ee({},function(){var e=null;try{e=window.localStorage}catch(e){"undefined"!=typeof window&&console.log("Failed to load local storage.",e)}return{prefix:"i18next_res_",expirationTime:6048e5,defaultVersion:void 0,getVersion:void 0,versions:{},store:e}}()),this.options),t),this.storage=new je(this.options)}},{key:"read",value:function(e,t,n){var o=Date.now();if(!this.storage.store)return n(null,null);var s=this.storage.getItem("".concat(this.options.prefix).concat(e,"-").concat(t));if(s)try{s=JSON.parse(s)}catch(e){s=null}if(s&&"object"===a(s)){var i=this.getVersion(e,t);if(s.i18nStamp&&s.i18nStamp+this.options.expirationTime>o&&i===s.i18nVersion){var r=s.i18nStamp;return delete s.i18nVersion,delete s.i18nStamp,n(null,s,r)}}return n(null,null)}},{key:"save",value:function(e,t,n){if(this.storage.store){var a=Ee(Ee({},n),{},{i18nStamp:Date.now()}),o=this.getVersion(e,t);o&&(a.i18nVersion=o),this.storage.setItem("".concat(this.options.prefix).concat(e,"-").concat(t),JSON.stringify(a))}}},{key:"getVersion",value:function(e,t){var n,a=this.options,o=a.getVersion,s=a.versions,i=a.defaultVersion,r=Object.prototype.hasOwnProperty.call(s,e)?s[e]:void 0;return(null===(n=o)||void 0===n?void 0:n(e,t))||r||i}}])}();Le.type="backend";const Pe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},$e=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Ce(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(Pe[n[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){const t=e.indexOf("--\x3e");return{type:"comment",comment:-1!==t?e.slice(4,t):""}}const a=new RegExp($e);let o=null;for(;o=a.exec(e),null!==o;)if(o[0].trim())if(o[1]){const e=o[1].trim();let n=[e,null];const s=e.indexOf("=");s>-1&&(n=[e.slice(0,s),e.slice(s+1)]),t.attrs[n[0]]=n[1],a.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}const Re=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Te=/<\/?([^\s]+?)[/\s>]/,Ae=/^\s*$/,_e=/^(script|style)$/i,Ie="\0",Fe=Object.create(null);function Ve(e){e.forEach(function(e){if("text"!==e.type)if("comment"!==e.type){for(const t in e.attrs){const n=e.attrs[t];"string"==typeof n&&n.indexOf(Ie)>-1&&(e.attrs[t]=n.split(Ie).join("<"))}e.children.length&&Ve(e.children)}else e.comment=e.comment.split(Ie).join("<");else e.content=e.content.split(Ie).join("<")})}function De(e,t){switch(t.type){case"text":return e+t.content;case"tag":{const n=t.voidElement&&"!doctype"!==t.name.toLowerCase()?"/>":">";return e+="<"+t.name+(t.attrs?function(e){const t=[];for(const n in e)null===e[n]?t.push(n):t.push(n+'="'+String(e[n]).replace(/"/g,""")+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+n,t.voidElement?e:e+t.children.reduce(De,"")+"</"+t.name+">"}case"comment":return e+="\x3c!--"+t.comment+"--\x3e"}}var Me={parse:function(e,t){const n=t&&t.components||Fe,a=t&&t.allowedTags;let o=!1;if(a){const t="function"==typeof a?a:function(e){return a.indexOf(e)>-1};let n,s="",i=0;for(Re.lastIndex=0;n=Re.exec(e);){const a=n[0];s+=e.slice(i,n.index);const r=a.match(Te);a.startsWith("\x3c!--")||r&&t(r[1])?(s+=a,i=n.index+a.length):(o=!0,s+=Ie,i=n.index+1,Re.lastIndex=i)}e=s+e.slice(i)}const s=[],i=[];let r,l,c=-1,u=!1,p=0;if(0!==e.indexOf("<")){const t=e.indexOf("<");s.push({type:"text",content:-1===t?e:e.substring(0,t)})}const d=[];let h;for(;h=Re.exec(e);)d.push(h);return d.forEach(function(e,t){const n=e[0];if(!n)return;if(n.startsWith("\x3c!--"))return;let a=0,o=0,s=-1,i=null;for(let e=0;e<n.length;e++){const t=n.charAt(e);i?t===i&&(i=null):'"'===t||"'"===t?i=t:"<"===t?(a++,2===a&&(s=e)):">"===t&&o++}const r=s>-1&&/[a-zA-Z0-9\-!/]/.test(n.charAt(s+1));if(a>o&&r){const e=n.substring(0,s),a=n.substring(e.length);d[t][0]=a,d[t].index+=e.length}}),d.forEach(function(t,a){const o=t[0];if(!o)return;const h=t.index;if(h<p)return;if(u){if(o!=="</"+r.name+">")return;u=!1}const g="/"!==o.charAt(1),f=o.startsWith("\x3c!--"),m=h+o.length,v=e.charAt(m),y=d[a+1];let b,k;if("<"===v&&y){const t=e.substring(m,y.index);b=t.split("<").length>t.split(">").length}if(f){const t=Ce(o);if(c<0)return s.push(t),s;k=i[c],k.children.push(t);const n=e.slice(m,y?y.index:void 0);return n.length>0&&k.children.push({type:"text",content:n}),s}if(g){c++,r=Ce(o),"tag"===r.type&&n[r.name]&&(r.type="component",u=!0);let t=!1;if(!u&&!r.voidElement&&_e.test(r.name)){t=!0,l||(l=e.toLowerCase());const n=l.indexOf("</"+r.name.toLowerCase()+">",m),a=-1===n?e.length:n,o=e.slice(m,a);o&&r.children.push({type:"text",content:o}),p=a}r.voidElement||u||t||!v||"<"===v||r.children.push({type:"text",content:e.slice(m,y?y.index:void 0)}),0===c&&s.push(r),k=i[c-1],k&&k.children.push(r),i[c]=r}if((!g||r.voidElement)&&(c>-1&&(r.voidElement||r.name===o.slice(2,-1))&&(c--,r=-1===c?s:i[c]),!u&&("<"!==v||b)&&v)){k=-1===c?s:i[c].children;const t=y?y.index:-1;let n=e.slice(m,-1===t?void 0:t);Ae.test(n)&&(n=" "),(t>-1&&c+k.length>=0||" "!==n)&&k.push({type:"text",content:n})}}),o&&Ve(s),s},stringify:function(e){return e.reduce(function(e,t){return e+De("",t)},"")}};const Ue=(e,t,n,a)=>{const o=[n,{code:t,...a||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);He(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},Ke={},ze=(e,t,n,a)=>{He(n)&&Ke[n]||(He(n)&&(Ke[n]=new Date),Ue(e,t,n,a))},He=e=>"string"==typeof e,Be=e=>"object"==typeof e&&null!==e,qe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Je={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},We=e=>Je[e],Ge=e=>e.replace(qe,We);let Xe={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ge,transDefaultProps:void 0};const Ye=()=>Xe;let Ze;const Qe=()=>Ze,et=(e,t)=>{if(!e)return!1;const n=e.props?.children??e.children;return t?n.length>0:!!n},tt=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?nt(t):t},nt=e=>Array.isArray(e)?e:[e],at=(e,t,n,a)=>{if(!e)return"";let o="";const s=nt(e),i=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((e,s)=>{if(He(e))o+=`${e}`;else{if((0,l.isValidElement)(e)){const{props:r,type:l}=e,c=Object.keys(r).length,u=i.indexOf(l)>-1,p=r.children;if(!p&&u&&!c)return void(o+=`<${l}/>`);if(!p&&(!u||c)||r.i18nIsDynamicList)return void(o+=`<${s}></${s}>`);if(u&&c<=1){const e=He(p)?p:at(p,t,n,a);return void(o+=`<${l}>${e}</${l}>`)}const d=at(p,t,n,a);return void(o+=`<${s}>${d}</${s}>`)}if(null!==e){if(Be(e)){const{format:t,...s}=e,i=Object.keys(s);if(1===i.length){const e=t?`${i[0]}, ${t}`:i[0];return void(o+=`{{${e}}}`)}return void Ue(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:a,child:e})}Ue(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:a,child:e})}else Ue(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:a})}}),o},ot=(e,t,n,a,o,s,i)=>{if(""===n)return[];const r=o.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(r.map(e=>`<${e}`).join("|")).test(n);if(!(e||t||c||i))return[n];const u=t??{},p=e=>{nt(e).forEach(e=>{He(e)||(et(e)?p(tt(e)):Be(e)&&!(0,l.isValidElement)(e)&&Object.assign(u,e))})};p(e);const d=Object.keys(u),h=Me.parse(`<0>${n}</0>`,{allowedTags:e=>/^\d+$/.test(e)||r.indexOf(e)>-1||d.indexOf(e)>-1}),g={...u,...s},f=(e,t,n)=>{const a=tt(e),o=v(a,t.children,n);return(e=>Array.isArray(e)&&e.every(l.isValidElement))(a)&&0===o.length||e.props?.i18nIsDynamicList?a:o},m=(e,t,n,a,o)=>{e.dummy?(e.children=t,n.push((0,l.cloneElement)(e,{key:a},o?void 0:t))):n.push(...l.Children.map([e],e=>{if(e.type===l.Fragment||void 0!==e.props?.i18nIsDynamicList){const n={key:a};return e&&e.props&&Object.keys(e.props).forEach(t=>{"children"!==t&&"i18nIsDynamicList"!==t&&(n[t]=e.props[t])}),(0,l.createElement)(e.type,n,o?null:t)}const n={key:a};return e&&e.props&&Object.keys(e.props).forEach(t=>{"ref"!==t&&"children"!==t&&(n[t]=e.props[t])}),(0,l.cloneElement)(e,n,o?null:t)}))},v=(e,n,s)=>{const u=nt(e),p=nt(n),d={};return p.reduce((e,n,p)=>{const h=n.children?.[0]?.content&&a.services.interpolator.interpolate(n.children[0].content,g,a.language);if("tag"===n.type){let y=u[parseInt(n.name,10)];!y&&t&&(y=t[n.name]),1!==s.length||y||(y=s[0][n.name]),y||(y={});const b={...n.attrs};i&&Object.keys(b).forEach(e=>{const t=b[e];He(t)&&(b[e]=Ge(t))});const k=0!==Object.keys(b).length?((e,t)=>{const n={...t};return n.props={...t.props,...e.props},n})({props:b},y):y,x=(0,l.isValidElement)(k),N=x&&et(n,!0)&&!n.voidElement,S=c&&Be(k)&&k.dummy&&!x,w=Be(t)&&Object.hasOwnProperty.call(t,n.name);if(He(k)){const t=a.services.interpolator.interpolate(k,g,a.language);e.push(t)}else if(et(k)||N){const t=f(k,n,s);m(k,t,e,p)}else if(S){const t=v(u,n.children,s);m(k,t,e,p)}else if(Number.isNaN(parseFloat(n.name)))if(w){const t=f(k,n,s);m(k,t,e,p,n.voidElement)}else if(o.transSupportBasicHtmlNodes&&r.indexOf(n.name)>-1)if(n.voidElement)e.push((0,l.createElement)(n.name,{key:`${n.name}-${p}`}));else{const t=d[n.name]||0;let a;d[n.name]=t+1;let o=0;for(let e=0;e<u.length;e+=1){const s=u[e];if((0,l.isValidElement)(s)&&s.type===n.name){if(o===t){a=s;break}o+=1}}const i=a?nt(tt(a)):u,r=v(i,n.children,s);e.push((0,l.createElement)(n.name,{key:`${n.name}-${p}`},r))}else if(n.voidElement)e.push(`<${n.name} />`);else{const t=v(u,n.children,s);e.push(`<${n.name}>${t}</${n.name}>`)}else if(Be(k)&&!x){const t=n.children[0]?h:null;t&&e.push(t)}else m(k,h,e,p,1!==n.children.length||!h)}else if("text"===n.type){const t=o.transWrapTextNodes,s="function"==typeof o.unescape?o.unescape:Ye().unescape,r=i?s(a.services.interpolator.interpolate(n.content,g,a.language)):a.services.interpolator.interpolate(n.content,g,a.language);t?e.push((0,l.createElement)(t,{key:`${n.name}-${p}`},r)):e.push(r)}return e},[])},y=v([{dummy:!0,children:e||[]}],h,nt(e||[]));return tt(y[0])},st=(e,t,n)=>{const a=e.key||t,o=(0,l.cloneElement)(e,{key:a});if(!o.props||!o.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return o;return(0,l.createElement)(function(){return(0,l.createElement)(l.Fragment,null,o)},{key:a})},it=(e,t,n,a)=>e?Array.isArray(e)?((e,t)=>e.map((e,n)=>st(e,n,t)))(e,t):Be(e)?((e,t)=>{const n={};return Object.keys(e).forEach(a=>{Object.assign(n,{[a]:st(e[a],a,t)})}),n})(e,t):(ze(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:a}),null):null;function rt({children:e,count:t,parent:n,i18nKey:a,context:o,tOptions:s={},values:i,defaults:r,components:c,ns:u,i18n:p,t:d,shouldUnescape:h,...g}){const f=p||Qe();if(!f)return ze(f,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:a}),e;const m=d||f.t.bind(f)||(e=>e),v={...Ye(),...f.options?.react};let y=u||m.ns||f.options?.defaultNS;y=He(y)?[y]:y||["translation"];const{transDefaultProps:b}=v,k=b?.tOptions?{...b.tOptions,...s}:s,x=h??b?.shouldUnescape,N=b?.values?{...b.values,...i}:i,S=b?.components?{...b.components,...c}:c,w=at(e,v,f,a),O=r||k?.defaultValue||w||v.transEmptyNodeValue||("function"==typeof a?A(a):a),{hashTransKey:E}=v,j=a||(E?E(w||O):w||O);i=f.options?.interpolation?.defaultVariables?N&&Object.keys(N).length>0?{...N,...f.options.interpolation.defaultVariables}:{...f.options.interpolation.defaultVariables}:N;const L=(e=>{const t={};if(!e)return t;const n=e=>{nt(e).forEach(e=>{He(e)||(et(e)?n(tt(e)):Be(e)&&!(0,l.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t})(e);L&&"number"==typeof L.count&&void 0===t&&(t=L.count);const P=i||void 0!==t&&!f.options?.interpolation?.alwaysFormat||!e?k.interpolation:{interpolation:{...k.interpolation,prefix:"#$?",suffix:"?$#"}},$={...k,context:o||k.context,count:t,...i,...P,defaultValue:O,ns:y};let C=j?m(j,$):O;C===j&&O&&(C=O);const R=it(S,C,f,a);let T=R||e,_=null;var I;Be(I=R)&&!Array.isArray(I)&&Object.keys(I).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0)&&(_=R,T=e);const F=ot(T,_,C,f,v,$,x),V=n??v.defaultTransParent;return V?(0,l.createElement)(V,g,F):F}const lt=(0,l.createContext)();function ct({children:e,count:t,parent:n,i18nKey:a,context:o,tOptions:s={},values:i,defaults:r,components:c,ns:u,i18n:p,t:d,shouldUnescape:h,...g}){const{i18n:f,defaultNS:m}=(0,l.useContext)(lt)||{},v=p||f||Qe(),y=d||v?.t.bind(v);return rt({children:e,count:t,parent:n,i18nKey:a,context:o,tOptions:s,values:i,defaults:r,components:c,ns:u||y?.ns||m||v?.options?.defaultNS,i18n:v,t:d,shouldUnescape:h,...g})}class ut extends Error{constructor(e,t,n){super(e),this.name="TranslationParserError",this.position=t,this.translationString=n,Error.captureStackTrace&&Error.captureStackTrace(this,ut)}}const pt={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'","©":"©","®":"®","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"§","¶":"¶","·":"·"," ":" "," ":" "," ":" ","€":"€","£":"£","¥":"¥","¢":"¢","¤":"¤","×":"×","÷":"÷","−":"−","±":"±","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"°","µ":"µ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"� |