PageSourceSearch

https://shapewords.fun/assets/feature-export-renderer-B-OHjZcN.js

js shapewords.fun collected 2026-10-02 01:54:28 UTC 58,825 bytes, 5 lines download raw bytes

vendor: 22,235 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jspdf.es.min-CL2-D7lJ.js","assets/rolldown-runtime-COnpUsM8.js","assets/account-core-PbODbfoQ.js"])))=>i.map(i=>d[i]);
2import{Gt as e,V as t,Xt as n,qt as r}from"./feature-3d-AcrIrn_D.js";var i=e=>typeof e==`string`,a=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},o=e=>e==null?``:String(e),s=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},c=/###/g,l=e=>e&&e.includes(`###`)?e.replace(c,`.`):e,u=e=>!e||i(e),d=(e,t,n)=>{let r=i(t)?t.split(`.`):t,a=0;for(;a<r.length-1;){if(u(e))return{};let t=l(r[a]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return u(e)?{}:{obj:e,k:l(r[a])}},f=(e,t,n)=>{let{obj:r,k:i}=d(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=d(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=d(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},p=(e,t,n,r)=>{let{obj:i,k:a}=d(e,t,Object);i[a]=i[a]||[],i[a].push(n)},m=(e,t)=>{let{obj:n,k:r}=d(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},h=(e,t,n)=>{let r=m(e,n);return r===void 0?m(t,n):r},g=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?i(e[r])||e[r]instanceof String||i(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):g(e[r],t[r],n):e[r]=t[r]);return e},_=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),v={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},y=e=>i(e)?e.replace(/[&<>"'\/]/g,e=>v[e]):e,b=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},x=[` `,`,`,`?`,`!`,`;`],S=new b(20),C=(e,t,n)=>{t||=``,n||=``;let r=x.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=S.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},w=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},T=e=>e?.replace(/_/g,`-`),E={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)}},D=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||E,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,n,r){return r&&!this.debug?null:(i(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},O=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},k=class extends O{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.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let a=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,o=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,s;e.includes(`.`)?s=e.split(`.`):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):i(n)&&a?s.push(...n.split(a)):s.push(n)));let c=m(this.data,s);return!c&&!t&&!n&&e.includes(`.`)&&(e=s[0],t=s[1],n=s.slice(2).join(`.`)),c||!o||!i(n)?c:w(this.data?.[e]?.[t],n,a)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),f(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(i(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=m(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?g(s,n,i):s={...s,...n},f(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},ee={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},A=Symbol(`i18next/PATH_KEY`);function te(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===A?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function j(e,t){let{[A]:n}=e(te()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var M=e=>!i(e)&&typeof e!=`boolean`&&typeof e!=`number`,ne=class e extends O{constructor(e,t={}){super(),s([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=D.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=M(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,a=t.ns||this.options.defaultNS||[],o=n&&e.includes(n),s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!C(e,n,r);if(o&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i(a)?[a]:a};let o=e.split(n);(n!==r||n===r&&this.options.ns.includes(o[0]))&&(a=o.shift()),e=o.join(r)}return{key:e,namespaces:i(a)?[a]:a}}translate(t,n,r){let a=typeof n==`object`?{...n}:n;if(typeof a!=`object`&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a==`object`&&(a={...a}),a||={},t==null)return``;typeof t==`function`&&(t=j(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?j(e,{...this.options,...a}):String(e));let o=a.returnDetails===void 0?this.options.returnDetails:a.returnDetails,s=a.keySeparator===void 0?this.options.keySeparator:a.keySeparator,{key:c,namespaces:l}=this.extractFromKey(t[t.length-1],a),u=l[l.length-1],d=a.nsSeparator===void 0?this.options.nsSeparator:a.nsSeparator;d===void 0&&(d=`:`);let f=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()===`cimode`)return p?o?{res:`${u}${d}${c}`,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${d}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:c;let m=this.resolve(t,a),h=m?.res,g=m?.usedKey||c,_=m?.exactUsedKey||c,v=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=a.joinArrays===void 0?this.options.joinArrays:a.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=a.count!==void 0&&!i(a.count),S=e.hasDefaultValue(a),C=x?this.pluralResolver.getSuffix(f,a.count,a):``,w=a.ordinal&&x?this.pluralResolver.getSuffix(f,a.count,{ordinal:!1}):``,T=x&&!a.ordinal&&a.count===0,E=T&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${C}`]||a[`defaultValue${w}`]||a.defaultValue,D=h;b&&!h&&S&&(D=E);let O=M(D),k=Object.prototype.toString.apply(D);if(b&&D&&O&&!v.includes(k)&&!(i(y)&&Array.isArray(D))){if(!a.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(g,D,{...a,ns:l}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(m.res=e,m.usedParams=this.getUsedParamsDetails(a),m):e}if(s){let e=Array.isArray(D),t=e?[]:{},n=e?_:g;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${s}${e}`;S&&!h?t[e]=this.translate(r,{...a,defaultValue:M(E)?E[e]:void 0,joinArrays:!1,ns:l}):t[e]=this.translate(r,{...a,joinArrays:!1,ns:l}),t[e]===r&&(t[e]=D[e])}h=t}}else if(b&&i(y)&&Array.isArray(h))h=h.join(y),h&&=this.extendTranslation(h,t,a,r);else{let e=!1,n=!1;!this.isValidLookup(h)&&S&&(e=!0,h=E),this.isValidLookup(h)||(n=!0,h=c);let i=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:h,o=S&&E!==h&&this.options.updateMissing;if(n||e||o){if(this.logger.log(o?`updateKey`:`missingKey`,f,u,c,o?E:h),s){let e=this.resolve(c,{...a,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);let n=(e,t,n)=>{let r=S&&n!==h?n:i;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,t,r,o,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,u,t,r,o,a),this.emit(`missingKey`,e,u,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,a);T&&a[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],c+t,a[`defaultValue${t}`]||E)})}):n(e,c,E))}h=this.extendTranslation(h,t,a,m,r),n&&h===c&&this.options.appendNamespaceToMissingKey&&(h=`${u}${d}${c}`),(n||e)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${c}`:c,e?h:void 0,a))}return o?(m.res=h,m.usedParams=this.getUsedParamsDetails(a),m):h}extendTranslation(e,t,n,r,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let o=i(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=n.replace&&!i(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),o){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;s<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>a?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,s=i(o)?[o]:o;return e!=null&&s?.length&&n.applyPostProcessor!==!1&&(e=ee.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,a,o,s;return i(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?j(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let c=this.extractFromKey(e,t),l=c.key;r=l;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let d=t.count!==void 0&&!i(t.count),f=d&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(i(t.context)||typeof t.context==`number`)&&t.context!==``,m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(s=e,!this.checkedLoadedFor[`${m[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${m[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${m.join(`, `)}" won't get resolved as namespace "${s}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),m.forEach(r=>{if(this.isValidLookup(n))return;o=r;let i=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,l,r,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(a)&&i.push(l+e.replace(a,this.options.pluralSeparator)),i.push(l+e),f&&i.push(l+n)),p){let r=`${l}${this.options.contextSeparator||`_`}${t.context}`;i.push(r),d&&(t.ordinal&&e.startsWith(a)&&i.push(r+e.replace(a,this.options.pluralSeparator)),i.push(r+e),f&&i.push(r+n))}}let s;for(;s=i.pop();)this.isValidLookup(n)||(a=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!i(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},re=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=D.create(`languageUtils`)}getScriptPartFromCode(e){if(e=T(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=T(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(i(e)&&e.includes(`-`)){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.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),i(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],a=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return i(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&a(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&a(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&a(this.getLanguagePartFromCode(e))):i(e)&&a(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||a(this.formatLanguageCode(e))}),r}},ie={zero:0,one:1,two:2,few:3,many:4,other:5},ae={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},oe=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=D.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=T(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),ae;if(!e.match(/-|_/))return ae;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>ie[e]-ie[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},se=(e,t,n,r=`.`,a=!0)=>{let o=h(e,t,n);return!o&&a&&i(n)&&(o=w(e,n,r),o===void 0&&(o=w(t,n,r))),o},N=e=>e.replace(/\$/g,`$$$$`),ce=class{constructor(e={}){this.logger=D.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=t===void 0?y:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?_(i):a||`{{`,this.suffix=o?_(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?_(d):f||_(`$t(`),this.nestingSuffix=p?_(p):m||_(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=v===void 0?!1:v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let a,s,c,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(!e.includes(this.formatSeparator)){let i=se(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(se(t,l,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let d=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r?.interpolation?.ski
2pOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>N(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?N(this.escape(e)):N(e)}].forEach(t=>{for(c=0;a=t.regex.exec(e);){let n=a[1].trim();if(s=u(n),s===void 0)if(typeof d==`function`){let t=d(e,a,r);s=i(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))s=``;else if(f){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),s=``;else !i(s)&&!this.useRawValueToEscape&&(s=o(s));let l=t.safeValue(s);if(e=e.replace(a[0],l),f?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,a,s,c=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${_(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,s);let a=i.match(/'/g),o=i.match(/"/g);((a?.length??0)%2==0&&!o||(o?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{s=JSON.parse(i),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let l=[];s={...n},s=s.replace&&!i(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(l=r[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),a=t(c.call(this,r[1].trim(),s),s),a&&r[0]===e&&!i(a))return a;i(a)||(a=o(a)),a||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),l.length&&(a=l.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),a.trim())),e=e.replace(r[0],a),this.regexp.lastIndex=0}return e}},le=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},ue=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(T(r),i),t[o]=s),s(n)}},de=e=>(t,n,r)=>e(T(n),r)(t),fe=class{constructor(e={}){this.logger=D.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?ue:de;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ue(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=le(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},pe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},me=class extends O{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=D.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};
vendor: 4,554 bytes, line 2
2return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{p(n.loaded,[i],a),pe(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();i(e)&&(e=this.languageUtils.toResolveHierarchy(e)),i(t)&&(t=[t]);let a=this.queueLoad(e,t,n,r);if(!a.toLoad.length)return a.pending.length||r(),null;a.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},P=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,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 t={};if(typeof e[1]==`object`&&(t=e[1]),i(e[1])&&(t.defaultValue=e[1]),i(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),he=e=>(i(e.ns)&&(e.ns=[e.ns]),i(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),i(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),F=()=>{},ge=e=>
vendor: 7,503 bytes, line 2
2{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},I=class e extends O{constructor(e={},t){if(super(),this.options=he(e),this.services={},this.logger=D,this.modules={external:[]},ge(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&&(i(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=P();this.options={...n,...this.options,...he(e)},this.options.interpolation={...n.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=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?D.init(r(this.modules.logger),this.options):D.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:fe;let t=new re(this.options);this.store=new k(this.options.resources,this.options);let n=this.services;n.logger=D,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new oe(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new ce(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new me(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new ne(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,t||=F,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=a(),s=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),o.resolve(n),t(e,n)};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?s():setTimeout(s,0),o}loadResources(e,t=F){let n=t,r=i(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=a();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=F,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}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 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`&&ee.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`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=a();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},s=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=i(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(i(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{o(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=j(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=j(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=j(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return i(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}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;
2if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=a();return this.options.ns?(i(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=a();i(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(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{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new re(P());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=F){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new k(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...P().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new ce(n)}return a.translator=new ne(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();I.createInstance,I.dir,I.init,I.loadResources,I.reloadResources,I.use,I.changeLanguage,I.getFixedT,I.t,I.exists,I.setDefaultNamespace,I.hasLoadedNamespace,I.loadNamespaces,I.loadLanguages;function _e(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=/Safari/i.test(e)&&!/Chrome|Chromium|CriOS|FxiOS|Edg|OPR|Android/i.test(e),n=/iPad|iPhone|iPod/i.test(e);return t||n}function ve(){if(!_e())return null;let e=window.open(``,`_blank`);return e?(e.document.title=`shapewords export`,e.document.body.style.margin=`0`,e.document.body.style.fontFamily=`system-ui, -apple-system, BlinkMacSystemFont, sans-serif`,e.document.body.style.display=`grid`,e.document.body.style.minHeight=`100vh`,e.document.body.style.placeItems=`center`,e.document.body.style.color=`#475569`,e.document.body.textContent=`Preparing export...`,e):null}function ye(e){!e||e.closed||e.close()}function L(e,t,n){let r=URL.createObjectURL(e);if(n&&!n.closed){try{n.document.title=t,n.document.body.style.margin=`0`,n.document.body.style.fontFamily=`system-ui, -apple-system, BlinkMacSystemFont, sans-serif`,n.document.body.style.display=`grid`,n.document.body.style.minHeight=`100vh`,n.document.body.style.placeItems=`center`,n.document.body.style.color=`#475569`,n.document.body.textContent=``;let e=n.document.createElement(`a`);
2e.href=r,e.download=t,e.textContent=`Download export`,e.style.border=`1px solid #d7c37a`,e.style.borderRadius=`10px`,e.style.background=`#123d2b`,e.style.color=`#fff`,e.style.padding=`10px 14px`,e.style.fontSize=`14px`,e.style.fontWeight=`600`,e.style.textDecoration=`none`,n.document.body.appendChild(e),e.click()}catch{n.location.href=r}window.setTimeout(()=>URL.revokeObjectURL(r),6e4);return}let i=document.createElement(`a`);i.href=r,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}var be=new Map,xe=new Map;function Se(e){let t=be.get(e);if(t)return t;let n=e.split(/\s+/).map(e=>Number(e)).filter(Number.isFinite);return be.set(e,n),n}function Ce(e,t){let n=Number(t)||400,r=Se(e);return r.length===0?!0:r.length===1?r[0]===n:n>=Math.min(...r)&&n<=Math.max(...r)}function we(e,t){let n=Number(t)||400,r=Se(e);if(r.length===0)return 0;if(r.length===1)return Math.abs(r[0]-n);let i=Math.min(...r),a=Math.max(...r);return n>=i&&n<=a?0:Math.min(Math.abs(n-i),Math.abs(n-a))}function Te(e){let t=e.trim().match(/^U\+([0-9A-F?]+)(?:-([0-9A-F]+))?$/i);if(!t)return null;let[,n,r]=t;if(n.includes(`?`)){let e=Number.parseInt(n.replace(/\?/g,`0`),16),t=Number.parseInt(n.replace(/\?/g,`F`),16);return Number.isFinite(e)&&Number.isFinite(t)?[e,t]:null}let i=Number.parseInt(n,16),a=r?Number.parseInt(r,16):i;return Number.isFinite(i)&&Number.isFinite(a)?[i,a]:null}function Ee(e){if(!e)return[];let t=xe.get(e);if(t)return t;let n=e.split(`,`).map(Te).filter(e=>!!e);return xe.set(e,n),n}function R(e,t){let n=Ee(e.unicodeRange);return n.length===0?!0:n.some(([e,n])=>t>=e&&t<=n)}function De(e,t){let n=Array.from(t).filter(e=>!/\s/.test(e)).map(e=>e.codePointAt(0)).filter(e=>e!==void 0);return n.length===0?!0:n.every(t=>R(e,t))}function Oe(e,t){let n=ke(e??[]);if(n.length===0)return!1;let r=Array.from(new Set(Array.from(t).filter(e=>!/\s/.test(e)).map(e=>e.codePointAt(0)).filter(e=>e!==void 0)));return r.length===0?!0:r.every(e=>n.some(t=>R(t,e)))}function ke(e){let t=new Set;return e.filter(e=>{let n=z(e);return t.has(n)?!1:(t.add(n),!0)})}function z(e){return`${e.url}|${e.weight}|${e.style}|${e.unicodeRange??``}`}function Ae(e,t,n=`400`,r=`normal`){let i=ke(e??[]).filter(e=>e.style===r).sort((e,t)=>we(e.weight,n)-we(t.weight,n));if(i.length===0)return[];let a=i.filter(e=>Ce(e.weight,n)),o=a.length>0?a:i,s=Array.from(new Set(Array.from(t).filter(e=>!/\s/.test(e)).map(e=>e.codePointAt(0)).filter(e=>e!==void 0)));if(s.length===0)return o;let c=[],l=new Set,u=e=>{let t=z(e);l.has(t)||(l.add(t),c.push(e))},d=o.filter(e=>!e.unicodeRange);for(let e of d)u(e);for(let e of s){let t=o.find(t=>R(t,e));t&&u(t)}if(c.length>0)return c;let f=o.filter(e=>De(e,t));return f.length>0?f:o}var B=`http://www.w3.org/2000/svg`,V=new Map,H=1200,U=630,W=28,G={sq:{scale:2,jpegQuality:.84,pdfCompression:`FAST`},hq:{scale:4,jpegQuality:.92,pdfCompression:`MEDIUM`}},je={a4:{width:210,height:297},a3:{width:297,height:420},letter:{width:215.9,height:279.4},poster:{width:500,height:700}};function Me(){return document.querySelector(`#word-cloud-svg`)}function Ne(){let e=window.location.hostname;return!e||e===`localhost`||e===`127.0.0.1`?`shapewords.fun`:e.replace(/^www\./i,``)}function Pe(){if(t.getState().exportHideWatermark)return null;let e=Ne(),n=I.t(`export.watermark`,{site:e,defaultValue:`source: ${e}`});return typeof n==`string`&&n.trim()?n:`source: ${e}`}function Fe(e,t,n,r,i,a){let o=Pe();if(!o)return;let s=Math.min(i,a),c=Math.max(8,Math.round(s*.02)),l=Math.max(10,Math.round(s*.025)),u=document.createElementNS(B,`text`);u.setAttribute(`x`,String(n+i-c)),u.setAttribute(`y`,String(r+a-c)),u.setAttribute(`text-anchor`,`end`),u.setAttribute(`font-family`,`Arial, 'Helvetica Neue', Helvetica, sans-serif`),u.setAttribute(`font-size`,String(l)),u.setAttribute(`font-weight`,`600`),u.setAttribute(`fill`,t===`dark`?`#e2e8f0`:`#334155`),u.setAttribute(`fill-opacity`,`0.62`),u.setAttribute(`paint-order`,`stroke`),u.setAttribute(`stroke`,t===`dark`?`#0f172a`:`#ffffff`),u.setAttribute(`stroke-width`,String(Math.max(1,l*.12))),u.setAttribute(`stroke-opacity`,`0.35`),u.setAttribute(`stroke-linejoin`,`round`),u.setAttribute(`data-export-watermark`,`true`),u.textContent=o,e.appendChild(u)}function K(e){return String(e).padStart(2,`0`)}function Ie(e=new Date){return`${e.getFullYear()}-${K(e.getMonth()+1)}-${K(e.getDate())}_${K(e.getHours())}-${K(e.getMinutes())}-${K(e.getSeconds())}`}function q(e,t){let n=t?`_${t.replace(/[^a-z0-9_-]+/gi,`-`).replace(/^-+|-+$/g,``)}`:``;return`${Ne()}_${Ie()}${n}.${e}`}function J(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r){let i=t.subarray(e,e+r);n+=String.fromCharCode(...i)}return btoa(n)}function Le(e){return e.split(`,`)[0].trim().replace(/^["']|["']$/g,``)}function Re(e){return/^\d+$/.test(e)?e:e===`bold`?`700`:e===`normal`||!e?`400`:String(Math.max(1,Math.round(Number(e)||400)))}function ze(e){return e===`italic`||e===`oblique`?`italic`:`normal`}function Be(e){let t=new Map;
2return e.querySelectorAll(`text`).forEach(e=>{let n=getComputedStyle(e),r=Le(e.style.fontFamily||e.getAttribute(`font-family`)||n.fontFamily);if(!r)return;let i={family:r,weight:Re(e.style.fontWeight||e.getAttribute(`font-weight`)||n.fontWeight),style:ze(e.style.fontStyle||e.getAttribute(`font-style`)||n.fontStyle),text:e.textContent?.trim()??``},a=`${i.family}|${i.weight}|${i.style}`,o=t.get(a);o?o.text=o.text?`${o.text} ${i.text}`.trim():i.text:t.set(a,i)}),[...t.values()]}function Ve(e,t){return t.headers.get(`content-type`)||(e.includes(`.woff2`)?`font/woff2`:e.includes(`.woff`)?`font/woff`:e.includes(`.otf`)?`font/otf`:e.includes(`.ttf`)?`font/ttf`:`application/octet-stream`)}function He(e){return e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}function Ue(e,t){let n=e.fontAssets??[];if(n.length===0)return[];let r=new Map;return t.forEach(t=>{let i=Ae(n,t.text||e.previewText,t.weight,t.style);(i.length>0?i:n).forEach(e=>{r.set(z(e),e)})}),r.size>0?[...r.values()]:n}function We(e,t){return t.map(t=>[`@font-face {`,`  font-family: '${He(e.family)}';`,`  font-style: ${t.style};`,`  font-weight: ${t.weight};`,`  font-display: swap;`,`  src: url(${t.url}) format('${t.format}');`,t.unicodeRange?`  unicode-range: ${t.unicodeRange};`:``,`}`].filter(Boolean).join(`
3`)).join(`
4`)}async function Ge(e,t){let n=e;return await Promise.all(t.map(async e=>{let t=await fetch(e.url);if(!t.ok)return;let r=Ve(e.url,t),i=J(await t.arrayBuffer());n=n.replaceAll(e.url,`data:${r};base64,${i}`)})),n}function Ke(e){let t=new Map;return e.forEach(e=>{t.set(e.family,[...t.get(e.family)??[],e])}),t}function qe(e,t){let n=t.length>0?t:[{family:e,weight:`400`,style:`normal`}],r=n.some(e=>e.style===`italic`),i=[...new Set(n.map(e=>r?`${e.style===`italic`?1:0},${e.weight}`:e.weight))].sort(),a=r?`ital,wght`:`wght`,o=`${e.trim()}:${a}@${i.join(`;`)}`,s=new URL(`https://fonts.googleapis.com/css2`);return s.searchParams.set(`family`,o),s.searchParams.set(`display`,`swap`),s.toString()}function Je(e,t){return`${e}|${t.map(e=>
4`${e.weight}:${e.style}:${e.text}`).sort().join(`,`)}`}async function Ye(e,t){let n=Je(e,t),i=V.get(n);if(i)return i;let a=(async()=>{let n=r(e);if(n.fontAssets?.length){let e=Ue(n,t);return Ge(We(n,e),e)}let i=qe(e,t),a=await fetch(i);if(!a.ok)return``;let o=await a.text(),s=[...new Set([...o.matchAll(/url\(([^)]+)\)/g)].map(e=>e[1].replace(/^["']|["']$/g,``)))];return await Promise.all(s.map(async e=>{let t=await fetch(e);if(!t.ok)return;let n=Ve(e,t),r=J(await t.arrayBuffer());o=o.replaceAll(e,`data:${n};base64,${r}`)})),o})();V.set(n,a);try{return await a}catch{return V.delete(n),``}}async function Xe(t){return await e(t.map(e=>e.family)),(await Promise.all([...Ke(t).entries()].map(([e,t])=>Ye(e,t)))).filter(Boolean).join(`
5`)}function Ze(e){let t=e.querySelector(`defs`);if(t)return t;let n=document.createElementNS(B,`defs`);return e.insertBefore(n,e.firstChild),n}function Qe(e){e.querySelectorAll(`style`).forEach(e=>{e.textContent?.includes(`@font-face`)&&e.remove()})}function $e(e,t){if(!t)return;let n=Ze(e),r=document.createElementNS(B,`style`);r.setAttribute(`type`,`text/css`),r.textContent=t,n.insertBefore(r,n.firstChild)}async function et(e){let t=[...e.querySelectorAll(`image[data-emoji-asset="twemoji"]`)];await Promise.all(t.map(async e=>{let t=e.getAttribute(`href`)||e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`);if(!(!t||t.startsWith(`data:`)))try{let n=await fetch(t);if(!n.ok)return;let r=J(await n.arrayBuffer());e.setAttribute(`href`,`data:image/svg+xml;base64,${r}`)}catch{}}))}function tt(e,t){let n=[e,...e.querySelectorAll(`*`)],r=[t,...t.querySelectorAll(`*`)],i=[`cursor`,`dominant-baseline`,`fill`,`fill-opacity`,`font-family`,`font-size`,`font-style`,`font-weight`,`opacity`,`stroke`,`stroke-dasharray`,`stroke-linecap`,`stroke-linejoin`,`stroke-opacity`,`stroke-width`,`text-anchor`];n.forEach((e,t)=>{let n=r[t];if(!n)return;let a=getComputedStyle(e);i.forEach(e=>{let t=a.getPropertyValue(e);t&&n.style.setProperty(e,t)})})}function nt(e){e.querySelectorAll(`[data-word-appear="true"]`).forEach(e=>{e instanceof SVGElement&&(e.style.setProperty(`animation`,`none`),e.style.setProperty(`opacity`,`1`),e.removeAttribute(`data-word-appear`))})}async function rt(){`fonts`in document&&await document.fonts.ready}async function Y(e,t={}){let n=Me();if(!n)return null;await rt();let r=n.cloneNode(!0),i=n.getAttribute(`width`)||`800`,a=n.getAttribute(`height`)||`600`,o=Number.parseFloat(n.getAttribute(`data-pan-x`)||`0`)||0,s=Number.parseFloat(n.getAttribute(`data-pan-y`)||`0`)||0,c=Number.parseFloat(i)||800,l=Number.parseFloat(a)||600,u=Be(n),d=t.embedFonts===!1?``:await Xe(u);if(r.removeAttribute(`style`),r.removeAttribute(`data-pan-x`),r.removeAttribute(`data-pan-y`),r.setAttribute(`xmlns`,B),r.setAttribute(`width`,i),r.setAttribute(`height`,a),r.setAttribute(`viewBox`,`${o} ${s} ${c} ${l}`),tt(n,r),nt(r),$e(r,d),await et(r),t.embedFonts===!1&&Qe(r),e!==`transparent`){let t=document.createElementNS(B,`rect`);t.setAttribute(`x`,String(o)),t.setAttribute(`y`,String(s)),t.setAttribute(`width`,i),t.setAttribute(`height`,a),t.setAttribute(`fill`,e===`white`?`#ffffff`:`#0f172a`),r.insertBefore(t,r.firstChild)}return r.querySelectorAll(`[data-export-ignore="true"]`).forEach(e=>e.remove()),Fe(r,e,o,s,c,l),r}function X(){return!_e()}function Z(e){return new XMLSerializer().serializeToString(e)}function Q(e,t,n){return new Promise((r,i)=>{e.toBlob(e=>{e?r(e):i(Error(`Unable to render export image`))},t,n)})}async function $(e,t,n){let r=G[t],i=parseInt(e.getAttribute(`width`)||`800`)*r.scale,a=parseInt(e.getAttribute(`height`)||`600`)*r.scale,o=Z(e),s=new Blob([o],{type:`image/svg+xml;charset=utf-8`}),c=URL.createObjectURL(s),l=document.createElement(`canvas`);l.width=i,l.height=a;let u=l.getContext(`2d`);u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=t===`hq`?`high`:`medium`;let d=new Image;d.crossOrigin=`anonymous`;try{await new Promise((e,t)=>{d.onload=()=>{n===`transparent`?u.clearRect(0,0,i,a):(u.fillStyle=n===`white`?`#ffffff`:`#0f172a`,u.fillRect(0,0,i,a)),u.drawImage(d,0,0,i,a),e()},d.onerror=()=>t(Error(`Unable to load export SVG`)),d.src=c})}finally{URL.revokeObjectURL(c)}return l}async function it(e,t){let n=parseInt(e.getAttribute(`width`)||`800`),r=parseInt(e.getAttribute(`height`)||`600`),i=Z(e),a=new Blob([i],{type:`image/svg+xml;charset=utf-8`}),o=URL.createObjectURL(a),s=document.createElement(`canvas`);s.width=H,s.height=U;let c=s.getContext(`2d`);c.imageSmoothingEnabled=!0,c.imageSmoothingQuality=`high`;let l=new Image;l.crossOrigin=`anonymous`;try{await new Promise((e,i)=>{l.onload=()=>{c.fillStyle=t===`dark`?`#0f172a`:`#ffffff`,c.fillRect(0,0,H,U);let i=H-W*2,a=U-W*2,o=Math.min(i/n,a/r),s=n*o,u=r*o,d=(H-s)/2,f=(U-u)/2;c.drawImage(l,d,f,s,u),e()},l.onerror=()=>i(Error(`Unable to load social preview SVG`)),l.src=o})}finally{URL.revokeObjectURL(o)}return s}function at(e){return e===`dark`?`dark`:`white`}function ot(e,t,n){let r=document.createElement(`canvas`);r.width=e.width,r.height=e.height;let i=r.getContext(`2d`);return i.fillStyle=t===`dark`?`#0f172a`:`#ffffff`,i.fillRect(0,0,r.width,r.height),i.drawImage(e,0,0),r.toDataURL(`image/jpeg`,G[n].jpegQuality)}function st(e){return{...e,marginMm:Math.max(0,Math.min(80,e.marginMm)),bleedMm:Math.max(0,Math.min(20,e.bleedMm)),safeZoneMm:Math.max(0,Math.min(50,e.safeZoneMm))}}function ct(e,t){let n=je[e.pagePreset];return t.width>=t.height==n.width>=n.height?n:{width:n.height,height:n.width}}function lt(e,t,n,r){let i=Math.max(1.5,r),a=r,o=r,s=t-r,c=n-r;e.setDrawColor(20,20,20),e.setLineWidth(.15),e.line(a-i-6,o,a-i,o),e.line(a,o-i-6,a,o-i),e.line(s+i,o,s+i+6,o),e.line(s,o-i-6,s,o-i),e.line(a-i-6,c,a-i,c),e.line(a,c+i,a,c+i+6),e.line(s+i,c,s+i+6,c),e.line(s,c+i,s,c+i+6)}function ut(e,t,n,r,i){let a=st(r),o=ct(a,t),s=a.bleedMm,c=o.width+s*2,l=o.height+s*2,u=s,d=s,f=a.marginMm+a.safeZoneMm,p=u+f,m=d+f,h=Math.max(1,o.width-f*2),g=Math.max(1,o.height-f*2),_=Math.min(h/t.width,g/t.height),v=t.width*_,y=t.height*_,b=p+(h-v)/2,x=m+(g-y)/2,S=at(n);e.setFillColor(S===`white`?`#ffffff`:`#0f172a`),e.rect(0,0,c,l,`F`);let C=ot(t,S,i);e.addImage(C,`JPEG`,b,x,v,y,void 0,G[i].pdfCompression),a.cropMarks&&lt(e,c,l,s)}async function dt(e,t){let n=X(),r=await Y(t,{embedFonts:n});if(!r)return null;let i;try{i=await $(r,e,t)}catch(r){if(!n)throw r;let a=await Y(t,{embedFonts:!1});if(!a)throw r;i=await $(a,e,t)}return{blob:await Q(i,`image/png`),filename:q(`png`),width:i.width,height:i.height}}async function ft(e=`white`){let t=X(),n=await Y(e,{embedFonts:t});if(!n)return null;let r;try{r=await it(n,e)}catch(n){if(!t)throw n;let i=await Y(e,{embedFonts:!1});if(!i)throw n;r=await it(i,e)}return{blob:await Q(r,`image/png`),filename:q(`png`,`social-preview`),width:r.width,height:r.height}}async function pt(e,t,n){let r=await dt(e,t);r&&L(r.blob,r.filename,n)}async function mt(e,t){let n=X(),r=await Y(t,{embedFonts:n});if(!r)return null;let i;try{i=await $(r,e,t)}catch(r){if(!n)throw r;let a=await Y(t,{embedFonts:!1});if(!a)throw r;i=await $(a,e,t)}return{blob:await Q(i,`image/jpeg`,G[e].jpegQuality),filename:q(`jpg`),width:i.width,height:i.height}}async function ht(e,t,n){let r=await mt(e,t);r&&L(r.blob,r.filename,n)}async function gt(e){let t=await Y(e);
5if(!t)return null;let n=Z(t);return{blob:new Blob([n],{type:`image/svg+xml;charset=utf-8`}),filename:q(`svg`)}}async function _t(e,t){let n=await gt(e);n&&L(n.blob,n.filename,t)}async function vt(e,t,r){let i=at(t),a=X(),o=await Y(i,{embedFonts:a});if(!o)return null;let s;try{s=await $(o,e,i)}catch(t){if(!a)throw t;let n=await Y(i,{embedFonts:!1});if(!n)throw t;s=await $(n,e,i)}if(r?.enabled){let t=st(r),a=ct(t,s),o=t.bleedMm,c=a.width+o*2,l=a.height+o*2,{jsPDF:u}=await n(async()=>{let{jsPDF:e}=await import(`./jspdf.es.min-CL2-D7lJ.js`);return{jsPDF:e}},__vite__mapDeps([0,1,2])),d=new u({orientation:c>l?`landscape`:`portrait`,unit:`mm`,format:[c,l],compress:!0});return ut(d,s,i,t,e),{blob:d.output(`blob`),filename:q(`pdf`,`${t.pagePreset}-print`),width:s.width,height:s.height}}let c=s.width,l=s.height,{jsPDF:u}=await n(async()=>{let{jsPDF:e}=await import(`./jspdf.es.min-CL2-D7lJ.js`);return{jsPDF:e}},__vite__mapDeps([0,1,2])),d=new u({orientation:c>l?`landscape`:`portrait`,unit:`px`,format:[c,l],compress:!0}),f=ot(s,i,e);return d.addImage(f,`JPEG`,0,0,c,l,void 0,G[e].pdfCompression),{blob:d.output(`blob`),filename:q(`pdf`),width:c,height:l}}async function yt(e,t,n,r){let i=await vt(e,t,n);i&&L(i.blob,i.filename,r)}export{yt as a,z as c,ye as d,ve as f,ht as i,Oe as l,I as m,ft as n,pt as o,L as p,gt as r,_t as s,dt as t,Ae as u};

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.