ray-template/assets/@intlify-deb68647.js
2023-05-19 14:50:52 +08:00

18 lines
14 KiB
JavaScript

/*!
* shared v9.2.2
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/const at=typeof window<"u",_e=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",rt=e=>_e?Symbol(e):e,ge=(e,t,n)=>de({l:e,k:t,s:n}),de=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),F=e=>typeof e=="number"&&isFinite(e),Ee=e=>j(e)==="[object Date]",z=e=>j(e)==="[object RegExp]",$=e=>b(e)&&Object.keys(e).length===0;function Te(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const U=Object.assign;let X;const be=()=>X||(X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function J(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const Ne=Object.prototype.hasOwnProperty;function st(e,t){return Ne.call(e,t)}const M=Array.isArray,C=e=>typeof e=="function",i=e=>typeof e=="string",S=e=>typeof e=="boolean",L=e=>e!==null&&typeof e=="object",ae=Object.prototype.toString,j=e=>ae.call(e),b=e=>j(e)==="[object Object]",De=e=>e==null?"":M(e)||b(e)&&e.toString===ae?JSON.stringify(e,null,2):String(e);/*!
* message-compiler v9.2.2
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/const Ie={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,__EXTEND_POINT__:15};function he(e,t,n={}){const{domain:a,messages:r,args:l}=n,o=e,u=new SyntaxError(String(o));return u.code=e,t&&(u.location=t),u.domain=a,u}/*!
* devtools-if v9.2.2
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/const re={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};/*!
* core-base v9.2.2
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/const R=[];R[0]={w:[0],i:[3,0],["["]:[4],o:[7]};R[1]={w:[1],["."]:[2],["["]:[4],o:[7]};R[2]={w:[2],i:[3,0],[0]:[3,0]};R[3]={i:[3,0],[0]:[3,0],w:[1,1],["."]:[2,1],["["]:[4,1],o:[7,1]};R[4]={["'"]:[5,0],['"']:[6,0],["["]:[4,2],["]"]:[1,3],o:8,l:[4,0]};R[5]={["'"]:[4,0],o:8,l:[5,0]};R[6]={['"']:[4,0],o:8,l:[6,0]};const Ae=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Oe(e){return Ae.test(e)}function Le(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function ye(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Ce(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Oe(t)?Le(t):"*"+t}function Fe(e){const t=[];let n=-1,a=0,r=0,l,o,u,s,c,m,E;const g=[];g[0]=()=>{o===void 0?o=u:o+=u},g[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},g[2]=()=>{g[0](),r++},g[3]=()=>{if(r>0)r--,a=4,g[0]();else{if(r=0,o===void 0||(o=Ce(o),o===!1))return!1;g[1]()}};function d(){const T=e[n+1];if(a===5&&T==="'"||a===6&&T==='"')return n++,u="\\"+T,g[0](),!0}for(;a!==null;)if(n++,l=e[n],!(l==="\\"&&d())){if(s=ye(l),E=R[a],c=E[s]||E.l||8,c===8||(a=c[0],c[1]!==void 0&&(m=g[c[1]],m&&(u=l,m()===!1))))return;if(a===7)return t}}const Q=new Map;function Se(e,t){return L(e)?e[t]:null}function lt(e,t){if(!L(e))return null;let n=Q.get(t);if(n||(n=Fe(t),n&&Q.set(t,n)),!n)return null;const a=n.length;let r=e,l=0;for(;l<a;){const o=r[n[l]];if(o===void 0)return null;r=o,l++}return r}const pe=e=>e,Me=e=>"",we="text",Re=e=>e.length===0?"":e.join(""),ke=De;function Z(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function We(e){const t=F(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(F(e.named.count)||F(e.named.n))?F(e.named.count)?e.named.count:F(e.named.n)?e.named.n:t:t}function Pe(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Ue(e={}){const t=e.locale,n=We(e),a=L(e.pluralRules)&&i(t)&&C(e.pluralRules[t])?e.pluralRules[t]:Z,r=L(e.pluralRules)&&i(t)&&C(e.pluralRules[t])?Z:void 0,l=f=>f[a(n,f.length,r)],o=e.list||[],u=f=>o[f],s=e.named||{};F(e.pluralIndex)&&Pe(n,s);const c=f=>s[f];function m(f){const N=C(e.messages)?e.messages(f):L(e.messages)?e.messages[f]:!1;return N||(e.parent?e.parent.message(f):Me)}const E=f=>e.modifiers?e.modifiers[f]:pe,g=b(e.processor)&&C(e.processor.normalize)?e.processor.normalize:Re,d=b(e.processor)&&C(e.processor.interpolate)?e.processor.interpolate:ke,T=b(e.processor)&&i(e.processor.type)?e.processor.type:we,A={list:u,named:c,plural:l,linked:(f,...N)=>{const[O,_]=N;let D="text",I="";N.length===1?L(O)?(I=O.modifier||I,D=O.type||D):i(O)&&(I=O||I):N.length===2&&(i(O)&&(I=O||I),i(_)&&(D=_||D));let y=m(f)(A);return D==="vnode"&&M(y)&&I&&(y=y[0]),I?E(I)(y,D):y},message:m,type:T,interpolate:d,normalize:g};return A}let P=null;function ot(e){P=e}function xe(e,t,n){P&&P.emit(re.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Ve=ve(re.FunctionTranslate);function ve(e){return t=>P&&P.emit(e,t)}function Ge(e,t,n){return[...new Set([n,...M(t)?t:L(t)?Object.keys(t):i(t)?[t]:[n]])]}function ct(e,t,n){const a=i(n)?n:se,r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let l=r.__localeChainCache.get(a);if(!l){l=[];let o=[n];for(;M(o);)o=q(l,o,t);const u=M(t)||!b(t)?t:t.default?t.default:null;o=i(u)?[u]:u,M(o)&&q(l,o,!1),r.__localeChainCache.set(a,l)}return l}function q(e,t,n){let a=!0;for(let r=0;r<t.length&&S(a);r++){const l=t[r];i(l)&&(a=$e(e,t[r],n))}return a}function $e(e,t,n){let a;const r=t.split("-");do{const l=r.join("-");a=je(e,l,n),r.splice(-1,1)}while(r.length&&a===!0);return a}function je(e,t,n){let a=!1;if(!e.includes(t)&&(a=!0,t)){a=t[t.length-1]!=="!";const r=t.replace(/!/g,"");e.push(r),(M(n)||b(n))&&n[r]&&(a=n[r])}return a}const Ke="9.2.2",K=-1,se="en-US",it="",ee=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function He(){return{upper:(e,t)=>t==="text"&&i(e)?e.toUpperCase():t==="vnode"&&L(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&i(e)?e.toLowerCase():t==="vnode"&&L(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&i(e)?ee(e):t==="vnode"&&L(e)&&"__v_isVNode"in e?ee(e.children):e}}let Ye,le;function ut(e){le=e}let oe;function ft(e){oe=e}let ce=null;const mt=e=>{ce=e},Be=()=>ce;let ie=null;const _t=e=>{ie=e},gt=()=>ie;let te=0;function dt(e={}){const t=i(e.version)?e.version:Ke,n=i(e.locale)?e.locale:se,a=M(e.fallbackLocale)||b(e.fallbackLocale)||i(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:n,r=b(e.messages)?e.messages:{[n]:{}},l=b(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},o=b(e.numberFormats)?e.numberFormats:{[n]:{}},u=U({},e.modifiers||{},He()),s=e.pluralRules||{},c=C(e.missing)?e.missing:null,m=S(e.missingWarn)||z(e.missingWarn)?e.missingWarn:!0,E=S(e.fallbackWarn)||z(e.fallbackWarn)?e.fallbackWarn:!0,g=!!e.fallbackFormat,d=!!e.unresolving,T=C(e.postTranslation)?e.postTranslation:null,h=b(e.processor)?e.processor:null,A=S(e.warnHtmlMessage)?e.warnHtmlMessage:!0,f=!!e.escapeParameter,N=C(e.messageCompiler)?e.messageCompiler:Ye,O=C(e.messageResolver)?e.messageResolver:le||Se,_=C(e.localeFallbacker)?e.localeFallbacker:oe||Ge,D=L(e.fallbackContext)?e.fallbackContext:void 0,I=C(e.onWarn)?e.onWarn:Te,y=e,V=L(y.__datetimeFormatters)?y.__datetimeFormatters:new Map,v=L(y.__numberFormatters)?y.__numberFormatters:new Map,x=L(y.__meta)?y.__meta:{};te++;const w={version:t,cid:te,locale:n,fallbackLocale:a,messages:r,modifiers:u,pluralRules:s,missing:c,missingWarn:m,fallbackWarn:E,fallbackFormat:g,unresolving:d,postTranslation:T,processor:h,warnHtmlMessage:A,escapeParameter:f,messageCompiler:N,messageResolver:O,localeFallbacker:_,fallbackContext:D,onWarn:I,__meta:x};return w.datetimeFormats=l,w.numberFormats=o,w.__datetimeFormatters=V,w.__numberFormatters=v,__INTLIFY_PROD_DEVTOOLS__&&xe(w,t,x),w}function H(e,t,n,a,r){const{missing:l,onWarn:o}=e;if(l!==null){const u=l(e,n,t,r);return i(u)?u:t}else return t}function Et(e,t,n){const a=e;a.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}let ue=Ie.__EXTEND_POINT__;const G=()=>++ue,k={INVALID_ARGUMENT:ue,INVALID_DATE_ARGUMENT:G(),INVALID_ISO_DATE_ARGUMENT:G(),__EXTEND_POINT__:G()};function W(e){return he(e,null,void 0)}const ne=()=>"",p=e=>C(e);function Tt(e,...t){const{fallbackFormat:n,postTranslation:a,unresolving:r,messageCompiler:l,fallbackLocale:o,messages:u}=e,[s,c]=Je(...t),m=S(c.missingWarn)?c.missingWarn:e.missingWarn,E=S(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,g=S(c.escapeParameter)?c.escapeParameter:e.escapeParameter,d=!!c.resolvedMessage,T=i(c.default)||S(c.default)?S(c.default)?l?s:()=>s:c.default:n?l?s:()=>s:"",h=n||T!=="",A=i(c.locale)?c.locale:e.locale;g&&ze(c);let[f,N,O]=d?[s,A,u[A]||{}]:fe(e,s,A,o,E,m),_=f,D=s;if(!d&&!(i(_)||p(_))&&h&&(_=T,D=_),!d&&(!(i(_)||p(_))||!i(N)))return r?K:s;let I=!1;const y=()=>{I=!0},V=p(_)?_:me(e,s,N,_,D,y);if(I)return _;const v=Ze(e,N,O,c),x=Ue(v),w=Xe(e,V,x),Y=a?a(w,s):w;if(__INTLIFY_PROD_DEVTOOLS__){const B={timestamp:Date.now(),key:i(s)?s:p(_)?_.key:"",locale:N||(p(_)?_.locale:""),format:i(_)?_:p(_)?_.source:"",message:Y};B.meta=U({},e.__meta,Be()||{}),Ve(B)}return Y}function ze(e){M(e.list)?e.list=e.list.map(t=>i(t)?J(t):t):L(e.named)&&Object.keys(e.named).forEach(t=>{i(e.named[t])&&(e.named[t]=J(e.named[t]))})}function fe(e,t,n,a,r,l){const{messages:o,onWarn:u,messageResolver:s,localeFallbacker:c}=e,m=c(e,a,n);let E={},g,d=null;const T="translate";for(let h=0;h<m.length&&(g=m[h],E=o[g]||{},(d=s(E,t))===null&&(d=E[t]),!(i(d)||C(d)));h++){const A=H(e,t,g,l,T);A!==t&&(d=A)}return[d,g,E]}function me(e,t,n,a,r,l){const{messageCompiler:o,warnHtmlMessage:u}=e;if(p(a)){const c=a;return c.locale=c.locale||n,c.key=c.key||t,c}if(o==null){const c=()=>a;return c.locale=n,c.key=t,c}const s=o(a,Qe(e,n,r,a,u,l));return s.locale=n,s.key=t,s.source=a,s}function Xe(e,t,n){return t(n)}function Je(...e){const[t,n,a]=e,r={};if(!i(t)&&!F(t)&&!p(t))throw W(k.INVALID_ARGUMENT);const l=F(t)?String(t):(p(t),t);return F(n)?r.plural=n:i(n)?r.default=n:b(n)&&!$(n)?r.named=n:M(n)&&(r.list=n),F(a)?r.plural=a:i(a)?r.default=a:b(a)&&U(r,a),[l,r]}function Qe(e,t,n,a,r,l){return{warnHtmlMessage:r,onError:o=>{throw l&&l(o),o},onCacheKey:o=>ge(t,n,o)}}function Ze(e,t,n,a){const{modifiers:r,pluralRules:l,messageResolver:o,fallbackLocale:u,fallbackWarn:s,missingWarn:c,fallbackContext:m}=e,g={locale:t,modifiers:r,pluralRules:l,messages:d=>{let T=o(n,d);if(T==null&&m){const[,,h]=fe(m,d,t,u,s,c);T=o(h,d)}if(i(T)){let h=!1;const f=me(e,d,t,T,d,()=>{h=!0});return h?ne:f}else return p(T)?T:ne}};return e.processor&&(g.processor=e.processor),a.list&&(g.list=a.list),a.named&&(g.named=a.named),F(a.plural)&&(g.pluralIndex=a.plural),g}function bt(e,...t){const{datetimeFormats:n,unresolving:a,fallbackLocale:r,onWarn:l,localeFallbacker:o}=e,{__datetimeFormatters:u}=e,[s,c,m,E]=et(...t),g=S(m.missingWarn)?m.missingWarn:e.missingWarn;S(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const d=!!m.part,T=i(m.locale)?m.locale:e.locale,h=o(e,r,T);if(!i(s)||s==="")return new Intl.DateTimeFormat(T,E).format(c);let A={},f,N=null;const O="datetime format";for(let I=0;I<h.length&&(f=h[I],A=n[f]||{},N=A[s],!b(N));I++)H(e,s,f,g,O);if(!b(N)||!i(f))return a?K:s;let _=`${f}__${s}`;$(E)||(_=`${_}__${JSON.stringify(E)}`);let D=u.get(_);return D||(D=new Intl.DateTimeFormat(f,U({},N,E)),u.set(_,D)),d?D.formatToParts(c):D.format(c)}const qe=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function et(...e){const[t,n,a,r]=e,l={};let o={},u;if(i(t)){const s=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!s)throw W(k.INVALID_ISO_DATE_ARGUMENT);const c=s[3]?s[3].trim().startsWith("T")?`${s[1].trim()}${s[3].trim()}`:`${s[1].trim()}T${s[3].trim()}`:s[1].trim();u=new Date(c);try{u.toISOString()}catch{throw W(k.INVALID_ISO_DATE_ARGUMENT)}}else if(Ee(t)){if(isNaN(t.getTime()))throw W(k.INVALID_DATE_ARGUMENT);u=t}else if(F(t))u=t;else throw W(k.INVALID_ARGUMENT);return i(n)?l.key=n:b(n)&&Object.keys(n).forEach(s=>{qe.includes(s)?o[s]=n[s]:l[s]=n[s]}),i(a)?l.locale=a:b(a)&&(o=a),b(r)&&(o=r),[l.key||"",u,l,o]}function Nt(e,t,n){const a=e;for(const r in n){const l=`${t}__${r}`;a.__datetimeFormatters.has(l)&&a.__datetimeFormatters.delete(l)}}function Dt(e,...t){const{numberFormats:n,unresolving:a,fallbackLocale:r,onWarn:l,localeFallbacker:o}=e,{__numberFormatters:u}=e,[s,c,m,E]=nt(...t),g=S(m.missingWarn)?m.missingWarn:e.missingWarn;S(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const d=!!m.part,T=i(m.locale)?m.locale:e.locale,h=o(e,r,T);if(!i(s)||s==="")return new Intl.NumberFormat(T,E).format(c);let A={},f,N=null;const O="number format";for(let I=0;I<h.length&&(f=h[I],A=n[f]||{},N=A[s],!b(N));I++)H(e,s,f,g,O);if(!b(N)||!i(f))return a?K:s;let _=`${f}__${s}`;$(E)||(_=`${_}__${JSON.stringify(E)}`);let D=u.get(_);return D||(D=new Intl.NumberFormat(f,U({},N,E)),u.set(_,D)),d?D.formatToParts(c):D.format(c)}const tt=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function nt(...e){const[t,n,a,r]=e,l={};let o={};if(!F(t))throw W(k.INVALID_ARGUMENT);const u=t;return i(n)?l.key=n:b(n)&&Object.keys(n).forEach(s=>{tt.includes(s)?o[s]=n[s]:l[s]=n[s]}),i(a)?l.locale=a:b(a)&&(o=a),b(r)&&(o=r),[l.key||"",u,l,o]}function It(e,t,n){const a=e;for(const r in n){const l=`${t}__${r}`;a.__numberFormatters.has(l)&&a.__numberFormatters.delete(l)}}typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(be().__INTLIFY_PROD_DEVTOOLS__=!1);export{gt as A,K as B,Ie as C,se as D,Je as E,Tt as F,et as G,bt as H,nt as I,Dt as J,_t as K,it as M,tt as N,U as a,i as b,L as c,S as d,$ as e,ft as f,be as g,he as h,F as i,M as j,b as k,z as l,rt as m,C as n,at as o,qe as p,lt as q,ut as r,ot as s,ct as t,Et as u,st as v,dt as w,Nt as x,It as y,mt as z};