@aidc-toolkit/utility 1.0.46-beta → 1.0.46
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/index.cjs +17 -0
- package/dist/index.d.cts +699 -0
- package/dist/index.d.ts +699 -26
- package/dist/index.js +1 -9
- package/package.json +3 -3
- package/src/version.ts +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
- package/dist/character-set.d.ts +0 -242
- package/dist/character-set.d.ts.map +0 -1
- package/dist/character-set.js +0 -542
- package/dist/character-set.js.map +0 -1
- package/dist/exclusion.d.ts +0 -26
- package/dist/exclusion.d.ts.map +0 -1
- package/dist/exclusion.js +0 -18
- package/dist/exclusion.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/iterable-utility.d.ts +0 -39
- package/dist/iterable-utility.d.ts.map +0 -1
- package/dist/iterable-utility.js +0 -35
- package/dist/iterable-utility.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -33
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -32
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -33
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -32
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -34
- package/dist/locale/i18n.js.map +0 -1
- package/dist/record.d.ts +0 -37
- package/dist/record.d.ts.map +0 -1
- package/dist/record.js +0 -58
- package/dist/record.js.map +0 -1
- package/dist/reg-exp.d.ts +0 -40
- package/dist/reg-exp.d.ts.map +0 -1
- package/dist/reg-exp.js +0 -55
- package/dist/reg-exp.js.map +0 -1
- package/dist/sequence.d.ts +0 -45
- package/dist/sequence.d.ts.map +0 -1
- package/dist/sequence.js +0 -96
- package/dist/sequence.js.map +0 -1
- package/dist/string.d.ts +0 -25
- package/dist/string.d.ts.map +0 -1
- package/dist/string.js +0 -2
- package/dist/string.js.map +0 -1
- package/dist/transformer.d.ts +0 -191
- package/dist/transformer.d.ts.map +0 -1
- package/dist/transformer.js +0 -459
- package/dist/transformer.js.map +0 -1
- package/dist/version.d.ts +0 -5
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -5
- package/dist/version.js.map +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var ae=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var _e=(s,e)=>{for(var t in e)ae(s,t,{get:e[t],enumerable:!0})},Xe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ze(e))!Je.call(s,n)&&n!==t&&ae(s,n,{get:()=>e[n],enumerable:!(i=ze(e,n))||i.enumerable});return s};var We=s=>Xe(ae({},"__esModule",{value:!0}),s);var yt={};_e(yt,{ALPHABETIC_CREATOR:()=>Ke,ALPHABETIC_VALIDATOR:()=>bt,ALPHANUMERIC_CREATOR:()=>He,ALPHANUMERIC_VALIDATOR:()=>xt,CharacterSetCreator:()=>k,CharacterSetValidator:()=>se,EncryptionTransformer:()=>re,Exclusions:()=>b,HEXADECIMAL_CREATOR:()=>Ue,HEXADECIMAL_VALIDATOR:()=>mt,IdentityTransformer:()=>ie,NUMERIC_CREATOR:()=>De,NUMERIC_VALIDATOR:()=>pt,RecordValidator:()=>xe,RegExpValidator:()=>J,Sequence:()=>Z,Transformer:()=>P,i18nUtilityInit:()=>gt,i18nextUtility:()=>m,mapIterable:()=>U,utilityNS:()=>Be,utilityResourceBundle:()=>je});module.exports=We(yt);var ne=require("@aidc-toolkit/core");var p=s=>typeof s=="string",q=()=>{let s,e,t=new Promise((i,n)=>{s=i,e=n});return t.resolve=s,t.reject=e,t},we=s=>s==null?"":""+s,Ye=(s,e,t)=>{s.forEach(i=>{e[i]&&(t[i]=e[i])})},Qe=/###/g,Te=s=>s&&s.indexOf("###")>-1?s.replace(Qe,"."):s,Ce=s=>!s||p(s),G=(s,e,t)=>{let i=p(e)?e.split("."):e,n=0;for(;n<i.length-1;){if(Ce(s))return{};let r=Te(i[n]);!s[r]&&t&&(s[r]=new t),Object.prototype.hasOwnProperty.call(s,r)?s=s[r]:s={},++n}return Ce(s)?{}:{obj:s,k:Te(i[n])}},Ne=(s,e,t)=>{let{obj:i,k:n}=G(s,e,Object);if(i!==void 0||e.length===1){i[n]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=G(s,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=G(s,a,Object),o?.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},et=(s,e,t,i)=>{let{obj:n,k:r}=G(s,e,Object);n[r]=n[r]||[],n[r].push(t)},W=(s,e)=>{let{obj:t,k:i}=G(s,e);if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i]},tt=(s,e,t)=>{let i=W(s,t);return i!==void 0?i:W(e,t)},Pe=(s,e,t)=>{for(let i in e)i!=="__proto__"&&i!=="constructor"&&(i in s?p(s[i])||s[i]instanceof String||p(e[i])||e[i]instanceof String?t&&(s[i]=e[i]):Pe(s[i],e[i],t):s[i]=e[i]);return s},j=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),nt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},it=s=>p(s)?s.replace(/[&<>"'\/]/g,e=>nt[e]):s,ce=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 i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}},rt=[" ",",","?","!",";"],st=new ce(20),at=(s,e,t)=>{e=e||"",t=t||"";let i=rt.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(i.length===0)return!0;let n=st.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`),r=!n.test(s);if(!r){let a=s.indexOf(t);a>0&&!n.test(s.substring(0,a))&&(r=!0)}return r},he=(s,e,t=".")=>{if(!s)return;if(s[e])return Object.prototype.hasOwnProperty.call(s,e)?s[e]:void 0;let i=e.split(t),n=s;for(let r=0;r<i.length;){if(!n||typeof n!="object")return;let a,o="";for(let l=r;l<i.length;++l)if(l!==r&&(o+=t),o+=i[l],a=n[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<i.length-1)continue;r+=l-r+1;break}n=a}return n},z=s=>s?.replace("_","-"),ot={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,e){console?.[s]?.apply?.(console,e)}},de=class s{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ot,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,i,n){return n&&!this.debug?null:(p(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new s(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new s(this.logger,e)}},I=new de,D=class{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);let n=this.observers[i].get(t)||0;this.observers[i].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n.apply(n,[e,...t])})}},Y=class extends D{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i,n={}){let r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure,o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],i&&(Array.isArray(i)?o.push(...i):p(i)&&r?o.push(...i.split(r)):o.push(i)));let l=W(this.data,o);return!l&&!t&&!i&&e.indexOf(".")>-1&&(e=o[0],t=o[1],i=o.slice(2).join(".")),l||!a||!p(i)?l:he(this.data?.[e]?.[t],i,r)}addResource(e,t,i,n,r={silent:!1}){let a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=[e,t];i&&(o=o.concat(a?i.split(a):i)),e.indexOf(".")>-1&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),Ne(this.data,o,n),r.silent||this.emit("added",e,t,i,n)}addResources(e,t,i,n={silent:!1}){for(let r in i)(p(i[r])||Array.isArray(i[r]))&&this.addResource(e,t,r,i[r],{silent:!0});n.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,n,r,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),n=i,i=t,t=o[1]),this.addNamespaces(t);let l=W(this.data,o)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),n?Pe(l,i,r):l={...l,...i},Ne(this.data,o,l),a.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}},Ve={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,e,t,i,n){return s.forEach(r=>{e=this.processors[r]?.process(e,t,i,n)??e}),e}},Fe=Symbol("i18next/PATH_KEY");function lt(){let s=[],e=Object.create(null),t;return e.get=(i,n)=>(t?.revoke?.(),n===Fe?s:(s.push(n),t=Proxy.revocable(i,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function fe(s,e){let{[Fe]:t}=s(lt());return t.join(e?.keySeparator??".")}var Re={},oe=s=>!p(s)&&typeof s!="boolean"&&typeof s!="number",Q=class s extends D{constructor(e,t={}){super(),Ye(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=I.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let i={...t};if(e==null)return!1;let n=this.resolve(e,i);if(n?.res===void 0)return!1;let r=oe(n.res);return!(i.returnObjects===!1&&r)}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");let n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],a=i&&e.indexOf(i)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!at(e,i,n);if(a&&!o){let l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:p(r)?[r]:r};let u=e.split(i);(i!==n||i===n&&this.options.ns.indexOf(u[0])>-1)&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:p(r)?[r]:r}}translate(e,t,i){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=fe(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);let r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1],h=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");let c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?r?{res:`${u}${h}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${h}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:o;let f=this.resolve(e,n),g=f?.res,x=f?.usedKey||o,L=f?.exactUsedKey||o,T=["[object Number]","[object Function]","[object RegExp]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,V=!this.i18nFormat||this.i18nFormat.handleAsObject,w=n.count!==void 0&&!p(n.count),A=s.hasDefaultValue(n),$=w?this.pluralResolver.getSuffix(c,n.count,n):"",B=n.ordinal&&w?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",ye=w&&!n.ordinal&&n.count===0,M=ye&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${$}`]||n[`defaultValue${B}`]||n.defaultValue,N=g;V&&!g&&A&&(N=M);let qe=oe(N),Ge=Object.prototype.toString.apply(N);if(V&&N&&qe&&T.indexOf(Ge)<0&&!(p(y)&&Array.isArray(N))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,N,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(f.res=R,f.usedParams=this.getUsedParamsDetails(n),f):R}if(a){let R=Array.isArray(N),C=R?[]:{},Se=R?L:x;for(let E in N)if(Object.prototype.hasOwnProperty.call(N,E)){let v=`${Se}${a}${E}`;A&&!g?C[E]=this.translate(v,{...n,defaultValue:oe(M)?M[E]:void 0,joinArrays:!1,ns:l}):C[E]=this.translate(v,{...n,joinArrays:!1,ns:l}),C[E]===v&&(C[E]=N[E])}g=C}}else if(V&&p(y)&&Array.isArray(g))g=g.join(y),g&&(g=this.extendTranslation(g,e,n,i));else{let R=!1,C=!1;!this.isValidLookup(g)&&A&&(R=!0,g=M),this.isValidLookup(g)||(C=!0,g=o);let E=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:g,v=A&&M!==g&&this.options.updateMissing;if(C||R||v){if(this.logger.log(v?"updateKey":"missingKey",c,u,o,v?M:g),a){let O=this.resolve(o,{...n,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let K=[],_=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_&&_[0])for(let O=0;O<_.length;O++)K.push(_[O]);else this.options.saveMissingTo==="all"?K=this.languageUtils.toResolveHierarchy(n.lng||this.language):K.push(n.lng||this.language);let Le=(O,F,H)=>{let Oe=A&&H!==g?H:E;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,F,Oe,v,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(O,u,F,Oe,v,n),this.emit("missingKey",O,u,F,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?K.forEach(O=>{let F=this.pluralResolver.getSuffixes(O,n);ye&&n[`defaultValue${this.options.pluralSeparator}zero`]&&F.indexOf(`${this.options.pluralSeparator}zero`)<0&&F.push(`${this.options.pluralSeparator}zero`),F.forEach(H=>{Le([O],o+H,n[`defaultValue${H}`]||M)})}):Le(K,o,M))}g=this.extendTranslation(g,e,n,f,i),C&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${u}${h}${o}`),(C||R)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${h}${o}`:o,R?g:void 0,n))}return r?(f.res=g,f.usedParams=this.getUsedParamsDetails(n),f):g}extendTranslation(e,t,i,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});let l=p(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),u;if(l){let c=e.match(this.interpolator.nestingRegexp);u=c&&c.length}let h=i.replace&&!p(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,i.lng||this.language||n.usedLng,i),l){let c=e.match(this.interpolator.nestingRegexp),d=c&&c.length;u<d&&(i.nest=!1)}!i.lng&&n&&n.res&&(i.lng=this.language||n.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...c)=>r?.[0]===c[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`),null):this.translate(...c,t),i)),i.interpolation&&this.interpolator.reset()}let a=i.postProcess||this.options.postProcess,o=p(a)?[a]:a;return e!=null&&o?.length&&i.applyPostProcessor!==!1&&(e=Ve.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,t={}){let i,n,r,a,o;return p(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(i))return;let u=this.extractFromKey(l,t),h=u.key;n=h;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let d=t.count!==void 0&&!p(t.count),f=d&&!t.ordinal&&t.count===0,g=t.context!==void 0&&(p(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(L=>{this.isValidLookup(i)||(o=L,!Re[`${x[0]}-${L}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(Re[`${x[0]}-${L}`]=!0,this.logger.warn(`key "${n}" for languages "${x.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(T=>{if(this.isValidLookup(i))return;a=T;let y=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(y,h,T,L,t);else{let w;d&&(w=this.pluralResolver.getSuffix(T,t.count,t));let A=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&w.indexOf($)===0&&y.push(h+w.replace($,this.options.pluralSeparator)),y.push(h+w),f&&y.push(h+A)),g){let B=`${h}${this.options.contextSeparator||"_"}${t.context}`;y.push(B),d&&(t.ordinal&&w.indexOf($)===0&&y.push(B+w.replace($,this.options.pluralSeparator)),y.push(B+w),f&&y.push(B+A))}}let V;for(;V=y.pop();)this.isValidLookup(i)||(r=V,i=this.getResource(T,L,V,t))}))})}),{res:i,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,i,n):this.resourceStore.getResource(e,t,i,n)}getUsedParamsDetails(e={}){let t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!p(e.replace),n=i?e.replace:e;if(i&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!i){n={...n};for(let r of t)delete n[r]}return n}static hasDefaultValue(e){let t="defaultValue";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&e[i]!==void 0)return!0;return!1}},ee=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=I.create("languageUtils")}getScriptPartFromCode(e){if(e=z(e),!e||e.indexOf("-")<0)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=z(e),!e||e.indexOf("-")<0)return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(p(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;let n=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;let n=this.getScriptPartFromCode(i);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(i);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(a=>{if(a===r)return a;if(!(a.indexOf("-")<0&&r.indexOf("-")<0)&&(a.indexOf("-")>0&&r.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===r||a.indexOf(r)===0&&r.length>1))return a})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),p(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){let i=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return p(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):p(e)&&r(this.formatLanguageCode(e)),i.forEach(a=>{n.indexOf(a)<0&&r(this.formatLanguageCode(a))}),n}},Ee={zero:0,one:1,two:2,few:3,many:4,other:5},Ie={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})},ge=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=I.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let i=z(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:i,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(i,{type:n})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ie;if(!e.match(/-|_/))return Ie;let l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,t)}return this.pluralRulesCache[r]=a,a}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((n,r)=>Ee[n]-Ee[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,i={}){let n=this.getRule(e,i);return n?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}},ve=(s,e,t,i=".",n=!0)=>{let r=tt(s,e,t);return!r&&n&&p(t)&&(r=he(s,t,i),r===void 0&&(r=he(e,t,i))),r},le=s=>s.replace(/\$/g,"$$$$"),te=class{constructor(e={}){this.logger=I.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:i,useRawValueToEscape:n,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:h,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:g,nestingSuffixEscaped:x,nestingOptionsSeparator:L,maxReplaces:T,alwaysFormat:y}=e.interpolation;this.escape=t!==void 0?t:it,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?j(r):a||"{{",this.suffix=o?j(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=d?j(d):f||j("$t("),this.nestingSuffix=g?j(g):x||j(")"),this.nestingOptionsSeparator=L||",",this.maxReplaces=T||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"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,i,n){let r,a,o,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=f=>{if(f.indexOf(this.formatSeparator)<0){let T=ve(t,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,i,{...n,...t,interpolationkey:f}):T}let g=f.split(this.formatSeparator),x=g.shift().trim(),L=g.join(this.formatSeparator).trim();return this.format(ve(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),L,i,{...n,...t,interpolationkey:x})};this.resetRegExp();let h=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>le(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?le(this.escape(f)):le(f)}].forEach(f=>{for(o=0;r=f.regex.exec(e);){let g=r[1].trim();if(a=u(g),a===void 0)if(typeof h=="function"){let L=h(e,r,n);a=p(L)?L:""}else if(n&&Object.prototype.hasOwnProperty.call(n,g))a="";else if(c){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),a="";else!p(a)&&!this.useRawValueToEscape&&(a=we(a));let x=f.safeValue(a);if(e=e.replace(r[0],x),c?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,i={}){let n,r,a,o=(l,u)=>{let h=this.nestingOptionsSeparator;if(l.indexOf(h)<0)return l;let c=l.split(new RegExp(`${h}[ ]*{`)),d=`{${c[1]}`;l=c[0],d=this.interpolate(d,a);let f=d.match(/'/g),g=d.match(/"/g);((f?.length??0)%2===0&&!g||g.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,x),`${l}${h}${d}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];a={...i},a=a.replace&&!p(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(o.call(this,n[1].trim(),a),a),r&&n[0]===e&&!p(r))return r;p(r)||(r=we(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((h,c)=>this.format(h,c,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}},ut=s=>{let e=s.toLowerCase().trim(),t={};if(s.indexOf("(")>-1){let i=s.split("(");e=i[0].toLowerCase().trim();let n=i[1].substring(0,i[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){let[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),h=o.trim();t[h]||(t[h]=u),u==="false"&&(t[h]=!1),u==="true"&&(t[h]=!0),isNaN(u)||(t[h]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},Ae=s=>{let e={};return(t,i,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});let a=i+JSON.stringify(r),o=e[a];return o||(o=s(z(i),n),e[a]=o),o(t)}},ct=s=>(e,t,i)=>s(z(t),i)(e),pe=class{constructor(e={}){this.logger=I.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let i=t.cacheInBuiltFormats?Ae:ct;this.formats={number:i((n,r)=>{let a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:i((n,r)=>{let a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:i((n,r)=>{let a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:i((n,r)=>{let a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:i((n,r)=>{let a=new Intl.ListFormat(n,{...r});return o=>a.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ae(t)}format(e,t,i,n={}){let r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(o=>o.indexOf(")")>-1)){let o=r.findIndex(l=>l.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,l)=>{let{formatName:u,formatOptions:h}=ut(l);if(this.formats[u]){let c=o;try{let d=n?.formatParams?.[n.interpolationkey]||{},f=d.locale||d.lng||n.locale||n.lng||i;c=this.formats[u](o,f,{...h,...n,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return o},e)}},ht=(s,e)=>{s.pending[e]!==void 0&&(delete s.pending[e],s.pendingCount--)},me=class extends D{constructor(e,t,i,n={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=n,this.logger=I.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,n.backend,n)}queueLoad(e,t,i,n){let r={},a={},o={},l={};return e.forEach(u=>{let h=!0;t.forEach(c=>{let d=`${u}|${c}`;!i.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,h=!1,a[d]===void 0&&(a[d]=!0),r[d]===void 0&&(r[d]=!0),l[c]===void 0&&(l[c]=!0)))}),h||(o[u]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,i){let n=e.split("|"),r=n[0],a=n[1];t&&this.emit("failedLoading",r,a,t),!t&&i&&this.store.addResourceBundle(r,a,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);let o={};this.queue.forEach(l=>{et(l.loaded,[r],a),ht(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});let h=l.loaded[u];h.length&&h.forEach(c=>{o[u][c]===void 0&&(o[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,i,n=0,r=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:n,wait:r,callback:a});return}this.readingCalls++;let o=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){let c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&h&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,i,n+1,r*2,a)},r);return}a(u,h)},l=this.backend[i].bind(this.backend);if(l.length===2){try{let u=l(e,t);u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t,i={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();p(e)&&(e=this.languageUtils.toResolveHierarchy(e)),p(t)&&(t=[t]);let r=this.queueLoad(e,t,i,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){let i=e.split("|"),n=i[0],r=i[1];this.read(n,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,o),this.loaded(e,a,o)})}saveMissing(e,t,i,n,r,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" 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(!(i==null||i==="")){if(this.backend?.create){let l={...a,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let h;u.length===5?h=u(e,t,i,n,l):h=u(e,t,i,n),h&&typeof h.then=="function"?h.then(c=>o(null,c)).catch(o):o(null,h)}catch(h){o(h)}else u(e,t,i,n,o,l)}!e||!e[0]||this.store.addResource(e[0],t,i,n)}}},ue=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let e={};if(typeof s[1]=="object"&&(e=s[1]),p(s[1])&&(e.defaultValue=s[1]),p(s[2])&&(e.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){let t=s[3]||s[2];Object.keys(t).forEach(i=>{e[i]=t[i]})}return e},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Me=s=>(p(s.ns)&&(s.ns=[s.ns]),p(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),p(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs?.indexOf?.("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s),X=()=>{},dt=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(t=>{typeof s[t]=="function"&&(s[t]=s[t].bind(s))})},ft=s=>!!(s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)),be=class s extends D{constructor(e={},t){if(super(),this.options=Me(e),this.services={},this.logger=I,this.modules={external:[]},dt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(p(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));let i=ue();this.options={...i,...this.options,...Me(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!ft(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("\u{1F310} i18next is maintained with support from locize.com \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}");let n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?I.init(n(this.modules.logger),this.options):I.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=pe;let h=new ee(this.options);this.store=new Y(this.options.resources,this.options);let c=this.services;c.logger=I,c.resourceStore=this.store,c.languageUtils=h,c.pluralResolver=new ge(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(c.formatter=n(u),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new te(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new me(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(f,...g)=>{this.emit(f,...g)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new Q(this.services,this.options),this.translator.on("*",(f,...g)=>{this.emit(f,...g)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,t||(t=X),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...h)=>this.store[u](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...h)=>(this.store[u](...h),this)});let o=q(),l=()=>{let u=(h,c)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(c),t(h,c)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=X){let i=t,n=p(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();let r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&r.indexOf(u)<0&&r.push(u)})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(o)})}else i(null)}reloadResources(e,t,i){let n=q();return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=X),this.services.backendConnector.reload(e,t,r=>{n.resolve(),i(r)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Ve.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){let i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let i=q();this.emit("languageChanging",e);let n=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},r=(o,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),t&&t(o,(...u)=>this.t(...u))},a=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);let l=p(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(p(o)?[o]:o);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,h=>{r(h,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),i}getFixedT(e,t,i){let n=(r,a,...o)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([r,a].concat(o)):l={...a},l.lng=l.lng||n.lng,l.lngs=l.lngs||n.lngs,l.ns=l.ns||n.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||i||n.keyPrefix);let u=this.options.keySeparator||".",h;return l.keyPrefix&&Array.isArray(r)?h=r.map(c=>(typeof c=="function"&&(c=fe(c,{...this.options,...a})),`${l.keyPrefix}${u}${c}`)):(typeof r=="function"&&(r=fe(r,{...this.options,...a})),h=l.keyPrefix?`${l.keyPrefix}${u}${r}`:r),this.t(h,l)};return p(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=i,n}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;let i=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;let a=(o,l)=>{let u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(t.precheck){let o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,e)&&(!n||a(r,e)))}loadNamespaces(e,t){let i=q();return this.options.ns?(p(e)&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{i.resolve(),t&&t(n)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){let i=q();p(e)&&(e=[e]);let n=this.options.preload||[],r=e.filter(a=>n.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=n.concat(r),this.loadResources(a=>{i.resolve(),t&&t(a)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let n=new Intl.Locale(e);if(n&&n.getTextInfo){let r=n.getTextInfo();if(r&&r.direction)return r.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"],i=this.services?.languageUtils||new ee(ue());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let i=new s(e,t);return i.createInstance=s.createInstance,i}cloneInstance(e={},t=X){let i=e.forkResourceStore;i&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},r=new s(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},i){let o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((h,c)=>(h[c]={...l[u][c]},h),l[u]),l),{});r.store=new Y(o,n),r.services.resourceStore=r.store}if(e.interpolation){let l={...ue().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new te(u)}return r.translator=new Q(r.services,n),r.translator.on("*",(o,...l)=>{r.emit(o,...l)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},S=be.createInstance(),Lt=S.createInstance,Ot=S.dir,wt=S.init,Tt=S.loadResources,Ct=S.reloadResources,Nt=S.use,Rt=S.changeLanguage,Et=S.getFixedT,It=S.t,vt=S.exists,At=S.setDefaultNamespace,Mt=S.hasLoadedNamespace,Pt=S.loadNamespaces,Vt=S.loadLanguages;var ke={Transformer:{domainMustBeGreaterThanZero:"Domain {{domain, number}} must be greater than 0",tweakMustBeGreaterThanOrEqualToZero:"Tweak {{tweak, number}} must be greater than or equal to 0",valueMustBeGreaterThanOrEqualToZero:"Value {{value, number}} must be greater than or equal to 0",valueMustBeLessThan:"Value {{value, number}} must be less than {{domain, number}}",minimumValueMustBeGreaterThanOrEqualToZero:"Minimum value {{minimumValue, number}} must be greater than or equal to 0",maximumValueMustBeLessThan:"Maximum value {{maximumValue, number}} must be less than {{domain, number}}"},RegExpValidator:{stringDoesNotMatchPattern:"String {{s}} does not match pattern"},CharacterSetValidator:{firstZeroFirstCharacter:"Character set must support zero as first character",allNumericAllNumericCharacters:"Character set must support all numeric characters in sequence",stringMustNotBeAllNumeric:"String must not be all numeric",lengthMustBeGreaterThanOrEqualTo:"Length {{length, number}} must be greater than or equal to {{minimumLength, number}}",lengthMustBeLessThanOrEqualTo:"Length {{length, number}} must be less than or equal to {{maximumLength, number}}",lengthMustBeEqualTo:"Length {{length, number}} must be equal to {{exactLength, number}}",lengthOfComponentMustBeGreaterThanOrEqualTo:"Length {{length, number}} of {{component}} must be greater than or equal to {{minimumLength, number}}",lengthOfComponentMustBeLessThanOrEqualTo:"Length {{length, number}} of {{component}} must be less than or equal to {{maximumLength, number}}",lengthOfComponentMustBeEqualTo:"Length {{length, number}} of {{component}} must be equal to {{exactLength, number}}",invalidCharacterAtPosition:"Invalid character '{{c}}' at position {{position, number}}",invalidCharacterAtPositionOfComponent:"Invalid character '{{c}}' at position {{position, number}} of {{component}}",exclusionNotSupported:"Exclusion value of {{exclusion, number}} is not supported",endSequenceValueMustBeLessThanOrEqualTo:"End sequence value (start sequence value + count - 1) must be less than {{domain, number}}"},RecordValidator:{typeNameKeyNotFound:'{{typeName}} "{{key}}" not found'}};var $e={Transformer:{domainMustBeGreaterThanZero:"Le domaine {{domain, number}} doit \xEAtre sup\xE9rieur \xE0 0",tweakMustBeGreaterThanOrEqualToZero:"Le r\xE9glage {{tweak, number}} doit \xEAtre sup\xE9rieur ou \xE9gal \xE0 0",valueMustBeGreaterThanOrEqualToZero:"La valeur {{value, number}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 0",valueMustBeLessThan:"La valeur {{value, number}} doit \xEAtre inf\xE9rieure \xE0 {{domain, number}}",minimumValueMustBeGreaterThanOrEqualToZero:"La valeur minimale {{minimumValue, number}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 0",maximumValueMustBeLessThan:"La valeur maximale {{maximumValue, number}} doit \xEAtre inf\xE9rieure \xE0 {{domain, number}}"},RegExpValidator:{stringDoesNotMatchPattern:"La cha\xEEne {{s}} ne correspond pas au mod\xE8le"},CharacterSetValidator:{firstZeroFirstCharacter:"Le jeu de caract\xE8res doit prendre en charge z\xE9ro comme premier caract\xE8re",allNumericAllNumericCharacters:"Le jeu de caract\xE8res doit prendre en charge tous les caract\xE8res num\xE9riques en s\xE9quence",stringMustNotBeAllNumeric:"La cha\xEEne ne doit pas \xEAtre enti\xE8rement num\xE9rique",lengthMustBeGreaterThanOrEqualTo:"La longueur {{length, number}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 {{minimumLength, number}}",lengthMustBeLessThanOrEqualTo:"La longueur {{length, number}} doit \xEAtre inf\xE9rieure ou \xE9gale \xE0 {{maximumLength, number}}",lengthMustBeEqualTo:"La longueur {{length, number}} doit \xEAtre \xE9gale \xE0 {{exactLength, number}}",lengthOfComponentMustBeGreaterThanOrEqualTo:"La longueur {{length, number}} de {{component}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 {{minimumLength, number}}",lengthOfComponentMustBeLessThanOrEqualTo:"La longueur {{length, number}} de {{component}} doit \xEAtre inf\xE9rieure ou \xE9gale \xE0 {{maximumLength, number}}",lengthOfComponentMustBeEqualTo:"La longueur {{length, number}} de {{component}} doit \xEAtre \xE9gale \xE0 {{exactLength, number}}",invalidCharacterAtPosition:"Caract\xE8re non valide '{{c}}' \xE0 la position {{position, number}}",invalidCharacterAtPositionOfComponent:"Caract\xE8re non valide '{{c}}' \xE0 la position {{position, number}} de {{component}}",exclusionNotSupported:"La valeur d'exclusion de {{exclusion, number}} n'est pas prise en charge",endSequenceValueMustBeLessThanOrEqualTo:"La valeur de la s\xE9quence de fin (valeur de la s\xE9quence de d\xE9but + nombre - 1) doit \xEAtre inf\xE9rieure \xE0 {{domain, number}}"},RecordValidator:{typeNameKeyNotFound:"{{typeName}} \xAB\xA0{{key}}\xA0\xBB introuvable"}};var Be="aidct_utility",je={en:{aidct_utility:ke},fr:{aidct_utility:$e}},m=S.createInstance();async function gt(s,e=!1){return(0,ne.i18nInit)(m,s,e,Be,je,ne.i18nCoreInit)}var Z=class{#t;#e;#r;#i;#n;#s;constructor(e,t){this.#t=BigInt(e),this.#e=this.#t+BigInt(t),this.#r=t,t>=0?(this.#i=1n,this.#n=this.#t,this.#s=this.#e-1n):(this.#i=-1n,this.#n=this.#e+1n,this.#s=this.#t)}get startValue(){return this.#t}get endValue(){return this.#e}get count(){return this.#r}get minimumValue(){return this.#n}get maximumValue(){return this.#s}*[Symbol.iterator](){for(let e=this.#t;e!==this.#e;e+=this.#i)yield e}};function U(s,e){return{*[Symbol.iterator](){let t=0;for(let i of s)yield e(i,t++)}}}var P=class s{static#t=new Map;#e;constructor(e){if(this.#e=BigInt(e),this.#e<=0n)throw new RangeError(m.t("Transformer.domainMustBeGreaterThanZero",{domain:e}))}static get(e,t){let i=BigInt(e),n=s.#t.get(i);n===void 0&&(n=new Map,s.#t.set(i,n));let r=t===void 0?void 0:BigInt(t),a=n.get(r);return a===void 0&&(a=r===void 0?new ie(i):new re(i,r),n.set(r,a)),a}get domain(){return this.#e}#r(e){if(e<0n)throw new RangeError(m.t("Transformer.valueMustBeGreaterThanOrEqualToZero",{value:e}));if(e>=this.domain)throw new RangeError(m.t("Transformer.valueMustBeLessThan",{value:e,domain:this.domain}))}#i(e){let t=BigInt(e);return this.#r(t),this.doForward(t)}#n(e,t,i){return e(this.#i(t),i)}forward(e,t){let i;if(typeof e!="object")i=t===void 0?this.#i(e):this.#n(t,e);else if(e instanceof Z){if(e.minimumValue<0n)throw new RangeError(m.t("Transformer.minimumValueMustBeGreaterThanOrEqualToZero",{minimumValue:e.minimumValue}));if(e.maximumValue>=this.domain)throw new RangeError(m.t("Transformer.maximumValueMustBeLessThan",{maximumValue:e.maximumValue,domain:this.domain}));i=t===void 0?U(e,n=>this.doForward(n)):U(e,(n,r)=>t(this.doForward(n),r))}else i=t===void 0?U(e,n=>this.#i(n)):U(e,(n,r)=>this.#n(t,n,r));return i}reverse(e){let t=BigInt(e);return this.#r(t),this.doReverse(t)}},ie=class extends P{doForward(e){return e}doReverse(e){return e}},re=class s extends P{static#t=603868999n;static#e=new Uint8Array([1,2,4,8,16,32,64,128]);static#r=new Uint8Array([254,253,251,247,239,223,191,127]);#i;#n;#s;#o;#a;constructor(e,t){if(super(e),t<0n)throw new RangeError(m.t("Transformer.tweakMustBeGreaterThanOrEqualToZero",{tweak:t}));let i=0;for(let o=this.domain-1n;o!==0n;o>>=8n)i++;this.#i=i;let n=[],r=[],a=[];for(let o=this.domain*BigInt(t)*s.#t;o!==0n;o>>=8n){n.unshift(Number(BigInt.asUintN(8,o)));let l=Number(BigInt.asUintN(3,o));r.push(s.#e[l]),a.push(s.#r[l])}if(i===1){let o=s.#e.filter(l=>l<e).reduce((l,u)=>l|u,0);this.#n=new Uint8Array([n.reduce((l,u)=>l^u,0)&o]),this.#s=new Uint8Array([s.#e[0]]),this.#o=new Uint8Array([s.#r[0]]),this.#a=1}else this.#n=new Uint8Array(n),this.#s=new Uint8Array(r),this.#o=new Uint8Array(a),this.#a=n.length}#l(e){let t=new Uint8Array(this.#i);for(let i=this.#i-1,n=e;i>=0&&n!==0n;i--,n>>=8n)t[i]=Number(BigInt.asUintN(8,n));return t}static#u(e){return e.reduce((t,i)=>t<<8n|BigInt(i),0n)}#c(e,t,i){let n=e.length,r=new Uint8Array(n),a=[],o=[],l=this.#s[t];e.forEach((c,d)=>{let f=c&l;r[d]=f,(f!==0?a:o).push(d)});let u=this.#o[t],h=new Uint8Array(n);return[...a,...o].forEach((c,d)=>{i?h[d]=e[c]&u|r[d]:h[c]=e[d]&u|r[c]}),h}#h(e,t,i){let n=this.#n[t];return e.map(r=>{let a=r^n;return n=i?a:r,a})}doForward(e){let t=this.#l(e),i;do{for(let n=0;n<this.#a;n++)t=this.#h(this.#c(t,n,!0),n,!0);i=s.#u(t)}while(i>=this.domain);return i}doReverse(e){let t=this.#l(e),i;do{for(let n=this.#a-1;n>=0;n--)t=this.#c(this.#h(t,n,!1),n,!1);i=s.#u(t)}while(i>=this.domain);return i}};var J=class{#t;constructor(e){this.#t=e}get regExp(){return this.#t}createErrorMessage(e){return m.t("RegExpValidator.stringDoesNotMatchPattern",{s:e})}validate(e){if(!this.#t.test(e))throw new RangeError(this.createErrorMessage(e))}};var xe=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get typeName(){return this.#t}get record(){return this.#e}validate(e){if(!(e in this.record))throw new RangeError(m.t("RecordValidator.typeNameKeyNotFound",{typeName:this.typeName,key:e}))}};var b={None:0,FirstZero:1,AllNumeric:2};var se=class s{static#t=new class extends J{createErrorMessage(e){return m.t("CharacterSetValidator.stringMustNotBeAllNumeric")}}(/\D/u);#e;#r;#i;constructor(e,...t){this.#e=e;let i=new Map;e.forEach((n,r)=>{i.set(n,r)}),this.#r=i,this.#i=t}get characterSet(){return this.#e}get characterSetSize(){return this.#e.length}get exclusionSupport(){return this.#i}character(e){return this.#e[e]}characterIndex(e){return this.#r.get(e)}characterIndexes(e){return Array.from(e).map(t=>this.#r.get(t))}static#n(e){return typeof e=="function"?e():e}validateExclusion(e){if(e!==void 0&&e!==b.None&&!this.#i.includes(e))throw new RangeError(m.t("CharacterSetValidator.exclusionNotSupported",{exclusion:e}))}validate(e,t){let i=e.length,n=t?.minimumLength,r=t?.maximumLength;if(n!==void 0&&i<n){let o;throw r!==void 0&&r===n?o=m.t(t?.component===void 0?"CharacterSetValidator.lengthMustBeEqualTo":"CharacterSetValidator.lengthOfComponentMustBeEqualTo",{component:s.#n(t?.component),length:i,exactLength:n}):o=m.t(t?.component===void 0?"CharacterSetValidator.lengthMustBeGreaterThanOrEqualTo":"CharacterSetValidator.lengthOfComponentMustBeGreaterThanOrEqualTo",{component:s.#n(t?.component),length:i,minimumLength:n}),new RangeError(o)}if(r!==void 0&&i>r)throw new RangeError(m.t(t?.component===void 0?"CharacterSetValidator.lengthMustBeLessThanOrEqualTo":"CharacterSetValidator.lengthOfComponentMustBeLessThanOrEqualTo",{component:s.#n(t?.component),length:i,maximumLength:r}));let a=this.characterIndexes(e).findIndex(o=>o===void 0);if(a!==-1)throw new RangeError(m.t(t?.component===void 0?"CharacterSetValidator.invalidCharacterAtPosition":"CharacterSetValidator.invalidCharacterAtPositionOfComponent",{component:s.#n(t?.component),c:e.charAt(a),position:a+(t?.positionOffset??0)+1}));if(t?.exclusion!==void 0)switch(this.validateExclusion(t.exclusion),t.exclusion){case b.None:break;case b.FirstZero:if(e.startsWith("0"))throw new RangeError(m.t(t.component===void 0?"CharacterSetValidator.invalidCharacterAtPosition":"CharacterSetValidator.invalidCharacterAtPositionOfComponent",{component:s.#n(t.component),c:"0",position:(t.positionOffset??0)+1}));break;case b.AllNumeric:s.#t.validate(e);break}}},k=class s extends se{static MAXIMUM_STRING_LENGTH=40;static#t;static#e(e){let t=new Array(this.MAXIMUM_STRING_LENGTH+1),i=BigInt(e);for(let n=0,r=1n;n<=this.MAXIMUM_STRING_LENGTH;n++,r*=i)t[n]=r;return t}static powerOf10(e){return s.#t??=s.#e(10),s.#t[e]}#r;#i;#n;#s;constructor(e,...t){super(e,...t),this.#r=BigInt(this.characterSetSize),this.#i=BigInt(this.characterSetSize-1);let i=[],n=s.#e(this.characterSetSize);if(i[b.None]=n,t.includes(b.FirstZero)){if(e[0]!=="0")throw new RangeError(m.t("CharacterSetValidator.firstZeroFirstCharacter"));let a=new Array(s.MAXIMUM_STRING_LENGTH+1);a[0]=0n;for(let o=1;o<=s.MAXIMUM_STRING_LENGTH;o++)a[o]=this.#i*n[o-1];i[b.FirstZero]=a}if(t.includes(b.AllNumeric)){let o=function(d){let f=d[0];for(let g of d){if(g===void 0||g!==f)throw new RangeError(m.t("CharacterSetValidator.allNumericAllNumericCharacters"));f=g+1}};var r=o;let a=new Array(s.MAXIMUM_STRING_LENGTH+1),l=this.characterIndexes("0123456789");o(l);let u=BigInt(l[0]),h=new Array(s.MAXIMUM_STRING_LENGTH+1),c=0n;for(let d=0;d<=s.MAXIMUM_STRING_LENGTH;d++)a[d]=n[d]-s.powerOf10(d),h[d]=c,c=c*this.#r+u;this.#s=h,i[b.AllNumeric]=a}else this.#s=[];this.#n=i}#o(e){return this.#n[b.None][e]}#a(e,t,i){let n;if(t===0){if(!e&&i<10n)throw new RangeError(m.t("CharacterSetValidator.stringMustNotBeAllNumeric"));n=10n}else{let r=this.#o(t),a=s.powerOf10(t),o=e?r-a:r,l=i/o;l>=10n?n=s.powerOf10(t+1):n=l*a+this.#a(e,t-1,i-l*o)}return n}#l(e){if(e<0)throw new RangeError(m.t("CharacterSetValidator.lengthMustBeGreaterThanOrEqualTo",{length:e,minimumLength:0}));if(e>s.MAXIMUM_STRING_LENGTH)throw new RangeError(m.t("CharacterSetValidator.lengthMustBeLessThanOrEqualTo",{length:e,maximumLength:s.MAXIMUM_STRING_LENGTH}))}create(e,t,i,n,r){this.#l(e),this.validateExclusion(i);let a=i===b.AllNumeric?this.#s[e]:0n;return P.get(this.#n[i??b.None][e],n).forward(t,(l,u)=>{let h="";if(e!==0){let c=l;i===b.AllNumeric&&c>=a&&(c+=this.#a(!0,e,c-a));for(let d=e-1;d>0;d--){let f=c/this.#r;h=this.character(Number(c-f*this.#r))+h,c=f}h=this.character(i===b.FirstZero?Number(c%this.#i)+1:Number(c%this.#r))+h}return r===void 0?h:r(h,u)})}valueFor(e,t,i){let n=e.length;this.#l(n),this.validateExclusion(t);let r=BigInt(this.characterSetSize),a=this.characterIndexes(e).reduce((o,l,u)=>{if(l===void 0)throw new RangeError(m.t("CharacterSetValidator.invalidCharacterAtPosition",{c:e.charAt(u),position:u+1}));let h;if(u===0&&t===b.FirstZero){if(l===0)throw new RangeError(m.t("CharacterSetValidator.invalidCharacterAtPosition",{c:"0",position:1}));h=BigInt(l-1)}else h=o*r+BigInt(l);return h},0n);if(t===b.AllNumeric){let o=this.#s[n];a>=o&&(a-=this.#a(!1,n,a-o))}return P.get(this.#n[t??b.None][n],i).reverse(a)}},De=new k(["0","1","2","3","4","5","6","7","8","9"],b.FirstZero),pt=De,Ue=new k(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],b.FirstZero,b.AllNumeric),mt=Ue,Ke=new k(["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]),bt=Ke,He=new k(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],b.FirstZero,b.AllNumeric),xt=He;0&&(module.exports={ALPHABETIC_CREATOR,ALPHABETIC_VALIDATOR,ALPHANUMERIC_CREATOR,ALPHANUMERIC_VALIDATOR,CharacterSetCreator,CharacterSetValidator,EncryptionTransformer,Exclusions,HEXADECIMAL_CREATOR,HEXADECIMAL_VALIDATOR,IdentityTransformer,NUMERIC_CREATOR,NUMERIC_VALIDATOR,RecordValidator,RegExpValidator,Sequence,Transformer,i18nUtilityInit,i18nextUtility,mapIterable,utilityNS,utilityResourceBundle});
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright © 2024-2026 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
4
|
+
* contributors
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|