frontend/.pnpm-store/v3/files/e5/d34494772baf2a593c04994174088d11de2aebe84d38e91d57bf454c672a41633486228652008480e2ffebb21703e5644d8009f5c267f8cef154c9f2b4caeb

2 lines
7.0 KiB
Plaintext

"use strict";var e=require("svelte/store"),t=require("deepmerge"),n=require("intl-messageformat");const o={},r=(e,t,n)=>n?(t in o||(o[t]={}),e in o[t]||(o[t][e]=n),n):n,i=(e,t)=>{if(null==t)return;if(t in o&&e in o[t])return o[t][e];const n=O(t);for(let o=0;o<n.length;o++){const i=u(n[o],e);if(i)return r(e,t,i)}};let s;const l=e.writable({});function a(e){return e in s}function u(e,t){if(!a(e))return null;const n=function(e){return s[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const n=t.split(".");let o=e;for(let e=0;e<n.length;e++)if("object"==typeof o){if(e>0){const t=n.slice(e,n.length).join(".");if(t in o){o=o[t];break}}o=o[n[e]]}else o=void 0;return o}(n,t)}function c(e,...n){delete o[e],l.update((o=>(o[e]=t.all([o[e]||{},...n]),o)))}const m=e.derived([l],(([e])=>Object.keys(e)));l.subscribe((e=>s=e));const d={};function f(e){return d[e]}function g(e){return null!=e&&O(e).some((e=>{var t;return null===(t=f(e))||void 0===t?void 0:t.size}))}function p(e,t){const n=Promise.all(t.map((t=>(function(e,t){d[e].delete(t),0===d[e].size&&delete d[e]}(e,t),t().then((e=>e.default||e))))));return n.then((t=>c(e,...t)))}const h={};function w(e){if(!g(e))return e in h?h[e]:Promise.resolve();const t=function(e){return O(e).map((e=>{const t=f(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return h[e]=Promise.all(t.map((([e,t])=>p(e,t)))).then((()=>{if(g(e))return w(e);delete h[e]})),h[e]}function b({locale:e,id:t}){console.warn(`[svelte-i18n] The message "${t}" was not found in "${O(e).join('", "')}".${g(F())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`)}const v={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function y(){return v}const x=e.writable(!1);let M;const j=e.writable(null);function L(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function O(e,t=y().fallbackLocale){const n=L(e);return t?[...new Set([...n,...L(t)])]:n}function F(){return null!=M?M:void 0}j.subscribe((e=>{M=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const T={...j,set:e=>{if(e&&function(e){if(null==e)return;const t=O(e);for(let e=0;e<t.length;e++){const n=t[e];if(a(n))return n}}(e)&&g(e)){const{loadingDelay:t}=y();let n;return"undefined"!=typeof window&&null!=F()&&t?n=window.setTimeout((()=>x.set(!0)),t):x.set(!0),w(e).then((()=>{j.set(e)})).finally((()=>{clearTimeout(n),x.set(!1)}))}return j.set(e)}},$=(e,t)=>{const n=e.split("&").find((e=>0===e.indexOf(`${t}=`)));return n?n.split("=").pop():null},k=(e,t)=>{const n=t.exec(e);return n&&n[1]||null},D=e=>{const t=Object.create(null);return n=>{const o=JSON.stringify(n);return o in t?t[o]:t[o]=e(n)}},E=(e,t)=>{const{formats:n}=y();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},N=D((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=E("number",t)),new Intl.NumberFormat(e,n)})),S=D((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=E("date",t):0===Object.keys(n).length&&(n=E("date","short")),new Intl.DateTimeFormat(e,n)})),P=D((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=E("time",t):0===Object.keys(n).length&&(n=E("time","short")),new Intl.DateTimeFormat(e,n)})),A=({locale:e=F(),...t}={})=>N({locale:e,...t}),q=({locale:e=F(),...t}={})=>S({locale:e,...t}),z=({locale:e=F(),...t}={})=>P({locale:e,...t}),I=D(((e,t=F())=>new n(e,t,y().formats,{ignoreTag:y().ignoreTag}))),H=(e,t={})=>{var n,o,r,s;let l=t;"object"==typeof e&&(l=e,e=l.id);const{values:a,locale:u=F(),default:c}=l;if(null==u)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let m=i(e,u);if(m){if("string"!=typeof m)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof m}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),m}else m=null!==(s=null!==(r=null===(o=(n=y()).handleMissingMessage)||void 0===o?void 0:o.call(n,{locale:u,id:e,defaultValue:c}))&&void 0!==r?r:c)&&void 0!==s?s:e;if(!a)return m;let d=m;try{d=I(m,u).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return d},Z=(e,t)=>z(t).format(e),C=(e,t)=>q(t).format(e),G=(e,t)=>A(t).format(e),J=(e,t=F())=>i(e,t),Q=e.derived([T,l],(()=>H)),U=e.derived([T],(()=>Z)),V=e.derived([T],(()=>C)),_=e.derived([T],(()=>G)),B=e.derived([T,l],(()=>J));exports._=Q,exports.addMessages=c,exports.date=V,exports.defineMessages=function(e){return e},exports.dictionary=l,exports.format=Q,exports.getDateFormatter=q,exports.getLocaleFromHash=e=>"undefined"==typeof window?null:$(window.location.hash.substr(1),e),exports.getLocaleFromHostname=e=>"undefined"==typeof window?null:k(window.location.hostname,e),exports.getLocaleFromNavigator=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],exports.getLocaleFromPathname=e=>"undefined"==typeof window?null:k(window.location.pathname,e),exports.getLocaleFromQueryString=e=>"undefined"==typeof window?null:$(window.location.search.substr(1),e),exports.getMessageFormatter=I,exports.getNumberFormatter=A,exports.getTimeFormatter=z,exports.init=function(e){const{formats:t,...n}=e,o=e.initialLocale||e.fallbackLocale;return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,null==n.handleMissingMessage?n.handleMissingMessage=b:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(v,n,{initialLocale:o}),t&&("number"in t&&Object.assign(v.formats.number,t.number),"date"in t&&Object.assign(v.formats.date,t.date),"time"in t&&Object.assign(v.formats.time,t.time)),T.set(o)},exports.isLoading=x,exports.json=B,exports.locale=T,exports.locales=m,exports.number=_,exports.register=function(e,t){f(e)||function(e){d[e]=new Set}(e);const n=f(e);f(e).has(t)||(a(e)||l.update((t=>(t[e]={},t))),n.add(t))},exports.t=Q,exports.time=U,exports.unwrapFunctionStore=function(e){let t;const n=e.subscribe((e=>t=e)),o=(...e)=>t(...e);return o.freeze=n,o},exports.waitLocale=function(e){return w(e||F()||y().initialLocale)};