7 lines
36 KiB
JavaScript
7 lines
36 KiB
JavaScript
|
/*!
|
||
|
* vue-i18n v9.2.2
|
||
|
* (c) 2022 kazuya kawaguchi
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
var VueI18n=function(e,t){"use strict";const a="undefined"!=typeof window,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=e=>n?Symbol(e):e,r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),s=e=>"[object RegExp]"===h(e),c=e=>E(e)&&0===Object.keys(e).length;function i(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const u=Object.assign;function m(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const f=Object.prototype.hasOwnProperty;function g(e,t){return f.call(e,t)}const _=Array.isArray,p=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"boolean"==typeof e,d=e=>null!==e&&"object"==typeof e,k=Object.prototype.toString,h=e=>k.call(e),E=e=>"[object Object]"===h(e),L=15;function F(e,t,a={}){const{domain:n,messages:l,args:r}=a,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=n,o}const y=[];y[0]={w:[0],i:[3,0],"[":[4],o:[7]},y[1]={w:[1],".":[2],"[":[4],o:[7]},y[2]={w:[2],i:[3,0],0:[3,0]},y[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},y[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},y[5]={"'":[4,0],o:8,l:[5,0]},y[6]={'"':[4,0],o:8,l:[6,0]};const I=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function T(e){if(null==e)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 N(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(a=t,I.test(a)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var a}const R=new Map;function W(e,t){return d(e)?e[t]:null}const M=e=>e,O=e=>"",w=e=>0===e.length?"":e.join(""),D=e=>null==e?"":_(e)||E(e)&&e.toString===k?JSON.stringify(e,null,2):String(e);function C(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function P(e={}){const t=e.locale,a=function(e){const t=o(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(o(e.named.count)||o(e.named.n))?o(e.named.count)?e.named.count:o(e.named.n)?e.named.n:t:t}(e),n=d(e.pluralRules)&&v(t)&&p(e.pluralRules[t])?e.pluralRules[t]:C,l=d(e.pluralRules)&&v(t)&&p(e.pluralRules[t])?C:void 0,r=e.list||[],s=e.named||{};o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(a,s);function c(t){const a=p(e.messages)?e.messages(t):!!d(e.messages)&&e.messages[t];return a||(e.parent?e.parent.message(t):O)}const i=E(e.processor)&&p(e.processor.normalize)?e.processor.normalize:w,u=E(e.processor)&&p(e.processor.interpolate)?e.processor.interpolate:D,m={list:e=>r[e],named:e=>s[e],plural:e=>e[n(a,e.length,l)],linked:(t,...a)=>{const[n,l]=a;let r="text",o="";1===a.length?d(n)?(o=n.modifier||o,r=n.type||r):v(n)&&(o=n||o):2===a.length&&(v(n)&&(o=n||o),v(l)&&(r=l||r));let s=c(t)(m);return"vnode"===r&&_(s)&&o&&(s=s[0]),o?(i=o,e.modifiers?e.modifiers[i]:M)(s,r):s;var i},message:c,type:E(e.processor)&&v(e.processor.type)?e.processor.type:"text",interpolate:u,normalize:i};return m}function A(e,t,a){return[...new Set([a,..._(t)?t:d(t)?Object.keys(t):v(t)?[t]:[a]])]}function S(e,t,a){const n=v(a)?a:j,l=e;l.__localeChainCache||(l.__localeChainCache=new Map);let r=l.__localeChainCache.get(n);if(!r){r=[];let e=[a];for(;_(e);)e=$(r,e,t);const o=_(t)||!E(t)?t:t.default?t.default:null;e=v(o)?[o]:o,_(e)&&$(r,e,!1),l.__localeChainCache.set(n,r)}return r}function $(e,t,a){let n=!0;for(let l=0;l<t.length&&b(n);l++){const r=t[l];v(r)&&(n=U(e,t[l],a))}return n}function U(e,t,a){let n;const l=t.split("-");do{n=H(e,l.join("-"),a),l.splice(-1,1)}while(l.length&&!0===n);return n}function H(e,t,a){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const l=t.replace(/!/g,"");e.push(l),(_(a)||E(a))&&a[l]&&(n=a[l])}return n}const j="en-US",V=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let x,G;let B=0;function Y(e={}){const t=v(e.version)?e.version:"9.2.2",a=v(e.locale)?e.locale:
|