7 lines
38 KiB
JavaScript
7 lines
38 KiB
JavaScript
|
|
/*!
|
||
|
|
* vue-i18n v9.1.9
|
||
|
|
* (c) 2021 kazuya kawaguchi
|
||
|
|
* Released under the MIT License.
|
||
|
|
*/
|
||
|
|
var VueI18n=function(e,t){"use strict";const n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=e=>n?Symbol(e):e,a=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]"===_(e),l=e=>v(e)&&0===Object.keys(e).length;function c(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const i=Object.assign;function u(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const f=Object.prototype.hasOwnProperty;function m(e,t){return f.call(e,t)}const p=Array.isArray,g=e=>"function"==typeof e,d=e=>"string"==typeof e,b=e=>"boolean"==typeof e,h=e=>null!==e&&"object"==typeof e,k=Object.prototype.toString,_=e=>k.call(e),v=e=>"[object Object]"===_(e),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 F=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function L(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 w(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(F.test(t)?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)}const T=new Map;function C(e,t){if(!h(e))return null;let n=T.get(t);if(n||(n=function(e){const t=[];let n,r,a,o,s,l,c,i=-1,u=0,f=0;const m=[];function p(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,a="\\"+t,m[0](),!0}for(m[0]=()=>{void 0===r?r=a:r+=a},m[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},m[2]=()=>{m[0](),f++},m[3]=()=>{if(f>0)f--,u=4,m[0]();else{if(f=0,void 0===r)return!1;if(r=w(r),!1===r)return!1;m[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!p()){if(o=L(n),c=y[u],s=c[o]||c.l||8,8===s)return;if(u=s[0],void 0!==s[1]&&(l=m[s[1]],l&&(a=n,!1===l())))return;if(7===u)return t}}(t),n&&T.set(t,n)),!n)return null;const r=n.length;let a=e,o=0;for(;o<r;){const e=a[n[o]];if(void 0===e)return null;a=e,o++}return a}function x(e){if(!h(e))return e;for(const t in e)if(m(e,t))if(t.includes(".")){const n=t.split("."),r=n.length-1;let a=e;for(let e=0;e<r;e++)n[e]in a||(a[n[e]]={}),a=a[n[e]];a[n[r]]=e[t],delete e[t],h(a[n[r]])&&x(a[n[r]])}else h(e[t])&&x(e[t]);return e}const P=e=>e,O=e=>"",$=e=>0===e.length?"":e.join(""),M=e=>null==e?"":p(e)||v(e)&&e.toString===k?JSON.stringify(e,null,2):String(e);function W(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function I(e={}){const t=e.locale,n=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),r=h(e.pluralRules)&&d(t)&&g(e.pluralRules[t])?e.pluralRules[t]:W,a=h(e.pluralRules)&&d(t)&&g(e.pluralRules[t])?W:void 0,s=e.list||[],l=e.named||{};o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,l);function c(t){const n=g(e.messages)?e.messages(t):!!h(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):O)}const i=v(e.processor)&&g(e.processor.normalize)?e.processor.normalize:$,u=v(e.processor)&&g(e.processor.interpolate)?e.processor.interpolate:M,f={list:e=>s[e],named:e=>l[e],plural:e=>e[r(n,e.length,a)],linked:(t,n)=>{const r=c(t)(f);return d(n)?(a=n,e.modifiers?e.modifiers[a]:P)(r):r;var a},message:c,type:v(e.processor)&&d(e.processor.type)?e.processor.type:"text",interpolate:u,normalize:i};return f}function N(e){throw e}function S(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const E=" ",j="\n",H=String.fromCharCode(8232),R=String.fromCharCode(8233);function D(e){const t=e;let n=0,r=1,a=1,o=0;const s=e=>"\r"===t[e]&&t[e+1]===j,l=e=>t[e]===R,c=e=>t[e]===H,i=e=>s(e)||(e=>t[e]===j)(e)||l(e)||c(e),u=e=>s(e)||l(e)|
|