dns-worker 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/serverfull.mjs +159 -251
- package/dist/serverfull.mjs.map +4 -4
- package/migrations/0070_add_list_stats_metadata.sql +2 -0
- package/package.json +5 -5
- package/static/assets/{AccountView-DWLPLl2r.js → AccountView-DilMdIu2.js} +4 -4
- package/static/assets/AnalyticsView-mYuaq2d3.js +2 -0
- package/static/assets/{DestinationMap-BFN0JDey.js → DestinationMap-DfE-_-qj.js} +1 -1
- package/static/assets/FilteringView-Rla6nBYN.js +1 -0
- package/static/assets/LogsView-Bi5St4cR.js +5 -0
- package/static/assets/{RulesView-Cdq10tRc.js → RulesView-FQHhXpVf.js} +1 -1
- package/static/assets/SettingsView-gLzsNIju.js +1 -0
- package/static/assets/{SetupView-CLixnmKc.js → SetupView-BUA7BYMb.js} +1 -1
- package/static/assets/{SwipeableDrawer-UY1QWnPj.js → SwipeableDrawer-BHXXZw7l.js} +1 -1
- package/static/assets/SystemView-BbOt5twD.js +1 -0
- package/static/assets/{TrendChart-DAMeH8DG.js → TrendChart-Kzctv9EA.js} +3 -3
- package/static/assets/allPaths-a_Gma8ca.js +1 -0
- package/static/assets/allPathsLoader-sY5nfYNE.js +1 -0
- package/static/assets/browser-xdENJ9hN.js +1 -0
- package/static/assets/date-CuEX0HAJ.js +1 -0
- package/static/assets/de-DE-sdqvOhE2.js +25 -0
- package/static/assets/es-ES-CZMRaxMw.js +25 -0
- package/static/assets/fr-FR-2IQyivXi.js +25 -0
- package/static/assets/index-CxK16i2C.js +30 -0
- package/static/assets/index-frQljXGb.css +2 -0
- package/static/assets/ja-JP-CuCkEZDz.js +25 -0
- package/static/assets/{ko-KR--ebX4PUe.js → ko-KR-CWUU7L79.js} +1 -1
- package/static/assets/ru-RU-DnuUcJXU.js +25 -0
- package/static/assets/services-B-Y_EKlc.js +1 -0
- package/static/assets/splitPathsBySizeLoader-CagJEoij.js +1 -0
- package/static/assets/{sqlite.worker-BQk-r3bK.js → sqlite.worker-RAW9CPiV.js} +2 -2
- package/static/assets/{useLogsE2ee-C5IGsZNu.js → useLogsE2ee-BEETAe5O.js} +1 -1
- package/static/assets/vendor-i18next-J2aoF7F1.js +1 -0
- package/static/assets/{vendor-icons-other-BTYC6Wvz.js → vendor-icons-other-kRhgWBno.js} +2 -2
- package/static/assets/vendor-react-R4_BUhus.js +11 -0
- package/static/assets/vendor-ui-core-CKSrm0Y8.js +1 -0
- package/static/assets/{vendor-utils-Bab4qB3W.js → vendor-utils-y3vK_J_u.js} +1 -1
- package/static/assets/vi-VN-Cyv4XVb4.js +25 -0
- package/static/assets/zh-CN-BFVuQTvF.js +25 -0
- package/static/assets/zh-TW-y_EkxxXD.js +25 -0
- package/static/index.html +7 -7
- package/static/assets/AnalyticsView-DOZ_4PlV.js +0 -2
- package/static/assets/FilteringView-YlS6S19l.js +0 -1
- package/static/assets/LogsView-C5on_f9X.js +0 -5
- package/static/assets/SettingsView-D8Q09eFj.js +0 -1
- package/static/assets/SystemView-0acjSWwE.js +0 -1
- package/static/assets/allPaths-ZKIw3HqD.js +0 -1
- package/static/assets/allPathsLoader-CvGx1ejI.js +0 -1
- package/static/assets/browser-D1bxqOmO.js +0 -1
- package/static/assets/date-Mn7JuCwI.js +0 -1
- package/static/assets/de-DE-ChqTmNoZ.js +0 -25
- package/static/assets/es-ES-DJyD_FHe.js +0 -25
- package/static/assets/fr-FR-BA1vQe8U.js +0 -25
- package/static/assets/index-BlF_HYXE.css +0 -2
- package/static/assets/index-C--PEfmU.js +0 -30
- package/static/assets/ja-JP-ndkxicCP.js +0 -25
- package/static/assets/ru-RU-DOZjzIx2.js +0 -25
- package/static/assets/services-DTfjQuNl.js +0 -1
- package/static/assets/splitPathsBySizeLoader-htHoS0DT.js +0 -1
- package/static/assets/vendor-i18next-DlmslyBB.js +0 -1
- package/static/assets/vendor-react-DYK5a2J9.js +0 -11
- package/static/assets/vendor-ui-core-CodM8CpF.js +0 -1
- package/static/assets/vi-VN-DgVTajq8.js +0 -25
- package/static/assets/zh-CN-C_Po-z3K.js +0 -25
- package/static/assets/zh-TW-C4h6ckgV.js +0 -25
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=e=>typeof e==`string`,t=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},n=e=>e==null?``:String(e),r=t=>e(t)&&/^[A-Za-z0-9_@.-]{1,128}$/.test(t)&&!t.includes(`..`)&&![`__proto__`,`constructor`,`prototype`].includes(t),i=e=>e?.callbackApi??e?.constructor?.callbackApi,a=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},o=/###/g,s=e=>e&&e.includes(`###`)?e.replace(o,`.`):e,c=t=>!t||e(t),l=(t,n,r)=>{let i=e(n)?n.split(`.`):n,a=0;for(;a<i.length-1;){if(c(t))return{};let e=s(i[a]);!t[e]&&r&&(t[e]=new r),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++a}return c(t)?{}:{obj:t,k:s(i[a])}},u=(e,t,n)=>{let{obj:r,k:i}=l(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=l(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=l(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},d=(e,t,n,r)=>{let{obj:i,k:a}=l(e,t,Object);i[a]=i[a]||[],i[a].push(n)},f=(e,t)=>{let{obj:n,k:r}=l(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},p=(e,t,n)=>{let r=f(e,n);return r===void 0?f(t,n):r},m=(t,n,r)=>{for(let i in n)i!==`__proto__`&&i!==`constructor`&&(Object.prototype.hasOwnProperty.call(t,i)?e(t[i])||t[i]instanceof String||e(n[i])||n[i]instanceof String?r&&(t[i]=n[i]):m(t[i],n[i],r):t[i]=n[i]);return t},h=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),g={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},_=t=>e(t)?t.replace(/[&<>"']/g,e=>g[e]):t,v=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},y=[` `,`,`,`?`,`!`,`;`],b=new v(20),x=(e,t,n)=>{t||=``,n||=``;let r=y.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=b.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},S=(e,t,n=`.`)=>{if(!e)return;if(e[t]||!n)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],(typeof t==`function`||a===`__proto__`)&&!Object.prototype.hasOwnProperty.call(i,a)&&(t=void 0),t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},C=e=>e?.replace(/_/g,`-`),w={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)}},T=class t{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||w,this.options=t,this.debug=t.debug,this.seen=new Set}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)}once(e,t,...n){return!this.debug||this.seen.has(e)||this.seen.size>=1e3?null:(this.seen.add(e),this[t](...n))}forward(t,n,r,i){return i&&!this.debug?null:(t=t.map(t=>e(t)?t.replace(/[\r\n\x00-\x1F\x7F]/g,` `):t),e(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(e){return new t(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e||=this.options,e.prefix=e.prefix||this.prefix,new t(this.logger,e)}},E=new T,D=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){(typeof e==`string`?e.split(` `):[e]).forEach(e=>{if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}})}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},O=new WeakSet,k=(t,...n)=>{if(n.some(t=>!e(t)))throw TypeError(`${t}: pass language, namespace${t===`addResource`?` and key`:``} as separate strings; the dotted form ('en.translation.key') was removed in i18next v27`)},A=class extends D{constructor(e,t={ns:[`translation`],defaultNS:`translation`},n=E){super(),this.data=e||{},this.options=t,this.logger=n.create(`resourceStore`),this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(t,n,r,i={}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=i.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:i.ignoreJSONStructure,s=[t,n];r&&(Array.isArray(r)?s.push(...r):e(r)&&a?s.push(...r.split(a)):s.push(r));let c=f(this.data,s);return c!=null||!o||!e(r)?c:S(this.data?.[t]?.[n],r,a)}addResource(e,t,n,r,i={silent:!1}){k(`addResource`,e,t,n);let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),this.addNamespaces(t),u(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){k(`addResources`,e,t),Object.keys(n||{}).forEach(r=>{r===`__proto__`||r===`constructor`||this.addResource(e,t,r,n[r],{silent:!0})}),r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){k(`addResourceBundle`,e,t);let o=[e,t];this.addNamespaces(t);let s=f(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?m(s,n,i):s={...s,...n},u(this.data,o,s),a.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 this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{let n=t[e];return O.has(n)?!0:!n||Object.keys(n).length===0?!1:(typeof n==`object`&&O.add(n),!0)})}toJSON(){return this.data}},j=Symbol(`i18next/PATH_KEY`);function ee(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===j?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function M(e,t){let{[j]:n}=e(ee()),r=t?.keySeparator||`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var N=t=>!e(t)&&typeof t!=`boolean`&&typeof t!=`number`,P=class t extends D{constructor(e,t={}){super(),a([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`,`postProcessors`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=(e.logger||E).create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=N(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(t,n){let r=n.nsSeparator===void 0?this.options.nsSeparator:n.nsSeparator;r===void 0&&(r=`:`);let i=n.keySeparator===void 0?this.options.keySeparator:n.keySeparator,a=n.ns||this.options.defaultNS||[],o=r&&t.includes(r),s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!x(t,r,i);if(o&&!s){let n=t.match(this.interpolator.nestingRegexp);if(n&&n.length>0)return{key:t,namespaces:e(a)?[a]:a};let o=t.split(r);(r!==i||r===i&&this.options.ns.includes(o[0]))&&(a=o.shift()),t=o.join(i)}return{key:t,namespaces:e(a)?[a]:a}}translate(n,r,i){let a=typeof r==`object`?{...r}:r;if(typeof a!=`object`&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a==`object`&&(a={...a}),a||={},n==null)return``;typeof n==`function`&&(n=M(n,{...this.options,...a})),Array.isArray(n)||(n=[String(n)]),n=n.map(e=>typeof e==`function`?M(e,{...this.options,...a}):String(e));let o=a.returnDetails===void 0?this.options.returnDetails:a.returnDetails,s=a.keySeparator===void 0?this.options.keySeparator:a.keySeparator,{key:c,namespaces:l}=this.extractFromKey(n[n.length-1],a),u=l[l.length-1],d=a.nsSeparator===void 0?this.options.nsSeparator:a.nsSeparator;d===void 0&&(d=`:`);let f=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()===`cimode`)return p?o?{res:`${u}${d}${c}`,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${d}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:c;let m=this.resolve(n,a),h=m?.res,g=m?.usedKey||c,_=m?.exactUsedKey||c,v=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=a.joinArrays===void 0?this.options.joinArrays:a.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=a.count!==void 0&&!e(a.count),S=t.hasDefaultValue(a),C=x?this.pluralResolver.getSuffix(f,a.count,a):``,w=a.ordinal&&x?this.pluralResolver.getSuffix(f,a.count,{ordinal:!1}):``,T=x&&!a.ordinal&&a.count===0,E=T&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${C}`]||a[`defaultValue${w}`]||a.defaultValue,D=h;b&&!h&&S&&(D=E);let O=N(D),k=Object.prototype.toString.apply(D),A=b&&D&&O&&!v.includes(k)&&!(e(y)&&Array.isArray(D)),j=A&&!a.returnObjects&&!this.options.returnObjects;if(j&&this.options.returnedObjectHandler){let e=this.options.returnedObjectHandler(g,D,{...a,ns:l});return o?(m.res=e,m.usedParams=this.getUsedParamsDetails(a),m):e}if(j&&this.logger.warn(`accessing an object - but returnObjects options is not enabled!`),A&&!j){if(s){let e=Array.isArray(D),t=e?[]:{},n=e?_:g;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${s}${e}`;S&&!h?t[e]=this.translate(r,{...a,defaultValue:N(E)?E[e]:void 0,joinArrays:!1,ns:l}):t[e]=this.translate(r,{...a,joinArrays:!1,ns:l}),t[e]===r&&(t[e]=D[e])}h=t}}else if(b&&e(y)&&Array.isArray(h))h=h.join(y),h&&=this.extendTranslation(h,n,a,m,i);else{let e=!1,t=!1;j&&(h=void 0),!this.isValidLookup(h)&&S&&!(j&&N(E))&&(e=!0,h=E),!this.isValidLookup(h)&&!(e&&h===``)&&(t=!0,h=c);let r=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&t?void 0:h,o=S&&E!==h&&this.options.updateMissing;if(!j&&(t||e||o)){if(this.logger.log(o?`updateKey`:`missingKey`,f,u,x&&!o?`${c}${this.pluralResolver.getSuffix(f,a.count,a)}`:c,o?E:h),s){let e=this.resolve(c,{...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=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);let n=(e,t,n)=>{let i=S&&n!==h?n:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,t,i,o,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,u,t,i,o,a,void 0,this.utils?.hasLoadedNamespace),this.emit(`missingKey`,e,u,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,a);T&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],c+t,a[`defaultValue${t}`]||E)})}):n(e,c,E))}h=this.extendTranslation(h,n,a,m,i),t&&h===c&&this.options.appendNamespaceToMissingKey&&(h=`${u}${d}${c}`),(t||e)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${c}`:c,e?h:void 0,a))}return o?(m.res=h,m.usedParams=this.getUsedParamsDetails(a),m):h}extendTranslation(t,n,r,i,a){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});let o=e(t)&&(r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables),s;if(o){let e=t.match(this.interpolator.nestingRegexp);s=e&&e.length}let c=r.replace&&!e(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),t=this.interpolator.interpolate(t,c,r.lng||this.language||i.usedLng,r),o){let e=t.match(this.interpolator.nestingRegexp),n=e&&e.length;s<n&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...e)=>a?.[0]===e[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${n[0]}`),null):this.translate(...e,n),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,s=e(o)?[o]:o;if(t!=null&&s?.length&&r.applyPostProcessor!==!1){let e=this.options?.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r;s.forEach(r=>{let i=this.postProcessors?.[r];if(!i){this.logger.once(`postProcess:${r}`,`warn`,`postProcess: '${r}' is not registered on this i18next instance; call use() with it on this instance`);return}t=i.process(t,n,e,this)??t})}return t}resolve(t,n={}){let r,i,a,o,s;return e(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(e=>typeof e==`function`?M(e,{...this.options,...n}):e)),t.forEach(t=>{if(this.isValidLookup(r))return;let c=this.extractFromKey(t,n),l=c.key;i=l;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let d=n.count!==void 0&&!e(n.count),f=d&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(e(n.context)||typeof n.context==`number`)&&n.context!==``,m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);u.forEach(e=>{this.isValidLookup(r)||(s=e,!this.checkedLoadedFor[`${m[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${m[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(`, `)}" won't get resolved as namespace "${s}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),m.forEach(t=>{if(this.isValidLookup(r))return;o=t;let i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,l,t,e,n);else{let e;d&&(e=this.pluralResolver.getSuffix(t,n.count,n));let r=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(n.ordinal&&e.startsWith(a)&&i.push(l+e.replace(a,this.options.pluralSeparator)),i.push(l+e),f&&i.push(l+r)),p){let t=`${l}${this.options.contextSeparator||`_`}${n.context}`;i.push(t),d&&(n.ordinal&&e.startsWith(a)&&i.push(t+e.replace(a,this.options.pluralSeparator)),i.push(t+e),f&&i.push(t+r))}}let s;for(;s=i.pop();)this.isValidLookup(r)||(a=s,r=this.getResource(t,e,s,n))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(t={}){let n=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],r=t.replace&&!e(t.replace),i=r?t.replace:t;if(r&&t.count!==void 0&&(i={...i,count:t.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(let e of n)delete i[e]}return i}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},F=class{constructor(e,t=E){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=t.create(`languageUtils`),this.resolveHierarchyCache={},this.formattedCodes=new Map}clearCache(){this.resolveHierarchyCache={},this.formattedCodes.clear()}getScriptPartFromCode(e){if(e=C(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=C(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(t){if(!e(t))return t;let n=this.formattedCodes.get(t);return n===void 0?(n=this.formatUncached(t),this.formattedCodes.size>=1e3&&this.formattedCodes.clear(),this.formattedCodes.set(t,n),n):n}formatUncached(e){let t=e.includes(`-`);if(t||this.options.cleanCode!==!1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}if(n&&(t||n.toLowerCase()===e.toLowerCase()))return this.options.lowerCaseLng?n.toLowerCase():n;if(n)return e.toLowerCase()}return this.options.lowerCaseLng||this.options.cleanCode&&!t?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(t,n){if(!t)return[];if(typeof t==`function`&&(t=t(n)),e(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||=t[this.getScriptPartFromCode(n)],r||=t[this.formatLanguageCode(n)],r||=t[this.getLanguagePartFromCode(n)],r||=t.default,r||[]}toResolveHierarchy(t,n){let r=this.options.fallbackLng,i=Array.isArray(r)?r.join(`|`):r;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);let a=n===void 0||n===!1||e(n),o=n===void 0&&typeof this.options.fallbackLng==`function`,s=e(t)&&a&&!o,c=null;if(s){let e;e=n===void 0?`undefined`:n===!1?`boolean:false`:`string:${n}`,c=`${t.length}:${t}|${e}`}if(c!==null){let e=this.resolveHierarchyCache[c];if(e!==void 0)return e.slice()}let l=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),u=[],d=e=>{e&&(this.isSupportedCode(e)?u.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return e(t)&&(t.includes(`-`)||t.includes(`_`))?(this.options.load!==`languageOnly`&&d(this.formatLanguageCode(t)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&d(this.getScriptPartFromCode(t)),this.options.load!==`currentOnly`&&d(this.getLanguagePartFromCode(t))):e(t)&&d(this.formatLanguageCode(t)),l.forEach(e=>{let t=this.formatLanguageCode(e);u.includes(t)||d(t)}),c===null?u:(this.resolveHierarchyCache[c]=u,u.slice())}},I={zero:0,one:1,two:2,few:3,many:4,other:5},L={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},te=class{constructor(e,t={},n=E){this.languageUtils=e,this.options=t,this.logger=n.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=C(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),L;if(!e.match(/-|_/))return L;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return 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||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>I[e]-I[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},R=(t,n,r,i=`.`,a=!0)=>{let o=p(t,n,r);return o==null&&a&&e(r)&&(o=S(t,r,i),o===void 0&&(o=S(n,r,i))),o},z=class{constructor(e={},t=E){this.logger=t.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,suffix:a,formatSeparator:o,unescapeSuffix:s,unescapePrefix:c,nestingPrefix:l,nestingSuffix:u,nestingOptionsSeparator:d,maxReplaces:f,alwaysFormat:p}=e.interpolation;this.escape=t===void 0?_:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?h(i):`{{`,this.suffix=a?h(a):`}}`,this.formatSeparator=o||`,`,this.unescapePrefix=s?``:c?h(c):`-`,this.unescapeSuffix=this.unescapePrefix?``:s?h(s):``,this.nestingPrefix=h(l||`$t(`),this.nestingSuffix=h(u||`)`),this.nestingOptionsSeparator=d||`,`,this.maxReplaces=f||1e3,this.alwaysFormat=p===void 0?!1:p,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let 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(t,r,i,a){let o,s,c,l=t,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=e=>{if(!e.includes(this.formatSeparator)){let t=R(r,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(t,void 0,i,{...a,...r,interpolationkey:e}):t}let t=e.split(this.formatSeparator),n=t.shift().trim(),o=t.join(this.formatSeparator).trim();return this.format(R(r,u,n,this.options.keySeparator,this.options.ignoreJSONStructure),o,i,{...a,...r,interpolationkey:n})};this.resetRegExp(),!this.escapeValue&&typeof t==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&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.`);let f=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:a.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}],h=[],g=0;return m.forEach(r=>{for(c=0;o=r.regex.exec(t);){let i=o.index-g,u=h.find(([e,t])=>i>=e&&i<t);if(u){r.regex.lastIndex=u[1]+g;continue}let m=o[1].trim();if(s=d(m),s===void 0)if(typeof f==`function`){let n=f(t,o,a);s=e(n)?n:``}else if(a&&Object.prototype.hasOwnProperty.call(a,m))s=``;else if(p){this.logger.debug&&this.logger.once(`${l}\u0000${o[0]}`,`warn`,`missed to pass in variable ${m} for interpolating ${l}`),s=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),s=``;else !e(s)&&!this.useRawValueToEscape&&(s=n(s));let _=n(r.safeValue(s));if(t=t.slice(0,o.index)+_+t.slice(o.index+o[0].length),p?(r.regex===this.regexpUnescape?h.push([o.index,o.index+_.length]):g+=_.length-o[0].length,r.regex.lastIndex+=_.length,r.regex.lastIndex-=o[0].length):r.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,r,i={}){let a,o,s,c=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${h(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,s);let a=i.match(/'/g),o=i.match(/"/g);((a?.length??0)%2==0&&!o||(o?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{s=JSON.parse(i),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,e},l=new RegExp(this.nestingRegexp),u=``,d=0;for(;a=l.exec(t);){let f=[];s={...i},s=s.replace&&!e(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let p=/{.*}/s.test(a[1])?a[1].lastIndexOf(`}`)+1:a[1].indexOf(this.formatSeparator);if(p!==-1&&(f=a[1].slice(p).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),a[1]=a[1].slice(0,p)),o=r(c.call(this,a[1].trim(),s),s),o&&a[0]===t&&!e(o))return o;e(o)||(o=n(o)),o||=(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),``),f.length&&(o=f.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:a[1].trim()}),o.trim())),u+=t.slice(d,a.index)+n(o),d=l.lastIndex,this.regexp.lastIndex=0}return d?u+t.slice(d):t}},ne=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},re=1e3,B=e=>{let t=new Map;return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o;try{o=r+JSON.stringify(a)}catch{return e(C(r),i)(n)}let s=t.get(o);return s||(s=e(C(r),i),t.size>=re&&t.delete(t.keys().next().value),t.set(o,s)),s(n)}},ie=e=>(t,n,r)=>e(C(n),r)(t),ae=class{constructor(e={}){this.logger=E.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){e?.logger?.create&&(this.logger=e.logger.create(`formatter`)),this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?B:ie;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let 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()]=B(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=ne(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},oe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},se=class extends D{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=(n.logger||E).create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r),this.callbackApi=i(this.backend),this.backend&&this.callbackApi===void 0&&(this.backend.read||this.backend.create)&&this.logger.deprecate(`backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated`)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:!n.reload&&this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{d(n.loaded,[i],a),oe(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(this.callbackApi===!1||this.callbackApi===void 0&&s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),i&&i();e(t)&&(t=this.languageUtils.toResolveHierarchy(t)),e(n)&&(n=[n]);let a=this.queueLoad(t,n,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.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=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{},s=this.newestCloneHasLoadedNamespace||this.services?.utils?.hasLoadedNamespace){if(s&&!s(t)){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!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(this.callbackApi===!1||this.callbackApi===void 0&&c.length<6)try{let i;i=this.callbackApi===!1||c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},V=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:!1,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:!1,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let n={};if(typeof t[1]==`object`&&(n=t[1]),e(t[1])&&(n.defaultValue=t[1]),e(t[2])&&(n.tDescription=t[2]),typeof t[2]==`object`||typeof t[3]==`object`){let e=t[3]||t[2];Object.keys(e).forEach(t=>{n[t]=e[t]})}return n},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),H=t=>(e(t.ns)&&(t.ns=[t.ns]),e(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),e(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes(`cimode`)&&(t.supportedLngs=t.supportedLngs.concat([`cimode`])),t),U=()=>{},W=e=>{let t=V(),n={...t,...e};return n.interpolation={...t.interpolation,...e.interpolation},typeof n.overloadTranslationOptionHandler!=`function`&&(n.overloadTranslationOptionHandler=t.overloadTranslationOptionHandler),n},G=t=>{let n=[].concat(t.supportedLngs||[],t.preload||[]);n.push(...Object.keys(t.resources||{}));let r=t.fallbackLng;return e(r)||Array.isArray(r)?n.push(...[].concat(r)):r&&typeof r==`object`&&Object.keys(r).forEach(e=>{e!==`default`&&n.push(e),n.push(...[].concat(r[e]))}),n},K=(t,n)=>!e(n)||r(n)||t.configuredLngs?.has(n)?!1:(t.logger.once(`lng:${n}`,`warn`,`refused the language code '${n.slice(0,64)}' from lng, changeLanguage(), the language detector or loadLanguages(): it is not configured and has other characters than letters, digits, '-', '_', '@' and '.' (or '..', or more than 128). List it in supportedLngs to use it`),!0),ce=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},q=class n extends D{constructor(e={},t){if(super(),this.userOptions=H(e),this.options=W(this.userOptions),this.services={postProcessors:Object.create(null)},this.logger=new T(null,this.options),this.modules={external:[]},ce(this),t&&!this.isInitialized&&!e.isClone){if(!this.userOptions.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(n={},r){this.isInitializing=!0,typeof n==`function`&&(r=n,n={}),n.defaultNS==null&&n.ns&&(e(n.ns)?n.defaultNS=n.ns:n.ns.includes(`translation`)||(n.defaultNS=n.ns[0])),H(n);let a={...this.userOptions,...n};this.options=W({...this.options,...n}),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator),this.options.isClone||(this.configuredLngs=new Set([...this.configuredLngs||[],...G(a)]));let o=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.logger.init(o(this.modules.logger),this.options);let{logger:e}=this;this.pendingWarnings?.forEach(e=>this.logger.warn(e)),this.pendingWarnings=void 0;let t;t=this.modules.formatter?this.modules.formatter:ae;let n=new F(this.options,e);this.store=new A(this.options.resources,this.options,e);let r=this.services;r.logger=e,r.resourceStore=this.store,r.languageUtils=n,r.pluralResolver=new te(n,{prepend:this.options.pluralSeparator},e),t&&(r.formatter=o(t),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new z(this.options,e),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this),reloadResources:this.reloadResources.bind(this)},r.backendConnector=new se(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options),r.languageDetector.async&&i(r.languageDetector)===void 0&&this.logger.deprecate(`languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated`)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new P(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,r||=U,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(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)});let s=t(),c=()=>{let e=(e,t)=>{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),s.resolve(t),r(e,t)};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?c():setTimeout(c,0),s}loadResources(t,n=U){let r=n,i=e(t)?t:this.language;if(typeof t==`function`&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return r();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};i?t(i):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),r(e)})}else r(null)}reloadResources(e,n,r){let i=t();if(typeof e==`function`&&(r=e,e=void 0),typeof n==`function`&&(r=n,n=void 0),!e){let t=Object.keys(this.services.backendConnector.state).map(e=>e.split(`|`)[0]);e=[...new Set([...this.languages||[],...t])].filter(e=>e!==`cimode`)}return n||=this.options.ns,r||=U,this.services.backendConnector.reload(e,n,e=>{i.resolve(),r(e)}),i}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);let t=t=>{if(this.modules[t]&&this.modules[t]!==e){let e=`use: this ${t} replaces the ${t} passed to an earlier use() call; only one ${t} is used per instance`;this.isInitializing||this.isInitialized?this.logger.warn(e):(this.pendingWarnings=this.pendingWarnings||[]).push(e)}this.modules[t]=e};return e.type===`backend`&&t(`backend`),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&t(`languageDetector`),e.type===`i18nFormat`&&t(`i18nFormat`),e.type===`postProcessor`&&(this.services.postProcessors[e.name]=e),e.type===`formatter`&&t(`formatter`),e.type===`3rdParty`&&this.modules.external.push(e),this}hydrate(e,t){return this.options.isClone?this:this.services.resourceStore?(e&&!this.initializedStoreOnce&&(this.services.resourceStore.data=e,Object.values(e).forEach(e=>{Object.keys(e).forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)})}),this.initializedStoreOnce=!0,this.isInitialized=!0),t&&!this.initializedLanguageOnce&&(this.changeLanguage(t),this.initializedLanguageOnce=!0),this):(this.logger.warn(`hydrate: call init() first, the instance has no resource store yet`),this)}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let 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(n,r){this.isLanguageChangingTo=n;let a=t();this.emit(`languageChanging`,n);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},s=(e,t)=>{t?this.isLanguageChangingTo===n&&(o(t),this.translator.changeLanguage(t),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,t),this.logger.log(`languageChanged`,t)):this.isLanguageChangingTo=void 0,a.resolve((...e)=>this.t(...e)),r&&r(e,(...e)=>this.t(...e))},c=t=>{!n&&!t&&this.services.languageDetector&&(t=[]);let{supportedLngs:r}=this.options;if(t&&!r){let e=[].concat(t).filter(e=>!K(this,e));e.length<[].concat(t).length&&(t=e)}let i=e(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(i)?i:this.services.languageUtils.getBestMatchFromCodes(e(t)?[t]:t);r&&K(this,a)&&(a=this.services.languageUtils.getBestMatchFromCodes([])),a&&(this.language||o(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{s(e,a)})};if(!n&&this.services.languageDetector&&!this.services.languageDetector.async)c(this.services.languageDetector.detect());else if(!n&&this.services.languageDetector&&this.services.languageDetector.async){let e=i(this.services.languageDetector);e===!1||e===void 0&&this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c)}else c(n);return a}getFixedT(t,n,r,i){let a=i?.scopeNs,o=(e,t,...n)=>{let i;i=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(n)),i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs;let s=i.ns!==void 0&&i.ns!==null;i.ns=i.ns||o.ns,i.keyPrefix!==``&&(i.keyPrefix=i.keyPrefix||r||o.keyPrefix);let c={...this.options,...i};Array.isArray(a)&&!s&&(c.ns=a),typeof i.keyPrefix==`function`&&(i.keyPrefix=M(i.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return i.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=M(e,c)),`${i.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=M(e,c)),u=i.keyPrefix?`${i.keyPrefix}${l}${e}`:e),this.t(u,i)};return e(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...e){return this.translator?this.translator.translate(...e):(this.logger.warn(`t: called before init(); returning an empty string`),``)}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;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}if(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;let{languageUtils:o}=this.services,s=t.lng?o.isSupportedCode(n)&&o.toResolveHierarchy(n,!1)[0]:n;return!!((!s||a(s,e))&&(!r||a(i,e)))}loadNamespaces(n,r){let i=t();return!this.options.ns||!this.services.backendConnector?(r&&r(),Promise.resolve()):(e(n)&&(n=[n]),n.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{i.resolve(),r&&r(e)}),i)}loadLanguages(n,r){let i=t();e(n)&&(n=[n]);let a=this.options.preload||[],o=n.filter(e=>!a.includes(e)&&!K(this,e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=a.concat(o),this.loadResources(e=>{i.resolve(),r&&r(e)}),i):(r&&r(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`ltr`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new F(V());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(e={},t){let r=new n(e,t);return r.createInstance=n.createInstance,r}cloneInstance(e={},t=U){let r=e.forkResourceStore;r&&(e={...e},delete e.forkResourceStore);let i={...this.options,preload:!1,...e,isClone:!0},a=new n(i);if(a.logger=e.debug!==void 0||e.prefix!==void 0?this.logger.clone(e):this.logger,[`store`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.postProcessors=Object.create(this.services.postProcessors),a.services.utils={...a.services.utils,hasLoadedNamespace:a.hasLoadedNamespace.bind(a),reloadResources:a.reloadResources.bind(a)},r){let e=t=>{let n=Array.isArray(t)?[...t]:{...t};return Object.keys(n).forEach(t=>{n[t]&&typeof n[t]==`object`&&(n[t]=e(n[t]))}),n};a.store=new A(e(this.store.data),i,this.logger),a.services.resourceStore=a.store}if(e.interpolation){let t={...V().interpolation,...this.options.interpolation,...e.interpolation},n={...i,interpolation:t};a.services.interpolator=new z(n,this.logger)}return a.configuredLngs=new Set([...this.configuredLngs||[],...G(e)]),a.translator=new P(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,t),a.translator.options=i,a.translator.backendConnector.newestCloneHasLoadedNamespace=a.hasLoadedNamespace.bind(a),a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();q.createInstance,q.dir,q.init,q.loadResources,q.reloadResources,q.use,q.changeLanguage,q.getFixedT;var le=q.t;q.exists,q.setDefaultNamespace,q.hasLoadedNamespace,q.loadNamespaces,q.loadLanguages;var{slice:ue,forEach:de}=[];function fe(e){return de.call(ue.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function pe(e){return typeof e==`string`&&/^[A-Za-z0-9_@.-]{1,128}$/.test(e)&&e.indexOf(`..`)<0&&[`__proto__`,`constructor`,`prototype`].indexOf(e)<0}var J=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,me=(e,t,n={path:`/`})=>{let r=n,i=`${e}=${encodeURIComponent(t)}`;if(r.maxAge>0){let e=r.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);i+=`; Max-Age=${Math.floor(e)}`}if(r.domain){if(!J.test(r.domain))throw TypeError(`option domain is invalid`);i+=`; Domain=${r.domain}`}if(r.path){if(!J.test(r.path))throw TypeError(`option path is invalid`);i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+=`; HttpOnly`),r.secure&&(i+=`; Secure`),r.sameSite)switch(typeof r.sameSite==`string`?r.sameSite.toLowerCase():r.sameSite){case!0:i+=`; SameSite=Strict`;break;case`lax`:i+=`; SameSite=Lax`;break;case`strict`:i+=`; SameSite=Strict`;break;case`none`:i+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return r.partitioned&&(i+=`; Partitioned`),i},Y={create(e,t,n,r,i={path:`/`,sameSite:`strict`}){n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=me(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},he={name:`cookie`,lookup({lookupCookie:e}){if(e&&typeof document<`u`)return Y.read(e)||void 0},cacheUserLanguage(e,{lookupCookie:t,cookieMinutes:n,cookieDomain:r,cookieOptions:i}){t&&typeof document<`u`&&Y.create(t,e,n,r,i)}},ge={name:`querystring`,lookup({lookupQuerystring:e}){let t;if(typeof window<`u`){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(n=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=n.substring(1).split(`&`);for(let n=0;n<r.length;n++){let i=r[n].indexOf(`=`);i>0&&r[n].substring(0,i)===e&&(t=r[n].substring(i+1))}}return t}},_e={name:`hash`,lookup({lookupHash:e,lookupFromHashIndex:t}){let n;if(typeof window<`u`){let{hash:r}=window.location;if(r&&r.length>2){let i=r.substring(1);if(e){let t=i.split(`&`);for(let r=0;r<t.length;r++){let i=t[r].indexOf(`=`);i>0&&t[r].substring(0,i)===e&&(n=t[r].substring(i+1))}}if(n)return n;if(!n&&t>-1){let e=r.match(/\/([a-zA-Z][a-zA-Z0-9-]*)?/g);return Array.isArray(e)?e[typeof t==`number`?t:0]?.replace(`/`,``):void 0}}}return n}},X=null,Z=()=>{if(X!==null)return X;try{if(X=typeof window<`u`&&window.localStorage!==null,!X)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{X=!1}return X},ve={name:`localStorage`,lookup({lookupLocalStorage:e}){if(e&&Z())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(e,{lookupLocalStorage:t}){t&&Z()&&window.localStorage.setItem(t,e)}},Q=null,ye=()=>{if(Q!==null)return Q;try{if(Q=typeof window<`u`&&window.sessionStorage!==null,!Q)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{Q=!1}return Q},be={name:`sessionStorage`,lookup({lookupSessionStorage:e}){if(e&&ye())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(e,{lookupSessionStorage:t}){t&&ye()&&window.sessionStorage.setItem(t,e)}},xe={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Se={name:`htmlTag`,lookup({htmlTag:e}){let t,n=e||(typeof document<`u`?document.documentElement:null);return n&&typeof n.getAttribute==`function`&&(t=n.getAttribute(`lang`)),t}},Ce={name:`path`,lookup({lookupFromPathIndex:e}){if(typeof window>`u`)return;let t=window.location.pathname.match(/\/([a-zA-Z][a-zA-Z0-9-]*)?/g);if(Array.isArray(t))return t[typeof e==`number`?e:0]?.replace(`/`,``)}},we={name:`subdomain`,lookup({lookupFromSubdomainIndex:e}){let t=typeof e==`number`?e:0,n=typeof window<`u`&&window.location?.hostname?.split(`.`).slice(t).join(`.`),r=n&&n.match(/^(\w{2,5}(?:-(?:[a-z]{4}|[a-z]{2}|\d{3}))*)\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[1]}},Te=!1;try{document.cookie,Te=!0}catch{}var Ee=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];Te||Ee.splice(1,1);var De=()=>({order:Ee,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),$=class{constructor(e,t={}){this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(e={languageUtils:{}},t={},n={}){this.services=e,this.options=fe(t,this.options||{},De()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(he),this.addDetector(ge),this.addDetector(ve),this.addDetector(be),this.addDetector(xe),this.addDetector(Se),this.addDetector(Ce),this.addDetector(we),this.addDetector(_e)}addDetector(e){return this.detectors[e.name]=e,this}detect(e=this.options.order){let t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>pe(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e,t=this.options.caches){t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};$.type=`languageDetector`;export{le as i,q as n,M as r,$ as t};
|