@invoice-sdk/widget 1.54.0 → 1.55.0

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.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(_,BA){typeof exports=="object"&&typeof module!="undefined"?BA(exports):typeof define=="function"&&define.amd?define(["exports"],BA):(_=typeof globalThis!="undefined"?globalThis:_||self,BA(_.InvoiceRegisterWidget={}))})(this,function(_){"use strict";var Jo=Object.defineProperty,To=Object.defineProperties;var ko=Object.getOwnPropertyDescriptors;var LC=Object.getOwnPropertySymbols;var Et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable;var bg=(_,BA)=>(BA=Symbol[_])?BA:Symbol.for("Symbol."+_),Ho=_=>{throw TypeError(_)};var It=(_,BA,K)=>BA in _?Jo(_,BA,{enumerable:!0,configurable:!0,writable:!0,value:K}):_[BA]=K,j=(_,BA)=>{for(var K in BA||(BA={}))Et.call(BA,K)&&It(_,K,BA[K]);if(LC)for(var K of LC(BA))nt.call(BA,K)&&It(_,K,BA[K]);return _},mA=(_,BA)=>To(_,ko(BA));var fQ=(_,BA)=>{var K={};for(var aA in _)Et.call(_,aA)&&BA.indexOf(aA)<0&&(K[aA]=_[aA]);if(_!=null&&LC)for(var aA of LC(_))BA.indexOf(aA)<0&&nt.call(_,aA)&&(K[aA]=_[aA]);return K};var U=(_,BA,K)=>new Promise((aA,HA)=>{var dA=lA=>{try{YA(K.next(lA))}catch(XA){HA(XA)}},RA=lA=>{try{YA(K.throw(lA))}catch(XA){HA(XA)}},YA=lA=>lA.done?aA(lA.value):Promise.resolve(lA.value).then(dA,RA);YA((K=K.apply(_,BA)).next())}),kg=function(_,BA){this[0]=_,this[1]=BA},mQ=(_,BA,K)=>{var aA=(RA,YA,lA,XA)=>{try{var jg=K[RA](YA),EC=(YA=jg.value)instanceof kg,Hg=jg.done;Promise.resolve(EC?YA[0]:YA).then(Ag=>EC?aA(RA==="return"?RA:"next",YA[1]?{done:Ag.done,value:Ag.value}:Ag,lA,XA):lA({value:Ag,done:Hg})).catch(Ag=>aA("throw",Ag,lA,XA))}catch(Ag){XA(Ag)}},HA=RA=>dA[RA]=YA=>new Promise((lA,XA)=>aA(RA,YA,lA,XA)),dA={};return K=K.apply(_,BA),dA[bg("asyncIterator")]=()=>dA,HA("next"),HA("throw"),HA("return"),dA},qQ=_=>{var BA=_[bg("asyncIterator")],K=!1,aA,HA={};return BA==null?(BA=_[bg("iterator")](),aA=dA=>HA[dA]=RA=>BA[dA](RA)):(BA=BA.call(_),aA=dA=>HA[dA]=RA=>{if(K){if(K=!1,dA==="throw")throw RA;return RA}return K=!0,{done:!1,value:new kg(new Promise(YA=>{var lA=BA[dA](RA);lA instanceof Object||Ho("Object expected"),YA(lA)}),1)}}),HA[bg("iterator")]=()=>HA,aA("next"),"throw"in BA?aA("throw"):HA.throw=dA=>{throw dA},"return"in BA&&aA("return"),HA},tt=(_,BA,K)=>(BA=_[bg("asyncIterator")])?BA.call(_):(_=_[bg("iterator")](),BA={},K=(aA,HA)=>(HA=_[aA])&&(BA[aA]=dA=>new Promise((RA,YA,lA)=>(dA=HA.call(_,dA),lA=dA.done,Promise.resolve(dA.value).then(XA=>RA({value:XA,done:lA}),YA)))),K("next"),K("return"),BA);function BA(g,A){for(var C=0;C<A.length;C++){const B=A[C];if(typeof B!="string"&&!Array.isArray(B)){for(const Q in B)if(Q!=="default"&&!(Q in g)){const I=Object.getOwnPropertyDescriptor(B,Q);I&&Object.defineProperty(g,Q,I.get?I:{enumerable:!0,get:()=>B[Q]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}const K=g=>typeof g=="string",aA=()=>{let g,A;const C=new Promise((B,Q)=>{g=B,A=Q});return C.resolve=g,C.reject=A,C},HA=g=>g==null?"":""+g,dA=(g,A,C)=>{g.forEach(B=>{A[B]&&(C[B]=A[B])})},RA=/###/g,YA=g=>g&&g.indexOf("###")>-1?g.replace(RA,"."):g,lA=g=>!g||K(g),XA=(g,A,C)=>{const B=K(A)?A.split("."):A;let Q=0;for(;Q<B.length-1;){if(lA(g))return{};const I=YA(B[Q]);!g[I]&&C&&(g[I]=new C),Object.prototype.hasOwnProperty.call(g,I)?g=g[I]:g={},++Q}return lA(g)?{}:{obj:g,k:YA(B[Q])}},jg=(g,A,C)=>{const{obj:B,k:Q}=XA(g,A,Object);if(B!==void 0||A.length===1){B[Q]=C;return}let I=A[A.length-1],E=A.slice(0,A.length-1),n=XA(g,E,Object);for(;n.obj===void 0&&E.length;)I=`${E[E.length-1]}.${I}`,E=E.slice(0,E.length-1),n=XA(g,E,Object),n!=null&&n.obj&&typeof n.obj[`${n.k}.${I}`]!="undefined"&&(n.obj=void 0);n.obj[`${n.k}.${I}`]=C},EC=(g,A,C,B)=>{const{obj:Q,k:I}=XA(g,A,Object);Q[I]=Q[I]||[],Q[I].push(C)},Hg=(g,A)=>{const{obj:C,k:B}=XA(g,A);if(C&&Object.prototype.hasOwnProperty.call(C,B))return C[B]},Ag=(g,A,C)=>{const B=Hg(g,C);return B!==void 0?B:Hg(A,C)},MQ=(g,A,C)=>{for(const B in A)B!=="__proto__"&&B!=="constructor"&&(B in g?K(g[B])||g[B]instanceof String||K(A[B])||A[B]instanceof String?C&&(g[B]=A[B]):MQ(g[B],A[B],C):g[B]=A[B]);return g},Rg=g=>g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ct=g=>K(g)?g.replace(/[&<>"'\/]/g,A=>ht[A]):g;class ot{constructor(A){this.capacity=A,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(A){const C=this.regExpMap.get(A);if(C!==void 0)return C;const B=new RegExp(A);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(A,B),this.regExpQueue.push(A),B}}const it=[" ",",","?","!",";"],at=new ot(20),st=(g,A,C)=>{A=A||"",C=C||"";const B=it.filter(E=>A.indexOf(E)<0&&C.indexOf(E)<0);if(B.length===0)return!0;const Q=at.getRegExp(`(${B.map(E=>E==="?"?"\\?":E).join("|")})`);let I=!Q.test(g);if(!I){const E=g.indexOf(C);E>0&&!Q.test(g.substring(0,E))&&(I=!0)}return I},NC=(g,A,C=".")=>{if(!g)return;if(g[A])return Object.prototype.hasOwnProperty.call(g,A)?g[A]:void 0;const B=A.split(C);let Q=g;for(let I=0;I<B.length;){if(!Q||typeof Q!="object")return;let E,n="";for(let t=I;t<B.length;++t)if(t!==I&&(n+=C),n+=B[t],E=Q[n],E!==void 0){if(["string","number","boolean"].indexOf(typeof E)>-1&&t<B.length-1)continue;I+=t-I+1;break}Q=E}return Q},Kg=g=>g==null?void 0:g.replace("_","-"),ut={type:"logger",log(g){this.output("log",g)},warn(g){this.output("warn",g)},error(g){this.output("error",g)},output(g,A){var C,B;(B=(C=console==null?void 0:console[g])==null?void 0:C.apply)==null||B.call(C,console,A)}};class nC{constructor(A,C={}){this.init(A,C)}init(A,C={}){this.prefix=C.prefix||"i18next:",this.logger=A||ut,this.options=C,this.debug=C.debug}log(...A){return this.forward(A,"log","",!0)}warn(...A){return this.forward(A,"warn","",!0)}error(...A){return this.forward(A,"error","")}deprecate(...A){return this.forward(A,"warn","WARNING DEPRECATED: ",!0)}forward(A,C,B,Q){return Q&&!this.debug?null:(K(A[0])&&(A[0]=`${B}${this.prefix} ${A[0]}`),this.logger[C](A))}create(A){return new nC(this.logger,j({prefix:`${this.prefix}:${A}:`},this.options))}clone(A){return A=A||this.options,A.prefix=A.prefix||this.prefix,new nC(this.logger,A)}}var gg=new nC;class tC{constructor(){this.observers={}}on(A,C){return A.split(" ").forEach(B=>{this.observers[B]||(this.observers[B]=new Map);const Q=this.observers[B].get(C)||0;this.observers[B].set(C,Q+1)}),this}off(A,C){if(this.observers[A]){if(!C){delete this.observers[A];return}this.observers[A].delete(C)}}emit(A,...C){this.observers[A]&&Array.from(this.observers[A].entries()).forEach(([Q,I])=>{for(let E=0;E<I;E++)Q(...C)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([Q,I])=>{for(let E=0;E<I;E++)Q.apply(Q,[A,...C])})}}class dQ extends tC{constructor(A,C={ns:["translation"],defaultNS:"translation"}){super(),this.data=A||{},this.options=C,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(A){this.options.ns.indexOf(A)<0&&this.options.ns.push(A)}removeNamespaces(A){const C=this.options.ns.indexOf(A);C>-1&&this.options.ns.splice(C,1)}getResource(A,C,B,Q={}){var e,h;const I=Q.keySeparator!==void 0?Q.keySeparator:this.options.keySeparator,E=Q.ignoreJSONStructure!==void 0?Q.ignoreJSONStructure:this.options.ignoreJSONStructure;let n;A.indexOf(".")>-1?n=A.split("."):(n=[A,C],B&&(Array.isArray(B)?n.push(...B):K(B)&&I?n.push(...B.split(I)):n.push(B)));const t=Hg(this.data,n);return!t&&!C&&!B&&A.indexOf(".")>-1&&(A=n[0],C=n[1],B=n.slice(2).join(".")),t||!E||!K(B)?t:NC((h=(e=this.data)==null?void 0:e[A])==null?void 0:h[C],B,I)}addResource(A,C,B,Q,I={silent:!1}){const E=I.keySeparator!==void 0?I.keySeparator:this.options.keySeparator;let n=[A,C];B&&(n=n.concat(E?B.split(E):B)),A.indexOf(".")>-1&&(n=A.split("."),Q=C,C=n[1]),this.addNamespaces(C),jg(this.data,n,Q),I.silent||this.emit("added",A,C,B,Q)}addResources(A,C,B,Q={silent:!1}){for(const I in B)(K(B[I])||Array.isArray(B[I]))&&this.addResource(A,C,I,B[I],{silent:!0});Q.silent||this.emit("added",A,C,B)}addResourceBundle(A,C,B,Q,I,E={silent:!1,skipCopy:!1}){let n=[A,C];A.indexOf(".")>-1&&(n=A.split("."),Q=B,B=C,C=n[1]),this.addNamespaces(C);let t=Hg(this.data,n)||{};E.skipCopy||(B=JSON.parse(JSON.stringify(B))),Q?MQ(t,B,I):t=j(j({},t),B),jg(this.data,n,t),E.silent||this.emit("added",A,C,B)}removeResourceBundle(A,C){this.hasResourceBundle(A,C)&&delete this.data[A][C],this.removeNamespaces(C),this.emit("removed",A,C)}hasResourceBundle(A,C){return this.getResource(A,C)!==void 0}getResourceBundle(A,C){return C||(C=this.options.defaultNS),this.getResource(A,C)}getDataByLanguage(A){return this.data[A]}hasLanguageSomeTranslations(A){const C=this.getDataByLanguage(A);return!!(C&&Object.keys(C)||[]).find(Q=>C[Q]&&Object.keys(C[Q]).length>0)}toJSON(){return this.data}}var lQ={processors:{},addPostProcessor(g){this.processors[g.name]=g},handle(g,A,C,B,Q){return g.forEach(I=>{var E,n;A=(n=(E=this.processors[I])==null?void 0:E.process(A,C,B,Q))!=null?n:A}),A}};const vQ={},PQ=g=>!K(g)&&typeof g!="boolean"&&typeof g!="number";class eC extends tC{constructor(A,C={}){super(),dA(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],A,this),this.options=C,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=gg.create("translator")}changeLanguage(A){A&&(this.language=A)}exists(A,C={interpolation:{}}){const B=j({},C);if(A==null)return!1;const Q=this.resolve(A,B);return(Q==null?void 0:Q.res)!==void 0}extractFromKey(A,C){let B=C.nsSeparator!==void 0?C.nsSeparator:this.options.nsSeparator;B===void 0&&(B=":");const Q=C.keySeparator!==void 0?C.keySeparator:this.options.keySeparator;let I=C.ns||this.options.defaultNS||[];const E=B&&A.indexOf(B)>-1,n=!this.options.userDefinedKeySeparator&&!C.keySeparator&&!this.options.userDefinedNsSeparator&&!C.nsSeparator&&!st(A,B,Q);if(E&&!n){const t=A.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:A,namespaces:K(I)?[I]:I};const e=A.split(B);(B!==Q||B===Q&&this.options.ns.indexOf(e[0])>-1)&&(I=e.shift()),A=e.join(Q)}return{key:A,namespaces:K(I)?[I]:I}}translate(A,C,B){let Q=typeof C=="object"?j({},C):C;if(typeof Q!="object"&&this.options.overloadTranslationOptionHandler&&(Q=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(Q=j({},Q)),Q||(Q={}),A==null)return"";Array.isArray(A)||(A=[String(A)]);const I=Q.returnDetails!==void 0?Q.returnDetails:this.options.returnDetails,E=Q.keySeparator!==void 0?Q.keySeparator:this.options.keySeparator,{key:n,namespaces:t}=this.extractFromKey(A[A.length-1],Q),e=t[t.length-1];let h=Q.nsSeparator!==void 0?Q.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const c=Q.lng||this.language,i=Q.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode")return i?I?{res:`${e}${h}${n}`,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:e,usedParams:this.getUsedParamsDetails(Q)}:`${e}${h}${n}`:I?{res:n,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:e,usedParams:this.getUsedParamsDetails(Q)}:n;const a=this.resolve(A,Q);let s=a==null?void 0:a.res;const r=(a==null?void 0:a.usedKey)||n,q=(a==null?void 0:a.exactUsedKey)||n,H=["[object Number]","[object Function]","[object RegExp]"],m=Q.joinArrays!==void 0?Q.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,v=Q.count!==void 0&&!K(Q.count),J=eC.hasDefaultValue(Q),k=v?this.pluralResolver.getSuffix(c,Q.count,Q):"",l=Q.ordinal&&v?this.pluralResolver.getSuffix(c,Q.count,{ordinal:!1}):"",P=v&&!Q.ordinal&&Q.count===0,T=P&&Q[`defaultValue${this.options.pluralSeparator}zero`]||Q[`defaultValue${k}`]||Q[`defaultValue${l}`]||Q.defaultValue;let O=s;M&&!s&&J&&(O=T);const X=PQ(O),F=Object.prototype.toString.apply(O);if(M&&O&&X&&H.indexOf(F)<0&&!(K(m)&&Array.isArray(O))){if(!Q.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(r,O,mA(j({},Q),{ns:t})):`key '${n} (${this.language})' returned an object instead of string.`;return I?(a.res=L,a.usedParams=this.getUsedParamsDetails(Q),a):L}if(E){const L=Array.isArray(O),z=L?[]:{},d=L?q:r;for(const G in O)if(Object.prototype.hasOwnProperty.call(O,G)){const p=`${d}${E}${G}`;J&&!s?z[G]=this.translate(p,mA(j({},Q),{defaultValue:PQ(T)?T[G]:void 0,joinArrays:!1,ns:t})):z[G]=this.translate(p,mA(j({},Q),{joinArrays:!1,ns:t})),z[G]===p&&(z[G]=O[G])}s=z}}else if(M&&K(m)&&Array.isArray(s))s=s.join(m),s&&(s=this.extendTranslation(s,A,Q,B));else{let L=!1,z=!1;!this.isValidLookup(s)&&J&&(L=!0,s=T),this.isValidLookup(s)||(z=!0,s=n);const G=(Q.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:s,p=J&&T!==s&&this.options.updateMissing;if(z||L||p){if(this.logger.log(p?"updateKey":"missingKey",c,e,n,p?T:s),E){const D=this.resolve(n,mA(j({},Q),{keySeparator:!1}));D&&D.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 w=[];const o=this.languageUtils.getFallbackCodes(this.options.fallbackLng,Q.lng||this.language);if(this.options.saveMissingTo==="fallback"&&o&&o[0])for(let D=0;D<o.length;D++)w.push(o[D]);else this.options.saveMissingTo==="all"?w=this.languageUtils.toResolveHierarchy(Q.lng||this.language):w.push(Q.lng||this.language);const u=(D,Y,x)=>{var V;const N=J&&x!==s?x:G;this.options.missingKeyHandler?this.options.missingKeyHandler(D,e,Y,N,p,Q):(V=this.backendConnector)!=null&&V.saveMissing&&this.backendConnector.saveMissing(D,e,Y,N,p,Q),this.emit("missingKey",D,e,Y,s)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?w.forEach(D=>{const Y=this.pluralResolver.getSuffixes(D,Q);P&&Q[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(x=>{u([D],n+x,Q[`defaultValue${x}`]||T)})}):u(w,n,T))}s=this.extendTranslation(s,A,Q,a,B),z&&s===n&&this.options.appendNamespaceToMissingKey&&(s=`${e}${h}${n}`),(z||L)&&this.options.parseMissingKeyHandler&&(s=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${e}${h}${n}`:n,L?s:void 0,Q))}return I?(a.res=s,a.usedParams=this.getUsedParamsDetails(Q),a):s}extendTranslation(A,C,B,Q,I){var t,e;if((t=this.i18nFormat)!=null&&t.parse)A=this.i18nFormat.parse(A,j(j({},this.options.interpolation.defaultVariables),B),B.lng||this.language||Q.usedLng,Q.usedNS,Q.usedKey,{resolved:Q});else if(!B.skipInterpolation){B.interpolation&&this.interpolator.init(mA(j({},B),{interpolation:j(j({},this.options.interpolation),B.interpolation)}));const h=K(A)&&(((e=B==null?void 0:B.interpolation)==null?void 0:e.skipOnVariables)!==void 0?B.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(h){const a=A.match(this.interpolator.nestingRegexp);c=a&&a.length}let i=B.replace&&!K(B.replace)?B.replace:B;if(this.options.interpolation.defaultVariables&&(i=j(j({},this.options.interpolation.defaultVariables),i)),A=this.interpolator.interpolate(A,i,B.lng||this.language||Q.usedLng,B),h){const a=A.match(this.interpolator.nestingRegexp),s=a&&a.length;c<s&&(B.nest=!1)}!B.lng&&Q&&Q.res&&(B.lng=this.language||Q.usedLng),B.nest!==!1&&(A=this.interpolator.nest(A,(...a)=>(I==null?void 0:I[0])===a[0]&&!B.context?(this.logger.warn(`It seems you are nesting recursively key: ${a[0]} in key: ${C[0]}`),null):this.translate(...a,C),B)),B.interpolation&&this.interpolator.reset()}const E=B.postProcess||this.options.postProcess,n=K(E)?[E]:E;return A!=null&&(n!=null&&n.length)&&B.applyPostProcessor!==!1&&(A=lQ.handle(n,A,C,this.options&&this.options.postProcessPassResolved?j({i18nResolved:mA(j({},Q),{usedParams:this.getUsedParamsDetails(B)})},B):B,this)),A}resolve(A,C={}){let B,Q,I,E,n;return K(A)&&(A=[A]),A.forEach(t=>{if(this.isValidLookup(B))return;const e=this.extractFromKey(t,C),h=e.key;Q=h;let c=e.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const i=C.count!==void 0&&!K(C.count),a=i&&!C.ordinal&&C.count===0,s=C.context!==void 0&&(K(C.context)||typeof C.context=="number")&&C.context!=="",r=C.lngs?C.lngs:this.languageUtils.toResolveHierarchy(C.lng||this.language,C.fallbackLng);c.forEach(q=>{var H,m;this.isValidLookup(B)||(n=q,!vQ[`${r[0]}-${q}`]&&((H=this.utils)!=null&&H.hasLoadedNamespace)&&!((m=this.utils)!=null&&m.hasLoadedNamespace(n))&&(vQ[`${r[0]}-${q}`]=!0,this.logger.warn(`key "${Q}" for languages "${r.join(", ")}" won't get resolved as namespace "${n}" 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!!!")),r.forEach(M=>{var k;if(this.isValidLookup(B))return;E=M;const v=[h];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(v,h,M,q,C);else{let l;i&&(l=this.pluralResolver.getSuffix(M,C.count,C));const P=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(i&&(v.push(h+l),C.ordinal&&l.indexOf(T)===0&&v.push(h+l.replace(T,this.options.pluralSeparator)),a&&v.push(h+P)),s){const O=`${h}${this.options.contextSeparator}${C.context}`;v.push(O),i&&(v.push(O+l),C.ordinal&&l.indexOf(T)===0&&v.push(O+l.replace(T,this.options.pluralSeparator)),a&&v.push(O+P))}}let J;for(;J=v.pop();)this.isValidLookup(B)||(I=J,B=this.getResource(M,q,J,C))}))})}),{res:B,usedKey:Q,exactUsedKey:I,usedLng:E,usedNS:n}}isValidLookup(A){return A!==void 0&&!(!this.options.returnNull&&A===null)&&!(!this.options.returnEmptyString&&A==="")}getResource(A,C,B,Q={}){var I;return(I=this.i18nFormat)!=null&&I.getResource?this.i18nFormat.getResource(A,C,B,Q):this.resourceStore.getResource(A,C,B,Q)}getUsedParamsDetails(A={}){const C=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],B=A.replace&&!K(A.replace);let Q=B?A.replace:A;if(B&&typeof A.count!="undefined"&&(Q.count=A.count),this.options.interpolation.defaultVariables&&(Q=j(j({},this.options.interpolation.defaultVariables),Q)),!B){Q=j({},Q);for(const I of C)delete Q[I]}return Q}static hasDefaultValue(A){const C="defaultValue";for(const B in A)if(Object.prototype.hasOwnProperty.call(A,B)&&C===B.substring(0,C.length)&&A[B]!==void 0)return!0;return!1}}class JQ{constructor(A){this.options=A,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gg.create("languageUtils")}getScriptPartFromCode(A){if(A=Kg(A),!A||A.indexOf("-")<0)return null;const C=A.split("-");return C.length===2||(C.pop(),C[C.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(C.join("-"))}getLanguagePartFromCode(A){if(A=Kg(A),!A||A.indexOf("-")<0)return A;const C=A.split("-");return this.formatLanguageCode(C[0])}formatLanguageCode(A){if(K(A)&&A.indexOf("-")>-1){let C;try{C=Intl.getCanonicalLocales(A)[0]}catch(B){}return C&&this.options.lowerCaseLng&&(C=C.toLowerCase()),C||(this.options.lowerCaseLng?A.toLowerCase():A)}return this.options.cleanCode||this.options.lowerCaseLng?A.toLowerCase():A}isSupportedCode(A){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(A=this.getLanguagePartFromCode(A)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(A)>-1}getBestMatchFromCodes(A){if(!A)return null;let C;return A.forEach(B=>{if(C)return;const Q=this.formatLanguageCode(B);(!this.options.supportedLngs||this.isSupportedCode(Q))&&(C=Q)}),!C&&this.options.supportedLngs&&A.forEach(B=>{if(C)return;const Q=this.getScriptPartFromCode(B);if(this.isSupportedCode(Q))return C=Q;const I=this.getLanguagePartFromCode(B);if(this.isSupportedCode(I))return C=I;C=this.options.supportedLngs.find(E=>{if(E===I)return E;if(!(E.indexOf("-")<0&&I.indexOf("-")<0)&&(E.indexOf("-")>0&&I.indexOf("-")<0&&E.substring(0,E.indexOf("-"))===I||E.indexOf(I)===0&&I.length>1))return E})}),C||(C=this.getFallbackCodes(this.options.fallbackLng)[0]),C}getFallbackCodes(A,C){if(!A)return[];if(typeof A=="function"&&(A=A(C)),K(A)&&(A=[A]),Array.isArray(A))return A;if(!C)return A.default||[];let B=A[C];return B||(B=A[this.getScriptPartFromCode(C)]),B||(B=A[this.formatLanguageCode(C)]),B||(B=A[this.getLanguagePartFromCode(C)]),B||(B=A.default),B||[]}toResolveHierarchy(A,C){const B=this.getFallbackCodes((C===!1?[]:C)||this.options.fallbackLng||[],A),Q=[],I=E=>{E&&(this.isSupportedCode(E)?Q.push(E):this.logger.warn(`rejecting language code not found in supportedLngs: ${E}`))};return K(A)&&(A.indexOf("-")>-1||A.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&I(this.formatLanguageCode(A)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&I(this.getScriptPartFromCode(A)),this.options.load!=="currentOnly"&&I(this.getLanguagePartFromCode(A))):K(A)&&I(this.formatLanguageCode(A)),B.forEach(E=>{Q.indexOf(E)<0&&I(this.formatLanguageCode(E))}),Q}}const TQ={zero:0,one:1,two:2,few:3,many:4,other:5},kQ={select:g=>g===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class wt{constructor(A,C={}){this.languageUtils=A,this.options=C,this.logger=gg.create("pluralResolver"),this.pluralRulesCache={}}addRule(A,C){this.rules[A]=C}clearCache(){this.pluralRulesCache={}}getRule(A,C={}){const B=Kg(A==="dev"?"en":A),Q=C.ordinal?"ordinal":"cardinal",I=JSON.stringify({cleanedCode:B,type:Q});if(I in this.pluralRulesCache)return this.pluralRulesCache[I];let E;try{E=new Intl.PluralRules(B,{type:Q})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),kQ;if(!A.match(/-|_/))return kQ;const t=this.languageUtils.getLanguagePartFromCode(A);E=this.getRule(t,C)}return this.pluralRulesCache[I]=E,E}needsPlural(A,C={}){let B=this.getRule(A,C);return B||(B=this.getRule("dev",C)),(B==null?void 0:B.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(A,C,B={}){return this.getSuffixes(A,B).map(Q=>`${C}${Q}`)}getSuffixes(A,C={}){let B=this.getRule(A,C);return B||(B=this.getRule("dev",C)),B?B.resolvedOptions().pluralCategories.sort((Q,I)=>TQ[Q]-TQ[I]).map(Q=>`${this.options.prepend}${C.ordinal?`ordinal${this.options.prepend}`:""}${Q}`):[]}getSuffix(A,C,B={}){const Q=this.getRule(A,B);return Q?`${this.options.prepend}${B.ordinal?`ordinal${this.options.prepend}`:""}${Q.select(C)}`:(this.logger.warn(`no plural rule found for: ${A}`),this.getSuffix("dev",C,B))}}const HQ=(g,A,C,B=".",Q=!0)=>{let I=Ag(g,A,C);return!I&&Q&&K(C)&&(I=NC(g,C,B),I===void 0&&(I=NC(A,C,B))),I},yC=g=>g.replace(/\$/g,"$$$$");class rt{constructor(A={}){var C;this.logger=gg.create("interpolator"),this.options=A,this.format=((C=A==null?void 0:A.interpolation)==null?void 0:C.format)||(B=>B),this.init(A)}init(A={}){A.interpolation||(A.interpolation={escapeValue:!0});const{escape:C,escapeValue:B,useRawValueToEscape:Q,prefix:I,prefixEscaped:E,suffix:n,suffixEscaped:t,formatSeparator:e,unescapeSuffix:h,unescapePrefix:c,nestingPrefix:i,nestingPrefixEscaped:a,nestingSuffix:s,nestingSuffixEscaped:r,nestingOptionsSeparator:q,maxReplaces:H,alwaysFormat:m}=A.interpolation;this.escape=C!==void 0?C:ct,this.escapeValue=B!==void 0?B:!0,this.useRawValueToEscape=Q!==void 0?Q:!1,this.prefix=I?Rg(I):E||"{{",this.suffix=n?Rg(n):t||"}}",this.formatSeparator=e||",",this.unescapePrefix=h?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=i?Rg(i):a||Rg("$t("),this.nestingSuffix=s?Rg(s):r||Rg(")"),this.nestingOptionsSeparator=q||",",this.maxReplaces=H||1e3,this.alwaysFormat=m!==void 0?m:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const A=(C,B)=>(C==null?void 0:C.source)===B?(C.lastIndex=0,C):new RegExp(B,"g");this.regexp=A(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=A(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=A(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(A,C,B,Q){var a;let I,E,n;const t=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},e=s=>{if(s.indexOf(this.formatSeparator)<0){const m=HQ(C,t,s,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,B,mA(j(j({},Q),C),{interpolationkey:s})):m}const r=s.split(this.formatSeparator),q=r.shift().trim(),H=r.join(this.formatSeparator).trim();return this.format(HQ(C,t,q,this.options.keySeparator,this.options.ignoreJSONStructure),H,B,mA(j(j({},Q),C),{interpolationkey:q}))};this.resetRegExp();const h=(Q==null?void 0:Q.missingInterpolationHandler)||this.options.missingInterpolationHandler,c=((a=Q==null?void 0:Q.interpolation)==null?void 0:a.skipOnVariables)!==void 0?Q.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:s=>yC(s)},{regex:this.regexp,safeValue:s=>this.escapeValue?yC(this.escape(s)):yC(s)}].forEach(s=>{for(n=0;I=s.regex.exec(A);){const r=I[1].trim();if(E=e(r),E===void 0)if(typeof h=="function"){const H=h(A,I,Q);E=K(H)?H:""}else if(Q&&Object.prototype.hasOwnProperty.call(Q,r))E="";else if(c){E=I[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${A}`),E="";else!K(E)&&!this.useRawValueToEscape&&(E=HA(E));const q=s.safeValue(E);if(A=A.replace(I[0],q),c?(s.regex.lastIndex+=E.length,s.regex.lastIndex-=I[0].length):s.regex.lastIndex=0,n++,n>=this.maxReplaces)break}}),A}nest(A,C,B={}){let Q,I,E;const n=(t,e)=>{var r;const h=this.nestingOptionsSeparator;if(t.indexOf(h)<0)return t;const c=t.split(new RegExp(`${h}[ ]*{`));let i=`{${c[1]}`;t=c[0],i=this.interpolate(i,E);const a=i.match(/'/g),s=i.match(/"/g);(((r=a==null?void 0:a.length)!=null?r:0)%2===0&&!s||s.length%2!==0)&&(i=i.replace(/'/g,'"'));try{E=JSON.parse(i),e&&(E=j(j({},e),E))}catch(q){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,q),`${t}${h}${i}`}return E.defaultValue&&E.defaultValue.indexOf(this.prefix)>-1&&delete E.defaultValue,t};for(;Q=this.nestingRegexp.exec(A);){let t=[];E=j({},B),E=E.replace&&!K(E.replace)?E.replace:E,E.applyPostProcessor=!1,delete E.defaultValue;const e=/{.*}/.test(Q[1])?Q[1].lastIndexOf("}")+1:Q[1].indexOf(this.formatSeparator);if(e!==-1&&(t=Q[1].slice(e).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),Q[1]=Q[1].slice(0,e)),I=C(n.call(this,Q[1].trim(),E),E),I&&Q[0]===A&&!K(I))return I;K(I)||(I=HA(I)),I||(this.logger.warn(`missed to resolve ${Q[1]} for nesting ${A}`),I=""),t.length&&(I=t.reduce((h,c)=>this.format(h,c,B.lng,mA(j({},B),{interpolationkey:Q[1].trim()})),I.trim())),A=A.replace(Q[0],I),this.regexp.lastIndex=0}return A}}const Dt=g=>{let A=g.toLowerCase().trim();const C={};if(g.indexOf("(")>-1){const B=g.split("(");A=B[0].toLowerCase().trim();const Q=B[1].substring(0,B[1].length-1);A==="currency"&&Q.indexOf(":")<0?C.currency||(C.currency=Q.trim()):A==="relativetime"&&Q.indexOf(":")<0?C.range||(C.range=Q.trim()):Q.split(";").forEach(E=>{if(E){const[n,...t]=E.split(":"),e=t.join(":").trim().replace(/^'+|'+$/g,""),h=n.trim();C[h]||(C[h]=e),e==="false"&&(C[h]=!1),e==="true"&&(C[h]=!0),isNaN(e)||(C[h]=parseInt(e,10))}})}return{formatName:A,formatOptions:C}},RQ=g=>{const A={};return(C,B,Q)=>{let I=Q;Q&&Q.interpolationkey&&Q.formatParams&&Q.formatParams[Q.interpolationkey]&&Q[Q.interpolationkey]&&(I=mA(j({},I),{[Q.interpolationkey]:void 0}));const E=B+JSON.stringify(I);let n=A[E];return n||(n=g(Kg(B),Q),A[E]=n),n(C)}},ft=g=>(A,C,B)=>g(Kg(C),B)(A);class mt{constructor(A={}){this.logger=gg.create("formatter"),this.options=A,this.init(A)}init(A,C={interpolation:{}}){this.formatSeparator=C.interpolation.formatSeparator||",";const B=C.cacheInBuiltFormats?RQ:ft;this.formats={number:B((Q,I)=>{const E=new Intl.NumberFormat(Q,j({},I));return n=>E.format(n)}),currency:B((Q,I)=>{const E=new Intl.NumberFormat(Q,mA(j({},I),{style:"currency"}));return n=>E.format(n)}),datetime:B((Q,I)=>{const E=new Intl.DateTimeFormat(Q,j({},I));return n=>E.format(n)}),relativetime:B((Q,I)=>{const E=new Intl.RelativeTimeFormat(Q,j({},I));return n=>E.format(n,I.range||"day")}),list:B((Q,I)=>{const E=new Intl.ListFormat(Q,j({},I));return n=>E.format(n)})}}add(A,C){this.formats[A.toLowerCase().trim()]=C}addCached(A,C){this.formats[A.toLowerCase().trim()]=RQ(C)}format(A,C,B,Q={}){const I=C.split(this.formatSeparator);if(I.length>1&&I[0].indexOf("(")>1&&I[0].indexOf(")")<0&&I.find(n=>n.indexOf(")")>-1)){const n=I.findIndex(t=>t.indexOf(")")>-1);I[0]=[I[0],...I.splice(1,n)].join(this.formatSeparator)}return I.reduce((n,t)=>{var c;const{formatName:e,formatOptions:h}=Dt(t);if(this.formats[e]){let i=n;try{const a=((c=Q==null?void 0:Q.formatParams)==null?void 0:c[Q.interpolationkey])||{},s=a.locale||a.lng||Q.locale||Q.lng||B;i=this.formats[e](n,s,j(j(j({},h),Q),a))}catch(a){this.logger.warn(a)}return i}else this.logger.warn(`there was no format function for ${e}`);return n},A)}}const qt=(g,A)=>{g.pending[A]!==void 0&&(delete g.pending[A],g.pendingCount--)};class Mt extends tC{constructor(A,C,B,Q={}){var I,E;super(),this.backend=A,this.store=C,this.services=B,this.languageUtils=B.languageUtils,this.options=Q,this.logger=gg.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=Q.maxParallelReads||10,this.readingCalls=0,this.maxRetries=Q.maxRetries>=0?Q.maxRetries:5,this.retryTimeout=Q.retryTimeout>=1?Q.retryTimeout:350,this.state={},this.queue=[],(E=(I=this.backend)==null?void 0:I.init)==null||E.call(I,B,Q.backend,Q)}queueLoad(A,C,B,Q){const I={},E={},n={},t={};return A.forEach(e=>{let h=!0;C.forEach(c=>{const i=`${e}|${c}`;!B.reload&&this.store.hasResourceBundle(e,c)?this.state[i]=2:this.state[i]<0||(this.state[i]===1?E[i]===void 0&&(E[i]=!0):(this.state[i]=1,h=!1,E[i]===void 0&&(E[i]=!0),I[i]===void 0&&(I[i]=!0),t[c]===void 0&&(t[c]=!0)))}),h||(n[e]=!0)}),(Object.keys(I).length||Object.keys(E).length)&&this.queue.push({pending:E,pendingCount:Object.keys(E).length,loaded:{},errors:[],callback:Q}),{toLoad:Object.keys(I),pending:Object.keys(E),toLoadLanguages:Object.keys(n),toLoadNamespaces:Object.keys(t)}}loaded(A,C,B){const Q=A.split("|"),I=Q[0],E=Q[1];C&&this.emit("failedLoading",I,E,C),!C&&B&&this.store.addResourceBundle(I,E,B,void 0,void 0,{skipCopy:!0}),this.state[A]=C?-1:2,C&&B&&(this.state[A]=0);const n={};this.queue.forEach(t=>{EC(t.loaded,[I],E),qt(t,A),C&&t.errors.push(C),t.pendingCount===0&&!t.done&&(Object.keys(t.loaded).forEach(e=>{n[e]||(n[e]={});const h=t.loaded[e];h.length&&h.forEach(c=>{n[e][c]===void 0&&(n[e][c]=!0)})}),t.done=!0,t.errors.length?t.callback(t.errors):t.callback())}),this.emit("loaded",n),this.queue=this.queue.filter(t=>!t.done)}read(A,C,B,Q=0,I=this.retryTimeout,E){if(!A.length)return E(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:A,ns:C,fcName:B,tried:Q,wait:I,callback:E});return}this.readingCalls++;const n=(e,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(e&&h&&Q<this.maxRetries){setTimeout(()=>{this.read.call(this,A,C,B,Q+1,I*2,E)},I);return}E(e,h)},t=this.backend[B].bind(this.backend);if(t.length===2){try{const e=t(A,C);e&&typeof e.then=="function"?e.then(h=>n(null,h)).catch(n):n(null,e)}catch(e){n(e)}return}return t(A,C,n)}prepareLoading(A,C,B={},Q){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),Q&&Q();K(A)&&(A=this.languageUtils.toResolveHierarchy(A)),K(C)&&(C=[C]);const I=this.queueLoad(A,C,B,Q);if(!I.toLoad.length)return I.pending.length||Q(),null;I.toLoad.forEach(E=>{this.loadOne(E)})}load(A,C,B){this.prepareLoading(A,C,{},B)}reload(A,C,B){this.prepareLoading(A,C,{reload:!0},B)}loadOne(A,C=""){const B=A.split("|"),Q=B[0],I=B[1];this.read(Q,I,"read",void 0,void 0,(E,n)=>{E&&this.logger.warn(`${C}loading namespace ${I} for language ${Q} failed`,E),!E&&n&&this.logger.log(`${C}loaded namespace ${I} for language ${Q}`,n),this.loaded(A,E,n)})}saveMissing(A,C,B,Q,I,E={},n=()=>{}){var t,e,h,c,i;if((e=(t=this.services)==null?void 0:t.utils)!=null&&e.hasLoadedNamespace&&!((c=(h=this.services)==null?void 0:h.utils)!=null&&c.hasLoadedNamespace(C))){this.logger.warn(`did not save key "${B}" as the namespace "${C}" 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(!(B==null||B==="")){if((i=this.backend)!=null&&i.create){const a=mA(j({},E),{isUpdate:I}),s=this.backend.create.bind(this.backend);if(s.length<6)try{let r;s.length===5?r=s(A,C,B,Q,a):r=s(A,C,B,Q),r&&typeof r.then=="function"?r.then(q=>n(null,q)).catch(n):n(null,r)}catch(r){n(r)}else s(A,C,B,Q,n,a)}!A||!A[0]||this.store.addResource(A[0],C,B,Q)}}}const YQ=()=>({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:g=>{let A={};if(typeof g[1]=="object"&&(A=g[1]),K(g[1])&&(A.defaultValue=g[1]),K(g[2])&&(A.tDescription=g[2]),typeof g[2]=="object"||typeof g[3]=="object"){const C=g[3]||g[2];Object.keys(C).forEach(B=>{A[B]=C[B]})}return A},interpolation:{escapeValue:!0,format:g=>g,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),xQ=g=>{var A,C;return K(g.ns)&&(g.ns=[g.ns]),K(g.fallbackLng)&&(g.fallbackLng=[g.fallbackLng]),K(g.fallbackNS)&&(g.fallbackNS=[g.fallbackNS]),((C=(A=g.supportedLngs)==null?void 0:A.indexOf)==null?void 0:C.call(A,"cimode"))<0&&(g.supportedLngs=g.supportedLngs.concat(["cimode"])),typeof g.initImmediate=="boolean"&&(g.initAsync=g.initImmediate),g},hC=()=>{},dt=g=>{Object.getOwnPropertyNames(Object.getPrototypeOf(g)).forEach(C=>{typeof g[C]=="function"&&(g[C]=g[C].bind(g))})};class pg extends tC{constructor(A={},C){if(super(),this.options=xQ(A),this.services={},this.logger=gg,this.modules={external:[]},dt(this),C&&!this.isInitialized&&!A.isClone){if(!this.options.initAsync)return this.init(A,C),this;setTimeout(()=>{this.init(A,C)},0)}}init(A={},C){this.isInitializing=!0,typeof A=="function"&&(C=A,A={}),A.defaultNS==null&&A.ns&&(K(A.ns)?A.defaultNS=A.ns:A.ns.indexOf("translation")<0&&(A.defaultNS=A.ns[0]));const B=YQ();this.options=j(j(j({},B),this.options),xQ(A)),this.options.interpolation=j(j({},B.interpolation),this.options.interpolation),A.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=A.keySeparator),A.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=A.nsSeparator);const Q=e=>e?typeof e=="function"?new e:e:null;if(!this.options.isClone){this.modules.logger?gg.init(Q(this.modules.logger),this.options):gg.init(null,this.options);let e;this.modules.formatter?e=this.modules.formatter:e=mt;const h=new JQ(this.options);this.store=new dQ(this.options.resources,this.options);const c=this.services;c.logger=gg,c.resourceStore=this.store,c.languageUtils=h,c.pluralResolver=new wt(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==B.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===B.interpolation.format)&&(c.formatter=Q(e),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new rt(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Mt(Q(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(a,...s)=>{this.emit(a,...s)}),this.modules.languageDetector&&(c.languageDetector=Q(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=Q(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new eC(this.services,this.options),this.translator.on("*",(a,...s)=>{this.emit(a,...s)}),this.modules.external.forEach(a=>{a.init&&a.init(this)})}if(this.format=this.options.interpolation.format,C||(C=hC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const 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]=(...h)=>this.store[e](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...h)=>(this.store[e](...h),this)});const n=aA(),t=()=>{const e=(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),n.resolve(c),C(h,c)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?t():setTimeout(t,0),n}loadResources(A,C=hC){var I,E;let B=C;const Q=K(A)?A:this.language;if(typeof A=="function"&&(B=A),!this.options.resources||this.options.partialBundledLanguages){if((Q==null?void 0:Q.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return B();const n=[],t=e=>{if(!e||e==="cimode")return;this.services.languageUtils.toResolveHierarchy(e).forEach(c=>{c!=="cimode"&&n.indexOf(c)<0&&n.push(c)})};Q?t(Q):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>t(h)),(E=(I=this.options.preload)==null?void 0:I.forEach)==null||E.call(I,e=>t(e)),this.services.backendConnector.load(n,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),B(e)})}else B(null)}reloadResources(A,C,B){const Q=aA();return typeof A=="function"&&(B=A,A=void 0),typeof C=="function"&&(B=C,C=void 0),A||(A=this.languages),C||(C=this.options.ns),B||(B=hC),this.services.backendConnector.reload(A,C,I=>{Q.resolve(),B(I)}),Q}use(A){if(!A)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!A.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return A.type==="backend"&&(this.modules.backend=A),(A.type==="logger"||A.log&&A.warn&&A.error)&&(this.modules.logger=A),A.type==="languageDetector"&&(this.modules.languageDetector=A),A.type==="i18nFormat"&&(this.modules.i18nFormat=A),A.type==="postProcessor"&&lQ.addPostProcessor(A),A.type==="formatter"&&(this.modules.formatter=A),A.type==="3rdParty"&&this.modules.external.push(A),this}setResolvedLanguage(A){if(!(!A||!this.languages)&&!(["cimode","dev"].indexOf(A)>-1)){for(let C=0;C<this.languages.length;C++){const B=this.languages[C];if(!(["cimode","dev"].indexOf(B)>-1)&&this.store.hasLanguageSomeTranslations(B)){this.resolvedLanguage=B;break}}!this.resolvedLanguage&&this.languages.indexOf(A)<0&&this.store.hasLanguageSomeTranslations(A)&&(this.resolvedLanguage=A,this.languages.unshift(A))}}changeLanguage(A,C){this.isLanguageChangingTo=A;const B=aA();this.emit("languageChanging",A);const Q=n=>{this.language=n,this.languages=this.services.languageUtils.toResolveHierarchy(n),this.resolvedLanguage=void 0,this.setResolvedLanguage(n)},I=(n,t)=>{t?this.isLanguageChangingTo===A&&(Q(t),this.translator.changeLanguage(t),this.isLanguageChangingTo=void 0,this.emit("languageChanged",t),this.logger.log("languageChanged",t)):this.isLanguageChangingTo=void 0,B.resolve((...e)=>this.t(...e)),C&&C(n,(...e)=>this.t(...e))},E=n=>{var h,c;!A&&!n&&this.services.languageDetector&&(n=[]);const t=K(n)?n:n&&n[0],e=this.store.hasLanguageSomeTranslations(t)?t:this.services.languageUtils.getBestMatchFromCodes(K(n)?[n]:n);e&&(this.language||Q(e),this.translator.language||this.translator.changeLanguage(e),(c=(h=this.services.languageDetector)==null?void 0:h.cacheUserLanguage)==null||c.call(h,e)),this.loadResources(e,i=>{I(i,e)})};return!A&&this.services.languageDetector&&!this.services.languageDetector.async?E(this.services.languageDetector.detect()):!A&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(E):this.services.languageDetector.detect(E):E(A),B}getFixedT(A,C,B){const Q=(I,E,...n)=>{let t;typeof E!="object"?t=this.options.overloadTranslationOptionHandler([I,E].concat(n)):t=j({},E),t.lng=t.lng||Q.lng,t.lngs=t.lngs||Q.lngs,t.ns=t.ns||Q.ns,t.keyPrefix!==""&&(t.keyPrefix=t.keyPrefix||B||Q.keyPrefix);const e=this.options.keySeparator||".";let h;return t.keyPrefix&&Array.isArray(I)?h=I.map(c=>`${t.keyPrefix}${e}${c}`):h=t.keyPrefix?`${t.keyPrefix}${e}${I}`:I,this.t(h,t)};return K(A)?Q.lng=A:Q.lngs=A,Q.ns=C,Q.keyPrefix=B,Q}t(...A){var C;return(C=this.translator)==null?void 0:C.translate(...A)}exists(...A){var C;return(C=this.translator)==null?void 0:C.exists(...A)}setDefaultNamespace(A){this.options.defaultNS=A}hasLoadedNamespace(A,C={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const B=C.lng||this.resolvedLanguage||this.languages[0],Q=this.options?this.options.fallbackLng:!1,I=this.languages[this.languages.length-1];if(B.toLowerCase()==="cimode")return!0;const E=(n,t)=>{const e=this.services.backendConnector.state[`${n}|${t}`];return e===-1||e===0||e===2};if(C.precheck){const n=C.precheck(this,E);if(n!==void 0)return n}return!!(this.hasResourceBundle(B,A)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||E(B,A)&&(!Q||E(I,A)))}loadNamespaces(A,C){const B=aA();return this.options.ns?(K(A)&&(A=[A]),A.forEach(Q=>{this.options.ns.indexOf(Q)<0&&this.options.ns.push(Q)}),this.loadResources(Q=>{B.resolve(),C&&C(Q)}),B):(C&&C(),Promise.resolve())}loadLanguages(A,C){const B=aA();K(A)&&(A=[A]);const Q=this.options.preload||[],I=A.filter(E=>Q.indexOf(E)<0&&this.services.languageUtils.isSupportedCode(E));return I.length?(this.options.preload=Q.concat(I),this.loadResources(E=>{B.resolve(),C&&C(E)}),B):(C&&C(),Promise.resolve())}dir(A){var Q,I;if(A||(A=this.resolvedLanguage||(((Q=this.languages)==null?void 0:Q.length)>0?this.languages[0]:this.language)),!A)return"rtl";if(Intl.Locale){const E=new Intl.Locale(A);if(E&&E.getTextInfo){const n=E.getTextInfo();if(n&&n.direction)return n.direction}}const C=["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"],B=((I=this.services)==null?void 0:I.languageUtils)||new JQ(YQ());return A.toLowerCase().indexOf("-latn")>1?"ltr":C.indexOf(B.getLanguagePartFromCode(A))>-1||A.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(A={},C){return new pg(A,C)}cloneInstance(A={},C=hC){const B=A.forkResourceStore;B&&delete A.forkResourceStore;const Q=mA(j(j({},this.options),A),{isClone:!0}),I=new pg(Q);if((A.debug!==void 0||A.prefix!==void 0)&&(I.logger=I.logger.clone(A)),["store","services","language"].forEach(n=>{I[n]=this[n]}),I.services=j({},this.services),I.services.utils={hasLoadedNamespace:I.hasLoadedNamespace.bind(I)},B){const n=Object.keys(this.store.data).reduce((t,e)=>(t[e]=j({},this.store.data[e]),t[e]=Object.keys(t[e]).reduce((h,c)=>(h[c]=j({},t[e][c]),h),t[e]),t),{});I.store=new dQ(n,Q),I.services.resourceStore=I.store}return I.translator=new eC(I.services,Q),I.translator.on("*",(n,...t)=>{I.emit(n,...t)}),I.init(Q,C),I.translator.options=Q,I.translator.backendConnector.services.utils={hasLoadedNamespace:I.hasLoadedNamespace.bind(I)},I}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const xA=pg.createInstance();xA.createInstance=pg.createInstance,xA.createInstance,xA.dir,xA.init,xA.loadResources,xA.reloadResources,xA.use,xA.changeLanguage,xA.getFixedT,xA.t,xA.exists,xA.setDefaultNamespace,xA.hasLoadedNamespace,xA.loadNamespaces,xA.loadLanguages;const lt={accountName:"Account Name",accountNumber:"Account Number",address:"Unit Address",agreeWith:"I agree with",and:"and",back:"Back",backIdCard:"Back ID Card",bankName:"Bank Name",beneficiaryBank:"Beneficiary Bank",businessLicense:"Business Registration License",cancel:"Cancel",cancelTransaction:"Cancel Transaction",close:"Close",codeTypeC:"C (With tax authority code)",codeTypeK:"K (Without code)",codeTypeTooltip:"C: With tax authority code, K: Without code",comingSoon:"Coming Soon",companyName:"Unit Name",completePaymentIn:"Complete your payment within",completeRegistration:"Complete registration",confirm:"Confirm",confirmationTitle:"Important Notice:",contactInfo:"3. Contact Person Information:",copy:"Copy",country:"Country",customLettersTooltip:"2 custom characters (default: YY)",customUnits:"Custom quantity",dateOfBirth:"Date of Birth",decrease:"Decrease",delete:"Delete",digitalSignaturePackage:"Digital Signature Package",district:"District",duration:"Duration",eContractTitle:"E-Contract",edit:"Edit",electronicInvoices:"e-invoices",email:"Email",enterIdCard:"Enter ID Card Number",enterInvoiceSymbol:"Enter Invoice Symbol",enterPassport:"Enter Passport Number",enterProviderName:"Enter Provider Name",enterTaxAuthorityCode:"Enter Tax Authority Code",errorCheckingCustomer:"Failed to check customer status",errorCreatingOrder:"Failed to create order",errorFetchTaxInfo:"Error fetching tax information.",errorFileFormat:"File format not supported",errorFileSize:"File size is too large",errorForbidden:"Access denied",errorInvalidAddress:"Address cannot contain special characters",errorInvalidCard:"Invalid ID card",errorInvalidDate:"Invalid date of birth",errorInvalidEmail:"Invalid email address",errorInvalidIdCard:"Invalid ID card number",errorInvalidName:"Only letters, numbers and underscores allowed",errorInvalidPhone:"Invalid phone number",errorInvalidProviderName:"Invalid provider name",errorInvalidRequest:"Invalid request",errorInvalidTaxAuthorityCode:"Invalid tax authority code",errorInvalidTaxCode:"Invalid tax code",errorLoadingData:"Failed to load data",errorLoadingInitPackages:"Failed to load registration packages",errorLoadingInvoicePackages:"Failed to load invoice packages",errorLoadingSignaturePackages:"Failed to load signature packages",errorNetwork:"Network connection error",errorNotFound:"Data not found",errorOrderStatus:"Unable to check order payment status. Please try again.",errorQRGeneration:"Unable to generate QR payment code. Please try again.",errorRequired:"This field is required",errorSearchingPackages:"Failed to search packages",errorServer:"Server error, please try again later",errorServiceUnavailable:"Service temporarily unavailable",errorTooManyRequests:"Too many requests, please try again later",errorUnauthorized:"Unauthorized access",errorUnknown:"An error occurred",errorValidation:"Invalid data",female:"Female",fileFormat:"Format",frontIdCard:"Front ID Card",fullName:"Full Name",gender:"Gender",hasUsedEInvoice:"Have you used e-invoices?",hasUsedEInvoiceBefore:"Are you using another e-invoice provider other than M-invoice?",hotlineDesc:"(Free Consulting and Support Hotline)",hotlineDomestic:"Hotline:",idNumber:"ID Card Number",increase:"Increase",informationSent:"Information sent to the provider",invoicePackage:"Invoice Package",invoiceSymbol:"Invoice Symbol",invoiceTemplate:"Invoice Template",invoiceTemplateTypes:{1:"1 (VAT Invoice)",2:"2 (Sales Invoice)",3:"3 (Public Asset Sales)",4:"4 (National Reserve Sales)",5:"5 (Stamps, Tickets, Other Cards)",6:"6 (Internal Documents)",7:"7 (Commercial Invoice)",8:"8 (VAT with Integrated Tax)",9:"9 (Sales with Integrated Tax)"},invoiceTypeB:"B (Agent)",invoiceTypeD:"D (Asset)",invoiceTypeG:"G (VAT Stamp)",invoiceTypeH:"H (Sales Stamp)",invoiceTypeL:"L (Tax Authority)",invoiceTypeM:"M (Cash Register)",invoiceTypeN:"N (Internal)",invoiceTypeT:"T (Registration)",invoiceTypeTooltip:"Invoice type",invoiceTypeX:"X (Commercial)",invoiceUsageInfo:"4. E-INVOICE USAGE INFORMATION:",invoicesPerMonth:"invoices/month",legalRepInfo:"2. Legal Representative Information:",legalRepNote:"Please check and enter the correct legal representative name according to the uploaded business license.",loading:"Loading...",male:"Male",maxFileSize:"Max 500KB",month:"Month",mostSuitablePackage:"Most Suitable Package",next:"Continue",noDataAvailable:"No data available",noPackageFound:"No package found.",notice1:"Please check your email inbox regularly to receive account information notifications from the provider.",notice2:"If you have not received the email account information (username/password) within 2 hours, please contact the information below for the fastest support:","notice3.1":"After being granted an account, please go to the Link","notice3.2":"to connect and use the service HDDT",of:"of",ok:"OK",optional:"Optional",or:"or",orderCreated:"Order created successfully",orderExpired:"Order has expired",orderInfo:"Order Information",orderSummary:"Order Summary",organizationCert:"Organization Registration Certificate",package:"Package",passport:"Passport",paymentAmount:"Payment Amount",paymentFailed:"Payment Failed",paymentInstructions:["Open your banking app or digital wallet on your phone","Select the QR Code scan feature in the app","Scan the QR code on this page and make payment"],paymentInstructionsTitle:"QR Payment Instructions",paymentMethod:"Payment Method:",paymentSuccess:"Payment Successful!",paymentTimeout:"Payment timeout",paymentTimeoutMessage:"Payment timeout! Please try again.",paymentTitle:"Payment",permanentAddress:"Permanent address",phone:"Phone Number",product:"Product",provider:"Provider",providerName:"Provider Name",province:"Province/City",qrPayment:"QR Code Payment",qrPaymentTitle:"Scan QR Code to Pay",quantity:"Quantity",registrationFee:"Registration Fee",required:"Required",returnHome:"Return Home",returnToStep1:"Return to step 1",sampleNumberTooltip:"Invoice template number (1-9)",save:"Save",searchUnits:"Units per month",selectFile:"Select File",selectInvoicePackage:"Select E-Invoice Package",selectProvider:"Select Provider",selectSignaturePackage:"Select Digital Signature Package",selectSubscriptionPackage:"Select Subscription Package",selectedProducts:"Selected Products",settings:"Settings",signaturePackage:"Digital Signature Package",softwareLicense:"E-invoice software license",stepInfo:"Information",stepPayment:"Confirmation & Payment",stepPlan:"Invoice Package",subscriptionPackage:"Subscription Package",taxAuthority:"Tax Authority",taxAuthorityCode:"5 characters issued by the Authority for cash register bills",taxCode:"Unit Tax Code",termsAndUsagePolicy:"Terms and Usage Policy",timeLeft:"Time Left",total:"Total",totalAmount:"Total Amount",totalPrice:"Total Price",transactionCanceled:"Transaction has been canceled. Returning to registration page.",unit:"Unit",unitInfo:"1. Unit Information",unitPerMonth:"units/month",unitPrice:"Unit Price",unitsPerMonth:"units/ month",uploadBackId:"Upload Back ID Card",uploadFile:"Upload File",uploadFrontId:"Upload Front ID Card",uploadLogo:"Upload Logo",usagePolicy:"Usage Policy",ward:"Ward",website:"Website",widgetTitle:"E-Invoice Registration",yearTooltip:"Release year (last 2 digits)"},vt={accountName:"Tên tài khoản",accountNumber:"Số tài khoản",address:"Địa chỉ đơn vị",agreeWith:"Tôi đồng ý với",and:"và",back:"Quay lại",backIdCard:"Mặt sau CCCD",bankName:"Ngân hàng",beneficiaryBank:"Ngân hàng thụ hưởng",businessLicense:"Giấy phép đăng ký kinh doanh",cancel:"Hủy",cancelTransaction:"Hủy giao dịch",close:"Đóng",codeTypeC:"C (Có mã CQT)",codeTypeK:"K (Không mã)",codeTypeTooltip:"C: Có mã CQT, K: Không mã",comingSoon:"Sắp ra mắt",companyName:"Tên đơn vị",completePaymentIn:"Hoàn tất thanh toán của bạn trong",completeRegistration:"Hoàn tất đăng ký",confirm:"Xác nhận",confirmationTitle:"Thông tin lưu ý:",contactInfo:"3. Thông tin người liên hệ:",copy:"Bản",country:"Quốc gia",customLettersTooltip:"2 ký tự tùy chọn (mặc định: YY)",customUnits:"Số lượng tùy chỉnh",dateOfBirth:"Ngày sinh",decrease:"Giảm",delete:"Xóa",digitalSignaturePackage:"Gói chữ ký số",district:"Quận/Huyện",duration:"Thời hạn",eContractTitle:"E-Contract",edit:"Chỉnh sửa",electronicInvoices:"hóa đơn điện tử",email:"Email",enterIdCard:"Nhập số CMND/CCCD",enterInvoiceSymbol:"Nhập ký hiệu hóa đơn",enterPassport:"Nhập số hộ chiếu",enterProviderName:"Nhập tên nhà cung cấp",enterTaxAuthorityCode:"Nhập mã CQT cấp",errorCheckingCustomer:"Không thể kiểm tra trạng thái khách hàng",errorCreatingOrder:"Không thể tạo đơn hàng",errorFetchTaxInfo:"Lỗi khi lấy thông tin mã số thuế.",errorFileFormat:"Định dạng tệp không được hỗ trợ",errorFileSize:"Kích thước tệp quá lớn",errorForbidden:"Truy cập bị từ chối",errorInvalidAddress:"Địa chỉ không được chứa ký tự đặc biệt",errorInvalidCard:"CCCD không hợp lệ",errorInvalidDate:"Ngày sinh không hợp lệ",errorInvalidEmail:"Email không hợp lệ",errorInvalidIdCard:"Số CCCD không hợp lệ",errorInvalidName:"Chỉ được dùng chữ cái, số và dấu gạch dưới",errorInvalidPhone:"Số điện thoại không hợp lệ",errorInvalidProviderName:"Tên nhà cung cấp không hợp lệ",errorInvalidRequest:"Yêu cầu không hợp lệ",errorInvalidTaxAuthorityCode:"Mã CQT cấp không hợp lệ",errorInvalidTaxCode:"Mã số thuế không hợp lệ",errorLoadingData:"Không thể tải dữ liệu",errorLoadingInitPackages:"Không thể tải gói đăng ký",errorLoadingInvoicePackages:"Không thể tải gói hóa đơn",errorLoadingSignaturePackages:"Không thể tải gói chữ ký số",errorNetwork:"Lỗi kết nối mạng",errorNotFound:"Không tìm thấy dữ liệu",errorOrderStatus:"Không thể kiểm tra trạng thái thanh toán đơn hàng. Vui lòng thử lại.",errorQRGeneration:"Không thể tạo mã QR thanh toán. Vui lòng thử lại.",errorRequired:"Trường này là bắt buộc",errorSearchingPackages:"Không thể tìm kiếm gói",errorServer:"Lỗi máy chủ, vui lòng thử lại sau",errorServiceUnavailable:"Dịch vụ tạm thời không khả dụng",errorTooManyRequests:"Quá nhiều yêu cầu, vui lòng thử lại sau",errorUnauthorized:"Không có quyền truy cập",errorUnknown:"Đã xảy ra lỗi",errorValidation:"Dữ liệu không hợp lệ",female:"Nữ",fileFormat:"Định dạng",frontIdCard:"Mặt trước CCCD",fullName:"Họ và tên",gender:"Giới tính",hasUsedEInvoice:"Bạn đã sử dụng hoá đơn điện tử?",hasUsedEInvoiceBefore:"Bạn đang sử dụng nhà NCC hoá đơn điện tử khác M-invoice không?",hotlineDesc:"(Tổng đài Tư vấn, Hỗ trợ miễn phí)",hotlineDomestic:"Hotline:",idNumber:"CCCD",increase:"Tăng",informationSent:"Đã gửi thông tin sang nhà cung cấp",invoicePackage:"Gói hóa đơn",invoiceSymbol:"Ký hiệu hóa đơn",invoiceTemplate:"Mẫu số",invoiceTemplateTypes:{1:"1 (Hóa đơn GTGT)",2:"2 (Hóa đơn bán hàng)",3:"3 (Bán tài sản công)",4:"4 (Bán dự trữ quốc gia)",5:"5 (Tem, vé, thẻ khác)",6:"6 (Chứng từ nội bộ)",7:"7 (Hóa đơn thương mại)",8:"8 (GTGT tích hợp thuế)",9:"9 (Bán hàng tích hợp thuế)"},invoiceTypeB:"B (Đại lý)",invoiceTypeD:"D (Tài sản)",invoiceTypeG:"G (Tem GTGT)",invoiceTypeH:"H (Tem bán hàng)",invoiceTypeL:"L (CQT)",invoiceTypeM:"M (Máy tính tiền)",invoiceTypeN:"N (Nội bộ)",invoiceTypeT:"T (Đăng ký)",invoiceTypeTooltip:"Loại hóa đơn",invoiceTypeX:"X (Thương mại)",invoiceUsageInfo:"4. THÔNG TIN SỬ DỤNG HDDT:",invoicesPerMonth:"hóa đơn/tháng",legalRepInfo:"2. Thông tin người đại diện pháp luật:",legalRepNote:"Vui lòng kiểm tra và nhập đúng tên người đại diện theo Giấy phép kinh doanh đã tải lên.",loading:"Đang tải...",male:"Nam",maxFileSize:"Tối đa 500Kb",month:"Tháng",mostSuitablePackage:"Gói phù hợp nhất",next:"Tiếp tục",noDataAvailable:"Không có dữ liệu",noPackageFound:"Không tìm thấy gói nào.",notice1:"Vui lòng thường xuyên kiểm tra hộp thư Email nhận thông báo thông tin tài khoản từ nhà cung cấp",notice2:"Trong vòng 2 giờ nếu chưa nhận được thông tin Email tài khoản (username/password). Bạn có thể liên hệ thông tin phía bên dưới để được hỗ trợ sớm nhất:","notice3.1":"Sau khi được cấp tài khoản, vui lòng vào Link","notice3.2":"để kết nối và sử dụng dịch vụ HDDT",of:"của",ok:"OK",optional:"Tùy chọn",or:"hoặc",orderCreated:"Đơn hàng đã được tạo thành công",orderExpired:"Đơn hàng đã hết hạn",orderInfo:"Thông tin đơn hàng",orderSummary:"Tóm tắt đơn hàng",organizationCert:"Giấy chứng nhận đăng ký doanh nghiệp",package:"Gói",passport:"Hộ chiếu",paymentAmount:"Số tiền thanh toán",paymentFailed:"Thanh toán thất bại",paymentInstructions:["Mở ứng dụng Ngân hàng hoặc Ví điện tử trên điện thoại","Trên ứng dụng chọn tính năng Quét mã QR","Quét mã QR ở trang này và thanh toán"],paymentInstructionsTitle:"Hướng dẫn thanh toán QR",paymentMethod:"Hình thức thanh toán:",paymentSuccess:"Thanh toán thành công!",paymentTimeout:"Hết thời gian thanh toán",paymentTimeoutMessage:"Hết thời gian thanh toán! Vui lòng thử lại.",paymentTitle:"Thanh toán",permanentAddress:"Địa chỉ thường trú",phone:"Số điện thoại",product:"Sản phẩm",provider:"Nhà cung cấp",providerName:"Tên NCC",province:"Tỉnh/Thành phố",qrPayment:"Thanh toán qua mã QR",qrPaymentTitle:"Quét mã QR để thanh toán",quantity:"Số lượng",registrationFee:"Phí đăng ký",required:"Bắt buộc",returnHome:"Trở về trang chủ",returnToStep1:"Quay lại bước 1",sampleNumberTooltip:"Mẫu số hóa đơn (1-9)",save:"Lưu",searchUnits:"Số đơn/tháng",selectFile:"Chọn tệp",selectInvoicePackage:"Chọn gói hóa đơn điện tử",selectProvider:"Chọn nhà cung cấp",selectSignaturePackage:"Chọn gói chữ ký số",selectSubscriptionPackage:"Chọn gói đăng ký",selectedProducts:"Sản phẩm đã chọn",settings:"Thiết lập",signaturePackage:"Gói chữ ký số",softwareLicense:"Bản quyền phần mềm hóa đơn điện tử",stepInfo:"Thông Tin",stepPayment:"Xác Nhận Và Thanh Toán",stepPlan:"Gói Hóa Đơn",subscriptionPackage:"Gói đăng ký",taxAuthority:"CQT quản lý",taxAuthorityCode:"5 ký tự do CQT cấp cho loại hóa đơn máy tính tiền",taxCode:"Mã số thuế đơn vị",termsAndUsagePolicy:"Điều khoản và Chính sách sử dụng",timeLeft:"Thời gian còn lại",total:"Tổng cộng",totalAmount:"Tổng tiền",totalPrice:"Thành tiền",transactionCanceled:"Giao dịch đã được hủy. Quay về trang đăng ký.",unit:"Đơn vị tính",unitInfo:"1. Thông tin đơn vị",unitPerMonth:"đơn/tháng",unitPrice:"Đơn giá",unitsPerMonth:"đơn/ tháng",uploadBackId:"Tải lên mặt sau CCCD",uploadFile:"Tải lên tệp",uploadFrontId:"Tải lên mặt trước CCCD",uploadLogo:"Tải logo lên",usagePolicy:"Chính sách sử dụng",ward:"Phường/Xã",website:"Website",widgetTitle:"Đăng ký hóa đơn điện tử",yearTooltip:"Năm phát hành (2 chữ số cuối)"},{slice:Pt,forEach:Jt}=[];function Tt(g){return Jt.call(Pt.call(arguments,1),A=>{if(A)for(const C in A)g[C]===void 0&&(g[C]=A[C])}),g}function kt(g){return typeof g!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(C=>C.test(g))}const zQ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ht=function(g,A){const B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},Q=encodeURIComponent(A);let I=`${g}=${Q}`;if(B.maxAge>0){const E=B.maxAge-0;if(Number.isNaN(E))throw new Error("maxAge should be a Number");I+=`; Max-Age=${Math.floor(E)}`}if(B.domain){if(!zQ.test(B.domain))throw new TypeError("option domain is invalid");I+=`; Domain=${B.domain}`}if(B.path){if(!zQ.test(B.path))throw new TypeError("option path is invalid");I+=`; Path=${B.path}`}if(B.expires){if(typeof B.expires.toUTCString!="function")throw new TypeError("option expires is invalid");I+=`; Expires=${B.expires.toUTCString()}`}if(B.httpOnly&&(I+="; HttpOnly"),B.secure&&(I+="; Secure"),B.sameSite)switch(typeof B.sameSite=="string"?B.sameSite.toLowerCase():B.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 new TypeError("option sameSite is invalid")}return B.partitioned&&(I+="; Partitioned"),I},GQ={create(g,A,C,B){let Q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};C&&(Q.expires=new Date,Q.expires.setTime(Q.expires.getTime()+C*60*1e3)),B&&(Q.domain=B),document.cookie=Ht(g,A,Q)},read(g){const A=`${g}=`,C=document.cookie.split(";");for(let B=0;B<C.length;B++){let Q=C[B];for(;Q.charAt(0)===" ";)Q=Q.substring(1,Q.length);if(Q.indexOf(A)===0)return Q.substring(A.length,Q.length)}return null},remove(g,A){this.create(g,"",-1,A)}};var Rt={name:"cookie",lookup(g){let{lookupCookie:A}=g;if(A&&typeof document!="undefined")return GQ.read(A)||void 0},cacheUserLanguage(g,A){let{lookupCookie:C,cookieMinutes:B,cookieDomain:Q,cookieOptions:I}=A;C&&typeof document!="undefined"&&GQ.create(C,g,B,Q,I)}},Yt={name:"querystring",lookup(g){var B;let{lookupQuerystring:A}=g,C;if(typeof window!="undefined"){let{search:Q}=window.location;!window.location.search&&((B=window.location.hash)==null?void 0:B.indexOf("?"))>-1&&(Q=window.location.hash.substring(window.location.hash.indexOf("?")));const E=Q.substring(1).split("&");for(let n=0;n<E.length;n++){const t=E[n].indexOf("=");t>0&&E[n].substring(0,t)===A&&(C=E[n].substring(t+1))}}return C}},xt={name:"hash",lookup(g){var Q;let{lookupHash:A,lookupFromHashIndex:C}=g,B;if(typeof window!="undefined"){const{hash:I}=window.location;if(I&&I.length>2){const E=I.substring(1);if(A){const n=E.split("&");for(let t=0;t<n.length;t++){const e=n[t].indexOf("=");e>0&&n[t].substring(0,e)===A&&(B=n[t].substring(e+1))}}if(B)return B;if(!B&&C>-1){const n=I.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(Q=n[typeof C=="number"?C:0])==null?void 0:Q.replace("/",""):void 0}}}return B}};let Yg=null;const OQ=()=>{if(Yg!==null)return Yg;try{if(Yg=typeof window!="undefined"&&window.localStorage!==null,!Yg)return!1;const g="i18next.translate.boo";window.localStorage.setItem(g,"foo"),window.localStorage.removeItem(g)}catch(g){Yg=!1}return Yg};var zt={name:"localStorage",lookup(g){let{lookupLocalStorage:A}=g;if(A&&OQ())return window.localStorage.getItem(A)||void 0},cacheUserLanguage(g,A){let{lookupLocalStorage:C}=A;C&&OQ()&&window.localStorage.setItem(C,g)}};let xg=null;const XQ=()=>{if(xg!==null)return xg;try{if(xg=typeof window!="undefined"&&window.sessionStorage!==null,!xg)return!1;const g="i18next.translate.boo";window.sessionStorage.setItem(g,"foo"),window.sessionStorage.removeItem(g)}catch(g){xg=!1}return xg};var Gt={name:"sessionStorage",lookup(g){let{lookupSessionStorage:A}=g;if(A&&XQ())return window.sessionStorage.getItem(A)||void 0},cacheUserLanguage(g,A){let{lookupSessionStorage:C}=A;C&&XQ()&&window.sessionStorage.setItem(C,g)}},Ot={name:"navigator",lookup(g){const A=[];if(typeof navigator!="undefined"){const{languages:C,userLanguage:B,language:Q}=navigator;if(C)for(let I=0;I<C.length;I++)A.push(C[I]);B&&A.push(B),Q&&A.push(Q)}return A.length>0?A:void 0}},Xt={name:"htmlTag",lookup(g){let{htmlTag:A}=g,C;const B=A||(typeof document!="undefined"?document.documentElement:null);return B&&typeof B.getAttribute=="function"&&(C=B.getAttribute("lang")),C}},Ft={name:"path",lookup(g){var Q;let{lookupFromPathIndex:A}=g;if(typeof window=="undefined")return;const C=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(C)?(Q=C[typeof A=="number"?A:0])==null?void 0:Q.replace("/",""):void 0}},Lt={name:"subdomain",lookup(g){var Q,I;let{lookupFromSubdomainIndex:A}=g;const C=typeof A=="number"?A+1:1,B=typeof window!="undefined"&&((I=(Q=window.location)==null?void 0:Q.hostname)==null?void 0:I.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(B)return B[C]}};let FQ=!1;try{document.cookie,FQ=!0}catch(g){}const LQ=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];FQ||LQ.splice(1,1);const Nt=()=>({order:LQ,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:g=>g});class NQ{constructor(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(A,C)}init(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=A,this.options=Tt(C,this.options||{},Nt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=Q=>Q.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=B,this.addDetector(Rt),this.addDetector(Yt),this.addDetector(zt),this.addDetector(Gt),this.addDetector(Ot),this.addDetector(Xt),this.addDetector(Ft),this.addDetector(Lt),this.addDetector(xt)}addDetector(A){return this.detectors[A.name]=A,this}detect(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,C=[];return A.forEach(B=>{if(this.detectors[B]){let Q=this.detectors[B].lookup(this.options);Q&&typeof Q=="string"&&(Q=[Q]),Q&&(C=C.concat(Q))}}),C=C.filter(B=>B!=null&&!kt(B)).map(B=>this.options.convertDetectedLanguage(B)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?C:C.length>0?C[0]:null}cacheUserLanguage(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;C&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(A)>-1||C.forEach(B=>{this.detectors[B]&&this.detectors[B].cacheUserLanguage(A,this.options)}))}}NQ.type="languageDetector";function bC(g){"@babel/helpers - typeof";return bC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},bC(g)}function yQ(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":bC(XMLHttpRequest))==="object"}function yt(g){return!!g&&typeof g.then=="function"}function bt(g){return yt(g)?g:Promise.resolve(g)}function bQ(g,A){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(g);A&&(B=B.filter(function(Q){return Object.getOwnPropertyDescriptor(g,Q).enumerable})),C.push.apply(C,B)}return C}function jQ(g){for(var A=1;A<arguments.length;A++){var C=arguments[A]!=null?arguments[A]:{};A%2?bQ(Object(C),!0).forEach(function(B){jt(g,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):bQ(Object(C)).forEach(function(B){Object.defineProperty(g,B,Object.getOwnPropertyDescriptor(C,B))})}return g}function jt(g,A,C){return(A=Kt(A))in g?Object.defineProperty(g,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[A]=C,g}function Kt(g){var A=pt(g,"string");return fg(A)=="symbol"?A:A+""}function pt(g,A){if(fg(g)!="object"||!g)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var B=C.call(g,A);if(fg(B)!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(g)}function fg(g){"@babel/helpers - typeof";return fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},fg(g)}var sg=typeof fetch=="function"?fetch:void 0;typeof global!="undefined"&&global.fetch?sg=global.fetch:typeof window!="undefined"&&window.fetch&&(sg=window.fetch);var Sg;yQ()&&(typeof global!="undefined"&&global.XMLHttpRequest?Sg=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(Sg=window.XMLHttpRequest));var cC;if(typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?cC=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(cC=window.ActiveXObject)),typeof sg!="function"&&(sg=void 0),!sg&&!Sg&&!cC)try{Promise.resolve().then(()=>t0).then(function(g){sg=g.default}).catch(function(){})}catch(g){}var jC=function(A,C){if(C&&fg(C)==="object"){var B="";for(var Q in C)B+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(C[Q]);if(!B)return A;A=A+(A.indexOf("?")!==-1?"&":"?")+B.slice(1)}return A},KQ=function(A,C,B,Q){var I=function(t){if(!t.ok)return B(t.statusText||"Error",{status:t.status});t.text().then(function(e){B(null,{status:t.status,data:e})}).catch(B)};if(Q){var E=Q(A,C);if(E instanceof Promise){E.then(I).catch(B);return}}typeof fetch=="function"?fetch(A,C).then(I).catch(B):sg(A,C).then(I).catch(B)},pQ=!1,St=function(A,C,B,Q){A.queryStringParams&&(C=jC(C,A.queryStringParams));var I=jQ({},typeof A.customHeaders=="function"?A.customHeaders():A.customHeaders);typeof window=="undefined"&&typeof global!="undefined"&&typeof global.process!="undefined"&&global.process.versions&&global.process.versions.node&&(I["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),B&&(I["Content-Type"]="application/json");var E=typeof A.requestOptions=="function"?A.requestOptions(B):A.requestOptions,n=jQ({method:B?"POST":"GET",body:B?A.stringify(B):void 0,headers:I},pQ?{}:E),t=typeof A.alternateFetch=="function"&&A.alternateFetch.length>=1?A.alternateFetch:void 0;try{KQ(C,n,Q,t)}catch(e){if(!E||Object.keys(E).length===0||!e.message||e.message.indexOf("not implemented")<0)return Q(e);try{Object.keys(E).forEach(function(h){delete n[h]}),KQ(C,n,Q,t),pQ=!0}catch(h){Q(h)}}},Ut=function(A,C,B,Q){B&&fg(B)==="object"&&(B=jC("",B).slice(1)),A.queryStringParams&&(C=jC(C,A.queryStringParams));try{var I=Sg?new Sg:new cC("MSXML2.XMLHTTP.3.0");I.open(B?"POST":"GET",C,1),A.crossDomain||I.setRequestHeader("X-Requested-With","XMLHttpRequest"),I.withCredentials=!!A.withCredentials,B&&I.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),I.overrideMimeType&&I.overrideMimeType("application/json");var E=A.customHeaders;if(E=typeof E=="function"?E():E,E)for(var n in E)I.setRequestHeader(n,E[n]);I.onreadystatechange=function(){I.readyState>3&&Q(I.status>=400?I.statusText:null,{status:I.status,data:I.responseText})},I.send(B)}catch(t){console&&console.log(t)}},Zt=function(A,C,B,Q){if(typeof B=="function"&&(Q=B,B=void 0),Q=Q||function(){},sg&&C.indexOf("file:")!==0)return St(A,C,B,Q);if(yQ()||typeof ActiveXObject=="function")return Ut(A,C,B,Q);Q(new Error("No fetch and no xhr implementation found!"))};function zg(g){"@babel/helpers - typeof";return zg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},zg(g)}function SQ(g,A){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(g);A&&(B=B.filter(function(Q){return Object.getOwnPropertyDescriptor(g,Q).enumerable})),C.push.apply(C,B)}return C}function KC(g){for(var A=1;A<arguments.length;A++){var C=arguments[A]!=null?arguments[A]:{};A%2?SQ(Object(C),!0).forEach(function(B){UQ(g,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):SQ(Object(C)).forEach(function(B){Object.defineProperty(g,B,Object.getOwnPropertyDescriptor(C,B))})}return g}function Vt(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function Wt(g,A){for(var C=0;C<A.length;C++){var B=A[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(g,ZQ(B.key),B)}}function $t(g,A,C){return A&&Wt(g.prototype,A),Object.defineProperty(g,"prototype",{writable:!1}),g}function UQ(g,A,C){return(A=ZQ(A))in g?Object.defineProperty(g,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[A]=C,g}function ZQ(g){var A=_t(g,"string");return zg(A)=="symbol"?A:A+""}function _t(g,A){if(zg(g)!="object"||!g)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var B=C.call(g,A);if(zg(B)!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}var A0=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(C){return JSON.parse(C)},stringify:JSON.stringify,parsePayload:function(C,B,Q){return UQ({},B,Q||"")},parseLoadPayload:function(C,B){},request:Zt,reloadInterval:typeof window!="undefined"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},VQ=function(){function g(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Vt(this,g),this.services=A,this.options=C,this.allOptions=B,this.type="backend",this.init(A,C,B)}return $t(g,[{key:"init",value:function(C){var B=this,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=C,this.options=KC(KC(KC({},A0()),this.options||{}),Q),this.allOptions=I,this.services&&this.options.reloadInterval){var E=setInterval(function(){return B.reload()},this.options.reloadInterval);zg(E)==="object"&&typeof E.unref=="function"&&E.unref()}}},{key:"readMulti",value:function(C,B,Q){this._readAny(C,C,B,B,Q)}},{key:"read",value:function(C,B,Q){this._readAny([C],C,[B],B,Q)}},{key:"_readAny",value:function(C,B,Q,I,E){var n=this,t=this.options.loadPath;typeof this.options.loadPath=="function"&&(t=this.options.loadPath(C,Q)),t=bt(t),t.then(function(e){if(!e)return E(null,{});var h=n.services.interpolator.interpolate(e,{lng:C.join("+"),ns:Q.join("+")});n.loadUrl(h,E,B,I)})}},{key:"loadUrl",value:function(C,B,Q,I){var E=this,n=typeof Q=="string"?[Q]:Q,t=typeof I=="string"?[I]:I,e=this.options.parseLoadPayload(n,t);this.options.request(this.options,C,e,function(h,c){if(c&&(c.status>=500&&c.status<600||!c.status))return B("failed loading "+C+"; status code: "+c.status,!0);if(c&&c.status>=400&&c.status<500)return B("failed loading "+C+"; status code: "+c.status,!1);if(!c&&h&&h.message){var i=h.message.toLowerCase(),a=["failed","fetch","network","load"].find(function(q){return i.indexOf(q)>-1});if(a)return B("failed loading "+C+": "+h.message,!0)}if(h)return B(h,!1);var s,r;try{typeof c.data=="string"?s=E.options.parse(c.data,Q,I):s=c.data}catch(q){r="failed parsing "+C+" to json"}if(r)return B(r,!1);B(null,s)})}},{key:"create",value:function(C,B,Q,I,E){var n=this;if(this.options.addPath){typeof C=="string"&&(C=[C]);var t=this.options.parsePayload(B,Q,I),e=0,h=[],c=[];C.forEach(function(i){var a=n.options.addPath;typeof n.options.addPath=="function"&&(a=n.options.addPath(i,B));var s=n.services.interpolator.interpolate(a,{lng:i,ns:B});n.options.request(n.options,s,t,function(r,q){e+=1,h.push(r),c.push(q),e===C.length&&typeof E=="function"&&E(h,c)})})}}},{key:"reload",value:function(){var C=this,B=this.services,Q=B.backendConnector,I=B.languageUtils,E=B.logger,n=Q.language;if(!(n&&n.toLowerCase()==="cimode")){var t=[],e=function(c){var i=I.toResolveHierarchy(c);i.forEach(function(a){t.indexOf(a)<0&&t.push(a)})};e(n),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return e(h)}),t.forEach(function(h){C.allOptions.ns.forEach(function(c){Q.read(h,c,"read",null,null,function(i,a){i&&E.warn("loading namespace ".concat(c," for language ").concat(h," failed"),i),!i&&a&&E.log("loaded namespace ".concat(c," for language ").concat(h),a),Q.loaded("".concat(h,"|").concat(c),i,a)})})})}}}])}();VQ.type="backend",xA.use(VQ).use(NQ).init({lng:"vi",fallbackLng:"vi",debug:!1,resources:{en:{translation:lt},vi:{translation:vt}},interpolation:{escapeValue:!1},returnObjects:!0});function g0(g){xA.changeLanguage(g)}function f(g,A){return xA.t(g,j({returnObjects:!0},A))}function C0(g="dev"){const A={dev:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-stag.atomsolution.vn/v1/portal"},stag:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-stag.atomsolution.vn/v1/portal"},uat:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-api-outscope.atomsolution.vn/v1/portal"},pilot:{invoiceHubBaseUrl:"https://invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-smartmerchant-pl-api.ocb.com.vn/v1/portal",posBvbApiUrl:"https://api-outscope-pos.bvbank.net.vn/v1/portal"},prod:{invoiceHubBaseUrl:"https://invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-smartmerchant-api.ocb.com.vn/v1/portal",posBvbApiUrl:"https://api-outscope-pos.bvbank.net.vn/v1/portal"}};return A[g]||A.dev}let oC=null,pC=!1;function WQ(g){if(!["dev","uat","prod","stag","pilot"].includes(g))throw new Error(`Invalid mode: ${g}. Valid modes are 'dev', 'uat', 'prod', 'stag', 'pilot'.`);oC=g,pC=!0;try{localStorage.setItem("currentMode",g)}catch(A){console.warn("Could not save to localStorage:",A)}}function B0(){if(pC&&oC)return oC;try{const g=localStorage.getItem("currentMode");if(g)return oC=g,pC=!0,g}catch(g){console.warn("Could not read from localStorage:",g)}return"dev"}function iC(){const g=B0();return C0(g)}const Ug={dev:{bvb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!0,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}},ocb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!0,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}}},prod:{bvb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}},ocb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}}},stag:{bvb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}},ocb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}}},uat:{bvb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}},ocb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}}},pilot:{bvb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}},ocb:{fpt:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"",isActive:!1,link:"https://minvoice.vn",name:"m-invoice",onboarding:!1,sso:!1}}}};let SC=null,UC=null;function Q0(g){return U(this,null,function*(){if(g.mode&&WQ(g.mode),g.language&&VC(g.language),!UC){const{InvoiceRegisterWidget:B}=yield Promise.resolve().then(()=>fn);UC=B}const A=typeof g.selector=="string"?document.querySelector(g.selector):g.selector;if(!A)throw new Error(`[WidgetSDK] Mount element not found: ${g.selector}`);function C(){A.innerHTML="",g.onClose&&g.onClose()}return UC(A,C,g.onShowPolicy||(()=>{}),g.data||{},g.theme,g.mode),{destroy:C}})}function I0(g){return U(this,null,function*(){if(g.mode&&WQ(g.mode),g.language&&VC(g.language),!SC){const{EContractWidget:B}=yield Promise.resolve().then(()=>fn);SC=B}const A=typeof g.selector=="string"?document.querySelector(g.selector):g.selector;if(!A)throw new Error(`[WidgetSDK] Mount element not found: ${g.selector}`);function C(){A.innerHTML="",g.onClose&&g.onClose()}return SC(A,C,g.data||{},g.theme),{destroy:C}})}let ZC=new Set;function VC(g){if(g!=="vi"&&g!=="en")throw new Error(`[WidgetSDK] Unsupported language: ${g}`);g0(g),ZC.forEach(A=>{A.rerender&&A.rerender()})}function WC(g){ZC.add(g)}function $C(g){ZC.delete(g)}function E0(){return Ug}var $Q=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function aC(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var sC={exports:{}},_Q;function n0(){return _Q||(_Q=1,function(g,A){var C=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof $Q!="undefined"&&$Q,B=function(){function I(){this.fetch=!1,this.DOMException=C.DOMException}return I.prototype=C,new I}();(function(I){(function(E){var n=typeof I!="undefined"&&I||typeof self!="undefined"&&self||typeof n!="undefined"&&n,t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(d){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function e(d){return d&&DataView.prototype.isPrototypeOf(d)}if(t.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(d){return d&&h.indexOf(Object.prototype.toString.call(d))>-1};function i(d){if(typeof d!="string"&&(d=String(d)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(d)||d==="")throw new TypeError('Invalid character in header field name: "'+d+'"');return d.toLowerCase()}function a(d){return typeof d!="string"&&(d=String(d)),d}function s(d){var G={next:function(){var p=d.shift();return{done:p===void 0,value:p}}};return t.iterable&&(G[Symbol.iterator]=function(){return G}),G}function r(d){this.map={},d instanceof r?d.forEach(function(G,p){this.append(p,G)},this):Array.isArray(d)?d.forEach(function(G){this.append(G[0],G[1])},this):d&&Object.getOwnPropertyNames(d).forEach(function(G){this.append(G,d[G])},this)}r.prototype.append=function(d,G){d=i(d),G=a(G);var p=this.map[d];this.map[d]=p?p+", "+G:G},r.prototype.delete=function(d){delete this.map[i(d)]},r.prototype.get=function(d){return d=i(d),this.has(d)?this.map[d]:null},r.prototype.has=function(d){return this.map.hasOwnProperty(i(d))},r.prototype.set=function(d,G){this.map[i(d)]=a(G)},r.prototype.forEach=function(d,G){for(var p in this.map)this.map.hasOwnProperty(p)&&d.call(G,this.map[p],p,this)},r.prototype.keys=function(){var d=[];return this.forEach(function(G,p){d.push(p)}),s(d)},r.prototype.values=function(){var d=[];return this.forEach(function(G){d.push(G)}),s(d)},r.prototype.entries=function(){var d=[];return this.forEach(function(G,p){d.push([p,G])}),s(d)},t.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries);function q(d){if(d.bodyUsed)return Promise.reject(new TypeError("Already read"));d.bodyUsed=!0}function H(d){return new Promise(function(G,p){d.onload=function(){G(d.result)},d.onerror=function(){p(d.error)}})}function m(d){var G=new FileReader,p=H(G);return G.readAsArrayBuffer(d),p}function M(d){var G=new FileReader,p=H(G);return G.readAsText(d),p}function v(d){for(var G=new Uint8Array(d),p=new Array(G.length),w=0;w<G.length;w++)p[w]=String.fromCharCode(G[w]);return p.join("")}function J(d){if(d.slice)return d.slice(0);var G=new Uint8Array(d.byteLength);return G.set(new Uint8Array(d)),G.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(d){this.bodyUsed=this.bodyUsed,this._bodyInit=d,d?typeof d=="string"?this._bodyText=d:t.blob&&Blob.prototype.isPrototypeOf(d)?this._bodyBlob=d:t.formData&&FormData.prototype.isPrototypeOf(d)?this._bodyFormData=d:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)?this._bodyText=d.toString():t.arrayBuffer&&t.blob&&e(d)?(this._bodyArrayBuffer=J(d.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(d)||c(d))?this._bodyArrayBuffer=J(d):this._bodyText=d=Object.prototype.toString.call(d):this._bodyText="",this.headers.get("content-type")||(typeof d=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var d=q(this);if(d)return d;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var d=q(this);return d||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(m)}),this.text=function(){var d=q(this);if(d)return d;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(v(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}var l=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(d){var G=d.toUpperCase();return l.indexOf(G)>-1?G:d}function T(d,G){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');G=G||{};var p=G.body;if(d instanceof T){if(d.bodyUsed)throw new TypeError("Already read");this.url=d.url,this.credentials=d.credentials,G.headers||(this.headers=new r(d.headers)),this.method=d.method,this.mode=d.mode,this.signal=d.signal,!p&&d._bodyInit!=null&&(p=d._bodyInit,d.bodyUsed=!0)}else this.url=String(d);if(this.credentials=G.credentials||this.credentials||"same-origin",(G.headers||!this.headers)&&(this.headers=new r(G.headers)),this.method=P(G.method||this.method||"GET"),this.mode=G.mode||this.mode||null,this.signal=G.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&p)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(p),(this.method==="GET"||this.method==="HEAD")&&(G.cache==="no-store"||G.cache==="no-cache")){var w=/([?&])_=[^&]*/;if(w.test(this.url))this.url=this.url.replace(w,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function O(d){var G=new FormData;return d.trim().split("&").forEach(function(p){if(p){var w=p.split("="),o=w.shift().replace(/\+/g," "),u=w.join("=").replace(/\+/g," ");G.append(decodeURIComponent(o),decodeURIComponent(u))}}),G}function X(d){var G=new r,p=d.replace(/\r?\n[\t ]+/g," ");return p.split("\r").map(function(w){return w.indexOf(`
1
+ (function(_,BA){typeof exports=="object"&&typeof module!="undefined"?BA(exports):typeof define=="function"&&define.amd?define(["exports"],BA):(_=typeof globalThis!="undefined"?globalThis:_||self,BA(_.InvoiceRegisterWidget={}))})(this,function(_){"use strict";var Jo=Object.defineProperty,To=Object.defineProperties;var ko=Object.getOwnPropertyDescriptors;var LC=Object.getOwnPropertySymbols;var Et=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable;var bg=(_,BA)=>(BA=Symbol[_])?BA:Symbol.for("Symbol."+_),Ho=_=>{throw TypeError(_)};var It=(_,BA,K)=>BA in _?Jo(_,BA,{enumerable:!0,configurable:!0,writable:!0,value:K}):_[BA]=K,j=(_,BA)=>{for(var K in BA||(BA={}))Et.call(BA,K)&&It(_,K,BA[K]);if(LC)for(var K of LC(BA))nt.call(BA,K)&&It(_,K,BA[K]);return _},mA=(_,BA)=>To(_,ko(BA));var fQ=(_,BA)=>{var K={};for(var aA in _)Et.call(_,aA)&&BA.indexOf(aA)<0&&(K[aA]=_[aA]);if(_!=null&&LC)for(var aA of LC(_))BA.indexOf(aA)<0&&nt.call(_,aA)&&(K[aA]=_[aA]);return K};var U=(_,BA,K)=>new Promise((aA,HA)=>{var dA=lA=>{try{YA(K.next(lA))}catch(XA){HA(XA)}},RA=lA=>{try{YA(K.throw(lA))}catch(XA){HA(XA)}},YA=lA=>lA.done?aA(lA.value):Promise.resolve(lA.value).then(dA,RA);YA((K=K.apply(_,BA)).next())}),kg=function(_,BA){this[0]=_,this[1]=BA},mQ=(_,BA,K)=>{var aA=(RA,YA,lA,XA)=>{try{var jg=K[RA](YA),EC=(YA=jg.value)instanceof kg,Hg=jg.done;Promise.resolve(EC?YA[0]:YA).then(Ag=>EC?aA(RA==="return"?RA:"next",YA[1]?{done:Ag.done,value:Ag.value}:Ag,lA,XA):lA({value:Ag,done:Hg})).catch(Ag=>aA("throw",Ag,lA,XA))}catch(Ag){XA(Ag)}},HA=RA=>dA[RA]=YA=>new Promise((lA,XA)=>aA(RA,YA,lA,XA)),dA={};return K=K.apply(_,BA),dA[bg("asyncIterator")]=()=>dA,HA("next"),HA("throw"),HA("return"),dA},qQ=_=>{var BA=_[bg("asyncIterator")],K=!1,aA,HA={};return BA==null?(BA=_[bg("iterator")](),aA=dA=>HA[dA]=RA=>BA[dA](RA)):(BA=BA.call(_),aA=dA=>HA[dA]=RA=>{if(K){if(K=!1,dA==="throw")throw RA;return RA}return K=!0,{done:!1,value:new kg(new Promise(YA=>{var lA=BA[dA](RA);lA instanceof Object||Ho("Object expected"),YA(lA)}),1)}}),HA[bg("iterator")]=()=>HA,aA("next"),"throw"in BA?aA("throw"):HA.throw=dA=>{throw dA},"return"in BA&&aA("return"),HA},tt=(_,BA,K)=>(BA=_[bg("asyncIterator")])?BA.call(_):(_=_[bg("iterator")](),BA={},K=(aA,HA)=>(HA=_[aA])&&(BA[aA]=dA=>new Promise((RA,YA,lA)=>(dA=HA.call(_,dA),lA=dA.done,Promise.resolve(dA.value).then(XA=>RA({value:XA,done:lA}),YA)))),K("next"),K("return"),BA);function BA(g,A){for(var C=0;C<A.length;C++){const B=A[C];if(typeof B!="string"&&!Array.isArray(B)){for(const Q in B)if(Q!=="default"&&!(Q in g)){const I=Object.getOwnPropertyDescriptor(B,Q);I&&Object.defineProperty(g,Q,I.get?I:{enumerable:!0,get:()=>B[Q]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}const K=g=>typeof g=="string",aA=()=>{let g,A;const C=new Promise((B,Q)=>{g=B,A=Q});return C.resolve=g,C.reject=A,C},HA=g=>g==null?"":""+g,dA=(g,A,C)=>{g.forEach(B=>{A[B]&&(C[B]=A[B])})},RA=/###/g,YA=g=>g&&g.indexOf("###")>-1?g.replace(RA,"."):g,lA=g=>!g||K(g),XA=(g,A,C)=>{const B=K(A)?A.split("."):A;let Q=0;for(;Q<B.length-1;){if(lA(g))return{};const I=YA(B[Q]);!g[I]&&C&&(g[I]=new C),Object.prototype.hasOwnProperty.call(g,I)?g=g[I]:g={},++Q}return lA(g)?{}:{obj:g,k:YA(B[Q])}},jg=(g,A,C)=>{const{obj:B,k:Q}=XA(g,A,Object);if(B!==void 0||A.length===1){B[Q]=C;return}let I=A[A.length-1],E=A.slice(0,A.length-1),n=XA(g,E,Object);for(;n.obj===void 0&&E.length;)I=`${E[E.length-1]}.${I}`,E=E.slice(0,E.length-1),n=XA(g,E,Object),n!=null&&n.obj&&typeof n.obj[`${n.k}.${I}`]!="undefined"&&(n.obj=void 0);n.obj[`${n.k}.${I}`]=C},EC=(g,A,C,B)=>{const{obj:Q,k:I}=XA(g,A,Object);Q[I]=Q[I]||[],Q[I].push(C)},Hg=(g,A)=>{const{obj:C,k:B}=XA(g,A);if(C&&Object.prototype.hasOwnProperty.call(C,B))return C[B]},Ag=(g,A,C)=>{const B=Hg(g,C);return B!==void 0?B:Hg(A,C)},MQ=(g,A,C)=>{for(const B in A)B!=="__proto__"&&B!=="constructor"&&(B in g?K(g[B])||g[B]instanceof String||K(A[B])||A[B]instanceof String?C&&(g[B]=A[B]):MQ(g[B],A[B],C):g[B]=A[B]);return g},Rg=g=>g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ct=g=>K(g)?g.replace(/[&<>"'\/]/g,A=>ht[A]):g;class ot{constructor(A){this.capacity=A,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(A){const C=this.regExpMap.get(A);if(C!==void 0)return C;const B=new RegExp(A);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(A,B),this.regExpQueue.push(A),B}}const it=[" ",",","?","!",";"],at=new ot(20),st=(g,A,C)=>{A=A||"",C=C||"";const B=it.filter(E=>A.indexOf(E)<0&&C.indexOf(E)<0);if(B.length===0)return!0;const Q=at.getRegExp(`(${B.map(E=>E==="?"?"\\?":E).join("|")})`);let I=!Q.test(g);if(!I){const E=g.indexOf(C);E>0&&!Q.test(g.substring(0,E))&&(I=!0)}return I},NC=(g,A,C=".")=>{if(!g)return;if(g[A])return Object.prototype.hasOwnProperty.call(g,A)?g[A]:void 0;const B=A.split(C);let Q=g;for(let I=0;I<B.length;){if(!Q||typeof Q!="object")return;let E,n="";for(let t=I;t<B.length;++t)if(t!==I&&(n+=C),n+=B[t],E=Q[n],E!==void 0){if(["string","number","boolean"].indexOf(typeof E)>-1&&t<B.length-1)continue;I+=t-I+1;break}Q=E}return Q},Kg=g=>g==null?void 0:g.replace("_","-"),ut={type:"logger",log(g){this.output("log",g)},warn(g){this.output("warn",g)},error(g){this.output("error",g)},output(g,A){var C,B;(B=(C=console==null?void 0:console[g])==null?void 0:C.apply)==null||B.call(C,console,A)}};class nC{constructor(A,C={}){this.init(A,C)}init(A,C={}){this.prefix=C.prefix||"i18next:",this.logger=A||ut,this.options=C,this.debug=C.debug}log(...A){return this.forward(A,"log","",!0)}warn(...A){return this.forward(A,"warn","",!0)}error(...A){return this.forward(A,"error","")}deprecate(...A){return this.forward(A,"warn","WARNING DEPRECATED: ",!0)}forward(A,C,B,Q){return Q&&!this.debug?null:(K(A[0])&&(A[0]=`${B}${this.prefix} ${A[0]}`),this.logger[C](A))}create(A){return new nC(this.logger,j({prefix:`${this.prefix}:${A}:`},this.options))}clone(A){return A=A||this.options,A.prefix=A.prefix||this.prefix,new nC(this.logger,A)}}var gg=new nC;class tC{constructor(){this.observers={}}on(A,C){return A.split(" ").forEach(B=>{this.observers[B]||(this.observers[B]=new Map);const Q=this.observers[B].get(C)||0;this.observers[B].set(C,Q+1)}),this}off(A,C){if(this.observers[A]){if(!C){delete this.observers[A];return}this.observers[A].delete(C)}}emit(A,...C){this.observers[A]&&Array.from(this.observers[A].entries()).forEach(([Q,I])=>{for(let E=0;E<I;E++)Q(...C)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([Q,I])=>{for(let E=0;E<I;E++)Q.apply(Q,[A,...C])})}}class dQ extends tC{constructor(A,C={ns:["translation"],defaultNS:"translation"}){super(),this.data=A||{},this.options=C,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(A){this.options.ns.indexOf(A)<0&&this.options.ns.push(A)}removeNamespaces(A){const C=this.options.ns.indexOf(A);C>-1&&this.options.ns.splice(C,1)}getResource(A,C,B,Q={}){var e,h;const I=Q.keySeparator!==void 0?Q.keySeparator:this.options.keySeparator,E=Q.ignoreJSONStructure!==void 0?Q.ignoreJSONStructure:this.options.ignoreJSONStructure;let n;A.indexOf(".")>-1?n=A.split("."):(n=[A,C],B&&(Array.isArray(B)?n.push(...B):K(B)&&I?n.push(...B.split(I)):n.push(B)));const t=Hg(this.data,n);return!t&&!C&&!B&&A.indexOf(".")>-1&&(A=n[0],C=n[1],B=n.slice(2).join(".")),t||!E||!K(B)?t:NC((h=(e=this.data)==null?void 0:e[A])==null?void 0:h[C],B,I)}addResource(A,C,B,Q,I={silent:!1}){const E=I.keySeparator!==void 0?I.keySeparator:this.options.keySeparator;let n=[A,C];B&&(n=n.concat(E?B.split(E):B)),A.indexOf(".")>-1&&(n=A.split("."),Q=C,C=n[1]),this.addNamespaces(C),jg(this.data,n,Q),I.silent||this.emit("added",A,C,B,Q)}addResources(A,C,B,Q={silent:!1}){for(const I in B)(K(B[I])||Array.isArray(B[I]))&&this.addResource(A,C,I,B[I],{silent:!0});Q.silent||this.emit("added",A,C,B)}addResourceBundle(A,C,B,Q,I,E={silent:!1,skipCopy:!1}){let n=[A,C];A.indexOf(".")>-1&&(n=A.split("."),Q=B,B=C,C=n[1]),this.addNamespaces(C);let t=Hg(this.data,n)||{};E.skipCopy||(B=JSON.parse(JSON.stringify(B))),Q?MQ(t,B,I):t=j(j({},t),B),jg(this.data,n,t),E.silent||this.emit("added",A,C,B)}removeResourceBundle(A,C){this.hasResourceBundle(A,C)&&delete this.data[A][C],this.removeNamespaces(C),this.emit("removed",A,C)}hasResourceBundle(A,C){return this.getResource(A,C)!==void 0}getResourceBundle(A,C){return C||(C=this.options.defaultNS),this.getResource(A,C)}getDataByLanguage(A){return this.data[A]}hasLanguageSomeTranslations(A){const C=this.getDataByLanguage(A);return!!(C&&Object.keys(C)||[]).find(Q=>C[Q]&&Object.keys(C[Q]).length>0)}toJSON(){return this.data}}var lQ={processors:{},addPostProcessor(g){this.processors[g.name]=g},handle(g,A,C,B,Q){return g.forEach(I=>{var E,n;A=(n=(E=this.processors[I])==null?void 0:E.process(A,C,B,Q))!=null?n:A}),A}};const vQ={},PQ=g=>!K(g)&&typeof g!="boolean"&&typeof g!="number";class eC extends tC{constructor(A,C={}){super(),dA(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],A,this),this.options=C,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=gg.create("translator")}changeLanguage(A){A&&(this.language=A)}exists(A,C={interpolation:{}}){const B=j({},C);if(A==null)return!1;const Q=this.resolve(A,B);return(Q==null?void 0:Q.res)!==void 0}extractFromKey(A,C){let B=C.nsSeparator!==void 0?C.nsSeparator:this.options.nsSeparator;B===void 0&&(B=":");const Q=C.keySeparator!==void 0?C.keySeparator:this.options.keySeparator;let I=C.ns||this.options.defaultNS||[];const E=B&&A.indexOf(B)>-1,n=!this.options.userDefinedKeySeparator&&!C.keySeparator&&!this.options.userDefinedNsSeparator&&!C.nsSeparator&&!st(A,B,Q);if(E&&!n){const t=A.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:A,namespaces:K(I)?[I]:I};const e=A.split(B);(B!==Q||B===Q&&this.options.ns.indexOf(e[0])>-1)&&(I=e.shift()),A=e.join(Q)}return{key:A,namespaces:K(I)?[I]:I}}translate(A,C,B){let Q=typeof C=="object"?j({},C):C;if(typeof Q!="object"&&this.options.overloadTranslationOptionHandler&&(Q=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(Q=j({},Q)),Q||(Q={}),A==null)return"";Array.isArray(A)||(A=[String(A)]);const I=Q.returnDetails!==void 0?Q.returnDetails:this.options.returnDetails,E=Q.keySeparator!==void 0?Q.keySeparator:this.options.keySeparator,{key:n,namespaces:t}=this.extractFromKey(A[A.length-1],Q),e=t[t.length-1];let h=Q.nsSeparator!==void 0?Q.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const c=Q.lng||this.language,i=Q.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode")return i?I?{res:`${e}${h}${n}`,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:e,usedParams:this.getUsedParamsDetails(Q)}:`${e}${h}${n}`:I?{res:n,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:e,usedParams:this.getUsedParamsDetails(Q)}:n;const a=this.resolve(A,Q);let s=a==null?void 0:a.res;const r=(a==null?void 0:a.usedKey)||n,q=(a==null?void 0:a.exactUsedKey)||n,H=["[object Number]","[object Function]","[object RegExp]"],m=Q.joinArrays!==void 0?Q.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,v=Q.count!==void 0&&!K(Q.count),J=eC.hasDefaultValue(Q),k=v?this.pluralResolver.getSuffix(c,Q.count,Q):"",l=Q.ordinal&&v?this.pluralResolver.getSuffix(c,Q.count,{ordinal:!1}):"",P=v&&!Q.ordinal&&Q.count===0,T=P&&Q[`defaultValue${this.options.pluralSeparator}zero`]||Q[`defaultValue${k}`]||Q[`defaultValue${l}`]||Q.defaultValue;let O=s;M&&!s&&J&&(O=T);const X=PQ(O),F=Object.prototype.toString.apply(O);if(M&&O&&X&&H.indexOf(F)<0&&!(K(m)&&Array.isArray(O))){if(!Q.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(r,O,mA(j({},Q),{ns:t})):`key '${n} (${this.language})' returned an object instead of string.`;return I?(a.res=L,a.usedParams=this.getUsedParamsDetails(Q),a):L}if(E){const L=Array.isArray(O),z=L?[]:{},d=L?q:r;for(const G in O)if(Object.prototype.hasOwnProperty.call(O,G)){const p=`${d}${E}${G}`;J&&!s?z[G]=this.translate(p,mA(j({},Q),{defaultValue:PQ(T)?T[G]:void 0,joinArrays:!1,ns:t})):z[G]=this.translate(p,mA(j({},Q),{joinArrays:!1,ns:t})),z[G]===p&&(z[G]=O[G])}s=z}}else if(M&&K(m)&&Array.isArray(s))s=s.join(m),s&&(s=this.extendTranslation(s,A,Q,B));else{let L=!1,z=!1;!this.isValidLookup(s)&&J&&(L=!0,s=T),this.isValidLookup(s)||(z=!0,s=n);const G=(Q.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:s,p=J&&T!==s&&this.options.updateMissing;if(z||L||p){if(this.logger.log(p?"updateKey":"missingKey",c,e,n,p?T:s),E){const D=this.resolve(n,mA(j({},Q),{keySeparator:!1}));D&&D.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 w=[];const o=this.languageUtils.getFallbackCodes(this.options.fallbackLng,Q.lng||this.language);if(this.options.saveMissingTo==="fallback"&&o&&o[0])for(let D=0;D<o.length;D++)w.push(o[D]);else this.options.saveMissingTo==="all"?w=this.languageUtils.toResolveHierarchy(Q.lng||this.language):w.push(Q.lng||this.language);const u=(D,Y,x)=>{var V;const N=J&&x!==s?x:G;this.options.missingKeyHandler?this.options.missingKeyHandler(D,e,Y,N,p,Q):(V=this.backendConnector)!=null&&V.saveMissing&&this.backendConnector.saveMissing(D,e,Y,N,p,Q),this.emit("missingKey",D,e,Y,s)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?w.forEach(D=>{const Y=this.pluralResolver.getSuffixes(D,Q);P&&Q[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(x=>{u([D],n+x,Q[`defaultValue${x}`]||T)})}):u(w,n,T))}s=this.extendTranslation(s,A,Q,a,B),z&&s===n&&this.options.appendNamespaceToMissingKey&&(s=`${e}${h}${n}`),(z||L)&&this.options.parseMissingKeyHandler&&(s=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${e}${h}${n}`:n,L?s:void 0,Q))}return I?(a.res=s,a.usedParams=this.getUsedParamsDetails(Q),a):s}extendTranslation(A,C,B,Q,I){var t,e;if((t=this.i18nFormat)!=null&&t.parse)A=this.i18nFormat.parse(A,j(j({},this.options.interpolation.defaultVariables),B),B.lng||this.language||Q.usedLng,Q.usedNS,Q.usedKey,{resolved:Q});else if(!B.skipInterpolation){B.interpolation&&this.interpolator.init(mA(j({},B),{interpolation:j(j({},this.options.interpolation),B.interpolation)}));const h=K(A)&&(((e=B==null?void 0:B.interpolation)==null?void 0:e.skipOnVariables)!==void 0?B.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(h){const a=A.match(this.interpolator.nestingRegexp);c=a&&a.length}let i=B.replace&&!K(B.replace)?B.replace:B;if(this.options.interpolation.defaultVariables&&(i=j(j({},this.options.interpolation.defaultVariables),i)),A=this.interpolator.interpolate(A,i,B.lng||this.language||Q.usedLng,B),h){const a=A.match(this.interpolator.nestingRegexp),s=a&&a.length;c<s&&(B.nest=!1)}!B.lng&&Q&&Q.res&&(B.lng=this.language||Q.usedLng),B.nest!==!1&&(A=this.interpolator.nest(A,(...a)=>(I==null?void 0:I[0])===a[0]&&!B.context?(this.logger.warn(`It seems you are nesting recursively key: ${a[0]} in key: ${C[0]}`),null):this.translate(...a,C),B)),B.interpolation&&this.interpolator.reset()}const E=B.postProcess||this.options.postProcess,n=K(E)?[E]:E;return A!=null&&(n!=null&&n.length)&&B.applyPostProcessor!==!1&&(A=lQ.handle(n,A,C,this.options&&this.options.postProcessPassResolved?j({i18nResolved:mA(j({},Q),{usedParams:this.getUsedParamsDetails(B)})},B):B,this)),A}resolve(A,C={}){let B,Q,I,E,n;return K(A)&&(A=[A]),A.forEach(t=>{if(this.isValidLookup(B))return;const e=this.extractFromKey(t,C),h=e.key;Q=h;let c=e.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const i=C.count!==void 0&&!K(C.count),a=i&&!C.ordinal&&C.count===0,s=C.context!==void 0&&(K(C.context)||typeof C.context=="number")&&C.context!=="",r=C.lngs?C.lngs:this.languageUtils.toResolveHierarchy(C.lng||this.language,C.fallbackLng);c.forEach(q=>{var H,m;this.isValidLookup(B)||(n=q,!vQ[`${r[0]}-${q}`]&&((H=this.utils)!=null&&H.hasLoadedNamespace)&&!((m=this.utils)!=null&&m.hasLoadedNamespace(n))&&(vQ[`${r[0]}-${q}`]=!0,this.logger.warn(`key "${Q}" for languages "${r.join(", ")}" won't get resolved as namespace "${n}" 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!!!")),r.forEach(M=>{var k;if(this.isValidLookup(B))return;E=M;const v=[h];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(v,h,M,q,C);else{let l;i&&(l=this.pluralResolver.getSuffix(M,C.count,C));const P=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(i&&(v.push(h+l),C.ordinal&&l.indexOf(T)===0&&v.push(h+l.replace(T,this.options.pluralSeparator)),a&&v.push(h+P)),s){const O=`${h}${this.options.contextSeparator}${C.context}`;v.push(O),i&&(v.push(O+l),C.ordinal&&l.indexOf(T)===0&&v.push(O+l.replace(T,this.options.pluralSeparator)),a&&v.push(O+P))}}let J;for(;J=v.pop();)this.isValidLookup(B)||(I=J,B=this.getResource(M,q,J,C))}))})}),{res:B,usedKey:Q,exactUsedKey:I,usedLng:E,usedNS:n}}isValidLookup(A){return A!==void 0&&!(!this.options.returnNull&&A===null)&&!(!this.options.returnEmptyString&&A==="")}getResource(A,C,B,Q={}){var I;return(I=this.i18nFormat)!=null&&I.getResource?this.i18nFormat.getResource(A,C,B,Q):this.resourceStore.getResource(A,C,B,Q)}getUsedParamsDetails(A={}){const C=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],B=A.replace&&!K(A.replace);let Q=B?A.replace:A;if(B&&typeof A.count!="undefined"&&(Q.count=A.count),this.options.interpolation.defaultVariables&&(Q=j(j({},this.options.interpolation.defaultVariables),Q)),!B){Q=j({},Q);for(const I of C)delete Q[I]}return Q}static hasDefaultValue(A){const C="defaultValue";for(const B in A)if(Object.prototype.hasOwnProperty.call(A,B)&&C===B.substring(0,C.length)&&A[B]!==void 0)return!0;return!1}}class JQ{constructor(A){this.options=A,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gg.create("languageUtils")}getScriptPartFromCode(A){if(A=Kg(A),!A||A.indexOf("-")<0)return null;const C=A.split("-");return C.length===2||(C.pop(),C[C.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(C.join("-"))}getLanguagePartFromCode(A){if(A=Kg(A),!A||A.indexOf("-")<0)return A;const C=A.split("-");return this.formatLanguageCode(C[0])}formatLanguageCode(A){if(K(A)&&A.indexOf("-")>-1){let C;try{C=Intl.getCanonicalLocales(A)[0]}catch(B){}return C&&this.options.lowerCaseLng&&(C=C.toLowerCase()),C||(this.options.lowerCaseLng?A.toLowerCase():A)}return this.options.cleanCode||this.options.lowerCaseLng?A.toLowerCase():A}isSupportedCode(A){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(A=this.getLanguagePartFromCode(A)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(A)>-1}getBestMatchFromCodes(A){if(!A)return null;let C;return A.forEach(B=>{if(C)return;const Q=this.formatLanguageCode(B);(!this.options.supportedLngs||this.isSupportedCode(Q))&&(C=Q)}),!C&&this.options.supportedLngs&&A.forEach(B=>{if(C)return;const Q=this.getScriptPartFromCode(B);if(this.isSupportedCode(Q))return C=Q;const I=this.getLanguagePartFromCode(B);if(this.isSupportedCode(I))return C=I;C=this.options.supportedLngs.find(E=>{if(E===I)return E;if(!(E.indexOf("-")<0&&I.indexOf("-")<0)&&(E.indexOf("-")>0&&I.indexOf("-")<0&&E.substring(0,E.indexOf("-"))===I||E.indexOf(I)===0&&I.length>1))return E})}),C||(C=this.getFallbackCodes(this.options.fallbackLng)[0]),C}getFallbackCodes(A,C){if(!A)return[];if(typeof A=="function"&&(A=A(C)),K(A)&&(A=[A]),Array.isArray(A))return A;if(!C)return A.default||[];let B=A[C];return B||(B=A[this.getScriptPartFromCode(C)]),B||(B=A[this.formatLanguageCode(C)]),B||(B=A[this.getLanguagePartFromCode(C)]),B||(B=A.default),B||[]}toResolveHierarchy(A,C){const B=this.getFallbackCodes((C===!1?[]:C)||this.options.fallbackLng||[],A),Q=[],I=E=>{E&&(this.isSupportedCode(E)?Q.push(E):this.logger.warn(`rejecting language code not found in supportedLngs: ${E}`))};return K(A)&&(A.indexOf("-")>-1||A.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&I(this.formatLanguageCode(A)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&I(this.getScriptPartFromCode(A)),this.options.load!=="currentOnly"&&I(this.getLanguagePartFromCode(A))):K(A)&&I(this.formatLanguageCode(A)),B.forEach(E=>{Q.indexOf(E)<0&&I(this.formatLanguageCode(E))}),Q}}const TQ={zero:0,one:1,two:2,few:3,many:4,other:5},kQ={select:g=>g===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class wt{constructor(A,C={}){this.languageUtils=A,this.options=C,this.logger=gg.create("pluralResolver"),this.pluralRulesCache={}}addRule(A,C){this.rules[A]=C}clearCache(){this.pluralRulesCache={}}getRule(A,C={}){const B=Kg(A==="dev"?"en":A),Q=C.ordinal?"ordinal":"cardinal",I=JSON.stringify({cleanedCode:B,type:Q});if(I in this.pluralRulesCache)return this.pluralRulesCache[I];let E;try{E=new Intl.PluralRules(B,{type:Q})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),kQ;if(!A.match(/-|_/))return kQ;const t=this.languageUtils.getLanguagePartFromCode(A);E=this.getRule(t,C)}return this.pluralRulesCache[I]=E,E}needsPlural(A,C={}){let B=this.getRule(A,C);return B||(B=this.getRule("dev",C)),(B==null?void 0:B.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(A,C,B={}){return this.getSuffixes(A,B).map(Q=>`${C}${Q}`)}getSuffixes(A,C={}){let B=this.getRule(A,C);return B||(B=this.getRule("dev",C)),B?B.resolvedOptions().pluralCategories.sort((Q,I)=>TQ[Q]-TQ[I]).map(Q=>`${this.options.prepend}${C.ordinal?`ordinal${this.options.prepend}`:""}${Q}`):[]}getSuffix(A,C,B={}){const Q=this.getRule(A,B);return Q?`${this.options.prepend}${B.ordinal?`ordinal${this.options.prepend}`:""}${Q.select(C)}`:(this.logger.warn(`no plural rule found for: ${A}`),this.getSuffix("dev",C,B))}}const HQ=(g,A,C,B=".",Q=!0)=>{let I=Ag(g,A,C);return!I&&Q&&K(C)&&(I=NC(g,C,B),I===void 0&&(I=NC(A,C,B))),I},yC=g=>g.replace(/\$/g,"$$$$");class rt{constructor(A={}){var C;this.logger=gg.create("interpolator"),this.options=A,this.format=((C=A==null?void 0:A.interpolation)==null?void 0:C.format)||(B=>B),this.init(A)}init(A={}){A.interpolation||(A.interpolation={escapeValue:!0});const{escape:C,escapeValue:B,useRawValueToEscape:Q,prefix:I,prefixEscaped:E,suffix:n,suffixEscaped:t,formatSeparator:e,unescapeSuffix:h,unescapePrefix:c,nestingPrefix:i,nestingPrefixEscaped:a,nestingSuffix:s,nestingSuffixEscaped:r,nestingOptionsSeparator:q,maxReplaces:H,alwaysFormat:m}=A.interpolation;this.escape=C!==void 0?C:ct,this.escapeValue=B!==void 0?B:!0,this.useRawValueToEscape=Q!==void 0?Q:!1,this.prefix=I?Rg(I):E||"{{",this.suffix=n?Rg(n):t||"}}",this.formatSeparator=e||",",this.unescapePrefix=h?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=i?Rg(i):a||Rg("$t("),this.nestingSuffix=s?Rg(s):r||Rg(")"),this.nestingOptionsSeparator=q||",",this.maxReplaces=H||1e3,this.alwaysFormat=m!==void 0?m:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const A=(C,B)=>(C==null?void 0:C.source)===B?(C.lastIndex=0,C):new RegExp(B,"g");this.regexp=A(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=A(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=A(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(A,C,B,Q){var a;let I,E,n;const t=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},e=s=>{if(s.indexOf(this.formatSeparator)<0){const m=HQ(C,t,s,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,B,mA(j(j({},Q),C),{interpolationkey:s})):m}const r=s.split(this.formatSeparator),q=r.shift().trim(),H=r.join(this.formatSeparator).trim();return this.format(HQ(C,t,q,this.options.keySeparator,this.options.ignoreJSONStructure),H,B,mA(j(j({},Q),C),{interpolationkey:q}))};this.resetRegExp();const h=(Q==null?void 0:Q.missingInterpolationHandler)||this.options.missingInterpolationHandler,c=((a=Q==null?void 0:Q.interpolation)==null?void 0:a.skipOnVariables)!==void 0?Q.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:s=>yC(s)},{regex:this.regexp,safeValue:s=>this.escapeValue?yC(this.escape(s)):yC(s)}].forEach(s=>{for(n=0;I=s.regex.exec(A);){const r=I[1].trim();if(E=e(r),E===void 0)if(typeof h=="function"){const H=h(A,I,Q);E=K(H)?H:""}else if(Q&&Object.prototype.hasOwnProperty.call(Q,r))E="";else if(c){E=I[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${A}`),E="";else!K(E)&&!this.useRawValueToEscape&&(E=HA(E));const q=s.safeValue(E);if(A=A.replace(I[0],q),c?(s.regex.lastIndex+=E.length,s.regex.lastIndex-=I[0].length):s.regex.lastIndex=0,n++,n>=this.maxReplaces)break}}),A}nest(A,C,B={}){let Q,I,E;const n=(t,e)=>{var r;const h=this.nestingOptionsSeparator;if(t.indexOf(h)<0)return t;const c=t.split(new RegExp(`${h}[ ]*{`));let i=`{${c[1]}`;t=c[0],i=this.interpolate(i,E);const a=i.match(/'/g),s=i.match(/"/g);(((r=a==null?void 0:a.length)!=null?r:0)%2===0&&!s||s.length%2!==0)&&(i=i.replace(/'/g,'"'));try{E=JSON.parse(i),e&&(E=j(j({},e),E))}catch(q){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,q),`${t}${h}${i}`}return E.defaultValue&&E.defaultValue.indexOf(this.prefix)>-1&&delete E.defaultValue,t};for(;Q=this.nestingRegexp.exec(A);){let t=[];E=j({},B),E=E.replace&&!K(E.replace)?E.replace:E,E.applyPostProcessor=!1,delete E.defaultValue;const e=/{.*}/.test(Q[1])?Q[1].lastIndexOf("}")+1:Q[1].indexOf(this.formatSeparator);if(e!==-1&&(t=Q[1].slice(e).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),Q[1]=Q[1].slice(0,e)),I=C(n.call(this,Q[1].trim(),E),E),I&&Q[0]===A&&!K(I))return I;K(I)||(I=HA(I)),I||(this.logger.warn(`missed to resolve ${Q[1]} for nesting ${A}`),I=""),t.length&&(I=t.reduce((h,c)=>this.format(h,c,B.lng,mA(j({},B),{interpolationkey:Q[1].trim()})),I.trim())),A=A.replace(Q[0],I),this.regexp.lastIndex=0}return A}}const Dt=g=>{let A=g.toLowerCase().trim();const C={};if(g.indexOf("(")>-1){const B=g.split("(");A=B[0].toLowerCase().trim();const Q=B[1].substring(0,B[1].length-1);A==="currency"&&Q.indexOf(":")<0?C.currency||(C.currency=Q.trim()):A==="relativetime"&&Q.indexOf(":")<0?C.range||(C.range=Q.trim()):Q.split(";").forEach(E=>{if(E){const[n,...t]=E.split(":"),e=t.join(":").trim().replace(/^'+|'+$/g,""),h=n.trim();C[h]||(C[h]=e),e==="false"&&(C[h]=!1),e==="true"&&(C[h]=!0),isNaN(e)||(C[h]=parseInt(e,10))}})}return{formatName:A,formatOptions:C}},RQ=g=>{const A={};return(C,B,Q)=>{let I=Q;Q&&Q.interpolationkey&&Q.formatParams&&Q.formatParams[Q.interpolationkey]&&Q[Q.interpolationkey]&&(I=mA(j({},I),{[Q.interpolationkey]:void 0}));const E=B+JSON.stringify(I);let n=A[E];return n||(n=g(Kg(B),Q),A[E]=n),n(C)}},ft=g=>(A,C,B)=>g(Kg(C),B)(A);class mt{constructor(A={}){this.logger=gg.create("formatter"),this.options=A,this.init(A)}init(A,C={interpolation:{}}){this.formatSeparator=C.interpolation.formatSeparator||",";const B=C.cacheInBuiltFormats?RQ:ft;this.formats={number:B((Q,I)=>{const E=new Intl.NumberFormat(Q,j({},I));return n=>E.format(n)}),currency:B((Q,I)=>{const E=new Intl.NumberFormat(Q,mA(j({},I),{style:"currency"}));return n=>E.format(n)}),datetime:B((Q,I)=>{const E=new Intl.DateTimeFormat(Q,j({},I));return n=>E.format(n)}),relativetime:B((Q,I)=>{const E=new Intl.RelativeTimeFormat(Q,j({},I));return n=>E.format(n,I.range||"day")}),list:B((Q,I)=>{const E=new Intl.ListFormat(Q,j({},I));return n=>E.format(n)})}}add(A,C){this.formats[A.toLowerCase().trim()]=C}addCached(A,C){this.formats[A.toLowerCase().trim()]=RQ(C)}format(A,C,B,Q={}){const I=C.split(this.formatSeparator);if(I.length>1&&I[0].indexOf("(")>1&&I[0].indexOf(")")<0&&I.find(n=>n.indexOf(")")>-1)){const n=I.findIndex(t=>t.indexOf(")")>-1);I[0]=[I[0],...I.splice(1,n)].join(this.formatSeparator)}return I.reduce((n,t)=>{var c;const{formatName:e,formatOptions:h}=Dt(t);if(this.formats[e]){let i=n;try{const a=((c=Q==null?void 0:Q.formatParams)==null?void 0:c[Q.interpolationkey])||{},s=a.locale||a.lng||Q.locale||Q.lng||B;i=this.formats[e](n,s,j(j(j({},h),Q),a))}catch(a){this.logger.warn(a)}return i}else this.logger.warn(`there was no format function for ${e}`);return n},A)}}const qt=(g,A)=>{g.pending[A]!==void 0&&(delete g.pending[A],g.pendingCount--)};class Mt extends tC{constructor(A,C,B,Q={}){var I,E;super(),this.backend=A,this.store=C,this.services=B,this.languageUtils=B.languageUtils,this.options=Q,this.logger=gg.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=Q.maxParallelReads||10,this.readingCalls=0,this.maxRetries=Q.maxRetries>=0?Q.maxRetries:5,this.retryTimeout=Q.retryTimeout>=1?Q.retryTimeout:350,this.state={},this.queue=[],(E=(I=this.backend)==null?void 0:I.init)==null||E.call(I,B,Q.backend,Q)}queueLoad(A,C,B,Q){const I={},E={},n={},t={};return A.forEach(e=>{let h=!0;C.forEach(c=>{const i=`${e}|${c}`;!B.reload&&this.store.hasResourceBundle(e,c)?this.state[i]=2:this.state[i]<0||(this.state[i]===1?E[i]===void 0&&(E[i]=!0):(this.state[i]=1,h=!1,E[i]===void 0&&(E[i]=!0),I[i]===void 0&&(I[i]=!0),t[c]===void 0&&(t[c]=!0)))}),h||(n[e]=!0)}),(Object.keys(I).length||Object.keys(E).length)&&this.queue.push({pending:E,pendingCount:Object.keys(E).length,loaded:{},errors:[],callback:Q}),{toLoad:Object.keys(I),pending:Object.keys(E),toLoadLanguages:Object.keys(n),toLoadNamespaces:Object.keys(t)}}loaded(A,C,B){const Q=A.split("|"),I=Q[0],E=Q[1];C&&this.emit("failedLoading",I,E,C),!C&&B&&this.store.addResourceBundle(I,E,B,void 0,void 0,{skipCopy:!0}),this.state[A]=C?-1:2,C&&B&&(this.state[A]=0);const n={};this.queue.forEach(t=>{EC(t.loaded,[I],E),qt(t,A),C&&t.errors.push(C),t.pendingCount===0&&!t.done&&(Object.keys(t.loaded).forEach(e=>{n[e]||(n[e]={});const h=t.loaded[e];h.length&&h.forEach(c=>{n[e][c]===void 0&&(n[e][c]=!0)})}),t.done=!0,t.errors.length?t.callback(t.errors):t.callback())}),this.emit("loaded",n),this.queue=this.queue.filter(t=>!t.done)}read(A,C,B,Q=0,I=this.retryTimeout,E){if(!A.length)return E(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:A,ns:C,fcName:B,tried:Q,wait:I,callback:E});return}this.readingCalls++;const n=(e,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(e&&h&&Q<this.maxRetries){setTimeout(()=>{this.read.call(this,A,C,B,Q+1,I*2,E)},I);return}E(e,h)},t=this.backend[B].bind(this.backend);if(t.length===2){try{const e=t(A,C);e&&typeof e.then=="function"?e.then(h=>n(null,h)).catch(n):n(null,e)}catch(e){n(e)}return}return t(A,C,n)}prepareLoading(A,C,B={},Q){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),Q&&Q();K(A)&&(A=this.languageUtils.toResolveHierarchy(A)),K(C)&&(C=[C]);const I=this.queueLoad(A,C,B,Q);if(!I.toLoad.length)return I.pending.length||Q(),null;I.toLoad.forEach(E=>{this.loadOne(E)})}load(A,C,B){this.prepareLoading(A,C,{},B)}reload(A,C,B){this.prepareLoading(A,C,{reload:!0},B)}loadOne(A,C=""){const B=A.split("|"),Q=B[0],I=B[1];this.read(Q,I,"read",void 0,void 0,(E,n)=>{E&&this.logger.warn(`${C}loading namespace ${I} for language ${Q} failed`,E),!E&&n&&this.logger.log(`${C}loaded namespace ${I} for language ${Q}`,n),this.loaded(A,E,n)})}saveMissing(A,C,B,Q,I,E={},n=()=>{}){var t,e,h,c,i;if((e=(t=this.services)==null?void 0:t.utils)!=null&&e.hasLoadedNamespace&&!((c=(h=this.services)==null?void 0:h.utils)!=null&&c.hasLoadedNamespace(C))){this.logger.warn(`did not save key "${B}" as the namespace "${C}" 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(!(B==null||B==="")){if((i=this.backend)!=null&&i.create){const a=mA(j({},E),{isUpdate:I}),s=this.backend.create.bind(this.backend);if(s.length<6)try{let r;s.length===5?r=s(A,C,B,Q,a):r=s(A,C,B,Q),r&&typeof r.then=="function"?r.then(q=>n(null,q)).catch(n):n(null,r)}catch(r){n(r)}else s(A,C,B,Q,n,a)}!A||!A[0]||this.store.addResource(A[0],C,B,Q)}}}const YQ=()=>({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:g=>{let A={};if(typeof g[1]=="object"&&(A=g[1]),K(g[1])&&(A.defaultValue=g[1]),K(g[2])&&(A.tDescription=g[2]),typeof g[2]=="object"||typeof g[3]=="object"){const C=g[3]||g[2];Object.keys(C).forEach(B=>{A[B]=C[B]})}return A},interpolation:{escapeValue:!0,format:g=>g,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),xQ=g=>{var A,C;return K(g.ns)&&(g.ns=[g.ns]),K(g.fallbackLng)&&(g.fallbackLng=[g.fallbackLng]),K(g.fallbackNS)&&(g.fallbackNS=[g.fallbackNS]),((C=(A=g.supportedLngs)==null?void 0:A.indexOf)==null?void 0:C.call(A,"cimode"))<0&&(g.supportedLngs=g.supportedLngs.concat(["cimode"])),typeof g.initImmediate=="boolean"&&(g.initAsync=g.initImmediate),g},hC=()=>{},dt=g=>{Object.getOwnPropertyNames(Object.getPrototypeOf(g)).forEach(C=>{typeof g[C]=="function"&&(g[C]=g[C].bind(g))})};class pg extends tC{constructor(A={},C){if(super(),this.options=xQ(A),this.services={},this.logger=gg,this.modules={external:[]},dt(this),C&&!this.isInitialized&&!A.isClone){if(!this.options.initAsync)return this.init(A,C),this;setTimeout(()=>{this.init(A,C)},0)}}init(A={},C){this.isInitializing=!0,typeof A=="function"&&(C=A,A={}),A.defaultNS==null&&A.ns&&(K(A.ns)?A.defaultNS=A.ns:A.ns.indexOf("translation")<0&&(A.defaultNS=A.ns[0]));const B=YQ();this.options=j(j(j({},B),this.options),xQ(A)),this.options.interpolation=j(j({},B.interpolation),this.options.interpolation),A.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=A.keySeparator),A.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=A.nsSeparator);const Q=e=>e?typeof e=="function"?new e:e:null;if(!this.options.isClone){this.modules.logger?gg.init(Q(this.modules.logger),this.options):gg.init(null,this.options);let e;this.modules.formatter?e=this.modules.formatter:e=mt;const h=new JQ(this.options);this.store=new dQ(this.options.resources,this.options);const c=this.services;c.logger=gg,c.resourceStore=this.store,c.languageUtils=h,c.pluralResolver=new wt(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==B.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===B.interpolation.format)&&(c.formatter=Q(e),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new rt(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Mt(Q(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(a,...s)=>{this.emit(a,...s)}),this.modules.languageDetector&&(c.languageDetector=Q(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=Q(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new eC(this.services,this.options),this.translator.on("*",(a,...s)=>{this.emit(a,...s)}),this.modules.external.forEach(a=>{a.init&&a.init(this)})}if(this.format=this.options.interpolation.format,C||(C=hC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const 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]=(...h)=>this.store[e](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...h)=>(this.store[e](...h),this)});const n=aA(),t=()=>{const e=(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),n.resolve(c),C(h,c)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?t():setTimeout(t,0),n}loadResources(A,C=hC){var I,E;let B=C;const Q=K(A)?A:this.language;if(typeof A=="function"&&(B=A),!this.options.resources||this.options.partialBundledLanguages){if((Q==null?void 0:Q.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return B();const n=[],t=e=>{if(!e||e==="cimode")return;this.services.languageUtils.toResolveHierarchy(e).forEach(c=>{c!=="cimode"&&n.indexOf(c)<0&&n.push(c)})};Q?t(Q):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>t(h)),(E=(I=this.options.preload)==null?void 0:I.forEach)==null||E.call(I,e=>t(e)),this.services.backendConnector.load(n,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),B(e)})}else B(null)}reloadResources(A,C,B){const Q=aA();return typeof A=="function"&&(B=A,A=void 0),typeof C=="function"&&(B=C,C=void 0),A||(A=this.languages),C||(C=this.options.ns),B||(B=hC),this.services.backendConnector.reload(A,C,I=>{Q.resolve(),B(I)}),Q}use(A){if(!A)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!A.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return A.type==="backend"&&(this.modules.backend=A),(A.type==="logger"||A.log&&A.warn&&A.error)&&(this.modules.logger=A),A.type==="languageDetector"&&(this.modules.languageDetector=A),A.type==="i18nFormat"&&(this.modules.i18nFormat=A),A.type==="postProcessor"&&lQ.addPostProcessor(A),A.type==="formatter"&&(this.modules.formatter=A),A.type==="3rdParty"&&this.modules.external.push(A),this}setResolvedLanguage(A){if(!(!A||!this.languages)&&!(["cimode","dev"].indexOf(A)>-1)){for(let C=0;C<this.languages.length;C++){const B=this.languages[C];if(!(["cimode","dev"].indexOf(B)>-1)&&this.store.hasLanguageSomeTranslations(B)){this.resolvedLanguage=B;break}}!this.resolvedLanguage&&this.languages.indexOf(A)<0&&this.store.hasLanguageSomeTranslations(A)&&(this.resolvedLanguage=A,this.languages.unshift(A))}}changeLanguage(A,C){this.isLanguageChangingTo=A;const B=aA();this.emit("languageChanging",A);const Q=n=>{this.language=n,this.languages=this.services.languageUtils.toResolveHierarchy(n),this.resolvedLanguage=void 0,this.setResolvedLanguage(n)},I=(n,t)=>{t?this.isLanguageChangingTo===A&&(Q(t),this.translator.changeLanguage(t),this.isLanguageChangingTo=void 0,this.emit("languageChanged",t),this.logger.log("languageChanged",t)):this.isLanguageChangingTo=void 0,B.resolve((...e)=>this.t(...e)),C&&C(n,(...e)=>this.t(...e))},E=n=>{var h,c;!A&&!n&&this.services.languageDetector&&(n=[]);const t=K(n)?n:n&&n[0],e=this.store.hasLanguageSomeTranslations(t)?t:this.services.languageUtils.getBestMatchFromCodes(K(n)?[n]:n);e&&(this.language||Q(e),this.translator.language||this.translator.changeLanguage(e),(c=(h=this.services.languageDetector)==null?void 0:h.cacheUserLanguage)==null||c.call(h,e)),this.loadResources(e,i=>{I(i,e)})};return!A&&this.services.languageDetector&&!this.services.languageDetector.async?E(this.services.languageDetector.detect()):!A&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(E):this.services.languageDetector.detect(E):E(A),B}getFixedT(A,C,B){const Q=(I,E,...n)=>{let t;typeof E!="object"?t=this.options.overloadTranslationOptionHandler([I,E].concat(n)):t=j({},E),t.lng=t.lng||Q.lng,t.lngs=t.lngs||Q.lngs,t.ns=t.ns||Q.ns,t.keyPrefix!==""&&(t.keyPrefix=t.keyPrefix||B||Q.keyPrefix);const e=this.options.keySeparator||".";let h;return t.keyPrefix&&Array.isArray(I)?h=I.map(c=>`${t.keyPrefix}${e}${c}`):h=t.keyPrefix?`${t.keyPrefix}${e}${I}`:I,this.t(h,t)};return K(A)?Q.lng=A:Q.lngs=A,Q.ns=C,Q.keyPrefix=B,Q}t(...A){var C;return(C=this.translator)==null?void 0:C.translate(...A)}exists(...A){var C;return(C=this.translator)==null?void 0:C.exists(...A)}setDefaultNamespace(A){this.options.defaultNS=A}hasLoadedNamespace(A,C={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const B=C.lng||this.resolvedLanguage||this.languages[0],Q=this.options?this.options.fallbackLng:!1,I=this.languages[this.languages.length-1];if(B.toLowerCase()==="cimode")return!0;const E=(n,t)=>{const e=this.services.backendConnector.state[`${n}|${t}`];return e===-1||e===0||e===2};if(C.precheck){const n=C.precheck(this,E);if(n!==void 0)return n}return!!(this.hasResourceBundle(B,A)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||E(B,A)&&(!Q||E(I,A)))}loadNamespaces(A,C){const B=aA();return this.options.ns?(K(A)&&(A=[A]),A.forEach(Q=>{this.options.ns.indexOf(Q)<0&&this.options.ns.push(Q)}),this.loadResources(Q=>{B.resolve(),C&&C(Q)}),B):(C&&C(),Promise.resolve())}loadLanguages(A,C){const B=aA();K(A)&&(A=[A]);const Q=this.options.preload||[],I=A.filter(E=>Q.indexOf(E)<0&&this.services.languageUtils.isSupportedCode(E));return I.length?(this.options.preload=Q.concat(I),this.loadResources(E=>{B.resolve(),C&&C(E)}),B):(C&&C(),Promise.resolve())}dir(A){var Q,I;if(A||(A=this.resolvedLanguage||(((Q=this.languages)==null?void 0:Q.length)>0?this.languages[0]:this.language)),!A)return"rtl";if(Intl.Locale){const E=new Intl.Locale(A);if(E&&E.getTextInfo){const n=E.getTextInfo();if(n&&n.direction)return n.direction}}const C=["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"],B=((I=this.services)==null?void 0:I.languageUtils)||new JQ(YQ());return A.toLowerCase().indexOf("-latn")>1?"ltr":C.indexOf(B.getLanguagePartFromCode(A))>-1||A.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(A={},C){return new pg(A,C)}cloneInstance(A={},C=hC){const B=A.forkResourceStore;B&&delete A.forkResourceStore;const Q=mA(j(j({},this.options),A),{isClone:!0}),I=new pg(Q);if((A.debug!==void 0||A.prefix!==void 0)&&(I.logger=I.logger.clone(A)),["store","services","language"].forEach(n=>{I[n]=this[n]}),I.services=j({},this.services),I.services.utils={hasLoadedNamespace:I.hasLoadedNamespace.bind(I)},B){const n=Object.keys(this.store.data).reduce((t,e)=>(t[e]=j({},this.store.data[e]),t[e]=Object.keys(t[e]).reduce((h,c)=>(h[c]=j({},t[e][c]),h),t[e]),t),{});I.store=new dQ(n,Q),I.services.resourceStore=I.store}return I.translator=new eC(I.services,Q),I.translator.on("*",(n,...t)=>{I.emit(n,...t)}),I.init(Q,C),I.translator.options=Q,I.translator.backendConnector.services.utils={hasLoadedNamespace:I.hasLoadedNamespace.bind(I)},I}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const xA=pg.createInstance();xA.createInstance=pg.createInstance,xA.createInstance,xA.dir,xA.init,xA.loadResources,xA.reloadResources,xA.use,xA.changeLanguage,xA.getFixedT,xA.t,xA.exists,xA.setDefaultNamespace,xA.hasLoadedNamespace,xA.loadNamespaces,xA.loadLanguages;const lt={accountName:"Account Name",accountNumber:"Account Number",address:"Unit Address",agreeWith:"I agree with",and:"and",back:"Back",backIdCard:"Back ID Card",bankName:"Bank Name",beneficiaryBank:"Beneficiary Bank",businessLicense:"Business Registration License",cancel:"Cancel",cancelTransaction:"Cancel Transaction",close:"Close",codeTypeC:"C (With tax authority code)",codeTypeK:"K (Without code)",codeTypeTooltip:"C: With tax authority code, K: Without code",comingSoon:"Coming Soon",companyName:"Unit Name",completePaymentIn:"Complete your payment within",completeRegistration:"Complete registration",confirm:"Confirm",confirmationTitle:"Important Notice:",contactInfo:"3. Contact Person Information:",copy:"Copy",country:"Country",customLettersTooltip:"2 custom characters (default: YY)",customUnits:"Custom quantity",dateOfBirth:"Date of Birth",decrease:"Decrease",delete:"Delete",digitalSignaturePackage:"Digital Signature Package",district:"District",duration:"Duration",eContractTitle:"E-Contract",edit:"Edit",electronicInvoices:"e-invoices",email:"Email",enterIdCard:"Enter ID Card Number",enterInvoiceSymbol:"Enter Invoice Symbol",enterPassport:"Enter Passport Number",enterProviderName:"Enter Provider Name",enterTaxAuthorityCode:"Enter Tax Authority Code",errorCheckingCustomer:"Failed to check customer status",errorCreatingOrder:"Failed to create order",errorFetchTaxInfo:"Error fetching tax information.",errorFileFormat:"File format not supported",errorFileSize:"File size is too large",errorForbidden:"Access denied",errorInvalidAddress:"Address cannot contain special characters",errorInvalidCard:"Invalid ID card",errorInvalidDate:"Invalid date of birth",errorInvalidEmail:"Invalid email address",errorInvalidIdCard:"Invalid ID card number",errorInvalidName:"Only letters, numbers and underscores allowed",errorInvalidPhone:"Invalid phone number",errorInvalidProviderName:"Invalid provider name",errorInvalidRequest:"Invalid request",errorInvalidTaxAuthorityCode:"Invalid tax authority code",errorInvalidTaxCode:"Invalid tax code",errorLoadingData:"Failed to load data",errorLoadingInitPackages:"Failed to load registration packages",errorLoadingInvoicePackages:"Failed to load invoice packages",errorLoadingSignaturePackages:"Failed to load signature packages",errorNetwork:"Network connection error",errorNotFound:"Data not found",errorOrderStatus:"Unable to check order payment status. Please try again.",errorQRGeneration:"Unable to generate QR payment code. Please try again.",errorRequired:"This field is required",errorSearchingPackages:"Failed to search packages",errorServer:"Server error, please try again later",errorServiceUnavailable:"Service temporarily unavailable",errorTooManyRequests:"Too many requests, please try again later",errorUnauthorized:"Unauthorized access",errorUnknown:"An error occurred",errorValidation:"Invalid data",female:"Female",fileFormat:"Format",frontIdCard:"Front ID Card",fullName:"Full Name",gender:"Gender",hasUsedEInvoice:"Have you used e-invoices?",hasUsedEInvoiceBefore:"Are you using another e-invoice provider other than M-invoice?",hotlineDesc:"(Free Consulting and Support Hotline)",hotlineDomestic:"Hotline:",idNumber:"ID Card Number",increase:"Increase",informationSent:"Information sent to the provider",invoicePackage:"Invoice Package",invoiceSymbol:"Invoice Symbol",invoiceTemplate:"Invoice Template",invoiceTemplateTypes:{1:"1 (VAT Invoice)",2:"2 (Sales Invoice)",3:"3 (Public Asset Sales)",4:"4 (National Reserve Sales)",5:"5 (Stamps, Tickets, Other Cards)",6:"6 (Internal Documents)",7:"7 (Commercial Invoice)",8:"8 (VAT with Integrated Tax)",9:"9 (Sales with Integrated Tax)"},invoiceTypeB:"B (Agent)",invoiceTypeD:"D (Asset)",invoiceTypeG:"G (VAT Stamp)",invoiceTypeH:"H (Sales Stamp)",invoiceTypeL:"L (Tax Authority)",invoiceTypeM:"M (Cash Register)",invoiceTypeN:"N (Internal)",invoiceTypeT:"T (Registration)",invoiceTypeTooltip:"Invoice type",invoiceTypeX:"X (Commercial)",invoiceUsageInfo:"4. E-INVOICE USAGE INFORMATION:",invoicesPerMonth:"invoices/month",legalRepInfo:"2. Legal Representative Information:",legalRepNote:"Please check and enter the correct legal representative name according to the uploaded business license.",loading:"Loading...",male:"Male",maxFileSize:"Max 500KB",month:"Month",mostSuitablePackage:"Most Suitable Package",next:"Continue",noDataAvailable:"No data available",noPackageFound:"No package found.",notice1:"Please check your email inbox regularly to receive account information notifications from the provider.",notice2:"If you have not received the email account information (username/password) within 2 hours, please contact the information below for the fastest support:","notice3.1":"After being granted an account, please go to the Link","notice3.2":"to connect and use the service HDDT",of:"of",ok:"OK",optional:"Optional",or:"or",orderCreated:"Order created successfully",orderExpired:"Order has expired",orderInfo:"Order Information",orderSummary:"Order Summary",organizationCert:"Organization Registration Certificate",package:"Package",passport:"Passport",paymentAmount:"Payment Amount",paymentFailed:"Payment Failed",paymentInstructions:["Open your banking app or digital wallet on your phone","Select the QR Code scan feature in the app","Scan the QR code on this page and make payment"],paymentInstructionsTitle:"QR Payment Instructions",paymentMethod:"Payment Method:",paymentSuccess:"Payment Successful!",paymentTimeout:"Payment timeout",paymentTimeoutMessage:"Payment timeout! Please try again.",paymentTitle:"Payment",permanentAddress:"Permanent address",phone:"Phone Number",product:"Product",provider:"Provider",providerName:"Provider Name",province:"Province/City",qrPayment:"QR Code Payment",qrPaymentTitle:"Scan QR Code to Pay",quantity:"Quantity",registrationFee:"Registration Fee",required:"Required",returnHome:"Return Home",returnToStep1:"Return to step 1",sampleNumberTooltip:"Invoice template number (1-9)",save:"Save",searchUnits:"Units per month",selectFile:"Select File",selectInvoicePackage:"Select E-Invoice Package",selectProvider:"Select Provider",selectSignaturePackage:"Select Digital Signature Package",selectSubscriptionPackage:"Select Subscription Package",selectedProducts:"Selected Products",settings:"Settings",signaturePackage:"Digital Signature Package",softwareLicense:"E-invoice software license",stepInfo:"Information",stepPayment:"Confirmation & Payment",stepPlan:"Invoice Package",subscriptionPackage:"Subscription Package",taxAuthority:"Tax Authority",taxAuthorityCode:"5 characters issued by the Authority for cash register bills",taxCode:"Unit Tax Code",termsAndUsagePolicy:"Terms and Usage Policy",timeLeft:"Time Left",total:"Total",totalAmount:"Total Amount",totalPrice:"Total Price",transactionCanceled:"Transaction has been canceled. Returning to registration page.",unit:"Unit",unitInfo:"1. Unit Information",unitPerMonth:"units/month",unitPrice:"Unit Price",unitsPerMonth:"units/ month",uploadBackId:"Upload Back ID Card",uploadFile:"Upload File",uploadFrontId:"Upload Front ID Card",uploadLogo:"Upload Logo",usagePolicy:"Usage Policy",ward:"Ward",website:"Website",widgetTitle:"E-Invoice Registration",yearTooltip:"Release year (last 2 digits)"},vt={accountName:"Tên tài khoản",accountNumber:"Số tài khoản",address:"Địa chỉ đơn vị",agreeWith:"Tôi đồng ý với",and:"và",back:"Quay lại",backIdCard:"Mặt sau CCCD",bankName:"Ngân hàng",beneficiaryBank:"Ngân hàng thụ hưởng",businessLicense:"Giấy phép đăng ký kinh doanh",cancel:"Hủy",cancelTransaction:"Hủy giao dịch",close:"Đóng",codeTypeC:"C (Có mã CQT)",codeTypeK:"K (Không mã)",codeTypeTooltip:"C: Có mã CQT, K: Không mã",comingSoon:"Sắp ra mắt",companyName:"Tên đơn vị",completePaymentIn:"Hoàn tất thanh toán của bạn trong",completeRegistration:"Hoàn tất đăng ký",confirm:"Xác nhận",confirmationTitle:"Thông tin lưu ý:",contactInfo:"3. Thông tin người liên hệ:",copy:"Bản",country:"Quốc gia",customLettersTooltip:"2 ký tự tùy chọn (mặc định: YY)",customUnits:"Số lượng tùy chỉnh",dateOfBirth:"Ngày sinh",decrease:"Giảm",delete:"Xóa",digitalSignaturePackage:"Gói chữ ký số",district:"Quận/Huyện",duration:"Thời hạn",eContractTitle:"E-Contract",edit:"Chỉnh sửa",electronicInvoices:"hóa đơn điện tử",email:"Email",enterIdCard:"Nhập số CMND/CCCD",enterInvoiceSymbol:"Nhập ký hiệu hóa đơn",enterPassport:"Nhập số hộ chiếu",enterProviderName:"Nhập tên nhà cung cấp",enterTaxAuthorityCode:"Nhập mã CQT cấp",errorCheckingCustomer:"Không thể kiểm tra trạng thái khách hàng",errorCreatingOrder:"Không thể tạo đơn hàng",errorFetchTaxInfo:"Lỗi khi lấy thông tin mã số thuế.",errorFileFormat:"Định dạng tệp không được hỗ trợ",errorFileSize:"Kích thước tệp quá lớn",errorForbidden:"Truy cập bị từ chối",errorInvalidAddress:"Địa chỉ không được chứa ký tự đặc biệt",errorInvalidCard:"CCCD không hợp lệ",errorInvalidDate:"Ngày sinh không hợp lệ",errorInvalidEmail:"Email không hợp lệ",errorInvalidIdCard:"Số CCCD không hợp lệ",errorInvalidName:"Chỉ được dùng chữ cái, số và dấu gạch dưới",errorInvalidPhone:"Số điện thoại không hợp lệ",errorInvalidProviderName:"Tên nhà cung cấp không hợp lệ",errorInvalidRequest:"Yêu cầu không hợp lệ",errorInvalidTaxAuthorityCode:"Mã CQT cấp không hợp lệ",errorInvalidTaxCode:"Mã số thuế không hợp lệ",errorLoadingData:"Không thể tải dữ liệu",errorLoadingInitPackages:"Không thể tải gói đăng ký",errorLoadingInvoicePackages:"Không thể tải gói hóa đơn",errorLoadingSignaturePackages:"Không thể tải gói chữ ký số",errorNetwork:"Lỗi kết nối mạng",errorNotFound:"Không tìm thấy dữ liệu",errorOrderStatus:"Không thể kiểm tra trạng thái thanh toán đơn hàng. Vui lòng thử lại.",errorQRGeneration:"Không thể tạo mã QR thanh toán. Vui lòng thử lại.",errorRequired:"Trường này là bắt buộc",errorSearchingPackages:"Không thể tìm kiếm gói",errorServer:"Lỗi máy chủ, vui lòng thử lại sau",errorServiceUnavailable:"Dịch vụ tạm thời không khả dụng",errorTooManyRequests:"Quá nhiều yêu cầu, vui lòng thử lại sau",errorUnauthorized:"Không có quyền truy cập",errorUnknown:"Đã xảy ra lỗi",errorValidation:"Dữ liệu không hợp lệ",female:"Nữ",fileFormat:"Định dạng",frontIdCard:"Mặt trước CCCD",fullName:"Họ và tên",gender:"Giới tính",hasUsedEInvoice:"Bạn đã sử dụng hoá đơn điện tử?",hasUsedEInvoiceBefore:"Bạn đang sử dụng nhà NCC hoá đơn điện tử khác M-invoice không?",hotlineDesc:"(Tổng đài Tư vấn, Hỗ trợ miễn phí)",hotlineDomestic:"Hotline:",idNumber:"CCCD",increase:"Tăng",informationSent:"Đã gửi thông tin sang nhà cung cấp",invoicePackage:"Gói hóa đơn",invoiceSymbol:"Ký hiệu hóa đơn",invoiceTemplate:"Mẫu số",invoiceTemplateTypes:{1:"1 (Hóa đơn GTGT)",2:"2 (Hóa đơn bán hàng)",3:"3 (Bán tài sản công)",4:"4 (Bán dự trữ quốc gia)",5:"5 (Tem, vé, thẻ khác)",6:"6 (Chứng từ nội bộ)",7:"7 (Hóa đơn thương mại)",8:"8 (GTGT tích hợp thuế)",9:"9 (Bán hàng tích hợp thuế)"},invoiceTypeB:"B (Đại lý)",invoiceTypeD:"D (Tài sản)",invoiceTypeG:"G (Tem GTGT)",invoiceTypeH:"H (Tem bán hàng)",invoiceTypeL:"L (CQT)",invoiceTypeM:"M (Máy tính tiền)",invoiceTypeN:"N (Nội bộ)",invoiceTypeT:"T (Đăng ký)",invoiceTypeTooltip:"Loại hóa đơn",invoiceTypeX:"X (Thương mại)",invoiceUsageInfo:"4. THÔNG TIN SỬ DỤNG HDDT:",invoicesPerMonth:"hóa đơn/tháng",legalRepInfo:"2. Thông tin người đại diện pháp luật:",legalRepNote:"Vui lòng kiểm tra và nhập đúng tên người đại diện theo Giấy phép kinh doanh đã tải lên.",loading:"Đang tải...",male:"Nam",maxFileSize:"Tối đa 500Kb",month:"Tháng",mostSuitablePackage:"Gói phù hợp nhất",next:"Tiếp tục",noDataAvailable:"Không có dữ liệu",noPackageFound:"Không tìm thấy gói nào.",notice1:"Vui lòng thường xuyên kiểm tra hộp thư Email nhận thông báo thông tin tài khoản từ nhà cung cấp",notice2:"Trong vòng 2 giờ nếu chưa nhận được thông tin Email tài khoản (username/password). Bạn có thể liên hệ thông tin phía bên dưới để được hỗ trợ sớm nhất:","notice3.1":"Sau khi được cấp tài khoản, vui lòng vào Link","notice3.2":"để kết nối và sử dụng dịch vụ HDDT",of:"của",ok:"OK",optional:"Tùy chọn",or:"hoặc",orderCreated:"Đơn hàng đã được tạo thành công",orderExpired:"Đơn hàng đã hết hạn",orderInfo:"Thông tin đơn hàng",orderSummary:"Tóm tắt đơn hàng",organizationCert:"Giấy chứng nhận đăng ký doanh nghiệp",package:"Gói",passport:"Hộ chiếu",paymentAmount:"Số tiền thanh toán",paymentFailed:"Thanh toán thất bại",paymentInstructions:["Mở ứng dụng Ngân hàng hoặc Ví điện tử trên điện thoại","Trên ứng dụng chọn tính năng Quét mã QR","Quét mã QR ở trang này và thanh toán"],paymentInstructionsTitle:"Hướng dẫn thanh toán QR",paymentMethod:"Hình thức thanh toán:",paymentSuccess:"Thanh toán thành công!",paymentTimeout:"Hết thời gian thanh toán",paymentTimeoutMessage:"Hết thời gian thanh toán! Vui lòng thử lại.",paymentTitle:"Thanh toán",permanentAddress:"Địa chỉ thường trú",phone:"Số điện thoại",product:"Sản phẩm",provider:"Nhà cung cấp",providerName:"Tên NCC",province:"Tỉnh/Thành phố",qrPayment:"Thanh toán qua mã QR",qrPaymentTitle:"Quét mã QR để thanh toán",quantity:"Số lượng",registrationFee:"Phí đăng ký",required:"Bắt buộc",returnHome:"Trở về trang chủ",returnToStep1:"Quay lại bước 1",sampleNumberTooltip:"Mẫu số hóa đơn (1-9)",save:"Lưu",searchUnits:"Số đơn/tháng",selectFile:"Chọn tệp",selectInvoicePackage:"Chọn gói hóa đơn điện tử",selectProvider:"Chọn nhà cung cấp",selectSignaturePackage:"Chọn gói chữ ký số",selectSubscriptionPackage:"Chọn gói đăng ký",selectedProducts:"Sản phẩm đã chọn",settings:"Thiết lập",signaturePackage:"Gói chữ ký số",softwareLicense:"Bản quyền phần mềm hóa đơn điện tử",stepInfo:"Thông Tin",stepPayment:"Xác Nhận Và Thanh Toán",stepPlan:"Gói Hóa Đơn",subscriptionPackage:"Gói đăng ký",taxAuthority:"CQT quản lý",taxAuthorityCode:"5 ký tự do CQT cấp cho loại hóa đơn máy tính tiền",taxCode:"Mã số thuế đơn vị",termsAndUsagePolicy:"Điều khoản và Chính sách sử dụng",timeLeft:"Thời gian còn lại",total:"Tổng cộng",totalAmount:"Tổng tiền",totalPrice:"Thành tiền",transactionCanceled:"Giao dịch đã được hủy. Quay về trang đăng ký.",unit:"Đơn vị tính",unitInfo:"1. Thông tin đơn vị",unitPerMonth:"đơn/tháng",unitPrice:"Đơn giá",unitsPerMonth:"đơn/ tháng",uploadBackId:"Tải lên mặt sau CCCD",uploadFile:"Tải lên tệp",uploadFrontId:"Tải lên mặt trước CCCD",uploadLogo:"Tải logo lên",usagePolicy:"Chính sách sử dụng",ward:"Phường/Xã",website:"Website",widgetTitle:"Đăng ký hóa đơn điện tử",yearTooltip:"Năm phát hành (2 chữ số cuối)"},{slice:Pt,forEach:Jt}=[];function Tt(g){return Jt.call(Pt.call(arguments,1),A=>{if(A)for(const C in A)g[C]===void 0&&(g[C]=A[C])}),g}function kt(g){return typeof g!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(C=>C.test(g))}const zQ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ht=function(g,A){const B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},Q=encodeURIComponent(A);let I=`${g}=${Q}`;if(B.maxAge>0){const E=B.maxAge-0;if(Number.isNaN(E))throw new Error("maxAge should be a Number");I+=`; Max-Age=${Math.floor(E)}`}if(B.domain){if(!zQ.test(B.domain))throw new TypeError("option domain is invalid");I+=`; Domain=${B.domain}`}if(B.path){if(!zQ.test(B.path))throw new TypeError("option path is invalid");I+=`; Path=${B.path}`}if(B.expires){if(typeof B.expires.toUTCString!="function")throw new TypeError("option expires is invalid");I+=`; Expires=${B.expires.toUTCString()}`}if(B.httpOnly&&(I+="; HttpOnly"),B.secure&&(I+="; Secure"),B.sameSite)switch(typeof B.sameSite=="string"?B.sameSite.toLowerCase():B.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 new TypeError("option sameSite is invalid")}return B.partitioned&&(I+="; Partitioned"),I},GQ={create(g,A,C,B){let Q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};C&&(Q.expires=new Date,Q.expires.setTime(Q.expires.getTime()+C*60*1e3)),B&&(Q.domain=B),document.cookie=Ht(g,A,Q)},read(g){const A=`${g}=`,C=document.cookie.split(";");for(let B=0;B<C.length;B++){let Q=C[B];for(;Q.charAt(0)===" ";)Q=Q.substring(1,Q.length);if(Q.indexOf(A)===0)return Q.substring(A.length,Q.length)}return null},remove(g,A){this.create(g,"",-1,A)}};var Rt={name:"cookie",lookup(g){let{lookupCookie:A}=g;if(A&&typeof document!="undefined")return GQ.read(A)||void 0},cacheUserLanguage(g,A){let{lookupCookie:C,cookieMinutes:B,cookieDomain:Q,cookieOptions:I}=A;C&&typeof document!="undefined"&&GQ.create(C,g,B,Q,I)}},Yt={name:"querystring",lookup(g){var B;let{lookupQuerystring:A}=g,C;if(typeof window!="undefined"){let{search:Q}=window.location;!window.location.search&&((B=window.location.hash)==null?void 0:B.indexOf("?"))>-1&&(Q=window.location.hash.substring(window.location.hash.indexOf("?")));const E=Q.substring(1).split("&");for(let n=0;n<E.length;n++){const t=E[n].indexOf("=");t>0&&E[n].substring(0,t)===A&&(C=E[n].substring(t+1))}}return C}},xt={name:"hash",lookup(g){var Q;let{lookupHash:A,lookupFromHashIndex:C}=g,B;if(typeof window!="undefined"){const{hash:I}=window.location;if(I&&I.length>2){const E=I.substring(1);if(A){const n=E.split("&");for(let t=0;t<n.length;t++){const e=n[t].indexOf("=");e>0&&n[t].substring(0,e)===A&&(B=n[t].substring(e+1))}}if(B)return B;if(!B&&C>-1){const n=I.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(Q=n[typeof C=="number"?C:0])==null?void 0:Q.replace("/",""):void 0}}}return B}};let Yg=null;const OQ=()=>{if(Yg!==null)return Yg;try{if(Yg=typeof window!="undefined"&&window.localStorage!==null,!Yg)return!1;const g="i18next.translate.boo";window.localStorage.setItem(g,"foo"),window.localStorage.removeItem(g)}catch(g){Yg=!1}return Yg};var zt={name:"localStorage",lookup(g){let{lookupLocalStorage:A}=g;if(A&&OQ())return window.localStorage.getItem(A)||void 0},cacheUserLanguage(g,A){let{lookupLocalStorage:C}=A;C&&OQ()&&window.localStorage.setItem(C,g)}};let xg=null;const XQ=()=>{if(xg!==null)return xg;try{if(xg=typeof window!="undefined"&&window.sessionStorage!==null,!xg)return!1;const g="i18next.translate.boo";window.sessionStorage.setItem(g,"foo"),window.sessionStorage.removeItem(g)}catch(g){xg=!1}return xg};var Gt={name:"sessionStorage",lookup(g){let{lookupSessionStorage:A}=g;if(A&&XQ())return window.sessionStorage.getItem(A)||void 0},cacheUserLanguage(g,A){let{lookupSessionStorage:C}=A;C&&XQ()&&window.sessionStorage.setItem(C,g)}},Ot={name:"navigator",lookup(g){const A=[];if(typeof navigator!="undefined"){const{languages:C,userLanguage:B,language:Q}=navigator;if(C)for(let I=0;I<C.length;I++)A.push(C[I]);B&&A.push(B),Q&&A.push(Q)}return A.length>0?A:void 0}},Xt={name:"htmlTag",lookup(g){let{htmlTag:A}=g,C;const B=A||(typeof document!="undefined"?document.documentElement:null);return B&&typeof B.getAttribute=="function"&&(C=B.getAttribute("lang")),C}},Ft={name:"path",lookup(g){var Q;let{lookupFromPathIndex:A}=g;if(typeof window=="undefined")return;const C=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(C)?(Q=C[typeof A=="number"?A:0])==null?void 0:Q.replace("/",""):void 0}},Lt={name:"subdomain",lookup(g){var Q,I;let{lookupFromSubdomainIndex:A}=g;const C=typeof A=="number"?A+1:1,B=typeof window!="undefined"&&((I=(Q=window.location)==null?void 0:Q.hostname)==null?void 0:I.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(B)return B[C]}};let FQ=!1;try{document.cookie,FQ=!0}catch(g){}const LQ=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];FQ||LQ.splice(1,1);const Nt=()=>({order:LQ,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:g=>g});class NQ{constructor(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(A,C)}init(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=A,this.options=Tt(C,this.options||{},Nt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=Q=>Q.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=B,this.addDetector(Rt),this.addDetector(Yt),this.addDetector(zt),this.addDetector(Gt),this.addDetector(Ot),this.addDetector(Xt),this.addDetector(Ft),this.addDetector(Lt),this.addDetector(xt)}addDetector(A){return this.detectors[A.name]=A,this}detect(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,C=[];return A.forEach(B=>{if(this.detectors[B]){let Q=this.detectors[B].lookup(this.options);Q&&typeof Q=="string"&&(Q=[Q]),Q&&(C=C.concat(Q))}}),C=C.filter(B=>B!=null&&!kt(B)).map(B=>this.options.convertDetectedLanguage(B)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?C:C.length>0?C[0]:null}cacheUserLanguage(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;C&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(A)>-1||C.forEach(B=>{this.detectors[B]&&this.detectors[B].cacheUserLanguage(A,this.options)}))}}NQ.type="languageDetector";function bC(g){"@babel/helpers - typeof";return bC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},bC(g)}function yQ(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":bC(XMLHttpRequest))==="object"}function yt(g){return!!g&&typeof g.then=="function"}function bt(g){return yt(g)?g:Promise.resolve(g)}function bQ(g,A){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(g);A&&(B=B.filter(function(Q){return Object.getOwnPropertyDescriptor(g,Q).enumerable})),C.push.apply(C,B)}return C}function jQ(g){for(var A=1;A<arguments.length;A++){var C=arguments[A]!=null?arguments[A]:{};A%2?bQ(Object(C),!0).forEach(function(B){jt(g,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):bQ(Object(C)).forEach(function(B){Object.defineProperty(g,B,Object.getOwnPropertyDescriptor(C,B))})}return g}function jt(g,A,C){return(A=Kt(A))in g?Object.defineProperty(g,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[A]=C,g}function Kt(g){var A=pt(g,"string");return fg(A)=="symbol"?A:A+""}function pt(g,A){if(fg(g)!="object"||!g)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var B=C.call(g,A);if(fg(B)!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(g)}function fg(g){"@babel/helpers - typeof";return fg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},fg(g)}var sg=typeof fetch=="function"?fetch:void 0;typeof global!="undefined"&&global.fetch?sg=global.fetch:typeof window!="undefined"&&window.fetch&&(sg=window.fetch);var Sg;yQ()&&(typeof global!="undefined"&&global.XMLHttpRequest?Sg=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(Sg=window.XMLHttpRequest));var cC;if(typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?cC=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(cC=window.ActiveXObject)),typeof sg!="function"&&(sg=void 0),!sg&&!Sg&&!cC)try{Promise.resolve().then(()=>t0).then(function(g){sg=g.default}).catch(function(){})}catch(g){}var jC=function(A,C){if(C&&fg(C)==="object"){var B="";for(var Q in C)B+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(C[Q]);if(!B)return A;A=A+(A.indexOf("?")!==-1?"&":"?")+B.slice(1)}return A},KQ=function(A,C,B,Q){var I=function(t){if(!t.ok)return B(t.statusText||"Error",{status:t.status});t.text().then(function(e){B(null,{status:t.status,data:e})}).catch(B)};if(Q){var E=Q(A,C);if(E instanceof Promise){E.then(I).catch(B);return}}typeof fetch=="function"?fetch(A,C).then(I).catch(B):sg(A,C).then(I).catch(B)},pQ=!1,St=function(A,C,B,Q){A.queryStringParams&&(C=jC(C,A.queryStringParams));var I=jQ({},typeof A.customHeaders=="function"?A.customHeaders():A.customHeaders);typeof window=="undefined"&&typeof global!="undefined"&&typeof global.process!="undefined"&&global.process.versions&&global.process.versions.node&&(I["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),B&&(I["Content-Type"]="application/json");var E=typeof A.requestOptions=="function"?A.requestOptions(B):A.requestOptions,n=jQ({method:B?"POST":"GET",body:B?A.stringify(B):void 0,headers:I},pQ?{}:E),t=typeof A.alternateFetch=="function"&&A.alternateFetch.length>=1?A.alternateFetch:void 0;try{KQ(C,n,Q,t)}catch(e){if(!E||Object.keys(E).length===0||!e.message||e.message.indexOf("not implemented")<0)return Q(e);try{Object.keys(E).forEach(function(h){delete n[h]}),KQ(C,n,Q,t),pQ=!0}catch(h){Q(h)}}},Ut=function(A,C,B,Q){B&&fg(B)==="object"&&(B=jC("",B).slice(1)),A.queryStringParams&&(C=jC(C,A.queryStringParams));try{var I=Sg?new Sg:new cC("MSXML2.XMLHTTP.3.0");I.open(B?"POST":"GET",C,1),A.crossDomain||I.setRequestHeader("X-Requested-With","XMLHttpRequest"),I.withCredentials=!!A.withCredentials,B&&I.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),I.overrideMimeType&&I.overrideMimeType("application/json");var E=A.customHeaders;if(E=typeof E=="function"?E():E,E)for(var n in E)I.setRequestHeader(n,E[n]);I.onreadystatechange=function(){I.readyState>3&&Q(I.status>=400?I.statusText:null,{status:I.status,data:I.responseText})},I.send(B)}catch(t){console&&console.log(t)}},Zt=function(A,C,B,Q){if(typeof B=="function"&&(Q=B,B=void 0),Q=Q||function(){},sg&&C.indexOf("file:")!==0)return St(A,C,B,Q);if(yQ()||typeof ActiveXObject=="function")return Ut(A,C,B,Q);Q(new Error("No fetch and no xhr implementation found!"))};function zg(g){"@babel/helpers - typeof";return zg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},zg(g)}function SQ(g,A){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(g);A&&(B=B.filter(function(Q){return Object.getOwnPropertyDescriptor(g,Q).enumerable})),C.push.apply(C,B)}return C}function KC(g){for(var A=1;A<arguments.length;A++){var C=arguments[A]!=null?arguments[A]:{};A%2?SQ(Object(C),!0).forEach(function(B){UQ(g,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):SQ(Object(C)).forEach(function(B){Object.defineProperty(g,B,Object.getOwnPropertyDescriptor(C,B))})}return g}function Vt(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function Wt(g,A){for(var C=0;C<A.length;C++){var B=A[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(g,ZQ(B.key),B)}}function $t(g,A,C){return A&&Wt(g.prototype,A),Object.defineProperty(g,"prototype",{writable:!1}),g}function UQ(g,A,C){return(A=ZQ(A))in g?Object.defineProperty(g,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[A]=C,g}function ZQ(g){var A=_t(g,"string");return zg(A)=="symbol"?A:A+""}function _t(g,A){if(zg(g)!="object"||!g)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var B=C.call(g,A);if(zg(B)!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}var A0=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(C){return JSON.parse(C)},stringify:JSON.stringify,parsePayload:function(C,B,Q){return UQ({},B,Q||"")},parseLoadPayload:function(C,B){},request:Zt,reloadInterval:typeof window!="undefined"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},VQ=function(){function g(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Vt(this,g),this.services=A,this.options=C,this.allOptions=B,this.type="backend",this.init(A,C,B)}return $t(g,[{key:"init",value:function(C){var B=this,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=C,this.options=KC(KC(KC({},A0()),this.options||{}),Q),this.allOptions=I,this.services&&this.options.reloadInterval){var E=setInterval(function(){return B.reload()},this.options.reloadInterval);zg(E)==="object"&&typeof E.unref=="function"&&E.unref()}}},{key:"readMulti",value:function(C,B,Q){this._readAny(C,C,B,B,Q)}},{key:"read",value:function(C,B,Q){this._readAny([C],C,[B],B,Q)}},{key:"_readAny",value:function(C,B,Q,I,E){var n=this,t=this.options.loadPath;typeof this.options.loadPath=="function"&&(t=this.options.loadPath(C,Q)),t=bt(t),t.then(function(e){if(!e)return E(null,{});var h=n.services.interpolator.interpolate(e,{lng:C.join("+"),ns:Q.join("+")});n.loadUrl(h,E,B,I)})}},{key:"loadUrl",value:function(C,B,Q,I){var E=this,n=typeof Q=="string"?[Q]:Q,t=typeof I=="string"?[I]:I,e=this.options.parseLoadPayload(n,t);this.options.request(this.options,C,e,function(h,c){if(c&&(c.status>=500&&c.status<600||!c.status))return B("failed loading "+C+"; status code: "+c.status,!0);if(c&&c.status>=400&&c.status<500)return B("failed loading "+C+"; status code: "+c.status,!1);if(!c&&h&&h.message){var i=h.message.toLowerCase(),a=["failed","fetch","network","load"].find(function(q){return i.indexOf(q)>-1});if(a)return B("failed loading "+C+": "+h.message,!0)}if(h)return B(h,!1);var s,r;try{typeof c.data=="string"?s=E.options.parse(c.data,Q,I):s=c.data}catch(q){r="failed parsing "+C+" to json"}if(r)return B(r,!1);B(null,s)})}},{key:"create",value:function(C,B,Q,I,E){var n=this;if(this.options.addPath){typeof C=="string"&&(C=[C]);var t=this.options.parsePayload(B,Q,I),e=0,h=[],c=[];C.forEach(function(i){var a=n.options.addPath;typeof n.options.addPath=="function"&&(a=n.options.addPath(i,B));var s=n.services.interpolator.interpolate(a,{lng:i,ns:B});n.options.request(n.options,s,t,function(r,q){e+=1,h.push(r),c.push(q),e===C.length&&typeof E=="function"&&E(h,c)})})}}},{key:"reload",value:function(){var C=this,B=this.services,Q=B.backendConnector,I=B.languageUtils,E=B.logger,n=Q.language;if(!(n&&n.toLowerCase()==="cimode")){var t=[],e=function(c){var i=I.toResolveHierarchy(c);i.forEach(function(a){t.indexOf(a)<0&&t.push(a)})};e(n),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return e(h)}),t.forEach(function(h){C.allOptions.ns.forEach(function(c){Q.read(h,c,"read",null,null,function(i,a){i&&E.warn("loading namespace ".concat(c," for language ").concat(h," failed"),i),!i&&a&&E.log("loaded namespace ".concat(c," for language ").concat(h),a),Q.loaded("".concat(h,"|").concat(c),i,a)})})})}}}])}();VQ.type="backend",xA.use(VQ).use(NQ).init({lng:"vi",fallbackLng:"vi",debug:!1,resources:{en:{translation:lt},vi:{translation:vt}},interpolation:{escapeValue:!1},returnObjects:!0});function g0(g){xA.changeLanguage(g)}function f(g,A){return xA.t(g,j({returnObjects:!0},A))}function C0(g="dev"){const A={dev:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-stag.atomsolution.vn/v1/portal"},stag:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-stag.atomsolution.vn/v1/portal"},uat:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-api-outscope.atomsolution.vn/v1/portal"},pilot:{invoiceHubBaseUrl:"https://invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-smartmerchant-pl-api.ocb.com.vn/v1/portal",posBvbApiUrl:"https://api-outscope-pos.bvbank.net.vn/v1/portal"},prod:{invoiceHubBaseUrl:"https://invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-smartmerchant-api.ocb.com.vn/v1/portal",posBvbApiUrl:"https://api-outscope-pos.bvbank.net.vn/v1/portal"}};return A[g]||A.dev}let oC=null,pC=!1;function WQ(g){if(!["dev","uat","prod","stag","pilot"].includes(g))throw new Error(`Invalid mode: ${g}. Valid modes are 'dev', 'uat', 'prod', 'stag', 'pilot'.`);oC=g,pC=!0;try{localStorage.setItem("currentMode",g)}catch(A){console.warn("Could not save to localStorage:",A)}}function B0(){if(pC&&oC)return oC;try{const g=localStorage.getItem("currentMode");if(g)return oC=g,pC=!0,g}catch(g){console.warn("Could not read from localStorage:",g)}return"dev"}function iC(){const g=B0();return C0(g)}const Ug={dev:{bvb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!0,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!0,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}},ocb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!0,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!0,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}}},pilot:{bvb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}},ocb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}}},prod:{bvb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://www.meinvoice.vn/tra-cuu/",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}},ocb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://www.meinvoice.vn/tra-cuu/",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}}},stag:{bvb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}},ocb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}}},uat:{bvb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}},ocb:{fpt:{email:"",hotline:"",invoiceLookupUrl:"",isActive:!1,link:"",name:"fpt",onboarding:!1,sso:!1},"m-invoice":{email:"info@minvoice.vn",hotline:"0901 80 16 18",invoiceLookupUrl:"https://test-tracuuhoadon.minvoice.com.vn/single/invoice",isActive:!0,link:"https://minvoice.vn",name:"m-invoice",onboarding:!0,sso:!1},misa:{email:"",hotline:"",invoiceLookupUrl:"https://test.meinvoice.vn/tra-cuu",isActive:!1,link:"https://www.misa.vn",name:"misa",onboarding:!1,sso:!1}}}};let SC=null,UC=null;function Q0(g){return U(this,null,function*(){if(g.mode&&WQ(g.mode),g.language&&VC(g.language),!UC){const{InvoiceRegisterWidget:B}=yield Promise.resolve().then(()=>fn);UC=B}const A=typeof g.selector=="string"?document.querySelector(g.selector):g.selector;if(!A)throw new Error(`[WidgetSDK] Mount element not found: ${g.selector}`);function C(){A.innerHTML="",g.onClose&&g.onClose()}return UC(A,C,g.onShowPolicy||(()=>{}),g.data||{},g.theme,g.mode),{destroy:C}})}function I0(g){return U(this,null,function*(){if(g.mode&&WQ(g.mode),g.language&&VC(g.language),!SC){const{EContractWidget:B}=yield Promise.resolve().then(()=>fn);SC=B}const A=typeof g.selector=="string"?document.querySelector(g.selector):g.selector;if(!A)throw new Error(`[WidgetSDK] Mount element not found: ${g.selector}`);function C(){A.innerHTML="",g.onClose&&g.onClose()}return SC(A,C,g.data||{},g.theme),{destroy:C}})}let ZC=new Set;function VC(g){if(g!=="vi"&&g!=="en")throw new Error(`[WidgetSDK] Unsupported language: ${g}`);g0(g),ZC.forEach(A=>{A.rerender&&A.rerender()})}function WC(g){ZC.add(g)}function $C(g){ZC.delete(g)}function E0(){return Ug}var $Q=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function aC(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var sC={exports:{}},_Q;function n0(){return _Q||(_Q=1,function(g,A){var C=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof $Q!="undefined"&&$Q,B=function(){function I(){this.fetch=!1,this.DOMException=C.DOMException}return I.prototype=C,new I}();(function(I){(function(E){var n=typeof I!="undefined"&&I||typeof self!="undefined"&&self||typeof n!="undefined"&&n,t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(d){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function e(d){return d&&DataView.prototype.isPrototypeOf(d)}if(t.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(d){return d&&h.indexOf(Object.prototype.toString.call(d))>-1};function i(d){if(typeof d!="string"&&(d=String(d)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(d)||d==="")throw new TypeError('Invalid character in header field name: "'+d+'"');return d.toLowerCase()}function a(d){return typeof d!="string"&&(d=String(d)),d}function s(d){var G={next:function(){var p=d.shift();return{done:p===void 0,value:p}}};return t.iterable&&(G[Symbol.iterator]=function(){return G}),G}function r(d){this.map={},d instanceof r?d.forEach(function(G,p){this.append(p,G)},this):Array.isArray(d)?d.forEach(function(G){this.append(G[0],G[1])},this):d&&Object.getOwnPropertyNames(d).forEach(function(G){this.append(G,d[G])},this)}r.prototype.append=function(d,G){d=i(d),G=a(G);var p=this.map[d];this.map[d]=p?p+", "+G:G},r.prototype.delete=function(d){delete this.map[i(d)]},r.prototype.get=function(d){return d=i(d),this.has(d)?this.map[d]:null},r.prototype.has=function(d){return this.map.hasOwnProperty(i(d))},r.prototype.set=function(d,G){this.map[i(d)]=a(G)},r.prototype.forEach=function(d,G){for(var p in this.map)this.map.hasOwnProperty(p)&&d.call(G,this.map[p],p,this)},r.prototype.keys=function(){var d=[];return this.forEach(function(G,p){d.push(p)}),s(d)},r.prototype.values=function(){var d=[];return this.forEach(function(G){d.push(G)}),s(d)},r.prototype.entries=function(){var d=[];return this.forEach(function(G,p){d.push([p,G])}),s(d)},t.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries);function q(d){if(d.bodyUsed)return Promise.reject(new TypeError("Already read"));d.bodyUsed=!0}function H(d){return new Promise(function(G,p){d.onload=function(){G(d.result)},d.onerror=function(){p(d.error)}})}function m(d){var G=new FileReader,p=H(G);return G.readAsArrayBuffer(d),p}function M(d){var G=new FileReader,p=H(G);return G.readAsText(d),p}function v(d){for(var G=new Uint8Array(d),p=new Array(G.length),w=0;w<G.length;w++)p[w]=String.fromCharCode(G[w]);return p.join("")}function J(d){if(d.slice)return d.slice(0);var G=new Uint8Array(d.byteLength);return G.set(new Uint8Array(d)),G.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(d){this.bodyUsed=this.bodyUsed,this._bodyInit=d,d?typeof d=="string"?this._bodyText=d:t.blob&&Blob.prototype.isPrototypeOf(d)?this._bodyBlob=d:t.formData&&FormData.prototype.isPrototypeOf(d)?this._bodyFormData=d:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)?this._bodyText=d.toString():t.arrayBuffer&&t.blob&&e(d)?(this._bodyArrayBuffer=J(d.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(d)||c(d))?this._bodyArrayBuffer=J(d):this._bodyText=d=Object.prototype.toString.call(d):this._bodyText="",this.headers.get("content-type")||(typeof d=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var d=q(this);if(d)return d;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var d=q(this);return d||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(m)}),this.text=function(){var d=q(this);if(d)return d;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(v(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}var l=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(d){var G=d.toUpperCase();return l.indexOf(G)>-1?G:d}function T(d,G){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');G=G||{};var p=G.body;if(d instanceof T){if(d.bodyUsed)throw new TypeError("Already read");this.url=d.url,this.credentials=d.credentials,G.headers||(this.headers=new r(d.headers)),this.method=d.method,this.mode=d.mode,this.signal=d.signal,!p&&d._bodyInit!=null&&(p=d._bodyInit,d.bodyUsed=!0)}else this.url=String(d);if(this.credentials=G.credentials||this.credentials||"same-origin",(G.headers||!this.headers)&&(this.headers=new r(G.headers)),this.method=P(G.method||this.method||"GET"),this.mode=G.mode||this.mode||null,this.signal=G.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&p)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(p),(this.method==="GET"||this.method==="HEAD")&&(G.cache==="no-store"||G.cache==="no-cache")){var w=/([?&])_=[^&]*/;if(w.test(this.url))this.url=this.url.replace(w,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function O(d){var G=new FormData;return d.trim().split("&").forEach(function(p){if(p){var w=p.split("="),o=w.shift().replace(/\+/g," "),u=w.join("=").replace(/\+/g," ");G.append(decodeURIComponent(o),decodeURIComponent(u))}}),G}function X(d){var G=new r,p=d.replace(/\r?\n[\t ]+/g," ");return p.split("\r").map(function(w){return w.indexOf(`
2
2
  `)===0?w.substr(1,w.length):w}).forEach(function(w){var o=w.split(":"),u=o.shift().trim();if(u){var D=o.join(":").trim();G.append(u,D)}}),G}k.call(T.prototype);function F(d,G){if(!(this instanceof F))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');G||(G={}),this.type="default",this.status=G.status===void 0?200:G.status,this.ok=this.status>=200&&this.status<300,this.statusText=G.statusText===void 0?"":""+G.statusText,this.headers=new r(G.headers),this.url=G.url||"",this._initBody(d)}k.call(F.prototype),F.prototype.clone=function(){return new F(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},F.error=function(){var d=new F(null,{status:0,statusText:""});return d.type="error",d};var L=[301,302,303,307,308];F.redirect=function(d,G){if(L.indexOf(G)===-1)throw new RangeError("Invalid status code");return new F(null,{status:G,headers:{location:d}})},E.DOMException=n.DOMException;try{new E.DOMException}catch(d){E.DOMException=function(G,p){this.message=G,this.name=p;var w=Error(G);this.stack=w.stack},E.DOMException.prototype=Object.create(Error.prototype),E.DOMException.prototype.constructor=E.DOMException}function z(d,G){return new Promise(function(p,w){var o=new T(d,G);if(o.signal&&o.signal.aborted)return w(new E.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function D(){u.abort()}u.onload=function(){var x={status:u.status,statusText:u.statusText,headers:X(u.getAllResponseHeaders()||"")};x.url="responseURL"in u?u.responseURL:x.headers.get("X-Request-URL");var N="response"in u?u.response:u.responseText;setTimeout(function(){p(new F(N,x))},0)},u.onerror=function(){setTimeout(function(){w(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){w(new TypeError("Network request failed"))},0)},u.onabort=function(){setTimeout(function(){w(new E.DOMException("Aborted","AbortError"))},0)};function Y(x){try{return x===""&&n.location.href?n.location.href:x}catch(N){return x}}u.open(o.method,Y(o.url),!0),o.credentials==="include"?u.withCredentials=!0:o.credentials==="omit"&&(u.withCredentials=!1),"responseType"in u&&(t.blob?u.responseType="blob":t.arrayBuffer&&o.headers.get("Content-Type")&&o.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(u.responseType="arraybuffer")),G&&typeof G.headers=="object"&&!(G.headers instanceof r)?Object.getOwnPropertyNames(G.headers).forEach(function(x){u.setRequestHeader(x,a(G.headers[x]))}):o.headers.forEach(function(x,N){u.setRequestHeader(N,x)}),o.signal&&(o.signal.addEventListener("abort",D),u.onreadystatechange=function(){u.readyState===4&&o.signal.removeEventListener("abort",D)}),u.send(typeof o._bodyInit=="undefined"?null:o._bodyInit)})}return z.polyfill=!0,n.fetch||(n.fetch=z,n.Headers=r,n.Request=T,n.Response=F),E.Headers=r,E.Request=T,E.Response=F,E.fetch=z,E})({})})(B),B.fetch.ponyfill=!0,delete B.fetch.polyfill;var Q=C.fetch?C:B;A=Q.fetch,A.default=Q.fetch,A.fetch=Q.fetch,A.Headers=Q.Headers,A.Request=Q.Request,A.Response=Q.Response,g.exports=A}(sC,sC.exports)),sC.exports}var AI=n0();const t0=BA({__proto__:null,default:aC(AI)},[AI]);function gI({steps:g=[],currentStep:A=1}={}){const C=document.createElement("div");C.className=["wgt:relative","wgt:flex","wgt:bg-weak-50","wgt:rounded-[10px]","wgt:overflow-hidden","wgt:shadow-sm"].join(" ");const B=document.createElement("div");B.className=["wgt:absolute","wgt:inset-0","wgt:transition-all","wgt:duration-250","wgt:rounded-r-md"].join(" "),B.style.backgroundColor="rgba(0,140,79,0.16)",B.style.clipPath="polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)";const Q=document.createElement("div");Q.className="wgt:relative wgt:flex wgt:w-full wgt:z-10";const I=[];g.forEach((n,t)=>{const e=t+1,h=document.createElement("div");h.setAttribute("role","listitem"),h.setAttribute("aria-label",`Step ${e} of ${g.length}: ${n.label}`),h.className=["wgt:flex-1","wgt:flex","wgt:items-center","wgt:justify-center","wgt:py-5","wgt:px-4",t<g.length-1?"wgt:pr-9":""].filter(Boolean).join(" ");const c=document.createElement("div");c.className=["wgt:flex","wgt:items-center","wgt:justify-center","wgt:w-8","wgt:h-8","wgt:rounded-full","wgt:mr-4"].join(" ");const i=document.createElement("span");i.innerText=String(e),i.className="wgt:text-white wgt:font-medium",c.appendChild(i);const a=document.createElement("span");a.innerText=n.label,a.className="wgt:font-medium wgt:whitespace-nowrap",h.append(c,a),Q.append(h),I.push({wrap:h,circle:c,label:a})}),C.append(B,Q);function E(n){const t=g.length,e=Math.max(0,Math.min(n,t)),h=e/t*100;B.style.width=`${h}%`,e===t?(B.style.clipPath="none",B.style.borderTopRightRadius="10px",B.style.borderBottomRightRadius="10px"):(B.style.clipPath="polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)",B.style.borderTopRightRadius="0",B.style.borderBottomRightRadius="0"),I.forEach(({circle:c,label:i},a)=>{a+1<=e?(c.classList.add("wgt:bg-icon-primary"),c.classList.remove("wgt:bg-icon-soft-400"),i.classList.add("wgt:text-primary-dark"),i.classList.remove("wgt:text-soft-400")):(c.classList.add("wgt:bg-icon-soft-400"),c.classList.remove("wgt:bg-icon-primary"),i.classList.add("wgt:text-soft-400"),i.classList.remove("wgt:text-primary-dark"))})}return E(A),{container:C,update(n){E(n)}}}function e0({steps:g=[],currentStep:A=1}={}){const C=document.createElement("div");C.className=["wgt:flex","wgt:bg-transparent","wgt:flex-col","wgt:h-fit","wgt:gap-6","wgt:items-center","wgt:justify-start","wgt:w-full","wgt:h-full","wgt:py-8","wgt:overflow-auto"].join(" ");const B=document.createElement("h1");B.className=["wgt:text-[28px]","wgt:font-bold","wgt:leading-[30px]","wgt:text-strong-950"].join(" "),B.innerText=f("widgetTitle");const Q=document.createElement("div");Q.className=["wgt:w-full","wgt:bg-white","wgt:max-w-[1320px]","wgt:flex-1","wgt:mx-auto","wgt:p-6","wgt:flex","wgt:flex-col","wgt:border","wgt:border-[#E1E4EA]","wgt:rounded-3xl","wgt:gap-6","wgt:shadow-[0px_1px_8px_0px_rgba(82,88,102,0.06)]"].join(" ");let I=gI({steps:g.map(e=>({label:e})),currentStep:A});Q.appendChild(I.container);const E=document.createElement("div");E.className="wgt:flex-1",Q.appendChild(E),C.appendChild(B),C.appendChild(Q);function n(){B.innerText=f("widgetTitle")}function t(e){I.container.remove(),I=gI({steps:e.map(h=>({label:h})),currentStep:A}),Q.insertBefore(I.container,E)}return{container:C,setStep(e){A=e,I.update(e)},setContent(e){E.replaceChildren(e)},updateSteps:t,updateTitle:n}}function CI({name:g,value:A="",label:C="",checked:B=!1,onChange:Q,disabled:I=!1}){const E=document.createElement("label");E.className="wgt:flex wgt:items-center wgt:gap-2 wgt:cursor-pointer";const n=document.createElement("input");n.type="radio",g&&(n.name=g),A&&(n.value=A),n.checked=B,n.disabled=I,n.className=["wgt:form-radio","wgt:h-6","wgt:w-6","wgt:border-grey-6","wgt:checked:accent-primary","wgt:focus:ring-primary"].join(" "),n.addEventListener("change",e=>{const h=e.target.checked;typeof Q=="function"&&Q(h)});const t=document.createElement("span");return t.innerText=C,E.append(n,t),{container:E,setChecked(e){n.checked=e}}}let ug=[],vA=null,mg=null;const h0=3;function c0(){!vA&&document.body&&BI()}function BI(){if(!document.body)if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",BI);return}else{console.warn("Document body not available for notification container");return}vA&&vA.parentNode&&vA.parentNode.removeChild(vA),vA=document.createElement("div"),vA.className="wgt:fixed wgt:z-[99999] wgt:pointer-events-none",window.innerWidth>=768?vA.className+=" wgt:bottom-4 wgt:right-4":vA.className+=" wgt:top-4 wgt:right-4",document.body.appendChild(vA),mg&&window.removeEventListener("resize",mg),mg=()=>{if(!vA)return;const A=window.innerWidth>=768;vA.className="wgt:fixed wgt:z-[99999] wgt:pointer-events-none",A?vA.className+=" wgt:bottom-4 wgt:right-4":vA.className+=" wgt:top-4 wgt:right-4"},window.addEventListener("resize",mg)}function uC(g,A={}){if(c0(),!vA)return console.warn("Notification container not available"),null;const{autoClose:C=5e3,hideProgressBar:B=!0,closeButton:Q=!1,icon:I=!1,type:E="info"}=A;ug.length>=h0&&wC(ug[0].id);const n=Date.now()+Math.random(),t=o0(n,g,{autoClose:C,hideProgressBar:B,closeButton:Q,icon:I,type:E});return ug.push({id:n,element:t}),vA.appendChild(t),requestAnimationFrame(()=>{t.classList.remove("wgt:translate-x-full","wgt:opacity-0"),t.classList.add("wgt:translate-x-0","wgt:opacity-100")}),C>0&&setTimeout(()=>{wC(n)},C),n}function o0(g,A,C){const{hideProgressBar:B,closeButton:Q,icon:I,type:E,autoClose:n}=C,t=document.createElement("div");t.className=["wgt:bg-white","wgt:px-5","wgt:py-4","wgt:rounded-lg","wgt:shadow-lg","wgt:mb-2","wgt:max-w-sm","wgt:w-full","wgt:transform","wgt:translate-x-full","wgt:opacity-0","wgt:transition-all","wgt:duration-300","wgt:ease-out","wgt:pointer-events-auto","wgt:relative","wgt:overflow-hidden"].join(" ");const e={info:"#40A9FF",success:"#52C41A",warning:"#FAAD14",error:"#FF4D4F"};t.style.borderLeft=`4px solid ${e[E]||e.info}`,t.style.zIndex="99999";const h=document.createElement("div");if(h.className="wgt:flex wgt:items-start wgt:gap-3",I){const i=document.createElement("div"),a={info:"wgt:bg-blue-500",success:"wgt:bg-green-500",warning:"wgt:bg-orange-500",error:"wgt:bg-red-500"};i.className=`wgt:flex-shrink-0 wgt:w-5 wgt:h-5 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center wgt:mt-0.5 ${a[E]||a.info}`,i.innerHTML='<span class="wgt:text-white wgt:text-xs wgt:font-bold">!</span>',h.appendChild(i)}const c=document.createElement("div");if(c.className="wgt:text-sm wgt:font-medium wgt:text-gray-700 wgt:leading-5 wgt:flex-1",c.innerText=A,h.appendChild(c),Q){const i=document.createElement("button");i.className="wgt:flex-shrink-0 wgt:ml-2 wgt:text-gray-400 wgt:hover:text-gray-600 wgt:text-lg wgt:leading-none",i.innerHTML="×",i.addEventListener("click",()=>{wC(g)}),h.appendChild(i)}if(t.appendChild(h),!B&&n>0){const i=document.createElement("div"),a={info:"wgt:bg-blue-500",success:"wgt:bg-green-500",warning:"wgt:bg-orange-500",error:"wgt:bg-red-500"};i.className=`wgt:absolute wgt:bottom-0 wgt:left-0 wgt:h-1 wgt:transition-all wgt:duration-300 ${a[E]||a.info}`,i.style.width="100%",requestAnimationFrame(()=>{i.style.transition=`width ${n}ms linear`,i.style.width="0%"}),t.appendChild(i)}return t}function wC(g){const A=ug.findIndex(B=>B.id===g);if(A===-1)return;const{element:C}=ug[A];C.classList.remove("wgt:translate-x-0","wgt:opacity-100"),C.classList.add("wgt:translate-x-full","wgt:opacity-0"),setTimeout(()=>{C.parentNode&&C.parentNode.removeChild(C),ug.splice(A,1)},300)}function QI(){ug.forEach(({id:g})=>wC(g))}function i0(){QI(),vA&&vA.parentNode&&vA.parentNode.removeChild(vA),mg&&window.removeEventListener("resize",mg),vA=null,mg=null,ug=[]}const tg={info:(g,A={})=>uC(g,mA(j({},A),{type:"info"})),success:(g,A={})=>uC(g,mA(j({},A),{type:"success"})),warning:(g,A={})=>uC(g,mA(j({},A),{type:"warning"})),error:(g,A={})=>uC(g,mA(j({},A),{type:"error"})),clear:QI,destroy:i0};function a0({providers:g=[],selectedRoute:A=null,onProviderChange:C}){const B=document.createElement("div");B.className="wgt:max-w-[1072px] wgt:mx-auto wgt:w-full wgt:flex wgt:flex-col wgt:gap-2";const Q=document.createElement("h2");Q.className="wgt:text-sm wgt:font-semibold wgt:text-black",Q.innerText=f("selectProvider"),B.appendChild(Q);const I=document.createElement("div");I.className="wgt:grid wgt:grid-cols-3 wgt:gap-4",B.appendChild(I);function E(){I.innerHTML="",g.forEach(n=>{const t=n.route===A,e=document.createElement("div");e.dataset.checked=t?"true":"false",e.className=["wgt:flex","wgt:items-center","wgt:justify-between","wgt:gap-2","wgt:p-4","wgt:border","wgt:border-border-light","wgt:rounded-xl","wgt:hover:bg-gray-100","wgt:cursor-pointer","wgt:transition-colors","wgt:duration-200",t?"wgt:border-primary":""].filter(Boolean).join(" "),e.addEventListener("click",()=>{if(n.route==="fpt"){tg.info(f("comingSoon"),{hideProgressBar:!0,closeButton:!1,autoClose:5e3,icon:!0,limit:3});return}A=n.route,typeof C=="function"&&C(n),E()});const h=document.createElement("div");h.className="wgt:flex wgt:items-center wgt:gap-3";const c=document.createElement("img");c.src=n.logoUrl,c.alt=n.name,c.className="wgt:h-8 wgt:object-contain";const i=document.createElement("div");i.className="wgt:w-[1px] wgt:h-8 wgt:bg-border-light";const a=document.createElement("label");a.className="wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase",a.innerText=n.name,h.appendChild(c),h.appendChild(i),h.appendChild(a);const{container:s}=CI({checked:t,onChange:r=>{if(r){if(n.route==="fpt"){tg.info(f("comingSoon"),{hideProgressBar:!0,closeButton:!1,autoClose:5e3,icon:!0,limit:3});return}A=n.route,typeof C=="function"&&C(n),E()}},disabled:n.route==="fpt"});e.appendChild(h),e.appendChild(s),I.appendChild(e)})}return E(),{container:B,setSelectedRoute(n){A=n,E()}}}function FA({name:g,value:A="",type:C="text",placeholder:B="",label:Q,required:I=!1,error:E=null,onInput:n=null,readOnly:t=!1,horizontal:e=!1}){const h=document.createElement("div");if(h.className="wgt:w-full "+(e?"wgt:grid wgt:grid-cols-6 wgt:items-center wgt:gap-2":"wgt:flex wgt:flex-col wgt:gap-2"),Q){const a=document.createElement("label");if(a.htmlFor=g,a.className="wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2",a.innerText=Q,I){const s=document.createElement("span");s.className="wgt:text-red-500 wgt:ml-1",s.innerText="*",a.appendChild(s)}h.appendChild(a)}const c=document.createElement("input");c.type=C,c.name=g,c.id=g,c.value=A,c.placeholder=B,c.readOnly=t,c.autocomplete="off",c.autocapitalize="off",c.spellcheck=!1,c.className=["wgt:col-span-4","wgt:w-full","wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:focus:outline-none","wgt:focus:ring-2",E?"wgt:border-red-500":"wgt:border-gray-300","wgt:read-only:focus:ring-transparent","wgt:bg-white","wgt:focus:ring-primary"].join(" "),I&&c.setAttribute("required","true"),typeof n=="function"&&c.addEventListener("input",n);const i=document.createElement("span");return i.className="wgt:text-red-500 wgt:text-sm wgt:whitespace-nowrap",i.innerText=E||"",E||(i.style.display="none"),h.appendChild(c),h.appendChild(i),{container:h,inputEl:c,setError(a){a?(i.innerText=a,i.style.display="block",c.classList.remove("wgt:border-gray-300"),c.classList.add("wgt:border-red-500")):(i.innerText="",i.style.display="none",c.classList.remove("wgt:border-red-500"),c.classList.add("wgt:border-gray-300"))},getValue(){return c.value}}}function _C({name:g,value:A="",options:C=[],label:B,disabled:Q=!1,error:I=null,onChange:E=null,required:n=!1,horizontal:t=!1,searchable:e=!1}){const h=document.createElement("div");h.className="wgt:w-full "+(t?"wgt:grid wgt:grid-cols-6 wgt:items-center wgt:gap-2":"wgt:flex wgt:flex-col wgt:gap-2");const c=document.createElement("label");if(c.htmlFor=g,c.className="wgt:font-medium wgt:text-text-sub-600 wgt:whitespace-nowrap wgt:col-span-2",c.innerText=B,h.appendChild(c),n){const i=document.createElement("span");i.className="wgt:text-red-500 wgt:ml-1",i.innerText="*",c.appendChild(i)}if(e){const i=document.createElement("div");i.className="wgt:col-span-4 wgt:relative";const a=document.createElement("input");a.type="text",a.placeholder=`Tìm kiếm ${B.toLowerCase()}...`,a.disabled=Q,a.className=["wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:w-full","wgt:focus:outline-none","wgt:focus:ring-2","wgt:focus:ring-blue-500","wgt:bg-white",I?"wgt:border-red-500":"wgt:border-gray-300"].join(" ");const s=document.createElement("div");s.className="wgt:absolute wgt:top-full wgt:left-0 wgt:right-0 wgt:bg-white wgt:border wgt:border-gray-300 wgt:rounded wgt:shadow-lg wgt:z-50 wgt:hidden wgt:max-h-[500px] wgt:overflow-y-auto";const r=document.createElement("div");r.className="wgt:divide-y wgt:divide-gray-200";let q=A,H=null,m=[...C];const M=()=>{const l=C.find(P=>P.id?P.id===H:P.value===q);return l?l.label:""};a.value=M();const v=(l=m)=>{if(r.innerHTML="",l.length===0){const P=document.createElement("div");P.className="wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm",P.innerText="Không tìm thấy kết quả",r.appendChild(P);return}l.forEach(P=>{const T=document.createElement("div");T.className=["wgt:px-3","wgt:py-2","wgt:cursor-pointer","wgt:hover:bg-gray-100","wgt:text-sm",P.id?H===P.id?"wgt:bg-blue-50 wgt:text-blue-700":"":q===P.value?"wgt:bg-blue-50 wgt:text-blue-700":""].filter(Boolean).join(" "),T.innerText=P.label,T.dataset.value=P.value,T.addEventListener("click",()=>{if(P.id&&(H=P.id),q=P.value,a.value=P.label,s.classList.add("wgt:hidden"),typeof E=="function"){const O={target:{value:P.value}};P.id&&(O.target.id=P.id),E(O)}}),r.appendChild(T)})};a.addEventListener("input",l=>{const P=l.target.value.toLowerCase();m=C.filter(T=>T.label.toLowerCase().includes(P)),v(m),s.classList.contains("wgt:hidden")||s.classList.remove("wgt:hidden")}),a.addEventListener("focus",()=>{s.classList.remove("wgt:hidden"),v()}),document.addEventListener("click",l=>{i.contains(l.target)||s.classList.add("wgt:hidden")}),a.addEventListener("keydown",l=>{l.key==="Escape"&&s.classList.add("wgt:hidden")}),s.appendChild(r),i.appendChild(a),i.appendChild(s),v();const J=document.createElement("select");J.style.display="none",J.name=g,J.id=g,C.forEach(l=>{const P=document.createElement("option");P.value=l.value,P.innerText=l.label,l.value===A&&(P.selected=!0),J.appendChild(P)}),h.appendChild(i),h.appendChild(J);const k=document.createElement("span");return k.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",k.innerText=I||"",I||(k.style.display="none"),h.appendChild(k),{container:h,selectEl:J,setError(l){l?(k.innerText=l,k.style.display="block",a.classList.remove("wgt:border-gray-300"),a.classList.add("wgt:border-red-500")):(k.innerText="",k.style.display="none",a.classList.remove("wgt:border-red-500"),a.classList.add("wgt:border-gray-300"))},getValue(){return q},setValue(l,P,T){H=T||null,q=l||"";const O=C.find(X=>X.id?X.id===T:X.value===l);O?(a.value=O.label,J.value=l,v()):(a.value=P||"",J.value=l||"",v())},setOptions(l){for(C.splice(0,C.length,...l),m=[...l];J.options.length>0;)J.remove(0);l.forEach(P=>{const T=document.createElement("option");T.value=P.value,T.innerText=P.label,J.appendChild(T)}),v()},setDisabled(l){a.disabled=!!l,J.disabled=!!l,l?(i.classList.add("wgt:opacity-75"),s.classList.add("wgt:hidden")):i.classList.remove("wgt:opacity-75")}}}else{const i=document.createElement("select");i.id=g,i.name=g,i.disabled=Q,i.className=["wgt:col-span-4","wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:focus:outline-none","wgt:focus:ring-2","wgt:focus:ring-blue-500","wgt:bg-white",I?"wgt:border-red-500":"wgt:border-gray-300"].join(" ");const a=document.createElement("option");a.value="",a.disabled=!0,a.selected=A===""||A==null,a.innerText=`-- Chọn ${B.toLowerCase()} --`,i.appendChild(a),C.forEach(r=>{const q=document.createElement("option");q.value=r.value,q.innerText=r.label,r.value===A&&(q.selected=!0),i.appendChild(q)}),typeof E=="function"&&i.addEventListener("change",E),h.appendChild(i);const s=document.createElement("span");return s.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",s.innerText=I||"",I||(s.style.display="none"),h.appendChild(s),{container:h,selectEl:i,setError(r){r?(s.innerText=r,s.style.display="block",i.classList.remove("wgt:border-gray-300"),i.classList.add("wgt:border-red-500")):(s.innerText="",s.style.display="none",i.classList.remove("wgt:border-red-500"),i.classList.add("wgt:border-gray-300"))},getValue(){return i.value},setOptions(r){for(;i.options.length>1;)i.remove(1);r.forEach(q=>{const H=document.createElement("option");H.value=q.value,H.innerText=q.label,i.appendChild(H)})},setDisabled(r){i.disabled=!!r}}}}function Gg({title:g,isDisabled:A=!1,handleClick:C=null,type:B="button",className:Q=""}={}){const I=document.createElement("button");return I.type=B,I.disabled=A,I.className=["wgt:bg-primary","wgt:hover:bg-primary-dark","wgt:px-6","wgt:py-2","wgt:rounded-lg","wgt:disabled:opacity-50","wgt:disabled:cursor-not-allowed","wgt:cursor-pointer",Q].filter(Boolean).join(" "),I.innerText=g,typeof C=="function"&&I.addEventListener("click",E=>U(null,null,function*(){if(!I.disabled){I.disabled=!0;try{yield C(E)}catch(n){console.error("Button click handler error:",n)}finally{I.disabled=!1}}})),I}function II({label:g,required:A=!1,file:C=null,onFileChange:B,error:Q=null,accept:I=""}){const E=document.createElement("form");E.className="wgt:flex wgt:flex-col";const n=document.createElement("label");if(n.htmlFor="upload",n.className="wgt:font-medium wgt:mb-1 wgt:text-text-sub-600",n.innerText=g,A){const M=document.createElement("span");M.className="wgt:text-red-500 wgt:ml-1",M.innerText="*",n.appendChild(M)}const t=I?I.split(",").map(M=>M.trim().startsWith("image/")?M.replace("image/","").toUpperCase():M.trim().startsWith(".")?M.replace(".","").toUpperCase():M.toUpperCase().replace("/*","")).filter(Boolean).join(", "):`JPG, PNG ${f("or")} JPEG`;n.innerHTML+=` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${f("fileFormat")} ${t}. ${f("maxFileSize")})</span>`,E.appendChild(n);const e=document.createElement("div");e.className=["wgt:h-fit","wgt:w-full","wgt:rounded","wgt:overflow-hidden","wgt:flex","wgt:items-start","wgt:cursor-pointer","wgt:justify-start","wgt:gap-2"].join(" ");const h=document.createElement("input");h.accept=I||"image/png, image/jpeg, .jpg, .jpeg, .png",h.id="upload",h.type="file",h.className="wgt:hidden";const c=document.createElement("div");c.className="wgt:w-full wgt:flex wgt:gap-1 wgt:items-start wgt:justify-start";const i=document.createElement("span");i.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",i.innerText=Q||"",Q||(i.style.display="none");let a=null;function s(M){a=M,M?(i.innerText=M,i.style.display="block"):(i.innerText="",i.style.display="none")}const r=Gg({title:"Upload file",className:"wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-white wgt:px-6 wgt:py-1 wgt:rounded-md wgt:cursor-pointer",handleClick:M=>{M.stopPropagation(),h.click()}});function q(M,v=2){if(M===0)return"0 Bytes";const J=1024,k=Math.max(0,v),l=["Bytes","KB","MB","GB","TB"],P=Math.floor(Math.log(M)/Math.log(J));return parseFloat((M/Math.pow(J,P)).toFixed(k))+" "+l[P]}function H(M){const v=M.type.toLowerCase(),J="."+M.name.split(".").pop().toLowerCase();return h.accept.split(",").map(l=>l.trim().toLowerCase()).filter(Boolean).some(l=>l.startsWith(".")?l===J:l.endsWith("/*")?v.startsWith(l.replace("/*","")):v===l)}function m(M){if(c.innerHTML="",s(null),M){H(M)||s(`File không hợp lệ. Chỉ chấp nhận: ${h.accept}`),M.size<=500*1024||s("Dung lượng file vượt quá 500KB.");const J=document.createElement("div");if(J.className="wgt:flex wgt:items-center wgt:gap-4",J.addEventListener("click",()=>{h.click()}),M.type.startsWith("image/")){const T=document.createElement("img");T.src=URL.createObjectURL(M),T.alt="Preview",T.className="wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded",J.appendChild(T)}const k=document.createElement("div");k.className="wgt:flex wgt:flex-col";const l=document.createElement("p");l.className="wgt:text-sm wgt:font-medium wgt:text-gray-800",l.innerText=M.name;const P=document.createElement("p");P.className="wgt:text-sm wgt:text-gray-500",P.innerText=q(M.size),k.appendChild(l),k.appendChild(P),J.appendChild(k),c.appendChild(J),C=M,typeof B=="function"&&B(M)}else{const v=document.createElement("div");v.className="wgt:flex wgt:items-center",v.appendChild(r),c.appendChild(v)}}return h.addEventListener("change",M=>{const v=M.target.files&&M.target.files[0]?M.target.files[0]:null;v&&(m(v),typeof B=="function"&&B(v))}),m(C),e.appendChild(c),e.appendChild(h),E.appendChild(e),E.appendChild(i),{container:E,getValues(){return C},setFile(M){C=M,m(M),typeof B=="function"&&B(M)},clearFile(){C=null,m(null),typeof B=="function"&&B(null)},getError:()=>a}}function EI({file:g,placeholder:A,caption:C,onFileSelected:B,onError:Q}){const I=document.createElement("div");I.className="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2";const E=document.createElement("div");E.className=["wgt:w-full","wgt:h-fit","wgt:border-2","wgt:border-dashed","wgt:border-sub-300","wgt:rounded-lg","wgt:flex","wgt:flex-col","wgt:gap-2","wgt:items-center","wgt:justify-center","wgt:cursor-pointer","wgt:bg-weak-50","wgt:py-6"].join(" "),I.append(E);const n=document.createElement("input");n.type="file",n.accept="image/png, image/jpeg, image/jpg",n.className="wgt:hidden",E.append(n);const t=document.createElement("div");t.className="wgt:w-10 wgt:h-10 wgt:rounded-full wgt:bg-primary/16 wgt:flex wgt:items-center wgt:justify-center",t.innerHTML=`
3
3
  <svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M8.83184 0.96875H10.3485C10.4833 0.96875 10.5507 1.03316 10.5507 1.16199V18.1668C10.5507 18.2956 10.4833 18.3601 10.3485 18.3601H8.83184C8.69702 18.3601 8.62962 18.2956 8.62962 18.1668V1.16199C8.62962 1.03316 8.69702 0.96875 8.83184 0.96875Z" fill="#008C4F"/>