PageSourceSearch

https://pictographic.ai/_next/static/chunks/0vf81tvysdps2.js?dpl=dpl_9CueBCjJyUr6aL5m6Md1Y9Jbo38E

js pictographic.ai collected 2026-10-05 12:23:56 UTC 63,208 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14451,e=>{"use strict";let t=e=>"string"==typeof e,i=()=>{let e,t,i=new Promise((i,a)=>{e=i,t=a});return i.resolve=e,i.reject=t,i},a=e=>null==e?"":""+e,o=/###/g,s=e=>e&&e.indexOf("###")>-1?e.replace(o,"."):e,r=e=>!e||t(e),n=(e,i,a)=>{let o=t(i)?i.split("."):i,n=0;for(;n<o.length-1;){if(r(e))return{};let t=s(o[n]);!e[t]&&a&&(e[t]=new a),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++n}return r(e)?{}:{obj:e,k:s(o[n])}},l=(e,t,i)=>{let{obj:a,k:o}=n(e,t,Object);if(void 0!==a||1===t.length){a[o]=i;return}let s=t[t.length-1],r=t.slice(0,t.length-1),l=n(e,r,Object);for(;void 0===l.obj&&r.length;)s=`${r[r.length-1]}.${s}`,l=n(e,r=r.slice(0,r.length-1),Object),l?.obj&&void 0!==l.obj[`${l.k}.${s}`]&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=i},d=(e,t)=>{let{obj:i,k:a}=n(e,t);if(i&&Object.prototype.hasOwnProperty.call(i,a))return i[a]},c=(e,i,a)=>{for(let o in i)"__proto__"!==o&&"constructor"!==o&&(o in e?t(e[o])||e[o]instanceof String||t(i[o])||i[o]instanceof String?a&&(e[o]=i[o]):c(e[o],i[o],a):e[o]=i[o]);return e};var p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let u=e=>t(e)?e.replace(/[&<>"'\/]/g,e=>p[e]):e,g=[" ",",","?","!",";"],h=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}(20),f=(e,t,i=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let a=t.split(i),o=e;for(let e=0;e<a.length;){let t;if(!o||"object"!=typeof o)return;let s="";for(let r=e;r<a.length;++r)if(r!==e&&(s+=i),s+=a[r],void 0!==(t=o[s])){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<a.length-1)continue;e+=r-e+1;break}o=t}return o},m=e=>e?.replace(/_/g,"-"),y={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class w{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||y,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,i,a,o){return o&&!this.debug?null:(t(e[0])&&(e[0]=`${a}${this.prefix} ${e[0]}`),this.logger[i](e))}create(e){return new w(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new w(this.logger,e)}}var v=new w;class S{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let i=this.observers[e].get(t)||0;this.observers[e].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,i])=>{for(let a=0;a<i;a++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,a])=>{for(let o=0;o<a;o++)i.apply(i,[e,...t])})}}class _ extends S{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,i,a,o={}){let s,r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,n=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?s=e.split("."):(s=[e,i],a&&(Array.isArray(a)?s.push(...a):t(a)&&r?s.push(...a.split(r)):s.push(a)));let l=d(this.data,s);return(!l&&!i&&!a&&e.indexOf(".")>-1&&(e=s[0],i=s[1],a=s.slice(2).join(".")),!l&&n&&t(a))?f(this.data?.[e]?.[i],a,r):l}addResource(e,t,i,a,o={silent:!1}){let s=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,r=[e,t];
1i&&(r=r.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(r=e.split("."),a=t,t=r[1]),this.addNamespaces(t),l(this.data,r,a),o.silent||this.emit("added",e,t,i,a)}addResources(e,i,a,o={silent:!1}){for(let o in a)(t(a[o])||Array.isArray(a[o]))&&this.addResource(e,i,o,a[o],{silent:!0});o.silent||this.emit("added",e,i,a)}addResourceBundle(e,t,i,a,o,s={silent:!1,skipCopy:!1}){let r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),a=i,i=t,t=r[1]),this.addNamespaces(t);let n=d(this.data,r)||{};s.skipCopy||(i=JSON.parse(JSON.stringify(i))),a?c(n,i,o):n={...n,...i},l(this.data,r,n),s.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var b={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,a,o){return e.forEach(e=>{t=this.processors[e]?.process(t,i,a,o)??t}),t}};let k=Symbol("i18next/PATH_KEY");function x(e,t){let i,a,o,{[k]:s}=e((a=[],(o=Object.create(null)).get=(e,t)=>(i?.revoke?.(),t===k)?a:(a.push(t),(i=Proxy.revocable(e,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),r=t?.keySeparator??".",n=t?.nsSeparator??":";if(s.length>1&&n){let e=t?.ns,i=Array.isArray(e)?e:null;if(i&&i.length>1&&i.slice(1).includes(s[0]))return`${s[0]}${n}${s.slice(1).join(r)}`}return s.join(r)}let L={},O=e=>!t(e)&&"boolean"!=typeof e&&"number"!=typeof e;class I extends S{constructor(e,t={}){super(),((e,t,i)=>{e.forEach(e=>{t[e]&&(i[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
1i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=v.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let i={...t};if(null==e)return!1;let a=this.resolve(e,i);if(a?.res===void 0)return!1;let o=O(a.res);return!1!==i.returnObjects||!o}extractFromKey(e,i){let a=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===a&&(a=":");let o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=i.ns||this.options.defaultNS||[],r=a&&e.indexOf(a)>-1,n=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!((e,t,i)=>{t=t||"",i=i||"";let a=g.filter(e=>0>t.indexOf(e)&&0>i.indexOf(e));if(0===a.length)return!0;let o=h.getRegExp(`(${a.map(e=>"?"===e?"\\?":e).join("|")})`),s=!o.test(e);if(!s){let t=e.indexOf(i);t>0&&!o.test(e.substring(0,t))&&(s=!0)}return s})(e,a,o);if(r&&!n){let i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:t(s)?[s]:s};let r=e.split(a);(a!==o||a===o&&this.options.ns.indexOf(r[0])>-1)&&(s=r.shift()),e=r.join(o)}return{key:e,namespaces:t(s)?[s]:s}}translate(e,i,a){let o="object"==typeof i?{...i}:i;if("object"!=typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof o&&(o={...o}),o||(o={}),null==e)return"";"function"==typeof e&&(e=x(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?x(e,{...this.options,...o}):String(e));let s=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:n,namespaces:l}=this.extractFromKey(e[e.length-1],o),d=l[l.length-1],c=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");let p=o.lng||this.language,u=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p?.toLowerCase()==="cimode")return u?s?{res:`${d}${c}${n}`,usedKey:n,exactUsedKey:n,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(o)}:`${d}${c}${n}`:s?{res:n,usedKey:n,exactUsedKey:n,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(o)}:n;let g=this.resolve(e,o),h=g?.res,f=g?.usedKey||n,m=g?.exactUsedKey||n,y=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!t(o.count),S=I.hasDefaultValue(o),_=v?this.pluralResolver.getSuffix(p,o.count,o):"",b=o.ordinal&&v?this.pluralResolver.getSuffix(p,o.count,{ordinal:!1}):"",k=v&&!o.ordinal&&0===o.count,L=k&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${_}`]||o[`defaultValue${b}`]||o.defaultValue,D=h;w&&!h&&S&&(D=L);let P=O(D),$=Object.prototype.toString.apply(D);if(w&&D&&P&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf($)&&!(t(y)&&Array.isArray(D))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,D,{...o,ns:l}):`key '${n} (${this.language})' returned an object instead of string.`;return s?(g.res=e,g.usedParams=this.getUsedParamsDetails(o),g):e}if(r){let e=Array.isArray(D),t=e?[]:{},i=e?m:f;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let a=`${i}${r}${e}`;S&&!h?t[e]=this.translate(a,{...o,defaultValue:O(L)?L[e]:void 0,...{joinArrays:!1,ns:l}}):t[e]=this.translate(a,{...o,joinArrays:!1,ns:l}),t[e]===a&&(t[e]=D[e])}h=t}}else if(w&&t(y)&&Array.isArray(h))(h=h.join(y))&&(h=this.extendTranslation(h,e,o,a));else{let t=!1,i=!1;!this.isValidLookup(h)&&S&&(t=!0,h=L),this.isValidLookup(h)||(i=!0,h=n);let s=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:h,l=S&&L!==h&&this.options.updateMissing;if(i||t||l){if(this.logger.log(l?"updateKey":"missingKey",p,d,n,l?L:h),r){let e=this.resolve(n,{...o,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let i=0;i<t.length;i++)e.push(t[i]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(o.lng||this.language):e.push(o.lng||this.language);let i=(e,t,i)=>{let a=S&&i!==h?i:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,d,t,a,l,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,d,t,a,l,o),this.emit
1("missingKey",e,d,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,o);k&&o[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{i([e],n+t,o[`defaultValue${t}`]||L)})}):i(e,n,L))}h=this.extendTranslation(h,e,o,g,a),i&&h===n&&this.options.appendNamespaceToMissingKey&&(h=`${d}${c}${n}`),(i||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${c}${n}`:n,t?h:void 0,o))}return s?(g.res=h,g.usedParams=this.getUsedParamsDetails(o),g):h}extendTranslation(e,i,a,o,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!a.skipInterpolation){let r;a.interpolation&&this.interpolator.init({...a,...{interpolation:{...this.options.interpolation,...a.interpolation}}});let n=t(e)&&(a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(n){let t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let l=a.replace&&!t(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,a.lng||this.language||o.usedLng,a),n){let t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(a.nest=!1)}!a.lng&&o&&o.res&&(a.lng=this.language||o.usedLng),!1!==a.nest&&(e=this.interpolator.nest(e,(...e)=>s?.[0]!==e[0]||a.context?this.translate(...e,i):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${i[0]}`),null),a)),a.interpolation&&this.interpolator.reset()}let r=a.postProcess||this.options.postProcess,n=t(r)?[r]:r;return null!=e&&n?.length&&!1!==a.applyPostProcessor&&(e=b.handle(n,e,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),e}resolve(e,i={}){let a,o,s,r,n;return t(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?x(e,{...this.options,...i}):e)),e.forEach(e=>{if(this.isValidLookup(a))return;let l=this.extractFromKey(e,i),d=l.key;o=d;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let p=void 0!==i.count&&!t(i.count),u=p&&!i.ordinal&&0===i.count,g=void 0!==i.context&&(t(i.context)||"number"==typeof i.context)&&""!==i.context,h=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);
1c.forEach(e=>{this.isValidLookup(a)||(n=e,!L[`${h[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(n)&&(L[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${h.join(", ")}" won't get resolved as namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(t=>{let o;if(this.isValidLookup(a))return;r=t;let n=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(n,d,t,e,i);else{let e;p&&(e=this.pluralResolver.getSuffix(t,i.count,i));let a=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(i.ordinal&&0===e.indexOf(o)&&n.push(d+e.replace(o,this.options.pluralSeparator)),n.push(d+e),u&&n.push(d+a)),g){let t=`${d}${this.options.contextSeparator||"_"}${i.context}`;n.push(t),p&&(i.ordinal&&0===e.indexOf(o)&&n.push(t+e.replace(o,this.options.pluralSeparator)),n.push(t+e),u&&n.push(t+a))}}for(;o=n.pop();)this.isValidLookup(a)||(s=o,a=this.getResource(t,e,o,i))}))})}),{res:a,usedKey:o,exactUsedKey:s,usedLng:r,usedNS:n}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,i,a={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,i,a):this.resourceStore.getResource(e,t,i,a)}getUsedParamsDetails(e={}){let i=e.replace&&!t(e.replace),a=i?e.replace:e;if(i&&void 0!==e.count&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!i)for(let e of(a={...a},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete a[e];return a}static hasDefaultValue(e){let t="defaultValue";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&void 0!==e[i])return!0;return!1}}class D{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=v.create("languageUtils")}getScriptPartFromCode(e){if(!(e=m(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=m(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(t(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let i=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let i=this.getScriptPartFromCode(e);if(this.isSupportedCode(i))return t=i;let a=this.getLanguagePartFromCode(e);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(e=>{if(e===a||!(0>e.indexOf("-")&&0>a.indexOf("-"))&&(e.indexOf("-")>0&&0>a.indexOf("-")&&e.substring(0,e.indexOf("-"))===a||0===e.indexOf(a)&&a.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,i){if(!e)return[];if("function"==typeof e&&(e=e(i)),t(e)&&(e=[e]),Array.isArray(e))return e;if(!i)return e.default||[];let a=e[i];return a||(a=e[this.getScriptPartFromCode(i)]),a||(a=e[this.formatLanguageCode(i)]),a||(a=e[this.getLanguagePartFromCode(i)]),a||(a=e.default),a||[]}toResolveHierarchy(e,i){let a=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],e),o=[],s=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return t(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):t(e)&&s(this.formatLanguageCode(e)),a.forEach(e
1=>{0>o.indexOf(e)&&s(this.formatLanguageCode(e))}),o}}let P={zero:0,one:1,two:2,few:3,many:4,other:5},$={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class C{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=v.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let i,a=m("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:a,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];try{i=new Intl.PluralRules(a,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),$;if(!e.match(/-|_/))return $;let a=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(a,t)}return this.pluralRulesCache[s]=i,i}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return(i||(i=this.getRule("dev",t)),i)?i.resolvedOptions().pluralCategories.sort((e,t)=>P[e]-P[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,i={}){let a=this.getRule(e,i);return a?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${a.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}}let E=(e,i,a,o=".",s=!0)=>{let r,n=void 0!==(r=d(e,a))?r:d(i,a);return!n&&s&&t(a)&&void 0===(n=f(e,a,o))&&(n=f(i,a,o)),n};class R{constructor(e={}){this.logger=v.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:i,useRawValueToEscape:a,prefix:o,prefixEscaped:s,suffix:r,suffixEscaped:n,formatSeparator:l,unescapeSuffix:d,unescapePrefix:c,nestingPrefix:p,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:f,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:w}=e.interpolation;this.escape=void 0!==t?t:u,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==a&&a,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"{{",this.suffix=r?r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):n||"}}",this.formatSeparator=l||",",this.unescapePrefix=d?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):g||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=h?h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==w&&w,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,i,o,s){let r,n,l,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(0>e.indexOf(this.formatSeparator)){let t=E(i,d,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(t,void 0,o,{...s,...i,interpolationkey:e}):t}let t=e.split(this.formatSeparator),a=t.shift().trim(),r=t.join(this.formatSeparator).trim();return this.format(E(i,d,a,this.options.keySeparator,this.options.ignoreJSONStructure),r,o,{...s,...i,interpolationkey:a})};this.resetRegExp();let p=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}
1].forEach(i=>{for(l=0;r=i.regex.exec(e);){let o=r[1].trim();if(void 0===(n=c(o)))if("function"==typeof p){let i=p(e,r,s);n=t(i)?i:""}else if(s&&Object.prototype.hasOwnProperty.call(s,o))n="";else if(u){n=r[0];continue}else this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),n="";else t(n)||this.useRawValueToEscape||(n=a(n));let d=i.safeValue(n);if(e=e.replace(r[0],d),u?(i.regex.lastIndex+=n.length,i.regex.lastIndex-=r[0].length):i.regex.lastIndex=0,++l>=this.maxReplaces)break}}),e}nest(e,i,o={}){let s,r,n,l=(e,t)=>{let i=this.nestingOptionsSeparator;if(0>e.indexOf(i))return e;let a=e.split(RegExp(`${i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${a[1]}`;e=a[0];let s=(o=this.interpolate(o,n)).match(/'/g),r=o.match(/"/g);((s?.length??0)%2!=0||r)&&(r?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{n=JSON.parse(o),t&&(n={...t,...n})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${i}${o}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,e};for(;s=this.nestingRegexp.exec(e);){let d=[];(n=(n={...o}).replace&&!t(n.replace)?n.replace:n).applyPostProcessor=!1,delete n.defaultValue;let c=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);
1if(-1!==c&&(d=s[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),s[1]=s[1].slice(0,c)),(r=i(l.call(this,s[1].trim(),n),n))&&s[0]===e&&!t(r))return r;t(r)||(r=a(r)),r||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),r=""),d.length&&(r=d.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:s[1].trim()}),r.trim())),e=e.replace(s[0],r),this.regexp.lastIndex=0}return e}}let N=e=>{let t={};return(i,a,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s={...s,[o.interpolationkey]:void 0});let r=a+JSON.stringify(s),n=t[r];return n||(n=e(m(a),o),t[r]=n),n(i)}},j=e=>(t,i,a)=>e(m(i),a)(t);class T{constructor(e={}){this.logger=v.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let i=t.cacheInBuiltFormats?N:j;this.formats={number:i((e,t)=>{let i=new Intl.NumberFormat(e,{...t});return e=>i.format(e)}),currency:i((e,t)=>{let i=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>i.format(e)}),datetime:i((e,t)=>{let i=new Intl.DateTimeFormat(e,{...t});return e=>i.format(e)}),relativetime:i((e,t)=>{let i=new Intl.RelativeTimeFormat(e,{...t});return e=>i.format(e,t.range||"day")}),list:i((e,t)=>{let i=new Intl.ListFormat(e,{...t});return e=>i.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=N(t)}format(e,t,i,a={}){let o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&0>o[0].indexOf(")")&&o.find(e=>e.indexOf(")")>-1)){let e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce((e,t)=>{let{formatName:o,formatOptions:s}=(e=>{let t=e.toLowerCase().trim(),i={};if(e.indexOf("(")>-1){let a=e.split("(");t=a[0].toLowerCase().trim();let o=a[1].substring(0,a[1].length-1);"currency"===t&&0>o.indexOf(":")?i.currency||(i.currency=o.trim()):"relativetime"===t&&0>o.indexOf(":")?i.range||(i.range=o.trim()):o.split(";").forEach(e=>{if(e){let[t,...a]=e.split(":"),o=a.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();i[s]||(i[s]=o),"false"===o&&(i[s]=!1),"true"===o&&(i[s]=!0),isNaN(o)||(i[s]=parseInt(o,10))}})}return{formatName:t,formatOptions:i}})(t);if(this.formats[o]){let t=e;try{let r=a?.formatParams?.[a.interpolationkey]||{},n=r.locale||r.lng||a.locale||a.lng||i;t=this.formats[o](e,n,{...s,...a,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class U extends S{constructor(e,t,i,a={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=a,this.logger=v.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,a.backend,a)}queueLoad(e,t,i,a){let o={},s={},r={},n={};return e.forEach(e=>{let a=!0;t.forEach(t=>{let r=`${e}|${t}`;!i.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===s[r]&&(s[r]=!0):(this.state[r]=1,a=!1,void 0===s[r]&&(s[r]=!0),void 0===o[r]&&(o[r]=!0),void 0===n[t]&&(n[t]=!0)))}),a||(r[e]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(n)}}loaded(e,t,i){let a=e.split("|"),o=a[0],s=a[1];t&&this.emit("failedLoading",o,s,t),!t&&i&&this.store.addResourceBundle(o,s,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);let r={};this.queue.forEach(i=>{((e,t,i,a)=>{let{obj:o,k:s}=n(e,t,Object);o[s]=o[s]||[],o[s].push(i)})(i.loaded,[o],s),void 0!==i.pending[e]&&(delete i.pending[e],i.pendingCount--),t&&i.errors.push(t),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach(e=>{r[e]||(r[e]={});let t=i.loaded[e];t.length&&t.forEach(t=>{void 0===r[e][t]&&(r[e][t]=!0)})}),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())}
1),this.emit("loaded",r),this.queue=this.queue.filter(e=>!e.done)}read(e,t,i,a=0,o=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:i,tried:a,wait:o,callback:s});this.readingCalls++;let r=(r,n)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&n&&a<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,i,a+1,2*o,s)},o):s(r,n)},n=this.backend[i].bind(this.backend);if(2===n.length){try{let i=n(e,t);i&&"function"==typeof i.then?i.then(e=>r(null,e)).catch(r):r(null,i)}catch(e){r(e)}return}return n(e,t,r)}prepareLoading(e,i,a={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();t(e)&&(e=this.languageUtils.toResolveHierarchy(e)),t(i)&&(i=[i]);let s=this.queueLoad(e,i,a,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){let i=e.split("|"),a=i[0],o=i[1];this.read(a,o,"read",void 0,void 0,(i,s)=>{i&&this.logger.warn(`${t}loading namespace ${o} for language ${a} failed`,i),!i&&s&&this.logger.log(`${t}loaded namespace ${o} for language ${a}`,s),this.loaded(e,i,s)})}saveMissing(e,t,i,a,o,s={},r=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=i&&""!==i){if(this.backend?.create){let n={...s,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;(o=5===l.length?l(e,t,i,a,n):l(e,t,i,a))&&"function"==typeof o.then?o.then(e=>r(null,e)).catch(r):r(null,o)}catch(e){r(e)}else l(e,t,i,a,r,n)}e&&e[0]&&this.store.addResource(e[0],t,i,a)}}}let A=()=>({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:e=>{let i={};if("object"==typeof e[1]&&(i=e[1]),t(e[1])&&(i.defaultValue=e[1]),t(e[2])&&(i.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let t=e[3]||e[2];Object.keys(t).forEach(e=>{i[e]=t[e]})}return i},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),F=e=>(t(e.ns)&&(e.ns=[e.ns]),t(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),t(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),V=()=>{},H="__i18next_supportNoticeShown";class K extends S{constructor(e={},t){if(super(),this.options=F(e),this.services={},this.logger=v,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},a){this.isInitializing=!0,"function"==typeof e&&(a=e,e={}),null==e.defaultNS&&e.ns&&(t(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let o=A();this.options={...o,...this.options,...F(e)},this.options.interpolation={...o.interpolation,...this.options.interpolation}
1,void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),!1!==this.options.showSupportNotice&&!(this?.modules?.backend?.name?.indexOf("Locize")>0||this?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||this?.options?.backend?.backends&&this.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||this?.options?.backend?.projectId||this?.options?.backend?.backendOptions&&this.options.backend.backendOptions.some(e=>e?.projectId))&&1&&!("u">typeof globalThis&&globalThis[H])&&("u">typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"u">typeof globalThis&&(globalThis[H]=!0));let s=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?v.init(s(this.modules.logger),this.options):v.init(null,this.options),e=this.modules.formatter?this.modules.formatter:T;let t=new D(this.options);this.store=new _(this.options.resources,this.options);let i=this.services;i.logger=v,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new C(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.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"),e&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(i.formatter=s(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new R(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new U(s(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=s(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=s(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new I(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,a||(a=V),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let r=i(),n=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(t),a(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?n():setTimeout(n,0),r}loadResources(e,i=V){let a=i,o=t(e)?e:this.language;if("function"==typeof e&&(a=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return a();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};o?t(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e
1=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),a(e)})}else a(null)}reloadResources(e,t,a){let o=i();return"function"==typeof e&&(a=e,e=void 0),"function"==typeof t&&(a=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),a||(a=V),this.services.backendConnector.reload(e,t,e=>{o.resolve(),a(e)}),o}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&b.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,a){this.isLanguageChangingTo=e;let o=i();this.emit("languageChanging",e);let s=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(t,i)=>{i?this.isLanguageChangingTo===e&&(s(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,o.resolve((...e)=>this.t(...e)),a&&a(t,(...e)=>this.t(...e))},n=i=>{e||i||!this.services.languageDetector||(i=[]);let a=t(i)?i:i&&i[0],o=this.store.hasLanguageSomeTranslations(a)?a:this.services.languageUtils.getBestMatchFromCodes(t(i)?[i]:i);o&&(this.language||s(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{r(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(n):this.services.languageDetector.detect(n):n(e):n(this.services.languageDetector.detect()),o}getFixedT(e,i,a){let o=(e,t,...i)=>{let s,r;(s="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=s.lng||o.lng,s.lngs=s.lngs||o.lngs,s.ns=s.ns||o.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||a||o.keyPrefix);let n={...this.options,...s},l=this.options.keySeparator||".";return s.keyPrefix&&Array.isArray(e)?r=e.map(e=>("function"==typeof e&&(e=x(e,n)),`${s.keyPrefix}${l}${e}`)):("function"==typeof e&&(e=x(e,n)),r=s.keyPrefix?`${s.keyPrefix}${l}${e}`:e),this.t(r,s)};return t(e)?o.lng=e:o.lngs=e,o.ns=i,o.keyPrefix=a,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
1if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let i=t.lng||this.resolvedLanguage||this.languages[0],a=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;let s=(e,t)=>{let i=this.services.backendConnector.state[`${e}|${t}`];return -1===i||0===i||2===i};if(t.precheck){let e=t.precheck(this,s);if(void 0!==e)return e}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(i,e)&&(!a||s(o,e)))}loadNamespaces(e,a){let o=i();return this.options.ns?(t(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{o.resolve(),a&&a(e)}),o):(a&&a(),Promise.resolve())}loadLanguages(e,a){let o=i();t(e)&&(e=[e]);let s=this.options.preload||[],r=e.filter(e=>0>s.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=s.concat(r),this.loadResources(e=>{o.resolve(),a&&a(e)}),o):(a&&a(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new D(A());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let i=new K(e,t);return i.createInstance=K.createInstance,i}cloneInstance(e={},t=V){let i=e.forkResourceStore;i&&delete e.forkResourceStore;let a={...this.options,...e,isClone:!0},o=new K(a);if((void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},i&&(o.store=new _(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((i,a)=>(i[a]={...e[t][a]},i),e[t]),e),{}),a),o.services.resourceStore=o.store),e.interpolation){let t={...A().interpolation,...this.options.interpolation,...e.interpolation},i={...a,interpolation:t};o.services.interpolator=new R(i)}return o.translator=new I(o.services,a),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(a,t),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let M=K.createInstance();M.createInstance,M.dir,M.init,M.loadResources,M.reloadResources,M.use,M.changeLanguage,M.getFixedT,M.t,M.exists,M.setDefaultNamespace,M.hasLoadedNamespace,M.loadNamespaces,M.loadLanguages,e.s(["default",0,M])},48160,53625,e=>{"use strict";var t=e.i(97968);let i=new class{identifyUser(e,i){try{t.default.identify(e),i&&t.default.people.set({$email:i.email,...i})}catch(e){console.error("Error identifying user:",e)}}setUserProperties(e){try{t.default.people.set(e)}catch(e){console.error("Error setting user properties:",e)}}trackEvent(e,i){try{t.default.track(e,i)}catch(e){console.error("Error tracking event:",e)}}trackSignup(e,t="free_tier"){this.trackEvent("Signup",{email:e,user_type:t,timestamp:new Date().toISOString()})}trackLogin(e,t){this.trackEvent("Login Successful",{email:e,user_type:t,timestamp:new Date().toISOString()})}trackLogout(){this.trackEvent("Logout")}trackPageView(e,t){this.trackEvent(`${e} Page Viewed`,{page:e,url:window.location.pathname,timestamp:new Date().toISOString(),...t})}trackSearch(e,t,i){this.trackEvent("Search Performed",{query:e,result_count:t,filters:i,timestamp:new Date().toISOString()})}trackIconDownload(e,t,i,a,o){let s=window.location.pathname.includes("/icons/generate");this.trackEvent(s?"Generated Icon Downloaded":"Iconset Downloaded",{icon_
1id:e,icon_name:t,style:i,format:a,download_source:s?"generated":"iconset",download_url:o,timestamp:new Date().toISOString()})}trackIllustrationDownload(e,t,i,a){this.trackEvent("Illustration Downloaded",{illustration_id:e,illustration_name:t,style:i,download_url:a,timestamp:new Date().toISOString()})}trackIconGeneration(e,t){this.trackEvent("Icon Generated",{prompt:e,style:t,timestamp:new Date().toISOString()})}trackIconGenerationCompleted(e,t,i,a){this.trackEvent("Icon Generated",{prompt:e,model:t,icons_generated:i.length,icon_url_1:i[0]?.png||i[0]?.url||null,icon_url_2:i[1]?.png||i[1]?.url||null,icon_url_3:i[2]?.png||i[2]?.url||null,icon_url_4:i[3]?.png||i[3]?.url||null,svg_url_1:i[0]?.svg||i[0]?.svg_url||null,svg_url_2:i[1]?.svg||i[1]?.svg_url||null,svg_url_3:i[2]?.svg||i[2]?.svg_url||null,svg_url_4:i[3]?.svg||i[3]?.svg_url||null,original_png_1:i[0]?.png.replace(/\.png$/,"_original.png")||i[0]?.url.replace(/\.png$/,"_original.png")||null,original_png_2:i[1]?.png.replace(/\.png$/,"_original.png")||i[1]?.url.replace(/\.png$/,"_original.png")||null,original_png_3:i[2]?.png.replace(/\.png$/,"_original.png")||i[2]?.url.replace(/\.png$/,"_original.png")||null,original_png_4:i[3]?.png.replace(/\.png$/,"_original.png")||i[3]?.url.replace(/\.png$/,"_original.png")||null,timestamp:new Date().toISOString(),...a})}trackIllustrationGeneration(e,t,i=[]){this.trackEvent("Illustration Generated",{prompt:e,style:t,image_1_url:i[0]?.url||null,image_2_url:i[1]?.url||null,image_3_url:i[2]?.url||null,image_4_url:i[3]?.url||null,timestamp:new Date().toISOString()})}trackSubscriptionStarted(e,t){this.trackEvent("Subscription Started",{email:e,plan:t,timestamp:new Date().toISOString()})}trackPaymentInitiated(e,t){this.trackEvent("Payment Initiated",{plan:e,price:t,timestamp:new Date().toISOString()});try{localStorage.setItem("last_payment_initiated",JSON.stringify({plan:e,price:t,timestamp:new Date().toISOString()}))}catch(e){console.error("Error saving payment initiated to localStorage:",e)}}trackPaymentCompleted(e,t,i){this.trackEvent("Payment Completed",{plan:e,price:t,payment_method:i,timestamp:new Date().toISOString()})}trackSubscriptionCancelled(e,t){this.trackEvent("Subscription Cancelled",{plan:e,reason:t,timestamp:new Date().toISOString()})}trackFilterApplied(e,t,i){this.trackEvent("Filter Applied",{filter_type:e,filter_value:t,page:i,timestamp:new Date().toISOString()})}trackIconFavorited(e,t){this.trackEvent("Icon Favorited",{icon_id:e,icon_name:t,timestamp:new Date().toISOString()})}trackContactFormSubmitted(e="contact_us"){this.trackEvent("Contact Form Submitted",{form_type:e,timestamp:new Date().toISOString()})}trackCategoryViewed(e,t){this.trackEvent("Category Viewed",{category:e,page:t,timestamp:new Date().toISOString()})}trackCollectionViewed(e,t){this.trackEvent("Collection Viewed",{collection_name:e,collection_id:t,timestamp:new Date().toISOString()})}trackError(e,t,i){this.trackEvent("Error Occurred",{error_type:e,error_message:t,location:i,timestamp:new Date().toISOString()})}trackGenerationError(e,t,i){this.trackEvent("Generation Failed",{generation_type:e,prompt:t,error_message:i,timestamp:new Date().toISOString()})}trackFeatureUsed(e,t){this.trackEvent("Feature Used",{feature:e,timestamp:new Date().toISOString(),...t})}trackPricingPlanPageVisited(){this.trackEvent("Pricing Plan Page Visited",{timestamp:new Date().toISOString()})}trackPlanButtonClicked(e,t,i){this.trackEvent("Plan Button Clicked",{plan:e,billing_period:t,user_type:i,timestamp:new Date().toISOString()})}trackImageReported(e,t,i){this.trackEvent("Image Reported",{image_id:e,image_type:t,reason:i,timestamp:new Date().toISOString()})}trackGeneratedIconLiked(e,t,i){this.trackEvent("Like Generated Icon",{prompt:e,model:t,timestamp:new Date().toISOString(),...i})}trackGeneratedIconDisliked(e,t,i){this.trackEvent("Dislike Generated Icon",{prompt:e,model:t,timestamp:new Date().toISOString(),...i})}resetUser(){try{t.default.reset()}catch(e){console.error("Error resetting user:",e)}}};e.s(["analytics",0,i],48160);var a=e.i(17539);let o=a.default.PG_WEB_APP_API;async function s(e){let t=await fetch(`${o}/increase_download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to increase download count");return await t.json()}async function r(e){let t=await fetch(`${a.default.PG_WEB_APP_API}/increase_icon_download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error((await t.json()).error||"Failed to increase icon download count");return await t.json()}async function n(e){let t=await fetch(`${o}/download_generate_image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to download generated image");return await t.json()}async function l(e){if(!(await fetch(`${o}/report_picture`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw Error("Failed to report image")}e.s(["downloadGenerateImage",0,n,"increaseDownload",0,s,"increaseIconDownload",0,r,"reportImage",0,l],53625)},52756,30010,46753,e=>{"use strict";e.s(["subscribeToStorageEvents",()=>u,"useUserStore",()=>p],52756);var t=e.i(73222),i=e.i(17539),a=e.i(20015),o=e.i(48160);e.s(["useDownloadStore",()=>c],46753);var s=e.i(53625),r=e.i(87045),n=e.i(14451);let l={free_tier:{dailyLimit:0,monthlyLimit:10,isPaid:!1,useDailyLimits:!1,i18nKey:"user"},paid_tier:{dailyLimit:100,monthlyLimit:1/0,isPaid:!0,useDailyLimits:!0,i18nKey:"paidTier"},free_paid_tier:{dailyLimit:100,monthlyLimit:1/0,isPaid:!0,useDailyLimits:!0,i18nKey:"freePaidTier"},starter_tier:{dailyLimit:100,monthlyLimit:1/0,isPaid:!0,useDailyLimits:!0,i18nKey:"starterTier"},pro_tier:{dailyLimit:500,monthlyLimit:1/0,isPaid:!0,useDailyLimits:!0,i18nKey:"proTier"},pro_plus_tier:{dailyLimit:2e3,monthlyLimit:1/0,isPaid:!0,useDailyLimits:!0,i18nKey:"proPlusTier"},enterprise_tier:{dailyLimit:500,monthlyLimit:1/0,isPaid:!0,useDailyLimits:!0,i18nKey:"enterpriseTier"}};function d(e){return l[e]??l.free_tier}e.s(["getTierConfig",0,d],30010);let c=(0,t.create)((t,a)=>({totalDownload:0,monthlyDownload:0,dailyDownload:0,downloadHistory:[],downloadCredits:0,iconDownloadHistory:[],setDownloadState:e=>t(t=>({totalDownload:e.total_downloaded_count??t.totalDownload,monthlyDownload:e.monthly_downloaded_count??t.monthlyDownload,dailyDownload:e.daily_downloaded_count??t.dailyDownload,downloadHistory:e.download_history||t.downloadHistory,iconDownloadHistory:e.icon_download_history||t.iconDownloadHistory})),clearDownloadState:()=>t(()=>({totalDownload:0,monthlyDownload:0,downloadHistory:[],downloadCredits:0,iconDownloadHistory:[]})),refreshIconDownloadHistory:async()=>{let{email:e}=p.getState();if(e)try{let a=await fetch(`${i.default.PG_WEB_APP_API}/get_user_icons?email=${encodeURIComponent(e)}`),o=await a.json(),s=o?.icon_download_history?.map(e=>e.file_id)||[];t(()=>({iconDownloadHistory:s}))}catch(e){console.error("Error refreshing icon download history:",e)}},increaseDownloadHistory:e=>t(t=>t.downloadHistory.includes(e)?t:{monthlyDownload:t.monthlyDownload+1,dailyDownload:t.dailyDownload+1,totalDownload:t.totalDownload+1,downloadHistory:[...t.downloadHistory,e]}),increaseIconDownloadHistory:e=>t(t=>t.iconDownloadHistory.includes(e)?t:{monthlyDownload:t.monthlyDownload+1,dailyDownload:t.dailyDownload+1,totalDownload:t.totalDownload+1,iconDownloadHistory:[...t.iconDownloadHistory,e]}),decreaseDownloadCredits:()=>t(e=>({downloadCredits:Math.max(0,e.downloadCredits-1)})),isUserReachDownloadLimitation:()=>{let{monthlyDownload:e,dailyDownload:t}=a(),{isAdmin:i,userType:o}=p.getState();if(i)return!1;let s=d(o);return s.useDailyLimits?t>=s.dailyLimit:e>=s.monthlyLimit},isAllowDownload:()=>{let{isAdmin:e,userType:t}=p.getState();return e||d(t).isPaid},isImageInDownloadHistory:e=>{let{downloadHistory:t}=a();return t.includes(e)},isIconInDownloadHistory:e=>{let{iconDownloadHistory:t}=a();return t.includes(e)},getDownloadCredits:()=>{let{monthlyDownload:e,dailyDownload:t}=a(),{isAdmin:i,userType:o}=p.getState();if(i)return"Unlimited";let s=d(o);if(s.useDailyLimits){let e=Math.max(0,s.dailyLimit-t);return`${e} ${n.default.t("credits.dailyDownloadCredits")}`}let r=Math.max(0,s.monthlyLimit-e);return`${r} ${n.default.t("credits.monthlyDownloadCredits")}`},getDownloadCreditsCount:()=>{let{monthlyDownload:e,dailyDownload:t}=a(),{isAdmin:i,userType:o}=p.getState();if(i)return 1/0;let s=d(o);return s.useDailyLimits?Math.max(0,s.dailyLimit-t):Math.max(0,s.monthlyLimit-e)},onDownloadImage:async(t,i="png",l=!1,d=!1,c)=>{let u=a(),{useDialogStore:g}=await e.A(88699),h=p.getState();l&&(t.file_id=t.fileId,t.is_generated_images=l);let f="icon"===t.asset_type||!t.asset_type&&!l&&t.svg_content;if(d)u.isAllowDownload()?f?await m(t,i,c):await y(t,i):f?await w(t,i,c):await v(t,i);else try{if("png"===i&&t.svg_content&&c){let e=c||1024;(0,r.downloadImage)(t,i,e/2,n.default.t)}else(0,r.downloadImage)(t,i,void 0,n.default.t)}catch(e){console.error("Error downloading image:",e)}async function m(e,t,i){let r=a();if(r.isIconInDownloadHistory(e.file_id))return void await S(e,t,i);if(!h.isLoggedIn)return void g.getState().setAuthenticationRequirePopup(!0);if(r.isUserReachDownloadLimitation())return void(r.isAllowDownload()?g.getState().setDailyLimitReachedPopup(!0):g.getState().setDownloadLimitationPopup(!0));try{let a=e.gcs_svg_url||e.svg_url||e.original_url||e.url,n=e.gcs_png_url||e.png_url||(e.svg_url?e.url:void 0);await (0,s.increaseIconDownload)({email:h.email,picture:{file_id:e.file_id,concept:e.concept,style:e.style,url:a,png_url:n}}),await S(e,t,i),o.analytics.trackIconDownload(e.file_id,e.concept,e.style,t,e.svg_url||e.original_url||e.url),r.increaseIconDownloadHistory(e.file_id),r.decreaseDownloadCredits()}catch(e){console.error("Error calling increase_icon_download:",e)}}async function y(e,t){let i=a();if(i.isImageInDownloadHistory(e.file_id))return void await S(e,t);if(!h.isLoggedIn)return void g.getState().setAuthenticationRequirePopup(!0);let r={email:h.email,picture:{fileId:e.file_id}};try{await (0,s.increaseDownload)(r),await S(e,t),o.analytics.trackIllustrationDownload(e.file_id,e.concept,e.style,e.url),i.increaseDownloadHistory(e.file_id),i.decreaseDownloadCredits()}catch(e){console.error("Error calling increase_download:",e)}}async function w(e,t,i){h.isLoggedIn?"svg"===t?g.getState().setUpgradeUserPlanPopup(!0):g.getState().setDialogStore({selectedImageDetail:e,downloadSuccessfullyPopupVisible:!0,isCopyImage:!1,downloadSize:i}):g.getState().setAuthenticationRequirePopup(!0)}async function v(e,t){h.isLoggedIn?"svg"===t?g.getState().setUpgradeUserPlanPopup(!0):g.getState().setDialogStore({selectedImageDetail:e,downloadSuccessfullyPopupVisible:!0,isCopyImage:!1,downloadSize:void 0}):g.getState().setAuthenticationRequirePopup(!0)}async function S(e,t,i){try{(0,r.downloadImage)(e,t,i,n.default.t)}catch(e){console.error("Error downloading:",e)}}},onCopyToClipboard:async(t,i="png",l=!1,d=!1,c)=>{let{useDialogStore:u}
1=await e.A(88699),g=a(),h=p.getState();if(l&&(t.file_id=t.fileId,t.is_generated_images=l),l){try{let e=await (0,s.downloadGenerateImage)({email:h.email,picture:{url:t.url,fileId:t.file_id,alt:null,concept:t.concept,style:t.style,prompt:t.prompt??t.concept}});(0,r.copyToClipboard)(e.data,i,void 0,n.default.t)}catch(e){console.error("Error call download_generate_image:",e)}return}let f="icon"===t.asset_type||!t.asset_type&&t.svg_content;if(d)g.isAllowDownload()?f?await m(t,i,c):await y(t,i):f?await w(t,i,c):await v(t,i);else try{(0,r.copyToClipboard)(t,i,c,n.default.t)}catch(e){console.error("Error copying to clipboard:",e)}async function m(e,t,i){let l=a();if(l.isIconInDownloadHistory(e.file_id))return void(0,r.copyToClipboard)(e,t,i,n.default.t);if(!h.isLoggedIn)return void u.getState().setAuthenticationRequirePopup(!0);if(l.isUserReachDownloadLimitation())return void(l.isAllowDownload()?u.getState().setDailyLimitReachedPopup(!0):u.getState().setDownloadLimitationPopup(!0));try{let a=e.gcs_svg_url||e.svg_url||e.original_url||e.url,d=e.gcs_png_url||e.png_url||(e.svg_url?e.url:void 0);await (0,s.increaseIconDownload)({email:h.email,picture:{file_id:e.file_id,concept:e.concept,style:e.style,url:a,png_url:d}}),(0,r.copyToClipboard)(e,t,i,n.default.t),o.analytics.trackEvent("Icon Copied to Clipboard",{icon_id:e.file_id,icon_name:e.concept,style:e.style,format:t,timestamp:new Date().toISOString()}),l.increaseIconDownloadHistory(e.file_id),l.decreaseDownloadCredits()}catch(e){console.error("Error calling increase_icon_download:",e)}}async function y(e,t){let i=a();if(i.isImageInDownloadHistory(e.file_id))return void(0,r.copyToClipboard)(e,t,void 0,n.default.t);if(!h.isLoggedIn)return void u.getState().setAuthenticationRequirePopup(!0);try{let a=await (0,s.increaseDownload)({email:h.email,picture:{fileId:e.file_id}}),l=a.data?{...e,...a.data}:e;(0,r.copyToClipboard)(l,t,void 0,n.default.t),o.analytics.trackEvent("Illustration Copied to Clipboard",{illustration_id:e.file_id,illustration_name:e.concept,style:e.style,format:t,timestamp:new Date().toISOString()}),i.increaseDownloadHistory(e.file_id),i.decreaseDownloadCredits()}catch(e){console.error("Error calling increase_download:",e)}}async function w(e,t,i){h.isLoggedIn?"svg"===t?u.getState().setUpgradeUserPlanPopup(!0):u.getState().setDialogStore({selectedImageDetail:e,downloadSuccessfullyPopupVisible:!0,isCopyImage:!0,downloadSize:i}):u.getState().setAuthenticationRequirePopup(!0)}async function v(e,t){h.isLoggedIn?"svg"===t?u.getState().setUpgradeUserPlanPopup(!0):u.getState().setDialogStore({selectedImageDetail:e,downloadSuccessfullyPopupVisible:!0,isCopyImage:!0,downloadSize:void 0}):u.getState().setAuthenticationRequirePopup(!0)}},reportImage:async t=>{let{mappedStyleName:i}=await e.A(14917),{useDialogStore:a}=await e.A(88699),r=p.getState();if(!r.isLoggedIn)return void a.getState().setAuthenticationRequirePopup(!0);try{await (0,s.reportImage)({email:r.email,fileId:t.file_id}),o.analytics.trackImageReported(t.file_id,t.svg_content?"icon":"illustration");let e=`(${i(t.style)}) - ${t.concept}`;a.getState().setReportImagePopup(!0,{filename:e,url:t.url})}catch(e){console.error("Error reporting image:",e)}}})),p=(0,t.create)((e,t)=>({uid:"",displayName:"Default User",email:"",userType:"none",isAdmin:!1,photoUrl:"/pictographic_128.png",sessionId:void 0,subscriptionEndDate:"",imagesGenerationCredits:0,isEndedTrial:!1,favorites:[],isLoadingUserData:!0,isLoggedIn:!1,setUser:(t,i,a,o)=>e(()=>({uid:t||"",email:i||"",displayName:a||"",photoUrl:o||"/pictographic_128.png",isLoggedIn:!!(t||i)})),setUserState:t=>{e(e=>{let i=t.uid||e.uid,o=t.email||e.email,s=t.sessionId||e.sessionId;return o&&!s&&(s=(0,a.generateUserSessionId)(o)),{...e,...t,uid:i,displayName:t.display_name||e.displayName,email:o,sessionId:s,userType:t.user_type||e.userType,isAdmin:t.is_admin??e.isAdmin,photoUrl:t.photo_url||e.photoUrl,subscriptionEndDate:t.subscription_end_date||e.subscriptionEndDate,imagesGenerationCredits:t.images_generation_credits??e.imagesGenerationCredits,isEndedTrial:t.is_ended_trial??e.isEndedTrial,favorites:t.favorites||e.favorites,isLoggedIn:!!(i||o)}}),c.getState().setDownloadState(t)},signOut:()=>{localStorage.removeItem("user"),localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token"),t().clearUser()},loginUser:e=>{localStorage.setItem("user",JSON.stringify(e.data)),localStorage.setItem("access_token",e.access_token),localStorage.setItem("refresh_token",e.refresh_token),t().setUserState(e.data)},clearUser:()=>{localStorage.removeItem("generate_prompt"),c.getState().clearDownloadState(),e(()=>({uid:"",displayName:"Default User",email:"",userType:"none",isAdmin:!1,photoUrl:"/pictographic_128.png",sessionId:void 0,subscriptionEndDate:"",imagesGenerationCredits:0,isEndedTrial:!1,favorites:[],isLoadingUserData:!1,isLoggedIn:!1}))},fetchUserInfo:async s=>{let{setUserState:r,clearUser:n}=t(),l=i.default.PG_WEB_APP_API;return new Promise(async(d,c)=>{try{let c=s;if(!c){let t=localStorage.getItem("user");if(!t){n(),e({isLoadingUserData:!1}),d();return}let i=JSON.parse(t);c=i?.email}if(!c){t().signOut(),e({isLoadingUserData:!1}),d();return}let[p,u]=await Promise.all([fetch(`${l}/me?email=${encodeURIComponent(c)}`),fetch(`${i.default.PG_WEB_APP_API}/get_user_icons?email=${encodeURIComponent(c)}`)]),g=await p.json(),h=await u.json();if(g?.data){let e={uid:g.data.uid,photo_url:g.data.photo_url||"/pictographic_128.png",email:g.data.email,display_name:g.data.display_name,created_time:g.data.created_time,monthly_downloaded_count:g.data.monthly_downloaded_count,daily_downloaded_count:g.data.daily_downloaded_count,total_downloaded_count:g.data.total_downloaded_count,user_type:"free_paid_tier"===g.data.user_type?"paid_tier":g.data.user_type,download_history:g.data.download_history||[],sign_up_origin:g.data.sign_up_origin,images_generation_credits:g.data.images_generation_credits,is_read_guide:g.data.is_read_guide,is_ended_trial:g.data.is_ended_trial,is_admin:g.data.is_admin,generated_images:g.data.generated_images||[],is_giveaway:g.data.is_giveaway,agree_term_of_service:g.data.agree_term_of_service,subscription_end_date:g.data.subscription_end_date,favorites:g.data.favorites||[],sessionId:(0,a.generateUserSessionId)(g.data.email),icon_download_history:h?.icon_download_history?.map(e=>e.file_id)||[]};localStorage.setItem("user",JSON.stringify(e)),r(e),o.analytics.identifyUser(e.email,{email:e.email,user_type:e.user_type,name:e.display_name,signup_date:e.created_time,subscription_status:"free_tier"===e.user_type?"free":"paid"}),window.dispatchEvent(new Event("userDataChanged")),d()}else throw Error("Invalid response from API")}catch(e){console.error("Error fetchUserInfo():",e),t().signOut(),window.dispatchEvent(new Event("userDataChanged")),c(e)}finally{e({isLoadingUserData:!1})}})},decreaseGenerationCredits:(t=1)=>e(e=>({imagesGenerationCredits:e.imagesGenerationCredits-t})),isFavorite:e=>{let{favorites:i}=t();return i?.includes(e)??!1},addToFavorites:t=>e(e=>({favorites:[...e.favorites,t]})),removeFromFavorites:t=>e(e=>({favorites:e.favorites.filter(e=>e!==t)}))}));function u(){let e=e=>{if("access_token"===e.key)if(e.newValue){let e=localStorage.getItem("user");if(e)try{let t=JSON.parse(e);p.getState().setUserState(t)}catch{}}else p.getState().clearUser();if("user"===e.key)if(e.newValue)try{let t=JSON.parse(e.newValue);p.getState().setUserState(t)}catch{}else p.getState().clearUser()};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.