@ciscode/ui-authentication-kit 1.0.2 → 1.0.3
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/components/actions/InputField.d.ts.map +1 -1
- package/dist/components/actions/InputField.js +4 -7
- package/dist/components/actions/InputField.js.map +1 -1
- package/dist/components/actions/SocialButton.d.ts.map +1 -1
- package/dist/components/actions/SocialButton.js +2 -4
- package/dist/components/actions/SocialButton.js.map +1 -1
- package/dist/index.mjs +151 -156
- package/dist/index.umd.js +5 -5
- package/dist/pages/auth/SignInPage.js +2 -2
- package/dist/pages/auth/SignInPage.js.map +1 -1
- package/dist/pages/auth/SignUpPage.js +2 -2
- package/dist/pages/auth/SignUpPage.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(function(I,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("axios"),require("jwt-decode"),require("react-dom"),require("react-router")):typeof define=="function"&&define.amd?define(["exports","react","axios","jwt-decode","react-dom","react-router"],o):(I=typeof globalThis<"u"?globalThis:I||self,o(I["ciscode-model"]={},I.React,I.axios,I.jwtDecode,I.ReactDOM,I.reactRouter))})(this,function(I,o,ue,et,tt,U){"use strict";function st(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Y=st(o),Ne=o.createContext(null);function Se(){const r=o.useContext(Ne);if(!r)throw new Error("useAuthConfig must be used within an AuthConfigProvider");return r}const ve=o.createContext(null);function G(){const r=o.useContext(ve);if(!r)throw new Error("useAuthState must be inside <AuthProvider>");return r}function ce(r){const e=et.jwtDecode(r);return{id:e.sub,email:e.email??"",roles:e.roles??[],permissions:e.permissions??[],modules:e.modules??[],tenantId:e.tenantId??""}}let de=!1;function nt(){de=!1}function rt(r,e){r.defaults.withCredentials=!0;const t=`${e.baseUrl}${e.refreshEndpoint??"/auth/refresh-token"}`;r.interceptors.request.use(i=>{const a=e.getAccessToken();return a&&(i.headers.Authorization=`Bearer ${a}`),i});let s=!1,n=[];return r.interceptors.response.use(i=>i,async i=>{var l;const a=i.config;if(((l=i.response)==null?void 0:l.status)!==401||!a||a._retry)return Promise.reject(i);if(a._retry=!0,!s){s=!0;try{const{data:c}=await ue.post(t,{},{withCredentials:!0});return e.setAccessToken(c.accessToken),n.forEach(u=>u(c.accessToken)),n=[],r.request(a)}catch(c){return!!e.getAccessToken()&&!de&&(de=!0,e.logout()),n.forEach(d=>d(null)),n=[],Promise.reject(c)}finally{s=!1}}return new Promise((c,u)=>{n.push(d=>{if(!d)return u(i);(a.headers??(a.headers={})).Authorization=`Bearer ${d}`,c(r.request(a))})})}),r}const x=r=>typeof r=="string",Q=()=>{let r,e;const t=new Promise((s,n)=>{r=s,e=n});return t.resolve=r,t.reject=e,t},Ee=r=>r==null?"":""+r,it=(r,e,t)=>{r.forEach(s=>{e[s]&&(t[s]=e[s])})},at=/###/g,Le=r=>r&&r.indexOf("###")>-1?r.replace(at,"."):r,Ce=r=>!r||x(r),q=(r,e,t)=>{const s=x(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(Ce(r))return{};const i=Le(s[n]);!r[i]&&t&&(r[i]=new t),Object.prototype.hasOwnProperty.call(r,i)?r=r[i]:r={},++n}return Ce(r)?{}:{obj:r,k:Le(s[n])}},ke=(r,e,t)=>{const{obj:s,k:n}=q(r,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let i=e[e.length-1],a=e.slice(0,e.length-1),l=q(r,a,Object);for(;l.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),l=q(r,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=t},ot=(r,e,t,s)=>{const{obj:n,k:i}=q(r,e,Object);n[i]=n[i]||[],n[i].push(t)},ne=(r,e)=>{const{obj:t,k:s}=q(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},lt=(r,e,t)=>{const s=ne(r,t);return s!==void 0?s:ne(e,t)},Ie=(r,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in r?x(r[s])||r[s]instanceof String||x(e[s])||e[s]instanceof String?t&&(r[s]=e[s]):Ie(r[s],e[s],t):r[s]=e[s]);return r},J=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ut={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ct=r=>x(r)?r.replace(/[&<>"'\/]/g,e=>ut[e]):r;class dt{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const ft=[" ",",","?","!",";"],ht=new dt(20),gt=(r,e,t)=>{e=e||"",t=t||"";const s=ft.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(s.length===0)return!0;const n=ht.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!n.test(r);if(!i){const a=r.indexOf(t);a>0&&!n.test(r.substring(0,a))&&(i=!0)}return i},fe=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const s=e.split(t);let n=r;for(let i=0;i<s.length;){if(!n||typeof n!="object")return;let a,l="";for(let c=i;c<s.length;++c)if(c!==i&&(l+=t),l+=s[c],a=n[l],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<s.length-1)continue;i+=c-i+1;break}n=a}return n},X=r=>r==null?void 0:r.replace("_","-"),mt={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,s;(s=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||s.call(t,console,e)}};class re{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||mt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,n){return n&&!this.debug?null:(x(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new re(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new re(this.logger,e)}}var K=new re;class ie{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n.apply(n,[e,...t])})}}class je extends ie{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,n={}){var u,d;const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,t],s&&(Array.isArray(s)?l.push(...s):x(s)&&i?l.push(...s.split(i)):l.push(s)));const c=ne(this.data,l);return!c&&!t&&!s&&e.indexOf(".")>-1&&(e=l[0],t=l[1],s=l.slice(2).join(".")),c||!a||!x(s)?c:fe((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[t],s,i)}addResource(e,t,s,n,i={silent:!1}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[e,t];s&&(l=l.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(l=e.split("."),n=t,t=l[1]),this.addNamespaces(t),ke(this.data,l,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const i in s)(x(s[i])||Array.isArray(s[i]))&&this.addResource(e,t,i,s[i],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,i,a={silent:!1,skipCopy:!1}){let l=[e,t];e.indexOf(".")>-1&&(l=e.split("."),n=s,s=t,t=l[1]),this.addNamespaces(t);let c=ne(this.data,l)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Ie(c,s,i):c={...c,...s},ke(this.data,l,c),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var Oe={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,s,n){return r.forEach(i=>{var a;e=((a=this.processors[i])==null?void 0:a.process(e,t,s,n))??e}),e}};const Pe=Symbol("i18next/PATH_KEY");function pt(){const r=[],e=Object.create(null);let t;return e.get=(s,n)=>{var i;return(i=t==null?void 0:t.revoke)==null||i.call(t),n===Pe?r:(r.push(n),t=Proxy.revocable(s,e),t.proxy)},Proxy.revocable(Object.create(null),e).proxy}function he(r,e){const{[Pe]:t}=r(pt());return t.join((e==null?void 0:e.keySeparator)??".")}const Me={},ge=r=>!x(r)&&typeof r!="boolean"&&typeof r!="number";class ae extends ie{constructor(e,t={}){super(),it(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=K.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if((n==null?void 0:n.res)===void 0)return!1;const i=ge(n.res);return!(s.returnObjects===!1&&i)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,l=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!gt(e,s,n);if(a&&!l){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:x(i)?[i]:i};const u=e.split(s);(s!==n||s===n&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(n)}return{key:e,namespaces:x(i)?[i]:i}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=he(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(e[e.length-1],n),u=c[c.length-1];let d=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=n.lng||this.language,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return m?i?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${d}${l}`:i?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:l;const g=this.resolve(e,n);let h=g==null?void 0:g.res;const p=(g==null?void 0:g.usedKey)||l,y=(g==null?void 0:g.exactUsedKey)||l,L=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,w=n.count!==void 0&&!x(n.count),C=ae.hasDefaultValue(n),F=w?this.pluralResolver.getSuffix(f,n.count,n):"",P=n.ordinal&&w?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",v=w&&!n.ordinal&&n.count===0,S=v&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${F}`]||n[`defaultValue${P}`]||n.defaultValue;let N=h;E&&!h&&C&&(N=S);const z=ge(N),M=Object.prototype.toString.apply(N);if(E&&N&&z&&L.indexOf(M)<0&&!(x(b)&&Array.isArray(N))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,N,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return i?(g.res=D,g.usedParams=this.getUsedParamsDetails(n),g):D}if(a){const D=Array.isArray(N),j=D?[]:{},k=D?y:p;for(const $ in N)if(Object.prototype.hasOwnProperty.call(N,$)){const T=`${k}${a}${$}`;C&&!h?j[$]=this.translate(T,{...n,defaultValue:ge(S)?S[$]:void 0,joinArrays:!1,ns:c}):j[$]=this.translate(T,{...n,joinArrays:!1,ns:c}),j[$]===T&&(j[$]=N[$])}h=j}}else if(E&&x(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,e,n,s));else{let D=!1,j=!1;!this.isValidLookup(h)&&C&&(D=!0,h=S),this.isValidLookup(h)||(j=!0,h=l);const $=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:h,T=C&&S!==h&&this.options.updateMissing;if(j||D||T){if(this.logger.log(T?"updateKey":"missingKey",f,u,l,T?S:h),a){const A=this.resolve(l,{...n,keySeparator:!1});A&&A.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 V=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let A=0;A<O.length;A++)V.push(O[A]);else this.options.saveMissingTo==="all"?V=this.languageUtils.toResolveHierarchy(n.lng||this.language):V.push(n.lng||this.language);const W=(A,H,se)=>{var Re;const Xe=C&&se!==h?se:$;this.options.missingKeyHandler?this.options.missingKeyHandler(A,u,H,Xe,T,n):(Re=this.backendConnector)!=null&&Re.saveMissing&&this.backendConnector.saveMissing(A,u,H,Xe,T,n),this.emit("missingKey",A,u,H,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?V.forEach(A=>{const H=this.pluralResolver.getSuffixes(A,n);v&&n[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(se=>{W([A],l+se,n[`defaultValue${se}`]||S)})}):W(V,l,S))}h=this.extendTranslation(h,e,n,g,s),j&&h===l&&this.options.appendNamespaceToMissingKey&&(h=`${u}${d}${l}`),(j||D)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,D?h:void 0,n))}return i?(g.res=h,g.usedParams=this.getUsedParamsDetails(n),g):h}extendTranslation(e,t,s,n,i){var c,u;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const d=x(e)&&(((u=s==null?void 0:s.interpolation)==null?void 0:u.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const g=e.match(this.interpolator.nestingRegexp);f=g&&g.length}let m=s.replace&&!x(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),e=this.interpolator.interpolate(e,m,s.lng||this.language||n.usedLng,s),d){const g=e.match(this.interpolator.nestingRegexp),h=g&&g.length;f<h&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...g)=>(i==null?void 0:i[0])===g[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${t[0]}`),null):this.translate(...g,t),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,l=x(a)?[a]:a;return e!=null&&(l!=null&&l.length)&&s.applyPostProcessor!==!1&&(e=Oe.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,i,a,l;return x(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(c,t),d=u.key;n=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const m=t.count!==void 0&&!x(t.count),g=m&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(x(t.context)||typeof t.context=="number")&&t.context!=="",p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(y=>{var L,b;this.isValidLookup(s)||(l=y,!Me[`${p[0]}-${y}`]&&((L=this.utils)!=null&&L.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(l))&&(Me[`${p[0]}-${y}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(E=>{var F;if(this.isValidLookup(s))return;a=E;const w=[d];if((F=this.i18nFormat)!=null&&F.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,E,y,t);else{let P;m&&(P=this.pluralResolver.getSuffix(E,t.count,t));const v=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(t.ordinal&&P.indexOf(S)===0&&w.push(d+P.replace(S,this.options.pluralSeparator)),w.push(d+P),g&&w.push(d+v)),h){const N=`${d}${this.options.contextSeparator||"_"}${t.context}`;w.push(N),m&&(t.ordinal&&P.indexOf(S)===0&&w.push(N+P.replace(S,this.options.pluralSeparator)),w.push(N+P),g&&w.push(N+v))}}let C;for(;C=w.pop();)this.isValidLookup(s)||(i=C,s=this.getResource(E,y,C,t))}))})}),{res:s,usedKey:n,exactUsedKey:i,usedLng:a,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!x(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const i of t)delete n[i]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}class Te{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=K.create("languageUtils")}getScriptPartFromCode(e){if(e=X(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=X(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(x(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),x(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],i=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return x(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):x(e)&&i(this.formatLanguageCode(e)),s.forEach(a=>{n.indexOf(a)<0&&i(this.formatLanguageCode(a))}),n}}const $e={zero:0,one:1,two:2,few:3,many:4,other:5},De={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class xt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=K.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=X(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:s,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(s,{type:n})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),De;if(!e.match(/-|_/))return De;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,i)=>$e[n]-$e[i]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Ae=(r,e,t,s=".",n=!0)=>{let i=lt(r,e,t);return!i&&n&&x(t)&&(i=fe(r,t,s),i===void 0&&(i=fe(e,t,s))),i},me=r=>r.replace(/\$/g,"$$$$");class Ue{constructor(e={}){var t;this.logger=K.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:i,prefixEscaped:a,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:m,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:p,nestingOptionsSeparator:y,maxReplaces:L,alwaysFormat:b}=e.interpolation;this.escape=t!==void 0?t:ct,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=i?J(i):a||"{{",this.suffix=l?J(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=m?J(m):g||J("$t("),this.nestingSuffix=h?J(h):p||J(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=L||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>(t==null?void 0:t.source)===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,n){var g;let i,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const b=Ae(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,s,{...n,...t,interpolationkey:h}):b}const p=h.split(this.formatSeparator),y=p.shift().trim(),L=p.join(this.formatSeparator).trim();return this.format(Ae(t,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),L,s,{...n,...t,interpolationkey:y})};this.resetRegExp();const d=(n==null?void 0:n.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((g=n==null?void 0:n.interpolation)==null?void 0:g.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>me(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?me(this.escape(h)):me(h)}].forEach(h=>{for(l=0;i=h.regex.exec(e);){const p=i[1].trim();if(a=u(p),a===void 0)if(typeof d=="function"){const L=d(e,i,n);a=x(L)?L:""}else if(n&&Object.prototype.hasOwnProperty.call(n,p))a="";else if(f){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!x(a)&&!this.useRawValueToEscape&&(a=Ee(a));const y=h.safeValue(a);if(e=e.replace(i[0],y),f?(h.regex.lastIndex+=a.length,h.regex.lastIndex-=i[0].length):h.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,i,a;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let m=`{${f[1]}`;c=f[0],m=this.interpolate(m,a);const g=m.match(/'/g),h=m.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!h||h.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),u&&(a={...u,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,p),`${c}${d}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;n=this.nestingRegexp.exec(e);){let c=[];a={...s},a=a.replace&&!x(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(c=n[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),i=t(l.call(this,n[1].trim(),a),a),i&&n[0]===e&&!x(i))return i;x(i)||(i=Ee(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),c.length&&(i=c.reduce((d,f)=>this.format(d,f,s.lng,{...s,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}const yt=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const s=r.split("(");e=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){const[l,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();t[d]||(t[d]=u),u==="false"&&(t[d]=!1),u==="true"&&(t[d]=!0),isNaN(u)||(t[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},Fe=r=>{const e={};return(t,s,n)=>{let i=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(i={...i,[n.interpolationkey]:void 0});const a=s+JSON.stringify(i);let l=e[a];return l||(l=r(X(s),n),e[a]=l),l(t)}},bt=r=>(e,t,s)=>r(X(t),s)(e);class wt{constructor(e={}){this.logger=K.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?Fe:bt;this.formats={number:s((n,i)=>{const a=new Intl.NumberFormat(n,{...i});return l=>a.format(l)}),currency:s((n,i)=>{const a=new Intl.NumberFormat(n,{...i,style:"currency"});return l=>a.format(l)}),datetime:s((n,i)=>{const a=new Intl.DateTimeFormat(n,{...i});return l=>a.format(l)}),relativetime:s((n,i)=>{const a=new Intl.RelativeTimeFormat(n,{...i});return l=>a.format(l,i.range||"day")}),list:s((n,i)=>{const a=new Intl.ListFormat(n,{...i});return l=>a.format(l)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Fe(t)}format(e,t,s,n={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,c)=>{var f;const{formatName:u,formatOptions:d}=yt(c);if(this.formats[u]){let m=l;try{const g=((f=n==null?void 0:n.formatParams)==null?void 0:f[n.interpolationkey])||{},h=g.locale||g.lng||n.locale||n.lng||s;m=this.formats[u](l,h,{...d,...n,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${u}`);return l},e)}}const Nt=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class St extends ie{constructor(e,t,s,n={}){var i,a;super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=K.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],(a=(i=this.backend)==null?void 0:i.init)==null||a.call(i,s,n.backend,n)}queueLoad(e,t,s,n){const i={},a={},l={},c={};return e.forEach(u=>{let d=!0;t.forEach(f=>{const m=`${u}|${f}`;!s.reload&&this.store.hasResourceBundle(u,f)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,d=!1,a[m]===void 0&&(a[m]=!0),i[m]===void 0&&(i[m]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(e,t,s){const n=e.split("|"),i=n[0],a=n[1];t&&this.emit("failedLoading",i,a,t),!t&&s&&this.store.addResourceBundle(i,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const l={};this.queue.forEach(c=>{ot(c.loaded,[i],a),Nt(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(e,t,s,n=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:a});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,n+1,i*2,a)},i);return}a(u,d)},c=this.backend[s].bind(this.backend);if(c.length===2){try{const u=c(e,t);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(e,t,l)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();x(e)&&(e=this.languageUtils.toResolveHierarchy(e)),x(t)&&(t=[t]);const i=this.queueLoad(e,t,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,a),!a&&l&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,l),this.loaded(e,a,l)})}saveMissing(e,t,s,n,i,a={},l=()=>{}){var c,u,d,f,m;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((m=this.backend)!=null&&m.create){const g={...a,isUpdate:i},h=this.backend.create.bind(this.backend);if(h.length<6)try{let p;h.length===5?p=h(e,t,s,n,g):p=h(e,t,s,n),p&&typeof p.then=="function"?p.then(y=>l(null,y)).catch(l):l(null,p)}catch(p){l(p)}else h(e,t,s,n,l,g)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const pe=()=>({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:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),x(r[1])&&(e.defaultValue=r[1]),x(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ze=r=>{var e,t;return x(r.ns)&&(r.ns=[r.ns]),x(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),x(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},oe=()=>{},vt=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class R extends ie{constructor(e={},t){if(super(),this.options=ze(e),this.services={},this.logger=K,this.modules={external:[]},vt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(x(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=pe();this.options={...s,...this.options,...ze(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.debug===!0&&typeof console<"u"&&console.warn("i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com");const n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?K.init(n(this.modules.logger),this.options):K.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=wt;const d=new Te(this.options);this.store=new je(this.options.resources,this.options);const f=this.services;f.logger=K,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xt(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=n(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Ue(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new St(n(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(g,...h)=>{this.emit(g,...h)}),this.modules.languageDetector&&(f.languageDetector=n(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=n(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ae(this.services,this.options),this.translator.on("*",(g,...h)=>{this.emit(g,...h)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,t||(t=oe),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=Q(),c=()=>{const u=(d,f)=>{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),l.resolve(f),t(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(e,t=oe){var i,a;let s=t;const n=x(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((n==null?void 0:n.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};n?c(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(i=this.options.preload)==null?void 0:i.forEach)==null||a.call(i,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(u)})}else s(null)}reloadResources(e,t,s){const n=Q();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=oe),this.services.backendConnector.reload(e,t,i=>{n.resolve(),s(i)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Oe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=Q();this.emit("languageChanging",e);const n=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},i=(l,c)=>{c?this.isLanguageChangingTo===e&&(n(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(l,(...u)=>this.t(...u))},a=l=>{var d,f;!e&&!l&&this.services.languageDetector&&(l=[]);const c=x(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(x(l)?[l]:l);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,m=>{i(m,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,s){const n=(i,a,...l)=>{let c;typeof a!="object"?c=this.options.overloadTranslationOptionHandler([i,a].concat(l)):c={...a},c.lng=c.lng||n.lng,c.lngs=c.lngs||n.lngs,c.ns=c.ns||n.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||s||n.keyPrefix);const u=this.options.keySeparator||".";let d;return c.keyPrefix&&Array.isArray(i)?d=i.map(f=>(typeof f=="function"&&(f=he(f,{...this.options,...a})),`${c.keyPrefix}${u}${f}`)):(typeof i=="function"&&(i=he(i,{...this.options,...a})),d=c.keyPrefix?`${c.keyPrefix}${u}${i}`:i),this.t(d,c)};return x(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=s,n}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(t.precheck){const l=t.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!n||a(i,e)))}loadNamespaces(e,t){const s=Q();return this.options.ns?(x(e)&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=Q();x(e)&&(e=[e]);const n=this.options.preload||[],i=e.filter(a=>n.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=n.concat(i),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){var n,i;if(e||(e=this.resolvedLanguage||(((n=this.languages)==null?void 0:n.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const a=new Intl.Locale(e);if(a&&a.getTextInfo){const l=a.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((i=this.services)==null?void 0:i.languageUtils)||new Te(pe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new R(e,t);return s.createInstance=R.createInstance,s}cloneInstance(e={},t=oe){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new R(n);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});i.store=new je(l,n),i.services.resourceStore=i.store}if(e.interpolation){const c={...pe().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:c};i.services.interpolator=new Ue(u)}return i.translator=new ae(i.services,n),i.translator.on("*",(l,...c)=>{i.emit(l,...c)}),i.init(n,t),i.translator.options=n,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 B=R.createInstance();B.createInstance,B.dir,B.init,B.loadResources,B.reloadResources,B.use,B.changeLanguage,B.getFixedT,B.t,B.exists,B.setDefaultNamespace,B.hasLoadedNamespace,B.loadNamespaces,B.loadLanguages;const Et=(r,e,t,s)=>{var i,a,l,c;const n=[t,{code:e,...s||{}}];if((a=(i=r==null?void 0:r.services)==null?void 0:i.logger)!=null&&a.forward)return r.services.logger.forward(n,"warn","react-i18next::",!0);Z(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(c=(l=r==null?void 0:r.services)==null?void 0:l.logger)!=null&&c.warn?r.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Ve={},xe=(r,e,t,s)=>{Z(t)&&Ve[t]||(Z(t)&&(Ve[t]=new Date),Et(r,e,t,s))},Be=(r,e)=>()=>{if(r.isInitialized)e();else{const t=()=>{setTimeout(()=>{r.off("initialized",t)},0),e()};r.on("initialized",t)}},ye=(r,e,t)=>{r.loadNamespaces(e,Be(r,t))},He=(r,e,t,s)=>{if(Z(t)&&(t=[t]),r.options.preload&&r.options.preload.indexOf(e)>-1)return ye(r,t,s);t.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(e,Be(r,s))},Lt=(r,e,t={})=>!e.languages||!e.languages.length?(xe(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),Z=r=>typeof r=="string",Ct=r=>typeof r=="object"&&r!==null,kt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,It={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},jt=r=>It[r];let Ot={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:r=>r.replace(kt,jt)};const Pt=()=>Ot;let Mt;const Tt=()=>Mt,$t=o.createContext();class Dt{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const At=(r,e)=>{const t=o.useRef();return o.useEffect(()=>{t.current=e?t.current:r},[r,e]),t.current},Ke=(r,e,t,s)=>r.getFixedT(e,t,s),Ut=(r,e,t,s)=>o.useCallback(Ke(r,e,t,s),[r,e,t,s]),Ft=(r,e={})=>{var w,C,F,P;const{i18n:t}=e,{i18n:s,defaultNS:n}=o.useContext($t)||{},i=t||s||Tt();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new Dt),!i){xe(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const v=(N,z)=>Z(z)?z:Ct(z)&&Z(z.defaultValue)?z.defaultValue:Array.isArray(N)?N[N.length-1]:N,S=[v,{},!1];return S.t=v,S.i18n={},S.ready=!1,S}(w=i.options.react)!=null&&w.wait&&xe(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Pt(),...i.options.react,...e},{useSuspense:l,keyPrefix:c}=a;let u=r||n||((C=i.options)==null?void 0:C.defaultNS);u=Z(u)?[u]:u||["translation"],(P=(F=i.reportNamespaces).addUsedNamespaces)==null||P.call(F,u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(v=>Lt(v,i,a)),f=Ut(i,e.lng||null,a.nsMode==="fallback"?u:u[0],c),m=()=>f,g=()=>Ke(i,e.lng||null,a.nsMode==="fallback"?u:u[0],c),[h,p]=o.useState(m);let y=u.join();e.lng&&(y=`${e.lng}${y}`);const L=At(y),b=o.useRef(!0);o.useEffect(()=>{const{bindI18n:v,bindI18nStore:S}=a;b.current=!0,!d&&!l&&(e.lng?He(i,e.lng,u,()=>{b.current&&p(g)}):ye(i,u,()=>{b.current&&p(g)})),d&&L&&L!==y&&b.current&&p(g);const N=()=>{b.current&&p(g)};return v&&(i==null||i.on(v,N)),S&&(i==null||i.store.on(S,N)),()=>{b.current=!1,i&&v&&(v==null||v.split(" ").forEach(z=>i.off(z,N))),S&&i&&S.split(" ").forEach(z=>i.store.off(z,N))}},[i,y]),o.useEffect(()=>{b.current&&d&&p(m)},[i,c,d]);const E=[h,i,d];if(E.t=h,E.i18n=i,E.ready=d,d||!d&&!l)return E;throw new Promise(v=>{e.lng?He(i,e.lng,u,()=>v()):ye(i,u,()=>v())})};let zt=!1;try{document.cookie,zt=!0}catch{}function _(r){const{t:e}=Ft(r);return e}const Vt=({onConfirm:r})=>{const e=_("authLib");return o.useEffect(()=>{const{body:t}=document,s=t.style.overflow,n=t.style.pointerEvents;return t.style.overflow="hidden",t.style.pointerEvents="none",()=>{t.style.overflow=s,t.style.pointerEvents=n}},[]),tt.createPortal(o.createElement("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm"},o.createElement("div",{className:"pointer-events-auto w-full max-w-sm rounded-xl bg-white p-6 shadow-xl"},o.createElement("h2",{className:"mb-4 text-xl font-semibold text-gray-800 ltr:text-left rtl:text-center"},e("sessionExpired.title")),o.createElement("p",{className:"mb-8 text-sm text-gray-600 ltr:text-left rtl:text-center"},e("sessionExpired.message")),o.createElement("div",{className:"flex justify-end"},o.createElement("button",{onClick:r,className:`
|
|
1
|
+
(function(I,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react"),require("axios"),require("jwt-decode"),require("react-dom"),require("react-router")):typeof define=="function"&&define.amd?define(["exports","react","axios","jwt-decode","react-dom","react-router"],o):(I=typeof globalThis<"u"?globalThis:I||self,o(I["ciscode-model"]={},I.React,I.axios,I.jwtDecode,I.ReactDOM,I.reactRouter))})(this,function(I,o,ue,et,tt,U){"use strict";function st(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Z=st(o),Ne=o.createContext(null);function Se(){const r=o.useContext(Ne);if(!r)throw new Error("useAuthConfig must be used within an AuthConfigProvider");return r}const ve=o.createContext(null);function G(){const r=o.useContext(ve);if(!r)throw new Error("useAuthState must be inside <AuthProvider>");return r}function ce(r){const e=et.jwtDecode(r);return{id:e.sub,email:e.email??"",roles:e.roles??[],permissions:e.permissions??[],modules:e.modules??[],tenantId:e.tenantId??""}}let de=!1;function nt(){de=!1}function rt(r,e){r.defaults.withCredentials=!0;const t=`${e.baseUrl}${e.refreshEndpoint??"/auth/refresh-token"}`;r.interceptors.request.use(i=>{const a=e.getAccessToken();return a&&(i.headers.Authorization=`Bearer ${a}`),i});let s=!1,n=[];return r.interceptors.response.use(i=>i,async i=>{var l;const a=i.config;if(((l=i.response)==null?void 0:l.status)!==401||!a||a._retry)return Promise.reject(i);if(a._retry=!0,!s){s=!0;try{const{data:c}=await ue.post(t,{},{withCredentials:!0});return e.setAccessToken(c.accessToken),n.forEach(u=>u(c.accessToken)),n=[],r.request(a)}catch(c){return!!e.getAccessToken()&&!de&&(de=!0,e.logout()),n.forEach(d=>d(null)),n=[],Promise.reject(c)}finally{s=!1}}return new Promise((c,u)=>{n.push(d=>{if(!d)return u(i);(a.headers??(a.headers={})).Authorization=`Bearer ${d}`,c(r.request(a))})})}),r}const x=r=>typeof r=="string",_=()=>{let r,e;const t=new Promise((s,n)=>{r=s,e=n});return t.resolve=r,t.reject=e,t},Ee=r=>r==null?"":""+r,it=(r,e,t)=>{r.forEach(s=>{e[s]&&(t[s]=e[s])})},at=/###/g,Le=r=>r&&r.indexOf("###")>-1?r.replace(at,"."):r,Ce=r=>!r||x(r),Q=(r,e,t)=>{const s=x(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(Ce(r))return{};const i=Le(s[n]);!r[i]&&t&&(r[i]=new t),Object.prototype.hasOwnProperty.call(r,i)?r=r[i]:r={},++n}return Ce(r)?{}:{obj:r,k:Le(s[n])}},ke=(r,e,t)=>{const{obj:s,k:n}=Q(r,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let i=e[e.length-1],a=e.slice(0,e.length-1),l=Q(r,a,Object);for(;l.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),l=Q(r,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=t},ot=(r,e,t,s)=>{const{obj:n,k:i}=Q(r,e,Object);n[i]=n[i]||[],n[i].push(t)},se=(r,e)=>{const{obj:t,k:s}=Q(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},lt=(r,e,t)=>{const s=se(r,t);return s!==void 0?s:se(e,t)},Ie=(r,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in r?x(r[s])||r[s]instanceof String||x(e[s])||e[s]instanceof String?t&&(r[s]=e[s]):Ie(r[s],e[s],t):r[s]=e[s]);return r},J=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ut={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ct=r=>x(r)?r.replace(/[&<>"'\/]/g,e=>ut[e]):r;class dt{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const ft=[" ",",","?","!",";"],ht=new dt(20),gt=(r,e,t)=>{e=e||"",t=t||"";const s=ft.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(s.length===0)return!0;const n=ht.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!n.test(r);if(!i){const a=r.indexOf(t);a>0&&!n.test(r.substring(0,a))&&(i=!0)}return i},fe=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const s=e.split(t);let n=r;for(let i=0;i<s.length;){if(!n||typeof n!="object")return;let a,l="";for(let c=i;c<s.length;++c)if(c!==i&&(l+=t),l+=s[c],a=n[l],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<s.length-1)continue;i+=c-i+1;break}n=a}return n},q=r=>r==null?void 0:r.replace("_","-"),mt={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,s;(s=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||s.call(t,console,e)}};class ne{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||mt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,n){return n&&!this.debug?null:(x(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ne(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ne(this.logger,e)}}var K=new ne;class re{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n.apply(n,[e,...t])})}}class je extends re{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,n={}){var u,d;const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,t],s&&(Array.isArray(s)?l.push(...s):x(s)&&i?l.push(...s.split(i)):l.push(s)));const c=se(this.data,l);return!c&&!t&&!s&&e.indexOf(".")>-1&&(e=l[0],t=l[1],s=l.slice(2).join(".")),c||!a||!x(s)?c:fe((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[t],s,i)}addResource(e,t,s,n,i={silent:!1}){const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[e,t];s&&(l=l.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(l=e.split("."),n=t,t=l[1]),this.addNamespaces(t),ke(this.data,l,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const i in s)(x(s[i])||Array.isArray(s[i]))&&this.addResource(e,t,i,s[i],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,i,a={silent:!1,skipCopy:!1}){let l=[e,t];e.indexOf(".")>-1&&(l=e.split("."),n=s,s=t,t=l[1]),this.addNamespaces(t);let c=se(this.data,l)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Ie(c,s,i):c={...c,...s},ke(this.data,l,c),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var Oe={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,s,n){return r.forEach(i=>{var a;e=((a=this.processors[i])==null?void 0:a.process(e,t,s,n))??e}),e}};const Pe=Symbol("i18next/PATH_KEY");function pt(){const r=[],e=Object.create(null);let t;return e.get=(s,n)=>{var i;return(i=t==null?void 0:t.revoke)==null||i.call(t),n===Pe?r:(r.push(n),t=Proxy.revocable(s,e),t.proxy)},Proxy.revocable(Object.create(null),e).proxy}function he(r,e){const{[Pe]:t}=r(pt());return t.join((e==null?void 0:e.keySeparator)??".")}const Me={},ge=r=>!x(r)&&typeof r!="boolean"&&typeof r!="number";class ie extends re{constructor(e,t={}){super(),it(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=K.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if((n==null?void 0:n.res)===void 0)return!1;const i=ge(n.res);return!(s.returnObjects===!1&&i)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,l=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!gt(e,s,n);if(a&&!l){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:x(i)?[i]:i};const u=e.split(s);(s!==n||s===n&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(n)}return{key:e,namespaces:x(i)?[i]:i}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=he(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(e[e.length-1],n),u=c[c.length-1];let d=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=n.lng||this.language,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return m?i?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${d}${l}`:i?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:l;const g=this.resolve(e,n);let h=g==null?void 0:g.res;const p=(g==null?void 0:g.usedKey)||l,y=(g==null?void 0:g.exactUsedKey)||l,L=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,w=n.count!==void 0&&!x(n.count),C=ie.hasDefaultValue(n),F=w?this.pluralResolver.getSuffix(f,n.count,n):"",P=n.ordinal&&w?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",v=w&&!n.ordinal&&n.count===0,S=v&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${F}`]||n[`defaultValue${P}`]||n.defaultValue;let N=h;E&&!h&&C&&(N=S);const z=ge(N),M=Object.prototype.toString.apply(N);if(E&&N&&z&&L.indexOf(M)<0&&!(x(b)&&Array.isArray(N))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,N,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return i?(g.res=D,g.usedParams=this.getUsedParamsDetails(n),g):D}if(a){const D=Array.isArray(N),j=D?[]:{},k=D?y:p;for(const $ in N)if(Object.prototype.hasOwnProperty.call(N,$)){const T=`${k}${a}${$}`;C&&!h?j[$]=this.translate(T,{...n,defaultValue:ge(S)?S[$]:void 0,joinArrays:!1,ns:c}):j[$]=this.translate(T,{...n,joinArrays:!1,ns:c}),j[$]===T&&(j[$]=N[$])}h=j}}else if(E&&x(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,e,n,s));else{let D=!1,j=!1;!this.isValidLookup(h)&&C&&(D=!0,h=S),this.isValidLookup(h)||(j=!0,h=l);const $=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:h,T=C&&S!==h&&this.options.updateMissing;if(j||D||T){if(this.logger.log(T?"updateKey":"missingKey",f,u,l,T?S:h),a){const A=this.resolve(l,{...n,keySeparator:!1});A&&A.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 V=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let A=0;A<O.length;A++)V.push(O[A]);else this.options.saveMissingTo==="all"?V=this.languageUtils.toResolveHierarchy(n.lng||this.language):V.push(n.lng||this.language);const W=(A,H,te)=>{var Re;const Xe=C&&te!==h?te:$;this.options.missingKeyHandler?this.options.missingKeyHandler(A,u,H,Xe,T,n):(Re=this.backendConnector)!=null&&Re.saveMissing&&this.backendConnector.saveMissing(A,u,H,Xe,T,n),this.emit("missingKey",A,u,H,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?V.forEach(A=>{const H=this.pluralResolver.getSuffixes(A,n);v&&n[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(te=>{W([A],l+te,n[`defaultValue${te}`]||S)})}):W(V,l,S))}h=this.extendTranslation(h,e,n,g,s),j&&h===l&&this.options.appendNamespaceToMissingKey&&(h=`${u}${d}${l}`),(j||D)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,D?h:void 0,n))}return i?(g.res=h,g.usedParams=this.getUsedParamsDetails(n),g):h}extendTranslation(e,t,s,n,i){var c,u;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const d=x(e)&&(((u=s==null?void 0:s.interpolation)==null?void 0:u.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const g=e.match(this.interpolator.nestingRegexp);f=g&&g.length}let m=s.replace&&!x(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),e=this.interpolator.interpolate(e,m,s.lng||this.language||n.usedLng,s),d){const g=e.match(this.interpolator.nestingRegexp),h=g&&g.length;f<h&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...g)=>(i==null?void 0:i[0])===g[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${t[0]}`),null):this.translate(...g,t),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,l=x(a)?[a]:a;return e!=null&&(l!=null&&l.length)&&s.applyPostProcessor!==!1&&(e=Oe.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,i,a,l;return x(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(c,t),d=u.key;n=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const m=t.count!==void 0&&!x(t.count),g=m&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(x(t.context)||typeof t.context=="number")&&t.context!=="",p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(y=>{var L,b;this.isValidLookup(s)||(l=y,!Me[`${p[0]}-${y}`]&&((L=this.utils)!=null&&L.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(l))&&(Me[`${p[0]}-${y}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(E=>{var F;if(this.isValidLookup(s))return;a=E;const w=[d];if((F=this.i18nFormat)!=null&&F.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,E,y,t);else{let P;m&&(P=this.pluralResolver.getSuffix(E,t.count,t));const v=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(t.ordinal&&P.indexOf(S)===0&&w.push(d+P.replace(S,this.options.pluralSeparator)),w.push(d+P),g&&w.push(d+v)),h){const N=`${d}${this.options.contextSeparator||"_"}${t.context}`;w.push(N),m&&(t.ordinal&&P.indexOf(S)===0&&w.push(N+P.replace(S,this.options.pluralSeparator)),w.push(N+P),g&&w.push(N+v))}}let C;for(;C=w.pop();)this.isValidLookup(s)||(i=C,s=this.getResource(E,y,C,t))}))})}),{res:s,usedKey:n,exactUsedKey:i,usedLng:a,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!x(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const i of t)delete n[i]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}class Te{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=K.create("languageUtils")}getScriptPartFromCode(e){if(e=q(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=q(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(x(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),x(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],i=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return x(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):x(e)&&i(this.formatLanguageCode(e)),s.forEach(a=>{n.indexOf(a)<0&&i(this.formatLanguageCode(a))}),n}}const $e={zero:0,one:1,two:2,few:3,many:4,other:5},De={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class xt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=K.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=q(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:s,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(s,{type:n})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),De;if(!e.match(/-|_/))return De;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,i)=>$e[n]-$e[i]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Ae=(r,e,t,s=".",n=!0)=>{let i=lt(r,e,t);return!i&&n&&x(t)&&(i=fe(r,t,s),i===void 0&&(i=fe(e,t,s))),i},me=r=>r.replace(/\$/g,"$$$$");class Ue{constructor(e={}){var t;this.logger=K.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:i,prefixEscaped:a,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:m,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:p,nestingOptionsSeparator:y,maxReplaces:L,alwaysFormat:b}=e.interpolation;this.escape=t!==void 0?t:ct,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=i?J(i):a||"{{",this.suffix=l?J(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=m?J(m):g||J("$t("),this.nestingSuffix=h?J(h):p||J(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=L||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>(t==null?void 0:t.source)===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,n){var g;let i,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const b=Ae(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,s,{...n,...t,interpolationkey:h}):b}const p=h.split(this.formatSeparator),y=p.shift().trim(),L=p.join(this.formatSeparator).trim();return this.format(Ae(t,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),L,s,{...n,...t,interpolationkey:y})};this.resetRegExp();const d=(n==null?void 0:n.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((g=n==null?void 0:n.interpolation)==null?void 0:g.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>me(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?me(this.escape(h)):me(h)}].forEach(h=>{for(l=0;i=h.regex.exec(e);){const p=i[1].trim();if(a=u(p),a===void 0)if(typeof d=="function"){const L=d(e,i,n);a=x(L)?L:""}else if(n&&Object.prototype.hasOwnProperty.call(n,p))a="";else if(f){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!x(a)&&!this.useRawValueToEscape&&(a=Ee(a));const y=h.safeValue(a);if(e=e.replace(i[0],y),f?(h.regex.lastIndex+=a.length,h.regex.lastIndex-=i[0].length):h.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,i,a;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let m=`{${f[1]}`;c=f[0],m=this.interpolate(m,a);const g=m.match(/'/g),h=m.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!h||h.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),u&&(a={...u,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,p),`${c}${d}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;n=this.nestingRegexp.exec(e);){let c=[];a={...s},a=a.replace&&!x(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(c=n[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),i=t(l.call(this,n[1].trim(),a),a),i&&n[0]===e&&!x(i))return i;x(i)||(i=Ee(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),c.length&&(i=c.reduce((d,f)=>this.format(d,f,s.lng,{...s,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}const yt=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const s=r.split("(");e=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){const[l,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();t[d]||(t[d]=u),u==="false"&&(t[d]=!1),u==="true"&&(t[d]=!0),isNaN(u)||(t[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},Fe=r=>{const e={};return(t,s,n)=>{let i=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(i={...i,[n.interpolationkey]:void 0});const a=s+JSON.stringify(i);let l=e[a];return l||(l=r(q(s),n),e[a]=l),l(t)}},bt=r=>(e,t,s)=>r(q(t),s)(e);class wt{constructor(e={}){this.logger=K.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?Fe:bt;this.formats={number:s((n,i)=>{const a=new Intl.NumberFormat(n,{...i});return l=>a.format(l)}),currency:s((n,i)=>{const a=new Intl.NumberFormat(n,{...i,style:"currency"});return l=>a.format(l)}),datetime:s((n,i)=>{const a=new Intl.DateTimeFormat(n,{...i});return l=>a.format(l)}),relativetime:s((n,i)=>{const a=new Intl.RelativeTimeFormat(n,{...i});return l=>a.format(l,i.range||"day")}),list:s((n,i)=>{const a=new Intl.ListFormat(n,{...i});return l=>a.format(l)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Fe(t)}format(e,t,s,n={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,c)=>{var f;const{formatName:u,formatOptions:d}=yt(c);if(this.formats[u]){let m=l;try{const g=((f=n==null?void 0:n.formatParams)==null?void 0:f[n.interpolationkey])||{},h=g.locale||g.lng||n.locale||n.lng||s;m=this.formats[u](l,h,{...d,...n,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${u}`);return l},e)}}const Nt=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class St extends re{constructor(e,t,s,n={}){var i,a;super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=K.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],(a=(i=this.backend)==null?void 0:i.init)==null||a.call(i,s,n.backend,n)}queueLoad(e,t,s,n){const i={},a={},l={},c={};return e.forEach(u=>{let d=!0;t.forEach(f=>{const m=`${u}|${f}`;!s.reload&&this.store.hasResourceBundle(u,f)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,d=!1,a[m]===void 0&&(a[m]=!0),i[m]===void 0&&(i[m]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(e,t,s){const n=e.split("|"),i=n[0],a=n[1];t&&this.emit("failedLoading",i,a,t),!t&&s&&this.store.addResourceBundle(i,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const l={};this.queue.forEach(c=>{ot(c.loaded,[i],a),Nt(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(e,t,s,n=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:a});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,n+1,i*2,a)},i);return}a(u,d)},c=this.backend[s].bind(this.backend);if(c.length===2){try{const u=c(e,t);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(e,t,l)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();x(e)&&(e=this.languageUtils.toResolveHierarchy(e)),x(t)&&(t=[t]);const i=this.queueLoad(e,t,s,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],i=s[1];this.read(n,i,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,a),!a&&l&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,l),this.loaded(e,a,l)})}saveMissing(e,t,s,n,i,a={},l=()=>{}){var c,u,d,f,m;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((m=this.backend)!=null&&m.create){const g={...a,isUpdate:i},h=this.backend.create.bind(this.backend);if(h.length<6)try{let p;h.length===5?p=h(e,t,s,n,g):p=h(e,t,s,n),p&&typeof p.then=="function"?p.then(y=>l(null,y)).catch(l):l(null,p)}catch(p){l(p)}else h(e,t,s,n,l,g)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const pe=()=>({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:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),x(r[1])&&(e.defaultValue=r[1]),x(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ze=r=>{var e,t;return x(r.ns)&&(r.ns=[r.ns]),x(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),x(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},ae=()=>{},vt=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class X extends re{constructor(e={},t){if(super(),this.options=ze(e),this.services={},this.logger=K,this.modules={external:[]},vt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(x(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=pe();this.options={...s,...this.options,...ze(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.debug===!0&&typeof console<"u"&&console.warn("i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com");const n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?K.init(n(this.modules.logger),this.options):K.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=wt;const d=new Te(this.options);this.store=new je(this.options.resources,this.options);const f=this.services;f.logger=K,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xt(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=n(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Ue(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new St(n(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(g,...h)=>{this.emit(g,...h)}),this.modules.languageDetector&&(f.languageDetector=n(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=n(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ie(this.services,this.options),this.translator.on("*",(g,...h)=>{this.emit(g,...h)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ae),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=_(),c=()=>{const u=(d,f)=>{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),l.resolve(f),t(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(e,t=ae){var i,a;let s=t;const n=x(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((n==null?void 0:n.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};n?c(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(i=this.options.preload)==null?void 0:i.forEach)==null||a.call(i,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(u)})}else s(null)}reloadResources(e,t,s){const n=_();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=ae),this.services.backendConnector.reload(e,t,i=>{n.resolve(),s(i)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Oe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=_();this.emit("languageChanging",e);const n=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},i=(l,c)=>{c?this.isLanguageChangingTo===e&&(n(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(l,(...u)=>this.t(...u))},a=l=>{var d,f;!e&&!l&&this.services.languageDetector&&(l=[]);const c=x(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(x(l)?[l]:l);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,m=>{i(m,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,s){const n=(i,a,...l)=>{let c;typeof a!="object"?c=this.options.overloadTranslationOptionHandler([i,a].concat(l)):c={...a},c.lng=c.lng||n.lng,c.lngs=c.lngs||n.lngs,c.ns=c.ns||n.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||s||n.keyPrefix);const u=this.options.keySeparator||".";let d;return c.keyPrefix&&Array.isArray(i)?d=i.map(f=>(typeof f=="function"&&(f=he(f,{...this.options,...a})),`${c.keyPrefix}${u}${f}`)):(typeof i=="function"&&(i=he(i,{...this.options,...a})),d=c.keyPrefix?`${c.keyPrefix}${u}${i}`:i),this.t(d,c)};return x(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=s,n}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(t.precheck){const l=t.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!n||a(i,e)))}loadNamespaces(e,t){const s=_();return this.options.ns?(x(e)&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=_();x(e)&&(e=[e]);const n=this.options.preload||[],i=e.filter(a=>n.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=n.concat(i),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){var n,i;if(e||(e=this.resolvedLanguage||(((n=this.languages)==null?void 0:n.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const a=new Intl.Locale(e);if(a&&a.getTextInfo){const l=a.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((i=this.services)==null?void 0:i.languageUtils)||new Te(pe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new X(e,t);return s.createInstance=X.createInstance,s}cloneInstance(e={},t=ae){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new X(n);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},s){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});i.store=new je(l,n),i.services.resourceStore=i.store}if(e.interpolation){const c={...pe().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:c};i.services.interpolator=new Ue(u)}return i.translator=new ie(i.services,n),i.translator.on("*",(l,...c)=>{i.emit(l,...c)}),i.init(n,t),i.translator.options=n,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 B=X.createInstance();B.createInstance,B.dir,B.init,B.loadResources,B.reloadResources,B.use,B.changeLanguage,B.getFixedT,B.t,B.exists,B.setDefaultNamespace,B.hasLoadedNamespace,B.loadNamespaces,B.loadLanguages;const Et=(r,e,t,s)=>{var i,a,l,c;const n=[t,{code:e,...s||{}}];if((a=(i=r==null?void 0:r.services)==null?void 0:i.logger)!=null&&a.forward)return r.services.logger.forward(n,"warn","react-i18next::",!0);Y(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),(c=(l=r==null?void 0:r.services)==null?void 0:l.logger)!=null&&c.warn?r.services.logger.warn(...n):console!=null&&console.warn&&console.warn(...n)},Ve={},xe=(r,e,t,s)=>{Y(t)&&Ve[t]||(Y(t)&&(Ve[t]=new Date),Et(r,e,t,s))},Be=(r,e)=>()=>{if(r.isInitialized)e();else{const t=()=>{setTimeout(()=>{r.off("initialized",t)},0),e()};r.on("initialized",t)}},ye=(r,e,t)=>{r.loadNamespaces(e,Be(r,t))},He=(r,e,t,s)=>{if(Y(t)&&(t=[t]),r.options.preload&&r.options.preload.indexOf(e)>-1)return ye(r,t,s);t.forEach(n=>{r.options.ns.indexOf(n)<0&&r.options.ns.push(n)}),r.loadLanguages(e,Be(r,s))},Lt=(r,e,t={})=>!e.languages||!e.languages.length?(xe(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(r,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,r))return!1}}),Y=r=>typeof r=="string",Ct=r=>typeof r=="object"&&r!==null,kt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,It={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},jt=r=>It[r];let Ot={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:r=>r.replace(kt,jt)};const Pt=()=>Ot;let Mt;const Tt=()=>Mt,$t=o.createContext();class Dt{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const At=(r,e)=>{const t=o.useRef();return o.useEffect(()=>{t.current=e?t.current:r},[r,e]),t.current},Ke=(r,e,t,s)=>r.getFixedT(e,t,s),Ut=(r,e,t,s)=>o.useCallback(Ke(r,e,t,s),[r,e,t,s]),Ft=(r,e={})=>{var w,C,F,P;const{i18n:t}=e,{i18n:s,defaultNS:n}=o.useContext($t)||{},i=t||s||Tt();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new Dt),!i){xe(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const v=(N,z)=>Y(z)?z:Ct(z)&&Y(z.defaultValue)?z.defaultValue:Array.isArray(N)?N[N.length-1]:N,S=[v,{},!1];return S.t=v,S.i18n={},S.ready=!1,S}(w=i.options.react)!=null&&w.wait&&xe(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Pt(),...i.options.react,...e},{useSuspense:l,keyPrefix:c}=a;let u=r||n||((C=i.options)==null?void 0:C.defaultNS);u=Y(u)?[u]:u||["translation"],(P=(F=i.reportNamespaces).addUsedNamespaces)==null||P.call(F,u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(v=>Lt(v,i,a)),f=Ut(i,e.lng||null,a.nsMode==="fallback"?u:u[0],c),m=()=>f,g=()=>Ke(i,e.lng||null,a.nsMode==="fallback"?u:u[0],c),[h,p]=o.useState(m);let y=u.join();e.lng&&(y=`${e.lng}${y}`);const L=At(y),b=o.useRef(!0);o.useEffect(()=>{const{bindI18n:v,bindI18nStore:S}=a;b.current=!0,!d&&!l&&(e.lng?He(i,e.lng,u,()=>{b.current&&p(g)}):ye(i,u,()=>{b.current&&p(g)})),d&&L&&L!==y&&b.current&&p(g);const N=()=>{b.current&&p(g)};return v&&(i==null||i.on(v,N)),S&&(i==null||i.store.on(S,N)),()=>{b.current=!1,i&&v&&(v==null||v.split(" ").forEach(z=>i.off(z,N))),S&&i&&S.split(" ").forEach(z=>i.store.off(z,N))}},[i,y]),o.useEffect(()=>{b.current&&d&&p(m)},[i,c,d]);const E=[h,i,d];if(E.t=h,E.i18n=i,E.ready=d,d||!d&&!l)return E;throw new Promise(v=>{e.lng?He(i,e.lng,u,()=>v()):ye(i,u,()=>v())})};let zt=!1;try{document.cookie,zt=!0}catch{}function oe(r){const{t:e}=Ft(r);return e}const Vt=({onConfirm:r})=>{const e=oe("authLib");return o.useEffect(()=>{const{body:t}=document,s=t.style.overflow,n=t.style.pointerEvents;return t.style.overflow="hidden",t.style.pointerEvents="none",()=>{t.style.overflow=s,t.style.pointerEvents=n}},[]),tt.createPortal(o.createElement("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm"},o.createElement("div",{className:"pointer-events-auto w-full max-w-sm rounded-xl bg-white p-6 shadow-xl"},o.createElement("h2",{className:"mb-4 text-xl font-semibold text-gray-800 ltr:text-left rtl:text-center"},e("sessionExpired.title")),o.createElement("p",{className:"mb-8 text-sm text-gray-600 ltr:text-left rtl:text-center"},e("sessionExpired.message")),o.createElement("div",{className:"flex justify-end"},o.createElement("button",{onClick:r,className:`
|
|
2
2
|
rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white
|
|
3
3
|
hover:bg-red-700 focus-visible:outline focus-visible:outline-2
|
|
4
4
|
focus-visible:outline-offset-2 focus-visible:outline-red-600
|
|
5
|
-
`},e("sessionExpired.button"))))),document.body)},
|
|
5
|
+
`},e("sessionExpired.button"))))),document.body)},R=({label:r,type:e="text",placeholder:t,color:s="",value:n,onChange:i})=>{const a=Z.useId();return Z.createElement("div",{className:"mt-8 flex flex-col"},r&&Z.createElement("label",{htmlFor:a,className:"self-start text-base text-black dark:text-white block ltr:text-left rtl:text-right"},r),Z.createElement("input",{id:a,type:e,placeholder:t||void 0,value:n,onChange:l=>i==null?void 0:i(l.target.value),className:`
|
|
6
6
|
px-4 py-4 mt-3.5 text-sm font-light rounded-lg border border-solid w-full
|
|
7
7
|
ltr:text-left rtl:text-right
|
|
8
8
|
${s}
|
|
9
|
-
`}))},We=({icon:r,label:e})=>
|
|
9
|
+
`}))},We=({icon:r,label:e})=>Z.createElement("div",{className:"flex gap-5 px-8 py-3 items-center bg-indigo-50 rounded-lg max-md:px-5"},Z.createElement("img",{loading:"lazy",src:r,alt:e||"",className:"object-contain shrink-0 aspect-square w-[26px]"}),e&&Z.createElement("div",{className:"basis-auto text-sm hidden md:block ltr:text-left rtl:text-right"},e)),Ge="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iLTMgMCAyNjIgMjYyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj48cGF0aCBkPSJNMjU1Ljg3OCAxMzMuNDUxYzAtMTAuNzM0LS44NzEtMTguNTY3LTIuNzU2LTI2LjY5SDEzMC41NXY0OC40NDhoNzEuOTQ3Yy0xLjQ1IDEyLjA0LTkuMjgzIDMwLjE3Mi0yNi42OSA0Mi4zNTZsLS4yNDQgMS42MjIgMzguNzU1IDMwLjAyMyAyLjY4NS4yNjhjMjQuNjU5LTIyLjc3NCAzOC44NzUtNTYuMjgyIDM4Ljg3NS05Ni4wMjciIGZpbGw9IiM0Mjg1RjQiLz48cGF0aCBkPSJNMTMwLjU1IDI2MS4xYzM1LjI0OCAwIDY0LjgzOS0xMS42MDUgODYuNDUzLTMxLjYyMmwtNDEuMTk2LTMxLjkxM2MtMTEu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iB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiPjxwYXRoIGZpbGw9IiNGMzUzMjUiIGQ9Ik0xIDFoNi41djYuNUgxVjF6Ii8+PHBhdGggZmlsbD0iIzgxQkMwNiIgZD0iTTguNSAxSDE1djYuNUg4LjVWMXoiLz48cGF0aCBmaWxsPSIjMDVBNkYwIiBkPSJNMSA4LjVoNi41VjE1SDFWOC41eiIvPjxwYXRoIGZpbGw9IiNGRkJBMDgiIGQ9Ik04LjUgOC41SDE1VjE1SDguNVY4LjV6Ii8+PC9zdmc+";function ee(r,e,t){return r?r.startsWith(`${e}-`)?r:r.startsWith("#")?`${r}`:t:t}function Ye(r,e){const t=(e==null?void 0:e.bg)||"bg-sky-500",s=(e==null?void 0:e.text)||"text-gray-800",n=(e==null?void 0:e.border)||"border-gray-300",i=(e==null?void 0:e.fill)||"fill-current",a=(e==null?void 0:e.stroke)||"stroke-current";return{bgClass:ee(r.bg??"","bg",t),textClass:ee(r.text??"","text",s),borderClass:ee(r.border??"","border",n),fillClass:ee(r.fill??"","fill",i),strokeClass:ee(r.stroke??"","stroke",a)}}/**
|
|
10
10
|
* @license lucide-react v0.481.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/const Gt=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qe=({message:r,dismissAfterMs:e=4e3})=>{const t=
|
|
39
|
+
*/const Gt=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qe=({message:r,dismissAfterMs:e=4e3})=>{const t=oe("authLib"),[s,n]=o.useState(!1);return o.useEffect(()=>{if(n(!!r),r&&e>0){const i=window.setTimeout(()=>n(!1),e);return()=>window.clearTimeout(i)}},[r,e]),!s||!r?null:o.createElement("div",{role:"alert","aria-live":"assertive",className:`
|
|
40
40
|
relative isolate flex w-full max-w-md items-start gap-2 overflow-hidden
|
|
41
41
|
rounded-lg border border-red-300 bg-red-50/80 p-4 pr-6 text-sm text-red-800
|
|
42
42
|
shadow-lg backdrop-blur
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
absolute ltr:right-2 rtl:left-2 top-2 rounded p-1 text-red-600/70
|
|
47
47
|
hover:bg-red-100 hover:text-red-700 focus:outline-none
|
|
48
48
|
focus-visible:ring focus-visible:ring-red-500/50
|
|
49
|
-
`},o.createElement(Gt,{className:"h-4 w-4"})))},Zt=()=>{const r=_("authLib"),e=U.useNavigate(),t=U.useLocation(),{brandName:s=r("brandName",{defaultValue:"MyBrand"}),colors:n={bg:"bg-sky-500",text:"text-white",border:"border-sky-500"},logoUrl:i,oauthProviders:a=[],illustrationUrl:l=r("community.illustrationUrl",{defaultValue:"https://cdn.builder.io/api/v1/image/assets/TEMP/35ba84b8335fda2819c3a14ea3d00321a0fd0e79e571caa31108468010868ca5?placeholderIfAbsent=true&apiKey=a460e9a46e514356ac1106eada03046c"}),communityContent:c={title:r("community.title"),description:r("community.description")},baseUrl:u}=Se(),{login:d}=G(),[f,m]=o.useState(""),[g,h]=o.useState(""),[p,y]=o.useState(!1),[L,b]=o.useState(null),E={google:{icon:Ge,label:"social.google"},microsoft:{icon:Ze,label:"social.microsoft"}},w=a.filter(M=>M in E).map(M=>({id:M,icon:E[M].icon,label:E[M].label})),{bgClass:C,textClass:F,borderClass:P}=Ye(n),v=`${C} bg-gradient-to-r from-white/10 via-white/0 to-white/0`;async function S(M){var D;if(M.preventDefault(),!p){b(null),y(!0);try{await d({email:f,password:g})}catch(j){((D=j==null?void 0:j.response)==null?void 0:D.status)===401?b(r("errors.invalidCredentials")):b(r("errors.generic"))}finally{y(!1)}}}function N(M){var j,k,$;if(!u){console.error("Auth baseUrl is not configured.");return}const D=((k=(j=t.state)==null?void 0:j.from)==null?void 0:k.pathname)||(($=t.state)==null?void 0:$.from)||"/";if(sessionStorage.setItem("postLoginRedirect",D),M==="google"){const T="/oauth/google/callback",V=`${window.location.origin}${T}`,O=new URL(`${u}/auth/google`);O.searchParams.set("redirect",V),window.location.href=O.toString();return}if(M==="microsoft"){const T="/oauth/microsoft/callback",V=`${window.location.origin}${T}`,O=new URL(`${u}/auth/microsoft`);O.searchParams.set("redirect",V),window.location.href=O.toString();return}}const z=o.createElement("svg",{className:"h-4 w-4 animate-spin stroke-current",viewBox:"0 0 24 24",fill:"none"},o.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",strokeWidth:"4"}),o.createElement("path",{className:"opacity-75",d:"M4 12a8 8 0 018-8",strokeWidth:"4",strokeLinecap:"round"}));return o.createElement("div",{className:`flex items-center justify-center min-h-screen p-4 ${v}`},o.createElement("div",{className:"flex w-full max-w-5xl bg-white rounded-2xl shadow-2xl overflow-hidden"},o.createElement("div",{className:`hidden md:flex md:w-1/2 p-12 flex-col justify-between text-white ${C}`},o.createElement("div",null,i?o.createElement("div",{className:"flex items-center gap-4"},o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:"bg-white h-8 md:h-22 rounded-lg"}),o.createElement("h2",{className:"text-sm md:text-2xl font-bold uppercase"},s)):o.createElement("h2",{className:"text-sm md:text-2xl font-bold"},s)),o.createElement("div",{className:"flex-1 space-y-4 mt-6 py-4"},o.createElement("h3",{className:"text-2xl font-semibold leading-tight"},c.title),o.createElement("p",{className:"text-base leading-relaxed opacity-90 ltr:text-left rtl:text-right"},c.description),o.createElement("div",{className:"relative"},o.createElement("div",{className:"absolute -left-4 -top-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("div",{className:"absolute -right-4 -bottom-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("img",{loading:"lazy",src:l,alt:"Sign in illustration",className:"max-w-sm w-full mx-auto rounded-lg shadow-lg transform hover:scale-105 transition-transform duration-300 p-6"})))),o.createElement("div",{className:"w-full md:w-1/2 p-4 md:p-8 m-auto"},o.createElement("div",{className:"flex flex-col md:flex-row justify-between items-center mb-8"},o.createElement("div",{className:"flex items-center justify-center md:hidden mb-5"},i?o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:`h-22 rounded-full border ${P}`}):o.createElement("h2",{className:"text-2xl font-bold"},s)),o.createElement("div",{className:"w-full md:w-auto mb-4 md:mb-0 text-center md:text-left ltr:text-center rtl:text-center md:ltr:text-left md:rtl:text-right"},o.createElement("p",{className:"text-sm md:text-lg"},r("SignInPage.welcome")," ",o.createElement("span",{className:`font-semibold ${F} uppercase`},s)),o.createElement("h1",{className:"text-2xl md:text-4xl font-bold text-gray-800"},r("SignInPage.signIn"))),o.createElement("div",{className:"text-sm text-gray-500 text-center md:text-right"},r("SignInPage.noAccount"),o.createElement("br",null),o.createElement("button",{type:"button",onClick:()=>e("/signup"),className:F},r("SignInPage.signUp")))),L&&o.createElement(Qe,{message:L}),o.createElement("form",{className:"space-y-6",onSubmit:S},o.createElement(ee,{label:r("form.emailLabel"),type:"email",placeholder:r("form.emailPlaceholder"),color:P,value:f,onChange:m}),o.createElement(ee,{label:r("form.passwordLabel"),type:"password",placeholder:r("form.passwordPlaceholder"),color:P,value:g,onChange:h}),o.createElement("div",{className:"ltr:text-right rtl:text-left"},o.createElement("button",{className:`text-sm ${F}`},r("SignInPage.forgotPassword"))),o.createElement("button",{type:"submit",disabled:p,className:`relative flex w-full items-center justify-center gap-2 py-3 rounded-lg font-medium transition-colors ${p?"opacity-60 cursor-not-allowed":""} ${C} text-white`},p&&z,r(p?"SignInPage.signInSubmitting":"SignInPage.signIn")),w.length>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:"flex items-center pt-2"},o.createElement("div",{className:`flex-grow h-px ${C}`}),o.createElement("span",{className:`${F} mx-3 text-sm`},r("SignInPage.orLoginWith")),o.createElement("div",{className:`flex-grow h-px ${C}`})),o.createElement("div",{className:"flex gap-3 mb-6 justify-center md:justify-start"},w.map(M=>o.createElement("button",{key:M.id,type:"button",onClick:()=>N(M.id),className:"flex-1"},o.createElement(We,{icon:M.icon,label:M.label})))))))))},Yt=()=>{const r=_("authLib"),e=U.useNavigate(),t=U.useLocation(),{brandName:s=r("brandName",{defaultValue:"MyBrand"}),colors:n={bg:"bg-sky-500",text:"text-white",border:"border-sky-500"},logoUrl:i,oauthProviders:a=[],illustrationUrl:l=r("community.illustrationUrl",{defaultValue:"https://cdn.builder.io/api/v1/image/assets/TEMP/35ba84b8335fda2819c3a14ea3d00321a0fd0e79e571caa31108468010868ca5?placeholderIfAbsent=true&apiKey=a460e9a46e514356ac1106eada03046c"}),communityContent:c={title:r("community.title"),description:r("community.description")},baseUrl:u}=Se(),{login:d,api:f}=G(),[m,g]=o.useState(""),[h,p]=o.useState(""),[y,L]=o.useState(""),[b,E]=o.useState(!1),[w,C]=o.useState(null),F={google:{icon:Ge,label:"social.google"},microsoft:{icon:Ze,label:"social.microsoft"}},P=a.filter(k=>k in F).map(k=>({id:k,icon:F[k].icon,label:F[k].label})),{bgClass:v,textClass:S,borderClass:N}=Ye(n),z=`${v} bg-gradient-to-r from-white/10 via-white/0 to-white/0`;async function M(k){var $,T,V;if(k.preventDefault(),!b){C(null),E(!0);try{await f.post("/auth/clients/register",{email:h,password:y,name:m||void 0}),await d({email:h,password:y})}catch(O){const W=($=O==null?void 0:O.response)==null?void 0:$.status;C(W===400?((V=(T=O==null?void 0:O.response)==null?void 0:T.data)==null?void 0:V.message)||r("errors.invalidData",{defaultValue:"Please check the fields and try again."}):W===409?r("errors.emailInUse",{defaultValue:"This email is already in use."}):r("errors.generic",{defaultValue:"Something went wrong. Please try again."}))}finally{E(!1)}}}function D(k){var T,V,O;if(!u){console.error("Auth baseUrl is not configured.");return}const $=((V=(T=t.state)==null?void 0:T.from)==null?void 0:V.pathname)||((O=t.state)==null?void 0:O.from)||"/";if(sessionStorage.setItem("postLoginRedirect",$),k==="google"){const W="/oauth/google/callback",A=`${window.location.origin}${W}`,H=new URL(`${u}/auth/google`);H.searchParams.set("redirect",A),window.location.href=H.toString();return}if(k==="microsoft"){const W="/oauth/microsoft/callback",A=`${window.location.origin}${W}`,H=new URL(`${u}/auth/microsoft`);H.searchParams.set("redirect",A),window.location.href=H.toString();return}}const j=o.createElement("svg",{className:"h-4 w-4 animate-spin stroke-current",viewBox:"0 0 24 24",fill:"none"},o.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",strokeWidth:"4"}),o.createElement("path",{className:"opacity-75",d:"M4 12a8 8 0 018-8",strokeWidth:"4",strokeLinecap:"round"}));return o.createElement("div",{className:`flex items-center justify-center min-h-screen p-4 ${z}`},o.createElement("div",{className:"flex w-full max-w-5xl bg-white rounded-2xl shadow-2xl overflow-hidden"},o.createElement("div",{className:`hidden md:flex md:w-1/2 p-12 flex-col justify-between text-white ${v}`},o.createElement("div",null,i?o.createElement("div",{className:"flex items-center gap-4"},o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:"bg-white h-8 md:h-22 rounded-lg"}),o.createElement("h2",{className:"text-sm md:text-2xl font-bold uppercase"},s)):o.createElement("h2",{className:"text-sm md:text-2xl font-bold"},s)),o.createElement("div",{className:"flex-1 space-y-4 mt-6 py-4"},o.createElement("h3",{className:"text-2xl font-semibold leading-tight"},c.title),o.createElement("p",{className:"text-base leading-relaxed opacity-90 ltr:text-left rtl:text-right"},c.description),o.createElement("div",{className:"relative"},o.createElement("div",{className:"absolute -left-4 -top-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("div",{className:"absolute -right-4 -bottom-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("img",{loading:"lazy",src:l,alt:"Sign up illustration",className:"max-w-sm w-full mx-auto rounded-lg shadow-lg transform hover:scale-105 transition-transform duration-300 p-6"})))),o.createElement("div",{className:"w-full md:w-1/2 p-4 md:p-8 m-auto"},o.createElement("div",{className:"flex flex-col md:flex-row justify-between items-center mb-8"},o.createElement("div",{className:"flex items-center justify-center md:hidden mb-5"},i?o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:`h-22 rounded-full border ${N}`}):o.createElement("h2",{className:"text-2xl font-bold"},s)),o.createElement("div",{className:"w-full md:w-auto mb-4 md:mb-0 text-center md:text-left ltr:text-center rtl:text-center md:ltr:text-left md:rtl:text-right"},o.createElement("p",{className:"text-sm md:text-lg"},r("SignUpPage.welcome",{defaultValue:"Join"})," ",o.createElement("span",{className:`font-semibold ${S} uppercase`},s)),o.createElement("h1",{className:"text-2xl md:text-4xl font-bold text-gray-800"},r("SignUpPage.signUp",{defaultValue:"Sign up"}))),o.createElement("div",{className:"text-sm text-gray-500 text-center md:text-right"},r("SignUpPage.alreadyHaveAccount",{defaultValue:"Already have an account?"}),o.createElement("br",null),o.createElement("button",{type:"button",onClick:()=>e("/login"),className:S},r("SignUpPage.signIn",{defaultValue:"Sign in"})))),w&&o.createElement(Qe,{message:w}),o.createElement("form",{className:"space-y-6",onSubmit:M},o.createElement(ee,{label:r("form.nameLabel",{defaultValue:"Name"}),type:"text",placeholder:r("form.namePlaceholder",{defaultValue:"Enter your name"}),color:N,value:m,onChange:g}),o.createElement(ee,{label:r("form.emailLabel"),type:"email",placeholder:r("form.emailPlaceholder"),color:N,value:h,onChange:p}),o.createElement(ee,{label:r("form.passwordLabel"),type:"password",placeholder:r("form.passwordPlaceholder"),color:N,value:y,onChange:L}),o.createElement("button",{type:"submit",disabled:b,className:`relative flex w-full items-center justify-center gap-2 py-3 rounded-lg font-medium transition-colors ${b?"opacity-60 cursor-not-allowed":""} ${v} text-white`},b&&j,b?r("SignUpPage.signUpSubmitting",{defaultValue:"Creating account..."}):r("SignUpPage.signUp",{defaultValue:"Sign up"})),P.length>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:"flex items-center pt-2"},o.createElement("div",{className:`flex-grow h-px ${v}`}),o.createElement("span",{className:`${S} mx-3 text-sm`},r("SignUpPage.orContinueWith",{defaultValue:"Or continue with"})),o.createElement("div",{className:`flex-grow h-px ${v}`})),o.createElement("div",{className:"flex gap-3 mb-6 justify-center md:justify-start"},P.map(k=>o.createElement("button",{key:k.id,type:"button",onClick:()=>D(k.id),className:"flex-1"},o.createElement(We,{icon:k.icon,label:k.label})))))))))},qe=()=>(o.useEffect(()=>{const r=new URLSearchParams(window.location.search),e=r.get("accessToken"),t=r.get("refreshToken");e&&localStorage.setItem("authToken",e),t&&localStorage.setItem("refreshToken",t);const s=sessionStorage.getItem("postLoginRedirect")||"/";sessionStorage.removeItem("postLoginRedirect"),window.location.replace(s)},[]),o.createElement("div",{className:"flex items-center justify-center min-h-screen text-gray-700"},"Finishing Google sign-in…")),Jt=({children:r})=>{const{isAuthenticated:e}=G(),t=U.useLocation();return e?r:o.createElement(U.Navigate,{to:"/login",state:{from:t},replace:!0})},_t=({config:r,children:e})=>{const t=U.useNavigate(),[s,n]=o.useState(()=>localStorage.getItem("authToken")),[i,a]=o.useState(null),[l,c]=o.useState(!0),[u,d]=o.useState(!1);async function f(){try{await m.post("/auth/logout")}catch(p){console.warn("Logout endpoint failed, proceeding with local logout:",p)}n(null),a(null),localStorage.removeItem("authToken"),sessionStorage.clear(),d(!1),t("/login",{replace:!0})}const m=o.useMemo(()=>{const p=ue.create({baseURL:r.baseUrl,withCredentials:!0});return rt(p,{baseUrl:r.baseUrl,getAccessToken:()=>s,setAccessToken:y=>n(y),logout:()=>d(!0)}),p},[r.baseUrl,s]);o.useEffect(()=>{(async()=>{if(s){a(ce(s)),c(!1);return}try{const{data:y}=await ue.post(`${r.baseUrl}/auth/refresh-token`,{},{withCredentials:!0});n(y.accessToken),a(ce(y.accessToken)),localStorage.setItem("authToken",y.accessToken)}catch{}finally{c(!1)}})()},[s,r.baseUrl]);async function g(p){const{data:y}=await m.post("/auth/clients/login",p);n(y.accessToken),a(ce(y.accessToken)),localStorage.setItem("authToken",y.accessToken),nt(),t("/",{replace:!0})}const h=o.useMemo(()=>({isAuthenticated:!!s,accessToken:s,user:i,login:g,logout:f,api:m,setUser:a}),[s,i,m]);return o.createElement(Ne.Provider,{value:r},o.createElement(ve.Provider,{value:h},o.createElement(U.Routes,null,o.createElement(U.Route,{path:"login",element:s?o.createElement(U.Navigate,{to:"/",replace:!0}):o.createElement(Zt,{baseUrl:r.baseUrl,colors:r.colors})}),o.createElement(U.Route,{path:"signup",element:s?o.createElement(U.Navigate,{to:"/",replace:!0}):o.createElement(Yt,null)}),o.createElement(U.Route,{path:"oauth/google/callback",element:o.createElement(qe,null)}),o.createElement(U.Route,{path:"/oauth/microsoft/callback",element:o.createElement(qe,null)}),o.createElement(U.Route,{path:"*",element:o.createElement(Jt,null,e)})),u&&o.createElement(Vt,{onConfirm:f})))};function be(...r){const{user:e}=G(),t=(e==null?void 0:e.roles)??[];return r.some(s=>t.includes(s))}function Qt(r){const{user:e}=G();return(e==null?void 0:e.modules.includes(r))??!1}function le(...r){const{user:e}=G(),t=(e==null?void 0:e.permissions)??[];return r.every(s=>t.includes(s))}const qt=({children:r,fallbackpermessions:e=[],anyPermessions:t=[],fallbackRoles:s=["super-admin"],redirectTo:n="/dashboard"})=>{if(s.some(c=>be(c)))return o.createElement(o.Fragment,null,r);const a=e.length===0||e.every(c=>le(c)),l=t.length===0||t.some(c=>le(c));return a&&l?o.createElement(o.Fragment,null,r):o.createElement(U.Navigate,{to:n,replace:!0})},we=o.createContext({}),Xt=we.Provider;function Rt(r,e){var n,i,a;const s=(n=o.useContext(we)[r])==null?void 0:n[e];return s?!!((i=s.perms)!=null&&i.some(l=>le(l))||(a=s.fallbackRoles)!=null&&a.some(l=>be(l))):!1}const es=()=>{const{user:r,api:e,setUser:t}=G(),[s,n]=o.useState((r==null?void 0:r.name)??""),[i,a]=o.useState((r==null?void 0:r.email)??""),[l,c]=o.useState(!1),[u,d]=o.useState(!1),[f,m]=o.useState({open:!1,type:"success",title:"",message:""}),g="+971 50 827 8229";o.useEffect(()=>{if(!f.open)return;const b=window.setTimeout(()=>m(E=>({...E,open:!1})),3e3);return()=>window.clearTimeout(b)},[f.open]),o.useEffect(()=>{let b=!1;async function E(){try{const{data:w}=await e.get("/auth/client/me");if(b)return;t(w),n((w==null?void 0:w.name)??""),a((w==null?void 0:w.email)??"")}catch(w){console.error("Failed to load profile details:",w)}}return E(),()=>{b=!0}},[e,t]);const h=o.useMemo(()=>(s||(r==null?void 0:r.name)||(r==null?void 0:r.email)||"").trim(),[s,r==null?void 0:r.name,r==null?void 0:r.email]),p=o.useMemo(()=>h.charAt(0).toUpperCase()||"?",[h]);async function y(){if(r){d(!0);try{await e.patch("/auth/client/me",{name:s}),t({...r,name:s}),c(!1),m({open:!0,type:"success",title:"Changes saved",message:"Your profile was updated successfully."})}catch(b){console.error("Failed to update profile:",b),m({open:!0,type:"error",title:"Save failed",message:"Failed to save changes. Please try again."})}finally{d(!1)}}}if(!r)return o.createElement("p",{className:"text-sm text-gray-500"},"No user data available.");const L=f.type==="success";return o.createElement("div",{className:"max-w-3xl mx-auto"},f.open&&o.createElement("div",{className:"fixed top-6 right-6 z-[999999] flex items-center gap-3 rounded-xl border bg-white px-4 py-3 shadow-lg",role:"status","aria-live":"polite",style:{borderColor:L?"#BBF7D0":"#FECACA"}},o.createElement("div",{className:"flex h-9 w-9 items-center justify-center rounded-full",style:{backgroundColor:L?"#ECFDF5":"#FEF2F2"}},L?o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-green-600"},o.createElement("path",{d:"M20 6L9 17L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})):o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-red-600"},o.createElement("path",{d:"M12 9V13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M12 17H12.01",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}))),o.createElement("div",{className:"flex flex-col"},o.createElement("span",{className:"text-sm font-semibold",style:{color:L?"#15803D":"#B91C1C"}},f.title),f.message&&o.createElement("span",{className:"text-xs text-gray-500"},f.message)),o.createElement("button",{type:"button",onClick:()=>m(b=>({...b,open:!1})),className:"ml-2 rounded-md px-2 py-1 text-gray-500 hover:bg-gray-100","aria-label":"Close",title:"Close"},o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})))),o.createElement("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm"},o.createElement("div",{className:"px-6 pt-6 pb-4"},o.createElement("div",{className:"flex items-center justify-between"},o.createElement("div",{className:"flex items-center gap-4"},o.createElement("div",{className:"relative"},o.createElement("div",{className:"h-16 w-16 rounded-full bg-blue-600 flex items-center justify-center text-white text-2xl font-semibold"},p),o.createElement("button",{type:"button",className:"absolute -bottom-1 -right-1 h-8 w-8 rounded-full border border-gray-200 bg-white shadow-sm flex items-center justify-center hover:bg-gray-50",title:"Change avatar"},o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M12 20H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"})))),o.createElement("div",null,o.createElement("h1",{className:"text-2xl font-semibold"},"My Profile"),o.createElement("p",{className:"text-sm text-gray-500"},"Personal details"))),l?o.createElement("button",{type:"button",onClick:y,disabled:u,className:"rounded-full border border-blue-200 bg-blue-50 px-4 py-2 text-sm font-medium text-blue-700 hover:bg-blue-100 disabled:opacity-60"},u?"Saving…":"Save changes"):o.createElement("button",{type:"button",onClick:()=>c(!0),title:"Edit profile",className:"h-9 w-9 rounded-full border border-gray-200 bg-white shadow-sm flex items-center justify-center hover:bg-gray-50"},o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M12 20H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}))))),o.createElement("div",{className:"px-6 pb-6 border-t border-gray-100 pt-6"},o.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5"},o.createElement("div",null,o.createElement("label",{className:"block text-xs font-medium text-gray-500 mb-2"},"Username"),o.createElement("input",{type:"text",value:s,disabled:!l||u,onChange:b=>n(b.target.value),className:`w-full rounded-lg border px-3 py-2 text-sm outline-none ${l?"border-gray-300 bg-white focus:border-blue-500 focus:ring-2 focus:ring-blue-100":"border-gray-200 bg-gray-50 text-gray-700"}`})),o.createElement("div",null,o.createElement("label",{className:"block text-xs font-medium text-gray-500 mb-2"},"Email ID"),o.createElement("input",{type:"email",value:i,disabled:!0,className:"w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-700 cursor-not-allowed"})),o.createElement("div",null,o.createElement("label",{className:"block text-xs font-medium text-gray-500 mb-2"},"Mobile number"),o.createElement("input",{type:"text",value:g,disabled:!0,className:"w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-700 cursor-not-allowed"}))),l&&o.createElement("button",{type:"button",disabled:u,onClick:()=>{c(!1),n((r==null?void 0:r.name)??"")},className:"mt-6 text-sm font-medium text-gray-600 hover:text-gray-900"},"Cancel"))))};I.AuthProvider=_t,I.ProfilePage=es,I.RbacContext=we,I.RbacProvider=Xt,I.RequirePermissions=qt,I.useAuthState=G,I.useCan=le,I.useGrant=Rt,I.useHasModule=Qt,I.useHasRole=be,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|
|
49
|
+
`},o.createElement(Gt,{className:"h-4 w-4"})))},Zt=()=>{const r=oe("authLib"),e=U.useNavigate(),t=U.useLocation(),{brandName:s=r("brandName",{defaultValue:"MyBrand"}),colors:n={bg:"bg-sky-500",text:"text-white",border:"border-sky-500"},logoUrl:i,oauthProviders:a=[],illustrationUrl:l=r("community.illustrationUrl",{defaultValue:"https://cdn.builder.io/api/v1/image/assets/TEMP/35ba84b8335fda2819c3a14ea3d00321a0fd0e79e571caa31108468010868ca5?placeholderIfAbsent=true&apiKey=a460e9a46e514356ac1106eada03046c"}),communityContent:c={title:r("community.title"),description:r("community.description")},baseUrl:u}=Se(),{login:d}=G(),[f,m]=o.useState(""),[g,h]=o.useState(""),[p,y]=o.useState(!1),[L,b]=o.useState(null),E={google:{icon:Ge,label:r("social.google")},microsoft:{icon:Ze,label:r("social.microsoft")}},w=a.filter(M=>M in E).map(M=>({id:M,icon:E[M].icon,label:E[M].label})),{bgClass:C,textClass:F,borderClass:P}=Ye(n),v=`${C} bg-gradient-to-r from-white/10 via-white/0 to-white/0`;async function S(M){var D;if(M.preventDefault(),!p){b(null),y(!0);try{await d({email:f,password:g})}catch(j){((D=j==null?void 0:j.response)==null?void 0:D.status)===401?b(r("errors.invalidCredentials")):b(r("errors.generic"))}finally{y(!1)}}}function N(M){var j,k,$;if(!u){console.error("Auth baseUrl is not configured.");return}const D=((k=(j=t.state)==null?void 0:j.from)==null?void 0:k.pathname)||(($=t.state)==null?void 0:$.from)||"/";if(sessionStorage.setItem("postLoginRedirect",D),M==="google"){const T="/oauth/google/callback",V=`${window.location.origin}${T}`,O=new URL(`${u}/auth/google`);O.searchParams.set("redirect",V),window.location.href=O.toString();return}if(M==="microsoft"){const T="/oauth/microsoft/callback",V=`${window.location.origin}${T}`,O=new URL(`${u}/auth/microsoft`);O.searchParams.set("redirect",V),window.location.href=O.toString();return}}const z=o.createElement("svg",{className:"h-4 w-4 animate-spin stroke-current",viewBox:"0 0 24 24",fill:"none"},o.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",strokeWidth:"4"}),o.createElement("path",{className:"opacity-75",d:"M4 12a8 8 0 018-8",strokeWidth:"4",strokeLinecap:"round"}));return o.createElement("div",{className:`flex items-center justify-center min-h-screen p-4 ${v}`},o.createElement("div",{className:"flex w-full max-w-5xl bg-white rounded-2xl shadow-2xl overflow-hidden"},o.createElement("div",{className:`hidden md:flex md:w-1/2 p-12 flex-col justify-between text-white ${C}`},o.createElement("div",null,i?o.createElement("div",{className:"flex items-center gap-4"},o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:"bg-white h-8 md:h-22 rounded-lg"}),o.createElement("h2",{className:"text-sm md:text-2xl font-bold uppercase"},s)):o.createElement("h2",{className:"text-sm md:text-2xl font-bold"},s)),o.createElement("div",{className:"flex-1 space-y-4 mt-6 py-4"},o.createElement("h3",{className:"text-2xl font-semibold leading-tight"},c.title),o.createElement("p",{className:"text-base leading-relaxed opacity-90 ltr:text-left rtl:text-right"},c.description),o.createElement("div",{className:"relative"},o.createElement("div",{className:"absolute -left-4 -top-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("div",{className:"absolute -right-4 -bottom-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("img",{loading:"lazy",src:l,alt:"Sign in illustration",className:"max-w-sm w-full mx-auto rounded-lg shadow-lg transform hover:scale-105 transition-transform duration-300 p-6"})))),o.createElement("div",{className:"w-full md:w-1/2 p-4 md:p-8 m-auto"},o.createElement("div",{className:"flex flex-col md:flex-row justify-between items-center mb-8"},o.createElement("div",{className:"flex items-center justify-center md:hidden mb-5"},i?o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:`h-22 rounded-full border ${P}`}):o.createElement("h2",{className:"text-2xl font-bold"},s)),o.createElement("div",{className:"w-full md:w-auto mb-4 md:mb-0 text-center md:text-left ltr:text-center rtl:text-center md:ltr:text-left md:rtl:text-right"},o.createElement("p",{className:"text-sm md:text-lg"},r("SignInPage.welcome")," ",o.createElement("span",{className:`font-semibold ${F} uppercase`},s)),o.createElement("h1",{className:"text-2xl md:text-4xl font-bold text-gray-800"},r("SignInPage.signIn"))),o.createElement("div",{className:"text-sm text-gray-500 text-center md:text-right"},r("SignInPage.noAccount"),o.createElement("br",null),o.createElement("button",{type:"button",onClick:()=>e("/signup"),className:F},r("SignInPage.signUp")))),L&&o.createElement(Qe,{message:L}),o.createElement("form",{className:"space-y-6",onSubmit:S},o.createElement(R,{label:r("form.emailLabel"),type:"email",placeholder:r("form.emailPlaceholder"),color:P,value:f,onChange:m}),o.createElement(R,{label:r("form.passwordLabel"),type:"password",placeholder:r("form.passwordPlaceholder"),color:P,value:g,onChange:h}),o.createElement("div",{className:"ltr:text-right rtl:text-left"},o.createElement("button",{className:`text-sm ${F}`},r("SignInPage.forgotPassword"))),o.createElement("button",{type:"submit",disabled:p,className:`relative flex w-full items-center justify-center gap-2 py-3 rounded-lg font-medium transition-colors ${p?"opacity-60 cursor-not-allowed":""} ${C} text-white`},p&&z,r(p?"SignInPage.signInSubmitting":"SignInPage.signIn")),w.length>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:"flex items-center pt-2"},o.createElement("div",{className:`flex-grow h-px ${C}`}),o.createElement("span",{className:`${F} mx-3 text-sm`},r("SignInPage.orLoginWith")),o.createElement("div",{className:`flex-grow h-px ${C}`})),o.createElement("div",{className:"flex gap-3 mb-6 justify-center md:justify-start"},w.map(M=>o.createElement("button",{key:M.id,type:"button",onClick:()=>N(M.id),className:"flex-1"},o.createElement(We,{icon:M.icon,label:M.label})))))))))},Yt=()=>{const r=oe("authLib"),e=U.useNavigate(),t=U.useLocation(),{brandName:s=r("brandName",{defaultValue:"MyBrand"}),colors:n={bg:"bg-sky-500",text:"text-white",border:"border-sky-500"},logoUrl:i,oauthProviders:a=[],illustrationUrl:l=r("community.illustrationUrl",{defaultValue:"https://cdn.builder.io/api/v1/image/assets/TEMP/35ba84b8335fda2819c3a14ea3d00321a0fd0e79e571caa31108468010868ca5?placeholderIfAbsent=true&apiKey=a460e9a46e514356ac1106eada03046c"}),communityContent:c={title:r("community.title"),description:r("community.description")},baseUrl:u}=Se(),{login:d,api:f}=G(),[m,g]=o.useState(""),[h,p]=o.useState(""),[y,L]=o.useState(""),[b,E]=o.useState(!1),[w,C]=o.useState(null),F={google:{icon:Ge,label:r("social.google")},microsoft:{icon:Ze,label:r("social.microsoft")}},P=a.filter(k=>k in F).map(k=>({id:k,icon:F[k].icon,label:F[k].label})),{bgClass:v,textClass:S,borderClass:N}=Ye(n),z=`${v} bg-gradient-to-r from-white/10 via-white/0 to-white/0`;async function M(k){var $,T,V;if(k.preventDefault(),!b){C(null),E(!0);try{await f.post("/auth/clients/register",{email:h,password:y,name:m||void 0}),await d({email:h,password:y})}catch(O){const W=($=O==null?void 0:O.response)==null?void 0:$.status;C(W===400?((V=(T=O==null?void 0:O.response)==null?void 0:T.data)==null?void 0:V.message)||r("errors.invalidData",{defaultValue:"Please check the fields and try again."}):W===409?r("errors.emailInUse",{defaultValue:"This email is already in use."}):r("errors.generic",{defaultValue:"Something went wrong. Please try again."}))}finally{E(!1)}}}function D(k){var T,V,O;if(!u){console.error("Auth baseUrl is not configured.");return}const $=((V=(T=t.state)==null?void 0:T.from)==null?void 0:V.pathname)||((O=t.state)==null?void 0:O.from)||"/";if(sessionStorage.setItem("postLoginRedirect",$),k==="google"){const W="/oauth/google/callback",A=`${window.location.origin}${W}`,H=new URL(`${u}/auth/google`);H.searchParams.set("redirect",A),window.location.href=H.toString();return}if(k==="microsoft"){const W="/oauth/microsoft/callback",A=`${window.location.origin}${W}`,H=new URL(`${u}/auth/microsoft`);H.searchParams.set("redirect",A),window.location.href=H.toString();return}}const j=o.createElement("svg",{className:"h-4 w-4 animate-spin stroke-current",viewBox:"0 0 24 24",fill:"none"},o.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",strokeWidth:"4"}),o.createElement("path",{className:"opacity-75",d:"M4 12a8 8 0 018-8",strokeWidth:"4",strokeLinecap:"round"}));return o.createElement("div",{className:`flex items-center justify-center min-h-screen p-4 ${z}`},o.createElement("div",{className:"flex w-full max-w-5xl bg-white rounded-2xl shadow-2xl overflow-hidden"},o.createElement("div",{className:`hidden md:flex md:w-1/2 p-12 flex-col justify-between text-white ${v}`},o.createElement("div",null,i?o.createElement("div",{className:"flex items-center gap-4"},o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:"bg-white h-8 md:h-22 rounded-lg"}),o.createElement("h2",{className:"text-sm md:text-2xl font-bold uppercase"},s)):o.createElement("h2",{className:"text-sm md:text-2xl font-bold"},s)),o.createElement("div",{className:"flex-1 space-y-4 mt-6 py-4"},o.createElement("h3",{className:"text-2xl font-semibold leading-tight"},c.title),o.createElement("p",{className:"text-base leading-relaxed opacity-90 ltr:text-left rtl:text-right"},c.description),o.createElement("div",{className:"relative"},o.createElement("div",{className:"absolute -left-4 -top-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("div",{className:"absolute -right-4 -bottom-4 w-20 h-20 bg-white/20 rounded-full blur-xl"}),o.createElement("img",{loading:"lazy",src:l,alt:"Sign up illustration",className:"max-w-sm w-full mx-auto rounded-lg shadow-lg transform hover:scale-105 transition-transform duration-300 p-6"})))),o.createElement("div",{className:"w-full md:w-1/2 p-4 md:p-8 m-auto"},o.createElement("div",{className:"flex flex-col md:flex-row justify-between items-center mb-8"},o.createElement("div",{className:"flex items-center justify-center md:hidden mb-5"},i?o.createElement("img",{loading:"lazy",src:i,alt:"Brand Logo",className:`h-22 rounded-full border ${N}`}):o.createElement("h2",{className:"text-2xl font-bold"},s)),o.createElement("div",{className:"w-full md:w-auto mb-4 md:mb-0 text-center md:text-left ltr:text-center rtl:text-center md:ltr:text-left md:rtl:text-right"},o.createElement("p",{className:"text-sm md:text-lg"},r("SignUpPage.welcome",{defaultValue:"Join"})," ",o.createElement("span",{className:`font-semibold ${S} uppercase`},s)),o.createElement("h1",{className:"text-2xl md:text-4xl font-bold text-gray-800"},r("SignUpPage.signUp",{defaultValue:"Sign up"}))),o.createElement("div",{className:"text-sm text-gray-500 text-center md:text-right"},r("SignUpPage.alreadyHaveAccount",{defaultValue:"Already have an account?"}),o.createElement("br",null),o.createElement("button",{type:"button",onClick:()=>e("/login"),className:S},r("SignUpPage.signIn",{defaultValue:"Sign in"})))),w&&o.createElement(Qe,{message:w}),o.createElement("form",{className:"space-y-6",onSubmit:M},o.createElement(R,{label:r("form.nameLabel",{defaultValue:"Name"}),type:"text",placeholder:r("form.namePlaceholder",{defaultValue:"Enter your name"}),color:N,value:m,onChange:g}),o.createElement(R,{label:r("form.emailLabel"),type:"email",placeholder:r("form.emailPlaceholder"),color:N,value:h,onChange:p}),o.createElement(R,{label:r("form.passwordLabel"),type:"password",placeholder:r("form.passwordPlaceholder"),color:N,value:y,onChange:L}),o.createElement("button",{type:"submit",disabled:b,className:`relative flex w-full items-center justify-center gap-2 py-3 rounded-lg font-medium transition-colors ${b?"opacity-60 cursor-not-allowed":""} ${v} text-white`},b&&j,b?r("SignUpPage.signUpSubmitting",{defaultValue:"Creating account..."}):r("SignUpPage.signUp",{defaultValue:"Sign up"})),P.length>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:"flex items-center pt-2"},o.createElement("div",{className:`flex-grow h-px ${v}`}),o.createElement("span",{className:`${S} mx-3 text-sm`},r("SignUpPage.orContinueWith",{defaultValue:"Or continue with"})),o.createElement("div",{className:`flex-grow h-px ${v}`})),o.createElement("div",{className:"flex gap-3 mb-6 justify-center md:justify-start"},P.map(k=>o.createElement("button",{key:k.id,type:"button",onClick:()=>D(k.id),className:"flex-1"},o.createElement(We,{icon:k.icon,label:k.label})))))))))},qe=()=>(o.useEffect(()=>{const r=new URLSearchParams(window.location.search),e=r.get("accessToken"),t=r.get("refreshToken");e&&localStorage.setItem("authToken",e),t&&localStorage.setItem("refreshToken",t);const s=sessionStorage.getItem("postLoginRedirect")||"/";sessionStorage.removeItem("postLoginRedirect"),window.location.replace(s)},[]),o.createElement("div",{className:"flex items-center justify-center min-h-screen text-gray-700"},"Finishing Google sign-in…")),Jt=({children:r})=>{const{isAuthenticated:e}=G(),t=U.useLocation();return e?r:o.createElement(U.Navigate,{to:"/login",state:{from:t},replace:!0})},_t=({config:r,children:e})=>{const t=U.useNavigate(),[s,n]=o.useState(()=>localStorage.getItem("authToken")),[i,a]=o.useState(null),[l,c]=o.useState(!0),[u,d]=o.useState(!1);async function f(){try{await m.post("/auth/logout")}catch(p){console.warn("Logout endpoint failed, proceeding with local logout:",p)}n(null),a(null),localStorage.removeItem("authToken"),sessionStorage.clear(),d(!1),t("/login",{replace:!0})}const m=o.useMemo(()=>{const p=ue.create({baseURL:r.baseUrl,withCredentials:!0});return rt(p,{baseUrl:r.baseUrl,getAccessToken:()=>s,setAccessToken:y=>n(y),logout:()=>d(!0)}),p},[r.baseUrl,s]);o.useEffect(()=>{(async()=>{if(s){a(ce(s)),c(!1);return}try{const{data:y}=await ue.post(`${r.baseUrl}/auth/refresh-token`,{},{withCredentials:!0});n(y.accessToken),a(ce(y.accessToken)),localStorage.setItem("authToken",y.accessToken)}catch{}finally{c(!1)}})()},[s,r.baseUrl]);async function g(p){const{data:y}=await m.post("/auth/clients/login",p);n(y.accessToken),a(ce(y.accessToken)),localStorage.setItem("authToken",y.accessToken),nt(),t("/",{replace:!0})}const h=o.useMemo(()=>({isAuthenticated:!!s,accessToken:s,user:i,login:g,logout:f,api:m,setUser:a}),[s,i,m]);return o.createElement(Ne.Provider,{value:r},o.createElement(ve.Provider,{value:h},o.createElement(U.Routes,null,o.createElement(U.Route,{path:"login",element:s?o.createElement(U.Navigate,{to:"/",replace:!0}):o.createElement(Zt,{baseUrl:r.baseUrl,colors:r.colors})}),o.createElement(U.Route,{path:"signup",element:s?o.createElement(U.Navigate,{to:"/",replace:!0}):o.createElement(Yt,null)}),o.createElement(U.Route,{path:"oauth/google/callback",element:o.createElement(qe,null)}),o.createElement(U.Route,{path:"/oauth/microsoft/callback",element:o.createElement(qe,null)}),o.createElement(U.Route,{path:"*",element:o.createElement(Jt,null,e)})),u&&o.createElement(Vt,{onConfirm:f})))};function be(...r){const{user:e}=G(),t=(e==null?void 0:e.roles)??[];return r.some(s=>t.includes(s))}function Qt(r){const{user:e}=G();return(e==null?void 0:e.modules.includes(r))??!1}function le(...r){const{user:e}=G(),t=(e==null?void 0:e.permissions)??[];return r.every(s=>t.includes(s))}const qt=({children:r,fallbackpermessions:e=[],anyPermessions:t=[],fallbackRoles:s=["super-admin"],redirectTo:n="/dashboard"})=>{if(s.some(c=>be(c)))return o.createElement(o.Fragment,null,r);const a=e.length===0||e.every(c=>le(c)),l=t.length===0||t.some(c=>le(c));return a&&l?o.createElement(o.Fragment,null,r):o.createElement(U.Navigate,{to:n,replace:!0})},we=o.createContext({}),Xt=we.Provider;function Rt(r,e){var n,i,a;const s=(n=o.useContext(we)[r])==null?void 0:n[e];return s?!!((i=s.perms)!=null&&i.some(l=>le(l))||(a=s.fallbackRoles)!=null&&a.some(l=>be(l))):!1}const es=()=>{const{user:r,api:e,setUser:t}=G(),[s,n]=o.useState((r==null?void 0:r.name)??""),[i,a]=o.useState((r==null?void 0:r.email)??""),[l,c]=o.useState(!1),[u,d]=o.useState(!1),[f,m]=o.useState({open:!1,type:"success",title:"",message:""}),g="+971 50 827 8229";o.useEffect(()=>{if(!f.open)return;const b=window.setTimeout(()=>m(E=>({...E,open:!1})),3e3);return()=>window.clearTimeout(b)},[f.open]),o.useEffect(()=>{let b=!1;async function E(){try{const{data:w}=await e.get("/auth/client/me");if(b)return;t(w),n((w==null?void 0:w.name)??""),a((w==null?void 0:w.email)??"")}catch(w){console.error("Failed to load profile details:",w)}}return E(),()=>{b=!0}},[e,t]);const h=o.useMemo(()=>(s||(r==null?void 0:r.name)||(r==null?void 0:r.email)||"").trim(),[s,r==null?void 0:r.name,r==null?void 0:r.email]),p=o.useMemo(()=>h.charAt(0).toUpperCase()||"?",[h]);async function y(){if(r){d(!0);try{await e.patch("/auth/client/me",{name:s}),t({...r,name:s}),c(!1),m({open:!0,type:"success",title:"Changes saved",message:"Your profile was updated successfully."})}catch(b){console.error("Failed to update profile:",b),m({open:!0,type:"error",title:"Save failed",message:"Failed to save changes. Please try again."})}finally{d(!1)}}}if(!r)return o.createElement("p",{className:"text-sm text-gray-500"},"No user data available.");const L=f.type==="success";return o.createElement("div",{className:"max-w-3xl mx-auto"},f.open&&o.createElement("div",{className:"fixed top-6 right-6 z-[999999] flex items-center gap-3 rounded-xl border bg-white px-4 py-3 shadow-lg",role:"status","aria-live":"polite",style:{borderColor:L?"#BBF7D0":"#FECACA"}},o.createElement("div",{className:"flex h-9 w-9 items-center justify-center rounded-full",style:{backgroundColor:L?"#ECFDF5":"#FEF2F2"}},L?o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-green-600"},o.createElement("path",{d:"M20 6L9 17L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})):o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-red-600"},o.createElement("path",{d:"M12 9V13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M12 17H12.01",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}))),o.createElement("div",{className:"flex flex-col"},o.createElement("span",{className:"text-sm font-semibold",style:{color:L?"#15803D":"#B91C1C"}},f.title),f.message&&o.createElement("span",{className:"text-xs text-gray-500"},f.message)),o.createElement("button",{type:"button",onClick:()=>m(b=>({...b,open:!1})),className:"ml-2 rounded-md px-2 py-1 text-gray-500 hover:bg-gray-100","aria-label":"Close",title:"Close"},o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})))),o.createElement("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm"},o.createElement("div",{className:"px-6 pt-6 pb-4"},o.createElement("div",{className:"flex items-center justify-between"},o.createElement("div",{className:"flex items-center gap-4"},o.createElement("div",{className:"relative"},o.createElement("div",{className:"h-16 w-16 rounded-full bg-blue-600 flex items-center justify-center text-white text-2xl font-semibold"},p),o.createElement("button",{type:"button",className:"absolute -bottom-1 -right-1 h-8 w-8 rounded-full border border-gray-200 bg-white shadow-sm flex items-center justify-center hover:bg-gray-50",title:"Change avatar"},o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M12 20H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"})))),o.createElement("div",null,o.createElement("h1",{className:"text-2xl font-semibold"},"My Profile"),o.createElement("p",{className:"text-sm text-gray-500"},"Personal details"))),l?o.createElement("button",{type:"button",onClick:y,disabled:u,className:"rounded-full border border-blue-200 bg-blue-50 px-4 py-2 text-sm font-medium text-blue-700 hover:bg-blue-100 disabled:opacity-60"},u?"Saving…":"Save changes"):o.createElement("button",{type:"button",onClick:()=>c(!0),title:"Edit profile",className:"h-9 w-9 rounded-full border border-gray-200 bg-white shadow-sm flex items-center justify-center hover:bg-gray-50"},o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M12 20H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),o.createElement("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}))))),o.createElement("div",{className:"px-6 pb-6 border-t border-gray-100 pt-6"},o.createElement("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5"},o.createElement("div",null,o.createElement("label",{className:"block text-xs font-medium text-gray-500 mb-2"},"Username"),o.createElement("input",{type:"text",value:s,disabled:!l||u,onChange:b=>n(b.target.value),className:`w-full rounded-lg border px-3 py-2 text-sm outline-none ${l?"border-gray-300 bg-white focus:border-blue-500 focus:ring-2 focus:ring-blue-100":"border-gray-200 bg-gray-50 text-gray-700"}`})),o.createElement("div",null,o.createElement("label",{className:"block text-xs font-medium text-gray-500 mb-2"},"Email ID"),o.createElement("input",{type:"email",value:i,disabled:!0,className:"w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-700 cursor-not-allowed"})),o.createElement("div",null,o.createElement("label",{className:"block text-xs font-medium text-gray-500 mb-2"},"Mobile number"),o.createElement("input",{type:"text",value:g,disabled:!0,className:"w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-700 cursor-not-allowed"}))),l&&o.createElement("button",{type:"button",disabled:u,onClick:()=>{c(!1),n((r==null?void 0:r.name)??"")},className:"mt-6 text-sm font-medium text-gray-600 hover:text-gray-900"},"Cancel"))))};I.AuthProvider=_t,I.ProfilePage=es,I.RbacContext=we,I.RbacProvider=Xt,I.RequirePermissions=qt,I.useAuthState=G,I.useCan=le,I.useGrant=Rt,I.useHasModule=Qt,I.useHasRole=be,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -35,8 +35,8 @@ export const SignInPage = () => {
|
|
|
35
35
|
const [pending, setPending] = useState(false);
|
|
36
36
|
const [error, setError] = useState(null);
|
|
37
37
|
const allProvidersData = {
|
|
38
|
-
google: { icon: googleIcon, label: "social.google" },
|
|
39
|
-
microsoft: { icon: microsoftIcon, label: "social.microsoft" },
|
|
38
|
+
google: { icon: googleIcon, label: t("social.google") },
|
|
39
|
+
microsoft: { icon: microsoftIcon, label: t("social.microsoft") },
|
|
40
40
|
};
|
|
41
41
|
const providerButtons = oauthProviders
|
|
42
42
|
.filter((p) => p in allProvidersData)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInPage.js","sourceRoot":"","sources":["../../../src/pages/auth/SignInPage.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,UAAU,MAAM,gDAAgD,CAAC;AACxE,OAAO,aAAa,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,CAAC,MAAM,UAAU,GAA8B,GAAG,EAAE;IACxD,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,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SAAS,eAAe,IACzC,CAAC,CAAC,wBAAwB,CAAC,CACvB;4BACP,6BAAK,SAAS,EAAE,kBAAkB,OAAO,EAAE,GAAI,CAC3C;wBACN,6BAAK,SAAS,EAAC,iDAAiD,IAC7D,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC5B,gCACE,GAAG,EAAE,GAAG,CAAC,EAAE,EACX,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,EAC1C,SAAS,EAAC,QAAQ;4BAElB,oBAAC,YAAY,IAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAI,CAC3C,CACV,CAAC,CACE,CACL,CACJ,CACI,CACH,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -36,8 +36,8 @@ export const SignUpPage = () => {
|
|
|
36
36
|
const [pending, setPending] = useState(false);
|
|
37
37
|
const [error, setError] = useState(null);
|
|
38
38
|
const allProvidersData = {
|
|
39
|
-
google: { icon: googleIcon, label: "social.google" },
|
|
40
|
-
microsoft: { icon: microsoftIcon, label: "social.microsoft" },
|
|
39
|
+
google: { icon: googleIcon, label: t("social.google") },
|
|
40
|
+
microsoft: { icon: microsoftIcon, label: t("social.microsoft") },
|
|
41
41
|
};
|
|
42
42
|
const providerButtons = oauthProviders
|
|
43
43
|
.filter((p) => p in allProvidersData)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUpPage.js","sourceRoot":"","sources":["../../../src/pages/auth/SignUpPage.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,UAAU,M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