@intlify/core 10.0.7 → 10.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,8 +1,25 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
+ function warn(msg, err) {
7
+ if (typeof console !== 'undefined') {
8
+ console.warn(`[intlify] ` + msg);
9
+ /* istanbul ignore if */
10
+ if (err) {
11
+ console.warn(err.stack);
12
+ }
13
+ }
14
+ }
15
+ const hasWarned = {};
16
+ function warnOnce(msg) {
17
+ if (!hasWarned[msg]) {
18
+ hasWarned[msg] = true;
19
+ warn(msg);
20
+ }
21
+ }
22
+
6
23
  /**
7
24
  * Original Utilities
8
25
  * written by kazuya kawaguchi
@@ -55,10 +72,49 @@ const _create = Object.create;
55
72
  const create = (obj = null) => _create(obj);
56
73
  function escapeHtml(rawText) {
57
74
  return rawText
75
+ .replace(/&/g, '&') // escape `&` first to avoid double escaping
58
76
  .replace(/</g, '&lt;')
59
77
  .replace(/>/g, '&gt;')
60
78
  .replace(/"/g, '&quot;')
61
- .replace(/'/g, '&apos;');
79
+ .replace(/'/g, '&apos;')
80
+ .replace(/\//g, '&#x2F;') // escape `/` to prevent closing tags or JavaScript URLs
81
+ .replace(/=/g, '&#x3D;'); // escape `=` to prevent attribute injection
82
+ }
83
+ function escapeAttributeValue(value) {
84
+ return value
85
+ .replace(/&(?![a-zA-Z0-9#]{2,6};)/g, '&amp;') // escape unescaped `&`
86
+ .replace(/"/g, '&quot;')
87
+ .replace(/'/g, '&apos;')
88
+ .replace(/</g, '&lt;')
89
+ .replace(/>/g, '&gt;');
90
+ }
91
+ function sanitizeTranslatedHtml(html) {
92
+ // Escape dangerous characters in attribute values
93
+ // Process attributes with double quotes
94
+ html = html.replace(/(\w+)\s*=\s*"([^"]*)"/g, (_, attrName, attrValue) => `${attrName}="${escapeAttributeValue(attrValue)}"`);
95
+ // Process attributes with single quotes
96
+ html = html.replace(/(\w+)\s*=\s*'([^']*)'/g, (_, attrName, attrValue) => `${attrName}='${escapeAttributeValue(attrValue)}'`);
97
+ // Detect and neutralize event handler attributes
98
+ const eventHandlerPattern = /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi;
99
+ if (eventHandlerPattern.test(html)) {
100
+ {
101
+ warn('Potentially dangerous event handlers detected in translation. ' +
102
+ 'Consider removing onclick, onerror, etc. from your translation messages.');
103
+ }
104
+ // Neutralize event handler attributes by escaping 'on'
105
+ html = html.replace(/(\s+)(on)(\w+\s*=)/gi, '$1&#111;n$3');
106
+ }
107
+ // Disable javascript: URLs in various contexts
108
+ const javascriptUrlPattern = [
109
+ // In href, src, action, formaction attributes
110
+ /(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,
111
+ // In style attributes within url()
112
+ /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi
113
+ ];
114
+ javascriptUrlPattern.forEach(pattern => {
115
+ html = html.replace(pattern, '$1javascript&#58;');
116
+ });
117
+ return html;
62
118
  }
63
119
  const hasOwnProperty = Object.prototype.hasOwnProperty;
64
120
  function hasOwn(obj, key) {
@@ -130,23 +186,6 @@ function generateCodeFrame(source, start = 0, end = source.length) {
130
186
  return res.join('\n');
131
187
  }
132
188
 
133
- function warn(msg, err) {
134
- if (typeof console !== 'undefined') {
135
- console.warn(`[intlify] ` + msg);
136
- /* istanbul ignore if */
137
- if (err) {
138
- console.warn(err.stack);
139
- }
140
- }
141
- }
142
- const hasWarned = {};
143
- function warnOnce(msg) {
144
- if (!hasWarned[msg]) {
145
- hasWarned[msg] = true;
146
- warn(msg);
147
- }
148
- }
149
-
150
189
  function createPosition(line, column, offset) {
151
190
  return { line, column, offset };
152
191
  }
@@ -2377,7 +2416,7 @@ function getWarnMessage(code, ...args) {
2377
2416
  * Intlify core-base version
2378
2417
  * @internal
2379
2418
  */
2380
- const VERSION = '10.0.7';
2419
+ const VERSION = '10.0.8';
2381
2420
  const NOT_REOSLVED = -1;
2382
2421
  const DEFAULT_LOCALE = 'en-US';
2383
2422
  const MISSING_RESOLVE_VALUE = '';
@@ -3169,9 +3208,13 @@ function translate(context, ...args) {
3169
3208
  const msgContext = createMessageContext(ctxOptions);
3170
3209
  const messaged = evaluateMessage(context, msg, msgContext);
3171
3210
  // if use post translation option, proceed it with handler
3172
- const ret = postTranslation
3211
+ let ret = postTranslation
3173
3212
  ? postTranslation(messaged, key)
3174
3213
  : messaged;
3214
+ // apply HTML sanitization for security
3215
+ if (escapeParameter && isString(ret)) {
3216
+ ret = sanitizeTranslatedHtml(ret);
3217
+ }
3175
3218
  // NOTE: experimental !!
3176
3219
  {
3177
3220
  // prettier-ignore
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
- const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign,_create=Object.create,create=(e=null)=>_create(e);function escapeHtml(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(e,t){return hasOwnProperty.call(e,t)}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>"[object Object]"===toTypeString(e),toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,n)=>0===n?e+r:e+t+r),"")}function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function createPosition(e,t,r){return{line:e,column:t,offset:r}}function createLocation(e,t,r){return{start:e,end:t}}const CompileErrorCodes={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17;function createCompileError(e,t,r={}){const{domain:n,messages:o,args:s}=r,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=n,a}function defaultOnError(e){throw e}CompileErrorCodes.EXPECTED_TOKEN,CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,CompileErrorCodes.UNBALANCED_CLOSING_BRACE,CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,CompileErrorCodes.EMPTY_PLACEHOLDER,CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,CompileErrorCodes.INVALID_LINKED_FORMAT,CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE,CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE;const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let r=0,n=1,o=1,s=0;const a=e=>t[e]===CHAR_CR&&t[e+1]===CHAR_LF,i=e=>t[e]===CHAR_PS,c=e=>t[e]===CHAR_LS,l=e=>a(e)||(e=>t[e]===CHAR_LF)(e)||i(e)||c(e),u=e=>a(e)||i(e)||c(e)?CHAR_LF:t[e];function E(){return s=0,l(r)&&(n++,o=0),a(r)&&r++,r++,o++,t[r]}return{index:()=>r,line:()=>n,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(r),currentPeek:()=>u(r+s),next:E,peek:function(){return a(r+s)&&s++,s++,t[r+s]},reset:function(){r=0,n=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=r+s;for(;e!==r;)E();s=0}}}const EOF=void 0,DOT=".",LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const r=!1!==t.location,n=createScanner(e),o=()=>n.index(),s=()=>createPosition(n.line(),n.column(),n.index()),a=s(),i=o(),c={currentType:13,offset:i,startLoc:a,endLoc:a,lastType:13,lastOffset:i,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function E(e,t,n){e.endLoc=s(),e.currentType=t;const o={type:t};return r&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=n&&(o.value=n),o}const f=e=>E(e,13);function _(e,t){return e.currentChar()===t?(e.next(),t):(CompileErrorCodes.EXPECTED_TOKEN,s(),"")}function m(e){let t="";for(;e.currentPeek()===CHAR_SP||e.currentPeek()===CHAR_LF;)t+=e.currentPeek(),e.peek();return t}function C(e){const t=m(e);return e.skipToPeek(),t}function d(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function p(e,t){const{currentType:r}=t;if(2!==r)return!1;m(e);const n=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),n}function T(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function N(e,t=!0){const r=(t=!1,n="")=>{const o=e.currentPeek();return"{"===o?t:"@"!==o&&o?"|"===o?!(n===CHAR_SP||n===CHAR_LF):o===CHAR_SP?(e.peek(),r(!0,CHAR_SP)):o!==CHAR_LF||(e.peek(),r(!0,CHAR_LF)):t},n=r();return t&&e.resetPeek(),n}function A(e,t){const r=e.currentChar();return r===EOF?EOF:t(r)?(e.next(),r):null}function O(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}function g(e){return A(e,O)}function S(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t||45===t}function L(e){return A(e,S)}function P(e){const t=e.charCodeAt(0);return t>=48&&t<=57}function h(e){return A(e,P)}function b(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function k(e){return A(e,b)}function R(e){let t="",r="";for(;t=h(e);)r+=t;return r}function I(e){return e!==LITERAL_DELIMITER&&e!==CHAR_LF}function M(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return y(e,t,4);case"U":return y(e,t,6);default:return CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function y(e,t,r){_(e,t);let n="";for(let o=0;o<r;o++){const t=k(e);if(!t){CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}n+=t}return`\\${t}${n}`}function D(e){return"{"!==e&&"}"!==e&&e!==CHAR_SP&&e!==CHAR_LF}function F(e){C(e);const t=_(e,"|");return C(e),t}function v(e,t){let r=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),r=E(t,2,"{"),C(e),t.braceNest++,r;case"}":return t.braceNest>0&&2===t.currentType&&(CompileErrorCodes.EMPTY_PLACEHOLDER,s()),e.next(),r=E(t,3,"}"),t.braceNest--,t.braceNest>0&&C(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),r;case"@":return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=U(e,t)||f(t),t.braceNest=0,r;default:{let n=!0,o=!0,a=!0;if(T(e))return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=E(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r;if(t.braceNest>0&&(4===t.currentType||5===t.currentType||6===t.currentType))return CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,x(e,t);if(n=function(e,t){const{currentType:r}=t;if(2!==r)return!1;m(e);const n=d(e.currentPeek());return e.resetPeek(),n}(e,t))return r=E(t,4,function(e){C(e);let t="",r="";for(;t=L(e);)r+=t;return e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r}(e)),C(e),r;if(o=p(e,t))return r=E(t,5,function(e){C(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${R(e)}`):t+=R(e),e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),C(e),r;if(a=function(e,t){const{currentType:r}=t;if(2!==r)return!1;m(e);const n=e.currentPeek()===LITERAL_DELIMITER;return e.resetPeek(),n}(e,t))return r=E(t,6,function(e){C(e),_(e,"'");let t="",r="";for(;t=A(e,I);)r+="\\"===t?M(e):t;const n=e.currentChar();return n===CHAR_LF||n===EOF?(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),n===CHAR_LF&&(e.next(),_(e,"'")),r):(_(e,"'"),r)}(e)),C(e),r;if(!n&&!o&&!a)return r=E(t,12,function(e){C(e);let t="",r="";for(;t=A(e,D);)r+=t;return r}(e)),CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,s(),r.value,C(e),r;break}}return r}function U(e,t){const{currentType:r}=t;let n=null;const o=e.currentChar();switch(7!==r&&8!==r&&11!==r&&9!==r||o!==CHAR_LF&&o!==CHAR_SP||(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),n=E(t,7,"@"),t.inLinked=!0,n;case".":return C(e),e.next(),E(t,8,".");case":":return C(e),e.next(),E(t,9,":");default:return T(e)?(n=E(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n):function(e,t){const{currentType:r}=t;if(7!==r)return!1;m(e);const n="."===e.currentPeek();return e.resetPeek(),n}(e,t)||function(e,t){const{currentType:r}=t;if(7!==r&&11!==r)return!1;m(e);const n=":"===e.currentPeek();return e.resetPeek(),n}(e,t)?(C(e),U(e,t)):function(e,t){const{currentType:r}=t;if(8!==r)return!1;m(e);const n=d(e.currentPeek());return e.resetPeek(),n}(e,t)?(C(e),E(t,11,function(e){let t="",r="";for(;t=g(e);)r+=t;return r}(e))):function(e,t){const{currentType:r}=t;if(9!==r)return!1;const n=()=>{const t=e.currentPeek();return"{"===t?d(e.peek()):!("@"===t||"|"===t||":"===t||"."===t||t===CHAR_SP||!t)&&(t===CHAR_LF?(e.peek(),n()):N(e,!1))},o=n();return e.resetPeek(),o}(e,t)?(C(e),"{"===o?v(e,t)||n:E(t,10,function(e){const t=r=>{const n=e.currentChar();return"{"!==n&&"@"!==n&&"|"!==n&&"("!==n&&")"!==n&&n?n===CHAR_SP?r:(r+=n,e.next(),t(r)):r};return t("")}(e))):(7===r&&(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,x(e,t))}}function x(e,t){let r={type:13};if(t.braceNest>0)return v(e,t)||f(t);if(t.inLinked)return U(e,t)||f(t);switch(e.currentChar()){case"{":return v(e,t)||f(t);case"}":return CompileErrorCodes.UNBALANCED_CLOSING_BRACE,s(),e.next(),E(t,3,"}");case"@":return U(e,t)||f(t);default:if(T(e))return r=E(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r;if(N(e))return E(t,0,function(e){let t="";for(;;){const r=e.currentChar();if("{"===r||"}"===r||"@"===r||"|"===r||!r)break;if(r===CHAR_SP||r===CHAR_LF)if(N(e))t+=r,e.next();else{if(T(e))break;t+=r,e.next()}else t+=r,e.next()}return t}(e))}return r}return{nextToken:function(){const{currentType:e,offset:t,startLoc:r,endLoc:a}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=r,c.lastEndLoc=a,c.offset=o(),c.startLoc=s(),n.currentChar()===EOF?E(c,13):x(n,c)},currentOffset:o,currentPosition:s,context:l}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,r){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||r,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:r}=e;function n(e,r,n){const o={type:e};return t&&(o.start=r,o.end=r,o.loc={start:n,end:n}),o}function o(e,r,n,o){t&&(e.end=r,e.loc&&(e.loc.end=n))}function s(e,t){const r=e.context(),s=n(3,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(5,s,a);return i.index=parseInt(t,10),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function i(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(4,s,a);return i.key=t,e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function c(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(9,s,a);return i.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function l(e){const t=e.context(),r=n(6,t.offset,t.startLoc);let s=e.nextToken();if(8===s.type){const t=function(e){const t=e.nextToken(),r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(8,s,a);return 11!==t.type?(CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,r.lastStartLoc,i.value="",o(i,s,a),{nextConsumeToken:t,node:i}):(null==t.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,r.lastStartLoc,getTokenCaption(t)),i.value=t.value||"",o(i,e.currentOffset(),e.currentPosition()),{node:i})}(e);r.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(9!==s.type&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 10:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=function(e,t){const r=e.context(),s=n(7,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 4:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=i(e,s.value||"");break;case 5:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=a(e,s.value||"");break;case 6:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=c(e,s.value||"");break;default:{CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const a=e.context(),i=n(7,a.offset,a.startLoc);return i.value="",o(i,a.offset,a.startLoc),r.key=i,o(r,a.offset,a.startLoc),{nextConsumeToken:s,node:r}}}return o(r,e.currentOffset(),e.currentPosition()),{node:r}}function u(e){const t=e.context(),r=n(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);r.items=[];let u=null;do{const n=u||e.nextToken();switch(u=null,n.type){case 0:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(s(e,n.value||""));break;case 5:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(a(e,n.value||""));break;case 4:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(i(e,n.value||""));break;case 6:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(c(e,n.value||""));break;case 7:{const t=l(e);r.items.push(t.node),u=t.nextConsumeToken||null;break}}}while(13!==t.currentType&&1!==t.currentType);return o(r,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),r}function E(e){const t=e.context(),{offset:r,startLoc:s}=t,a=u(e);return 13===t.currentType?a:function(e,t,r,s){const a=e.context();let i=0===s.items.length;const c=n(1,t,r);c.cases=[],c.cases.push(s);do{const t=u(e);i||(i=0===t.items.length),c.cases.push(t)}while(13!==a.currentType);return i&&CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,o(c,e.currentOffset(),e.currentPosition()),c}(e,r,s,a)}return{parse:function(r){const s=createTokenizer(r,assign({},e)),a=s.context(),i=n(0,a.offset,a.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=E(s),e.onCacheKey&&(i.cacheKey=e.onCacheKey(r)),13!==a.currentType&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,r[a.offset]),o(i,s.currentOffset(),s.currentPosition()),i}}}function getTokenCaption(e){if(13===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const r={ast:e,helpers:new Set};return{context:()=>r,helper:e=>(r.helpers.add(e),e)}}function traverseNodes(e,t){for(let r=0;r<e.length;r++)traverseNode(e[r],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const r=createTransformer(e);r.helper("normalize"),e.body&&traverseNode(e.body,r);const n=r.context();e.helpers=Array.from(n.helpers)}function optimize(e){const t=e.body;return 2===t.type?optimizeMessageNode(t):t.cases.forEach((e=>optimizeMessageNode(e))),e}function optimizeMessageNode(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let r=0;r<e.items.length;r++){const n=e.items[r];if(3!==n.type&&9!==n.type)break;if(null==n.value)break;t.push(n.value)}if(t.length===e.items.length){e.static=join(t);for(let t=0;t<e.items.length;t++){const r=e.items[t];3!==r.type&&9!==r.type||delete r.value}}}}function minify(e){switch(e.t=e.type,e.type){case 0:{const t=e;minify(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,r=t.cases;for(let e=0;e<r.length;e++)minify(r[e]);t.c=r,delete t.cases;break}case 2:{const t=e,r=t.items;for(let e=0;e<r.length;e++)minify(r[e]);t.i=r,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;minify(t.key),t.k=t.key,delete t.key,t.modifier&&(minify(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function createCodeGenerator(e,t){const{sourceMap:r,filename:n,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};a&&e.loc&&(i.source=e.loc.source);function c(e,t){i.code+=e}function l(e,t=!0){const r=t?o:"";c(s?r+" ".repeat(e):r)}return{context:()=>i,push:c,indent:function(e=!0){const t=++i.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--i.indentLevel;e&&l(t)},newline:function(){l(i.indentLevel)},helper:e=>`_${e}`,needIndent:()=>i.needIndent}}function generateLinkedNode(e,t){const{helper:r}=e;e.push(`${r("linked")}(`),generateNode(e,t.key),t.modifier?(e.push(", "),generateNode(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function generateMessageNode(e,t){const{helper:r,needIndent:n}=e;e.push(`${r("normalize")}([`),e.indent(n());const o=t.items.length;for(let s=0;s<o&&(generateNode(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(n()),e.push("])")}function generatePluralNode(e,t){const{helper:r,needIndent:n}=e;if(t.cases.length>1){e.push(`${r("plural")}([`),e.indent(n());const o=t.cases.length;for(let r=0;r<o&&(generateNode(e,t.cases[r]),r!==o-1);r++)e.push(", ");e.deindent(n()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:r}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${r("interpolate")}(${r("list")}(${t.index}))`,t);break;case 4:e.push(`${r("interpolate")}(${r("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const r=isString(t.mode)?t.mode:"normal",n=isString(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==r,i=e.helpers||[],c=createCodeGenerator(e,{mode:r,filename:n,sourceMap:o,breakLineCode:s,needIndent:a});c.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(a),i.length>0&&(c.push(`const { ${join(i.map((e=>`${e}: _${e}`)),", ")} } = ctx`),c.newline()),c.push("return "),generateNode(c,e),c.deindent(a),c.push("}"),delete e.helpers;const{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function baseCompile$1(e,t={}){const r=assign({},t),n=!!r.jit,o=!!r.minify,s=null==r.optimize||r.optimize,a=createParser(r).parse(e);return n?(s&&optimize(a),o&&minify(a),{ast:a,code:""}):(transform(a,r),generate(a,r))}function isMessageAST(e){return isObject(e)&&0===resolveType(e)&&(hasOwn(e,"b")||hasOwn(e,"body"))}const PROPS_BODY=["b","body"];function resolveBody(e){return resolveProps(e,PROPS_BODY)}const PROPS_CASES=["c","cases"];function resolveCases(e){return resolveProps(e,PROPS_CASES,[])}const PROPS_STATIC=["s","static"];function resolveStatic(e){return resolveProps(e,PROPS_STATIC)}const PROPS_ITEMS=["i","items"];function resolveItems(e){return resolveProps(e,PROPS_ITEMS,[])}const PROPS_TYPE=["t","type"];function resolveType(e){return resolveProps(e,PROPS_TYPE)}const PROPS_VALUE=["v","value"];function resolveValue$1(e,t){const r=resolveProps(e,PROPS_VALUE);if(null!=r)return r;throw createUnhandleNodeError(t)}const PROPS_MODIFIER=["m","modifier"];function resolveLinkedModifier(e){return resolveProps(e,PROPS_MODIFIER)}const PROPS_KEY=["k","key"];function resolveLinkedKey(e){const t=resolveProps(e,PROPS_KEY);if(t)return t;throw createUnhandleNodeError(6)}function resolveProps(e,t,r){for(let n=0;n<t.length;n++){const r=t[n];if(hasOwn(e,r)&&null!=e[r])return e[r]}return r}const AST_NODE_PROPS_KEYS=[...PROPS_BODY,...PROPS_CASES,...PROPS_STATIC,...PROPS_ITEMS,...PROPS_KEY,...PROPS_MODIFIER,...PROPS_VALUE,...PROPS_TYPE];function createUnhandleNodeError(e){return new Error(`unhandled node type: ${e}`)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=resolveBody(t);if(null==r)throw createUnhandleNodeError(0);if(1===resolveType(r)){const t=resolveCases(r);return e.plural(t.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=resolveStatic(t);if(null!=r)return"text"===e.type?r:e.normalize([r]);{const r=resolveItems(t).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=resolveType(t);switch(r){case 3:case 9:case 7:case 8:return resolveValue$1(t,r);case 4:{const n=t;if(hasOwn(n,"k")&&n.k)return e.interpolate(e.named(n.k));if(hasOwn(n,"key")&&n.key)return e.interpolate(e.named(n.key));throw createUnhandleNodeError(r)}case 5:{const n=t;if(hasOwn(n,"i")&&isNumber(n.i))return e.interpolate(e.list(n.i));if(hasOwn(n,"index")&&isNumber(n.index))return e.interpolate(e.list(n.index));throw createUnhandleNodeError(r)}case 6:{const r=t,n=resolveLinkedModifier(r),o=resolveLinkedKey(r);return e.linked(formatMessagePart(e,o),n?formatMessagePart(e,n):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${r}`)}}const defaultOnCacheKey=e=>e;let compileCache=create();function clearCompileCache(){compileCache=create()}function baseCompile(e,t={}){let r=!1;const n=t.onError||defaultOnError;return t.onError=e=>{r=!0,n(e)},{...baseCompile$1(e,t),detectError:r}}function compile(e,t){if(isString(e)){!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{ast:o,detectError:s}=baseCompile(e,{...t,location:!1,jit:!0}),a=format(o);return s?a:compileCache[r]=a}{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook("function:translate");function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreErrorCodes={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},CORE_ERROR_CODES_EXTEND_POINT=24;function createCoreError(e){return createCompileError(e,null,void 0)}function getLocale(e,t){return null!=t.locale?resolveLocale(t.locale):resolveLocale(e.locale)}let _resolveLocale;function resolveLocale(e){if(isString(e))return e;if(isFunction(e)){if(e.resolvedOnce&&null!=_resolveLocale)return _resolveLocale;if("Function"===e.constructor.name){const t=e();if(isPromise(t))throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=t}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const n=isString(r)?r:DEFAULT_LOCALE,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(n);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const a=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(a)?[a]:a,isArray(e)&&appendBlockToChain(s,e,!1),o.__localeChainCache.set(n,s)}return s}function appendBlockToChain(e,t,r){let n=!0;for(let o=0;o<t.length&&isBoolean(n);o++){const s=t[o];isString(s)&&(n=appendLocaleToChain(e,t[o],r))}return n}function appendLocaleToChain(e,t,r){let n;const o=t.split("-");do{n=appendItemToChain(e,o.join("-"),r),o.splice(-1,1)}while(o.length&&!0===n);return n}function appendItemToChain(e,t,r){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray(r)||isPlainObject(r))&&r[o]&&(n=r[o])}return n}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE,CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE,CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE;const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(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 formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,n,o,s,a,i,c,l=-1,u=0,E=0;const f=[];function _(){const t=e[l+1];if(5===u&&"'"===t||6===u&&'"'===t)return l++,o="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===n?n=o:n+=o},f[1]=()=>{void 0!==n&&(t.push(n),n=void 0)},f[2]=()=>{f[0](),E++},f[3]=()=>{if(E>0)E--,u=4,f[0]();else{if(E=0,void 0===n)return!1;if(n=formatSubPath(n),!1===n)return!1;f[1]()}};null!==u;)if(l++,r=e[l],"\\"!==r||!_()){if(s=getPathCharType(r),c=pathStateMachine[u],a=c[s]||c.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(i=f[a[1]],i&&(o=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const n=r.length;let o=e,s=0;for(;s<n;){const e=r[s];if(AST_NODE_PROPS_KEYS.includes(e)&&isMessageAST(o))return null;const t=o[e];if(void 0===t)return null;if(isFunction(o))return null;o=t,s++}return o}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},CORE_WARN_CODES_EXTEND_POINT=8,warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}const VERSION="10.0.7",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:VERSION,n=isString(e.locale)||isFunction(e.locale)?e.locale:DEFAULT_LOCALE,o=isFunction(n)?DEFAULT_LOCALE:n,s=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,a=isPlainObject(e.messages)?e.messages:createResources(o),i=isPlainObject(e.datetimeFormats)?e.datetimeFormats:createResources(o),c=isPlainObject(e.numberFormats)?e.numberFormats:createResources(o),l=assign(create(),e.modifiers,getDefaultLinkedModifiers()),u=e.pluralRules||create(),E=isFunction(e.missing)?e.missing:null,f=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,_=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,m=!!e.fallbackFormat,C=!!e.unresolving,d=isFunction(e.postTranslation)?e.postTranslation:null,p=isPlainObject(e.processor)?e.processor:null,T=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,N=!!e.escapeParameter,A=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,O=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,g=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,S=isObject(e.fallbackContext)?e.fallbackContext:void 0,L=e,P=isObject(L.__datetimeFormatters)?L.__datetimeFormatters:new Map,h=isObject(L.__numberFormatters)?L.__numberFormatters:new Map,b=isObject(L.__meta)?L.__meta:{};_cid++;const k={version:r,cid:_cid,locale:n,fallbackLocale:s,messages:a,modifiers:l,pluralRules:u,missing:E,missingWarn:f,fallbackWarn:_,fallbackFormat:m,unresolving:C,postTranslation:d,processor:p,warnHtmlMessage:T,escapeParameter:N,messageCompiler:A,messageResolver:O,localeFallbacker:g,fallbackContext:S,onWarn:t,__meta:b};return k.datetimeFormats=i,k.numberFormats=c,k.__datetimeFormatters=P,k.__numberFormatters=h,k}const createResources=e=>({[e]:create()});function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,n,o){const{missing:s,onWarn:a}=e;if(null!==s){const n=s(e,r,t,o);return isString(n)?n:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function isAlmostSameLocale(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function isImplicitFallback(e,t){const r=t.indexOf(e);if(-1===r)return!1;for(let n=r+1;n<t.length;n++)if(isAlmostSameLocale(e,t[n]))return!0;return!1}function datetime(e,...t){const{datetimeFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[c,l,u,E]=parseDateTimeArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const _=!!u.part,m=getLocale(e,u),C=a(e,o,m);if(!isString(c)||""===c)return new Intl.DateTimeFormat(m,E).format(l);let d,p={},T=null;for(let O=0;O<C.length&&(d=C[O],p=r[d]||{},T=p[c],!isPlainObject(T));O++)handleMissing(e,c,d,f,"datetime format");if(!isPlainObject(T)||!isString(d))return n?-1:c;let N=`${d}__${c}`;isEmptyObject(E)||(N=`${N}__${JSON.stringify(E)}`);let A=i.get(N);return A||(A=new Intl.DateTimeFormat(d,assign({},T,E)),i.set(N,A)),_?A.formatToParts(l):A.format(l)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,n,o]=e,s=create();let a,i=create();if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();a=new Date(r);try{a.toISOString()}catch{throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);a=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);a=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(i=n),isPlainObject(o)&&(i=o),[s.key||"",a,s,i]}function clearDateTimeFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__datetimeFormatters.has(e)&&n.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[c,l,u,E]=parseNumberArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const _=!!u.part,m=getLocale(e,u),C=a(e,o,m);if(!isString(c)||""===c)return new Intl.NumberFormat(m,E).format(l);let d,p={},T=null;for(let O=0;O<C.length&&(d=C[O],p=r[d]||{},T=p[c],!isPlainObject(T));O++)handleMissing(e,c,d,f,"number format");if(!isPlainObject(T)||!isString(d))return n?-1:c;let N=`${d}__${c}`;isEmptyObject(E)||(N=`${N}__${JSON.stringify(E)}`);let A=i.get(N);return A||(A=new Intl.NumberFormat(d,assign({},T,E)),i.set(N,A)),_?A.formatToParts(l):A.format(l)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,n,o]=e,s=create();let a=create();if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?a[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(a=n),isPlainObject(o)&&(a=o),[s.key||"",i,s,a]}function clearNumberFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__numberFormatters.has(e)&&n.__numberFormatters.delete(e)}}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],a=e.named||create();isNumber(e.pluralIndex)&&normalizeNamed(r,a);function i(t,r){const n=isFunction(e.messages)?e.messages(t,!!r):!!isObject(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const c=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,l=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>a[e],plural:e=>e[n(r,e.length,o)],linked:(t,...r)=>{const[n,o]=r;let s="text",a="";1===r.length?isObject(n)?(a=n.modifier||a,s=n.type||s):isString(n)&&(a=n||a):2===r.length&&(isString(n)&&(a=n||a),isString(o)&&(s=o||s));const c=i(t,!0)(u),l="vnode"===s&&isArray(c)&&a?c[0]:c;return a?(E=a,e.modifiers?e.modifiers[E]:DEFAULT_MODIFIER)(l,s):l;var E},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:l,normalize:c,values:assign(create(),s,a)};return u}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:n,unresolving:o,messageCompiler:s,fallbackLocale:a,messages:i}=e,[c,l]=parseTranslateArgs(...t),u=isBoolean(l.missingWarn)?l.missingWarn:e.missingWarn,E=isBoolean(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=isBoolean(l.escapeParameter)?l.escapeParameter:e.escapeParameter,_=!!l.resolvedMessage,m=isString(l.default)||isBoolean(l.default)?isBoolean(l.default)?s?c:()=>c:l.default:r?s?c:()=>c:null,C=r||null!=m&&(isString(m)||isFunction(m)),d=getLocale(e,l);f&&escapeParams(l);let[p,T,N]=_?[c,d,i[d]||create()]:resolveMessageFormat(e,c,d,a,E,u),A=p,O=c;if(_||isString(A)||isMessageAST(A)||isMessageFunction(A)||C&&(A=m,O=A),!(_||(isString(A)||isMessageAST(A)||isMessageFunction(A))&&isString(T)))return o?-1:c;let g=!1;const S=isMessageFunction(A)?A:compileMessageFormat(e,c,T,A,O,(()=>{g=!0}));if(g)return A;const L=evaluateMessage(e,S,createMessageContext(getMessageContextOptions(e,T,N,l)));return n?n(L,c):L}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,n,o,s){const{messages:a,onWarn:i,messageResolver:c,localeFallbacker:l}=e,u=l(e,n,r);let E,f=create(),_=null;for(let m=0;m<u.length&&(E=u[m],f=a[E]||create(),null===(_=c(f,t))&&(_=f[t]),!(isString(_)||isMessageAST(_)||isMessageFunction(_)));m++)if(!isImplicitFallback(E,u)){const r=handleMissing(e,t,E,s,"translate");r!==t&&(_=r)}return[_,E,f]}function compileMessageFormat(e,t,r,n,o,s){const{messageCompiler:a,warnHtmlMessage:i}=e;if(isMessageFunction(n)){const e=n;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==a){const e=()=>n;return e.locale=r,e.key=t,e}const c=a(n,getCompileContext(e,r,o,n,i,s));return c.locale=r,c.key=t,c.source=n,c}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,n]=e,o=create();if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?o.plural=r:isString(r)?o.default=r:isPlainObject(r)&&!isEmptyObject(r)?o.named=r:isArray(r)&&(o.list=r),isNumber(n)?o.plural=n:isString(n)?o.default=n:isPlainObject(n)&&assign(o,n),[s,o]}function getCompileContext(e,t,r,n,o,s){return{locale:t,key:r,warnHtmlMessage:o,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,n){const{modifiers:o,pluralRules:s,messageResolver:a,fallbackLocale:i,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,E={locale:t,modifiers:o,pluralRules:s,messages:(n,o)=>{let s=a(r,n);if(null==s&&(u||o)){const[,,r]=resolveMessageFormat(u||e,n,t,i,c,l);s=a(r,n)}if(isString(s)||isMessageAST(s)){let r=!1;const o=compileMessageFormat(e,n,t,s,n,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:o}return isMessageFunction(s)?s:NOOP_MESSAGE_FUNCTION}};return e.processor&&(E.processor=e.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),isNumber(n.plural)&&(E.pluralIndex=n.plural),E}registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain);export{AST_NODE_PROPS_KEYS,CORE_ERROR_CODES_EXTEND_POINT,CORE_WARN_CODES_EXTEND_POINT,CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getLocale,getWarnMessage,handleMissing,initI18nDevTools,isAlmostSameLocale,isImplicitFallback,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveLocale,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale};
6
+ function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign,_create=Object.create,create=(e=null)=>_create(e);function escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function escapeAttributeValue(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function sanitizeTranslatedHtml(e){e=(e=e.replace(/(\w+)\s*=\s*"([^"]*)"/g,((e,t,r)=>`${t}="${escapeAttributeValue(r)}"`))).replace(/(\w+)\s*=\s*'([^']*)'/g,((e,t,r)=>`${t}='${escapeAttributeValue(r)}'`));/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3"));return[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach((t=>{e=e.replace(t,"$1javascript&#58;")})),e}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(e,t){return hasOwnProperty.call(e,t)}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>"[object Object]"===toTypeString(e),toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,n)=>0===n?e+r:e+t+r),"")}function createPosition(e,t,r){return{line:e,column:t,offset:r}}function createLocation(e,t,r){return{start:e,end:t}}const CompileErrorCodes={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17;function createCompileError(e,t,r={}){const{domain:n,messages:o,args:s}=r,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=n,a}function defaultOnError(e){throw e}CompileErrorCodes.EXPECTED_TOKEN,CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,CompileErrorCodes.UNBALANCED_CLOSING_BRACE,CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,CompileErrorCodes.EMPTY_PLACEHOLDER,CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,CompileErrorCodes.INVALID_LINKED_FORMAT,CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE,CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE;const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let r=0,n=1,o=1,s=0;const a=e=>t[e]===CHAR_CR&&t[e+1]===CHAR_LF,i=e=>t[e]===CHAR_PS,c=e=>t[e]===CHAR_LS,l=e=>a(e)||(e=>t[e]===CHAR_LF)(e)||i(e)||c(e),u=e=>a(e)||i(e)||c(e)?CHAR_LF:t[e];function E(){return s=0,l(r)&&(n++,o=0),a(r)&&r++,r++,o++,t[r]}return{index:()=>r,line:()=>n,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(r),currentPeek:()=>u(r+s),next:E,peek:function(){return a(r+s)&&s++,s++,t[r+s]},reset:function(){r=0,n=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=r+s;for(;e!==r;)E();s=0}}}const EOF=void 0,DOT=".",LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const r=!1!==t.location,n=createScanner(e),o=()=>n.index(),s=()=>createPosition(n.line(),n.column(),n.index()),a=s(),i=o(),c={currentType:13,offset:i,startLoc:a,endLoc:a,lastType:13,lastOffset:i,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function E(e,t,n){e.endLoc=s(),e.currentType=t;const o={type:t};return r&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=n&&(o.value=n),o}const f=e=>E(e,13);function _(e,t){return e.currentChar()===t?(e.next(),t):(CompileErrorCodes.EXPECTED_TOKEN,s(),"")}function m(e){let t="";for(;e.currentPeek()===CHAR_SP||e.currentPeek()===CHAR_LF;)t+=e.currentPeek(),e.peek();return t}function p(e){const t=m(e);return e.skipToPeek(),t}function C(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function d(e,t){const{currentType:r}=t;if(2!==r)return!1;m(e);const n=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),n}function g(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const r=(t=!1,n="")=>{const o=e.currentPeek();return"{"===o?t:"@"!==o&&o?"|"===o?!(n===CHAR_SP||n===CHAR_LF):o===CHAR_SP?(e.peek(),r(!0,CHAR_SP)):o!==CHAR_LF||(e.peek(),r(!0,CHAR_LF)):t},n=r();return t&&e.resetPeek(),n}function A(e,t){const r=e.currentChar();return r===EOF?EOF:t(r)?(e.next(),r):null}function N(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}function O(e){return A(e,N)}function S(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t||45===t}function L(e){return A(e,S)}function P(e){const t=e.charCodeAt(0);return t>=48&&t<=57}function h(e){return A(e,P)}function b(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function k(e){return A(e,b)}function R(e){let t="",r="";for(;t=h(e);)r+=t;return r}function I(e){return e!==LITERAL_DELIMITER&&e!==CHAR_LF}function M(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return y(e,t,4);case"U":return y(e,t,6);default:return CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function y(e,t,r){_(e,t);let n="";for(let o=0;o<r;o++){const t=k(e);if(!t){CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}n+=t}return`\\${t}${n}`}function D(e){return"{"!==e&&"}"!==e&&e!==CHAR_SP&&e!==CHAR_LF}function F(e){p(e);const t=_(e,"|");return p(e),t}function v(e,t){let r=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),r=E(t,2,"{"),p(e),t.braceNest++,r;case"}":return t.braceNest>0&&2===t.currentType&&(CompileErrorCodes.EMPTY_PLACEHOLDER,s()),e.next(),r=E(t,3,"}"),t.braceNest--,t.braceNest>0&&p(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),r;case"@":return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=U(e,t)||f(t),t.braceNest=0,r;default:{let n=!0,o=!0,a=!0;if(g(e))return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=E(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r;if(t.braceNest>0&&(4===t.currentType||5===t.currentType||6===t.currentType))return CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,x(e,t);if(n=function(e,t){const{currentType:r}=t;if(2!==r)return!1;m(e);const n=C(e.currentPeek());return e.resetPeek(),n}(e,t))return r=E(t,4,function(e){p(e);let t="",r="";for(;t=L(e);)r+=t;return e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r}(e)),p(e),r;if(o=d(e,t))return r=E(t,5,function(e){p(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${R(e)}`):t+=R(e),e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),p(e),r;if(a=function(e,t){const{currentType:r}=t;if(2!==r)return!1;m(e);const n=e.currentPeek()===LITERAL_DELIMITER;return e.resetPeek(),n}(e,t))return r=E(t,6,function(e){p(e),_(e,"'");let t="",r="";for(;t=A(e,I);)r+="\\"===t?M(e):t;const n=e.currentChar();return n===CHAR_LF||n===EOF?(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),n===CHAR_LF&&(e.next(),_(e,"'")),r):(_(e,"'"),r)}(e)),p(e),r;if(!n&&!o&&!a)return r=E(t,12,function(e){p(e);let t="",r="";for(;t=A(e,D);)r+=t;return r}(e)),CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,s(),r.value,p(e),r;break}}return r}function U(e,t){const{currentType:r}=t;let n=null;const o=e.currentChar();switch(7!==r&&8!==r&&11!==r&&9!==r||o!==CHAR_LF&&o!==CHAR_SP||(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),n=E(t,7,"@"),t.inLinked=!0,n;case".":return p(e),e.next(),E(t,8,".");case":":return p(e),e.next(),E(t,9,":");default:return g(e)?(n=E(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n):function(e,t){const{currentType:r}=t;if(7!==r)return!1;m(e);const n="."===e.currentPeek();return e.resetPeek(),n}(e,t)||function(e,t){const{currentType:r}=t;if(7!==r&&11!==r)return!1;m(e);const n=":"===e.currentPeek();return e.resetPeek(),n}(e,t)?(p(e),U(e,t)):function(e,t){const{currentType:r}=t;if(8!==r)return!1;m(e);const n=C(e.currentPeek());return e.resetPeek(),n}(e,t)?(p(e),E(t,11,function(e){let t="",r="";for(;t=O(e);)r+=t;return r}(e))):function(e,t){const{currentType:r}=t;if(9!==r)return!1;const n=()=>{const t=e.currentPeek();return"{"===t?C(e.peek()):!("@"===t||"|"===t||":"===t||"."===t||t===CHAR_SP||!t)&&(t===CHAR_LF?(e.peek(),n()):T(e,!1))},o=n();return e.resetPeek(),o}(e,t)?(p(e),"{"===o?v(e,t)||n:E(t,10,function(e){const t=r=>{const n=e.currentChar();return"{"!==n&&"@"!==n&&"|"!==n&&"("!==n&&")"!==n&&n?n===CHAR_SP?r:(r+=n,e.next(),t(r)):r};return t("")}(e))):(7===r&&(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,x(e,t))}}function x(e,t){let r={type:13};if(t.braceNest>0)return v(e,t)||f(t);if(t.inLinked)return U(e,t)||f(t);switch(e.currentChar()){case"{":return v(e,t)||f(t);case"}":return CompileErrorCodes.UNBALANCED_CLOSING_BRACE,s(),e.next(),E(t,3,"}");case"@":return U(e,t)||f(t);default:if(g(e))return r=E(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r;if(T(e))return E(t,0,function(e){let t="";for(;;){const r=e.currentChar();if("{"===r||"}"===r||"@"===r||"|"===r||!r)break;if(r===CHAR_SP||r===CHAR_LF)if(T(e))t+=r,e.next();else{if(g(e))break;t+=r,e.next()}else t+=r,e.next()}return t}(e))}return r}return{nextToken:function(){const{currentType:e,offset:t,startLoc:r,endLoc:a}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=r,c.lastEndLoc=a,c.offset=o(),c.startLoc=s(),n.currentChar()===EOF?E(c,13):x(n,c)},currentOffset:o,currentPosition:s,context:l}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,r){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||r,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:r}=e;function n(e,r,n){const o={type:e};return t&&(o.start=r,o.end=r,o.loc={start:n,end:n}),o}function o(e,r,n,o){t&&(e.end=r,e.loc&&(e.loc.end=n))}function s(e,t){const r=e.context(),s=n(3,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(5,s,a);return i.index=parseInt(t,10),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function i(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(4,s,a);return i.key=t,e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function c(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(9,s,a);return i.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function l(e){const t=e.context(),r=n(6,t.offset,t.startLoc);let s=e.nextToken();if(8===s.type){const t=function(e){const t=e.nextToken(),r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(8,s,a);return 11!==t.type?(CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,r.lastStartLoc,i.value="",o(i,s,a),{nextConsumeToken:t,node:i}):(null==t.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,r.lastStartLoc,getTokenCaption(t)),i.value=t.value||"",o(i,e.currentOffset(),e.currentPosition()),{node:i})}(e);r.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(9!==s.type&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 10:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=function(e,t){const r=e.context(),s=n(7,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 4:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=i(e,s.value||"");break;case 5:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=a(e,s.value||"");break;case 6:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=c(e,s.value||"");break;default:{CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const a=e.context(),i=n(7,a.offset,a.startLoc);return i.value="",o(i,a.offset,a.startLoc),r.key=i,o(r,a.offset,a.startLoc),{nextConsumeToken:s,node:r}}}return o(r,e.currentOffset(),e.currentPosition()),{node:r}}function u(e){const t=e.context(),r=n(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);r.items=[];let u=null;do{const n=u||e.nextToken();switch(u=null,n.type){case 0:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(s(e,n.value||""));break;case 5:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(a(e,n.value||""));break;case 4:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(i(e,n.value||""));break;case 6:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(c(e,n.value||""));break;case 7:{const t=l(e);r.items.push(t.node),u=t.nextConsumeToken||null;break}}}while(13!==t.currentType&&1!==t.currentType);return o(r,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),r}function E(e){const t=e.context(),{offset:r,startLoc:s}=t,a=u(e);return 13===t.currentType?a:function(e,t,r,s){const a=e.context();let i=0===s.items.length;const c=n(1,t,r);c.cases=[],c.cases.push(s);do{const t=u(e);i||(i=0===t.items.length),c.cases.push(t)}while(13!==a.currentType);return i&&CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,o(c,e.currentOffset(),e.currentPosition()),c}(e,r,s,a)}return{parse:function(r){const s=createTokenizer(r,assign({},e)),a=s.context(),i=n(0,a.offset,a.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=E(s),e.onCacheKey&&(i.cacheKey=e.onCacheKey(r)),13!==a.currentType&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,r[a.offset]),o(i,s.currentOffset(),s.currentPosition()),i}}}function getTokenCaption(e){if(13===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const r={ast:e,helpers:new Set};return{context:()=>r,helper:e=>(r.helpers.add(e),e)}}function traverseNodes(e,t){for(let r=0;r<e.length;r++)traverseNode(e[r],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const r=createTransformer(e);r.helper("normalize"),e.body&&traverseNode(e.body,r);const n=r.context();e.helpers=Array.from(n.helpers)}function optimize(e){const t=e.body;return 2===t.type?optimizeMessageNode(t):t.cases.forEach((e=>optimizeMessageNode(e))),e}function optimizeMessageNode(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let r=0;r<e.items.length;r++){const n=e.items[r];if(3!==n.type&&9!==n.type)break;if(null==n.value)break;t.push(n.value)}if(t.length===e.items.length){e.static=join(t);for(let t=0;t<e.items.length;t++){const r=e.items[t];3!==r.type&&9!==r.type||delete r.value}}}}function minify(e){switch(e.t=e.type,e.type){case 0:{const t=e;minify(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,r=t.cases;for(let e=0;e<r.length;e++)minify(r[e]);t.c=r,delete t.cases;break}case 2:{const t=e,r=t.items;for(let e=0;e<r.length;e++)minify(r[e]);t.i=r,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;minify(t.key),t.k=t.key,delete t.key,t.modifier&&(minify(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function createCodeGenerator(e,t){const{sourceMap:r,filename:n,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};a&&e.loc&&(i.source=e.loc.source);function c(e,t){i.code+=e}function l(e,t=!0){const r=t?o:"";c(s?r+" ".repeat(e):r)}return{context:()=>i,push:c,indent:function(e=!0){const t=++i.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--i.indentLevel;e&&l(t)},newline:function(){l(i.indentLevel)},helper:e=>`_${e}`,needIndent:()=>i.needIndent}}function generateLinkedNode(e,t){const{helper:r}=e;e.push(`${r("linked")}(`),generateNode(e,t.key),t.modifier?(e.push(", "),generateNode(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function generateMessageNode(e,t){const{helper:r,needIndent:n}=e;e.push(`${r("normalize")}([`),e.indent(n());const o=t.items.length;for(let s=0;s<o&&(generateNode(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(n()),e.push("])")}function generatePluralNode(e,t){const{helper:r,needIndent:n}=e;if(t.cases.length>1){e.push(`${r("plural")}([`),e.indent(n());const o=t.cases.length;for(let r=0;r<o&&(generateNode(e,t.cases[r]),r!==o-1);r++)e.push(", ");e.deindent(n()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:r}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${r("interpolate")}(${r("list")}(${t.index}))`,t);break;case 4:e.push(`${r("interpolate")}(${r("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const r=isString(t.mode)?t.mode:"normal",n=isString(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==r,i=e.helpers||[],c=createCodeGenerator(e,{mode:r,filename:n,sourceMap:o,breakLineCode:s,needIndent:a});c.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(a),i.length>0&&(c.push(`const { ${join(i.map((e=>`${e}: _${e}`)),", ")} } = ctx`),c.newline()),c.push("return "),generateNode(c,e),c.deindent(a),c.push("}"),delete e.helpers;const{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function baseCompile$1(e,t={}){const r=assign({},t),n=!!r.jit,o=!!r.minify,s=null==r.optimize||r.optimize,a=createParser(r).parse(e);return n?(s&&optimize(a),o&&minify(a),{ast:a,code:""}):(transform(a,r),generate(a,r))}function isMessageAST(e){return isObject(e)&&0===resolveType(e)&&(hasOwn(e,"b")||hasOwn(e,"body"))}const PROPS_BODY=["b","body"];function resolveBody(e){return resolveProps(e,PROPS_BODY)}const PROPS_CASES=["c","cases"];function resolveCases(e){return resolveProps(e,PROPS_CASES,[])}const PROPS_STATIC=["s","static"];function resolveStatic(e){return resolveProps(e,PROPS_STATIC)}const PROPS_ITEMS=["i","items"];function resolveItems(e){return resolveProps(e,PROPS_ITEMS,[])}const PROPS_TYPE=["t","type"];function resolveType(e){return resolveProps(e,PROPS_TYPE)}const PROPS_VALUE=["v","value"];function resolveValue$1(e,t){const r=resolveProps(e,PROPS_VALUE);if(null!=r)return r;throw createUnhandleNodeError(t)}const PROPS_MODIFIER=["m","modifier"];function resolveLinkedModifier(e){return resolveProps(e,PROPS_MODIFIER)}const PROPS_KEY=["k","key"];function resolveLinkedKey(e){const t=resolveProps(e,PROPS_KEY);if(t)return t;throw createUnhandleNodeError(6)}function resolveProps(e,t,r){for(let n=0;n<t.length;n++){const r=t[n];if(hasOwn(e,r)&&null!=e[r])return e[r]}return r}const AST_NODE_PROPS_KEYS=[...PROPS_BODY,...PROPS_CASES,...PROPS_STATIC,...PROPS_ITEMS,...PROPS_KEY,...PROPS_MODIFIER,...PROPS_VALUE,...PROPS_TYPE];function createUnhandleNodeError(e){return new Error(`unhandled node type: ${e}`)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=resolveBody(t);if(null==r)throw createUnhandleNodeError(0);if(1===resolveType(r)){const t=resolveCases(r);return e.plural(t.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=resolveStatic(t);if(null!=r)return"text"===e.type?r:e.normalize([r]);{const r=resolveItems(t).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=resolveType(t);switch(r){case 3:case 9:case 7:case 8:return resolveValue$1(t,r);case 4:{const n=t;if(hasOwn(n,"k")&&n.k)return e.interpolate(e.named(n.k));if(hasOwn(n,"key")&&n.key)return e.interpolate(e.named(n.key));throw createUnhandleNodeError(r)}case 5:{const n=t;if(hasOwn(n,"i")&&isNumber(n.i))return e.interpolate(e.list(n.i));if(hasOwn(n,"index")&&isNumber(n.index))return e.interpolate(e.list(n.index));throw createUnhandleNodeError(r)}case 6:{const r=t,n=resolveLinkedModifier(r),o=resolveLinkedKey(r);return e.linked(formatMessagePart(e,o),n?formatMessagePart(e,n):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${r}`)}}const defaultOnCacheKey=e=>e;let compileCache=create();function clearCompileCache(){compileCache=create()}function baseCompile(e,t={}){let r=!1;const n=t.onError||defaultOnError;return t.onError=e=>{r=!0,n(e)},{...baseCompile$1(e,t),detectError:r}}function compile(e,t){if(isString(e)){!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{ast:o,detectError:s}=baseCompile(e,{...t,location:!1,jit:!0}),a=format(o);return s?a:compileCache[r]=a}{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook("function:translate");function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreErrorCodes={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},CORE_ERROR_CODES_EXTEND_POINT=24;function createCoreError(e){return createCompileError(e,null,void 0)}function getLocale(e,t){return null!=t.locale?resolveLocale(t.locale):resolveLocale(e.locale)}let _resolveLocale;function resolveLocale(e){if(isString(e))return e;if(isFunction(e)){if(e.resolvedOnce&&null!=_resolveLocale)return _resolveLocale;if("Function"===e.constructor.name){const t=e();if(isPromise(t))throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=t}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const n=isString(r)?r:DEFAULT_LOCALE,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(n);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const a=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(a)?[a]:a,isArray(e)&&appendBlockToChain(s,e,!1),o.__localeChainCache.set(n,s)}return s}function appendBlockToChain(e,t,r){let n=!0;for(let o=0;o<t.length&&isBoolean(n);o++){const s=t[o];isString(s)&&(n=appendLocaleToChain(e,t[o],r))}return n}function appendLocaleToChain(e,t,r){let n;const o=t.split("-");do{n=appendItemToChain(e,o.join("-"),r),o.splice(-1,1)}while(o.length&&!0===n);return n}function appendItemToChain(e,t,r){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray(r)||isPlainObject(r))&&r[o]&&(n=r[o])}return n}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE,CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE,CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE;const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(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 formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,n,o,s,a,i,c,l=-1,u=0,E=0;const f=[];function _(){const t=e[l+1];if(5===u&&"'"===t||6===u&&'"'===t)return l++,o="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===n?n=o:n+=o},f[1]=()=>{void 0!==n&&(t.push(n),n=void 0)},f[2]=()=>{f[0](),E++},f[3]=()=>{if(E>0)E--,u=4,f[0]();else{if(E=0,void 0===n)return!1;if(n=formatSubPath(n),!1===n)return!1;f[1]()}};null!==u;)if(l++,r=e[l],"\\"!==r||!_()){if(s=getPathCharType(r),c=pathStateMachine[u],a=c[s]||c.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(i=f[a[1]],i&&(o=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const n=r.length;let o=e,s=0;for(;s<n;){const e=r[s];if(AST_NODE_PROPS_KEYS.includes(e)&&isMessageAST(o))return null;const t=o[e];if(void 0===t)return null;if(isFunction(o))return null;o=t,s++}return o}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},CORE_WARN_CODES_EXTEND_POINT=8,warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}const VERSION="10.0.8",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:VERSION,n=isString(e.locale)||isFunction(e.locale)?e.locale:DEFAULT_LOCALE,o=isFunction(n)?DEFAULT_LOCALE:n,s=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,a=isPlainObject(e.messages)?e.messages:createResources(o),i=isPlainObject(e.datetimeFormats)?e.datetimeFormats:createResources(o),c=isPlainObject(e.numberFormats)?e.numberFormats:createResources(o),l=assign(create(),e.modifiers,getDefaultLinkedModifiers()),u=e.pluralRules||create(),E=isFunction(e.missing)?e.missing:null,f=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,_=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,m=!!e.fallbackFormat,p=!!e.unresolving,C=isFunction(e.postTranslation)?e.postTranslation:null,d=isPlainObject(e.processor)?e.processor:null,g=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,T=!!e.escapeParameter,A=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,N=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,O=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,S=isObject(e.fallbackContext)?e.fallbackContext:void 0,L=e,P=isObject(L.__datetimeFormatters)?L.__datetimeFormatters:new Map,h=isObject(L.__numberFormatters)?L.__numberFormatters:new Map,b=isObject(L.__meta)?L.__meta:{};_cid++;const k={version:r,cid:_cid,locale:n,fallbackLocale:s,messages:a,modifiers:l,pluralRules:u,missing:E,missingWarn:f,fallbackWarn:_,fallbackFormat:m,unresolving:p,postTranslation:C,processor:d,warnHtmlMessage:g,escapeParameter:T,messageCompiler:A,messageResolver:N,localeFallbacker:O,fallbackContext:S,onWarn:t,__meta:b};return k.datetimeFormats=i,k.numberFormats=c,k.__datetimeFormatters=P,k.__numberFormatters=h,k}const createResources=e=>({[e]:create()});function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,n,o){const{missing:s,onWarn:a}=e;if(null!==s){const n=s(e,r,t,o);return isString(n)?n:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function isAlmostSameLocale(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function isImplicitFallback(e,t){const r=t.indexOf(e);if(-1===r)return!1;for(let n=r+1;n<t.length;n++)if(isAlmostSameLocale(e,t[n]))return!0;return!1}function datetime(e,...t){const{datetimeFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[c,l,u,E]=parseDateTimeArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const _=!!u.part,m=getLocale(e,u),p=a(e,o,m);if(!isString(c)||""===c)return new Intl.DateTimeFormat(m,E).format(l);let C,d={},g=null;for(let N=0;N<p.length&&(C=p[N],d=r[C]||{},g=d[c],!isPlainObject(g));N++)handleMissing(e,c,C,f,"datetime format");if(!isPlainObject(g)||!isString(C))return n?-1:c;let T=`${C}__${c}`;isEmptyObject(E)||(T=`${T}__${JSON.stringify(E)}`);let A=i.get(T);return A||(A=new Intl.DateTimeFormat(C,assign({},g,E)),i.set(T,A)),_?A.formatToParts(l):A.format(l)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,n,o]=e,s=create();let a,i=create();if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();a=new Date(r);try{a.toISOString()}catch{throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);a=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);a=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(i=n),isPlainObject(o)&&(i=o),[s.key||"",a,s,i]}function clearDateTimeFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__datetimeFormatters.has(e)&&n.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[c,l,u,E]=parseNumberArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const _=!!u.part,m=getLocale(e,u),p=a(e,o,m);if(!isString(c)||""===c)return new Intl.NumberFormat(m,E).format(l);let C,d={},g=null;for(let N=0;N<p.length&&(C=p[N],d=r[C]||{},g=d[c],!isPlainObject(g));N++)handleMissing(e,c,C,f,"number format");if(!isPlainObject(g)||!isString(C))return n?-1:c;let T=`${C}__${c}`;isEmptyObject(E)||(T=`${T}__${JSON.stringify(E)}`);let A=i.get(T);return A||(A=new Intl.NumberFormat(C,assign({},g,E)),i.set(T,A)),_?A.formatToParts(l):A.format(l)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,n,o]=e,s=create();let a=create();if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?a[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(a=n),isPlainObject(o)&&(a=o),[s.key||"",i,s,a]}function clearNumberFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__numberFormatters.has(e)&&n.__numberFormatters.delete(e)}}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],a=e.named||create();isNumber(e.pluralIndex)&&normalizeNamed(r,a);function i(t,r){const n=isFunction(e.messages)?e.messages(t,!!r):!!isObject(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const c=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,l=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>a[e],plural:e=>e[n(r,e.length,o)],linked:(t,...r)=>{const[n,o]=r;let s="text",a="";1===r.length?isObject(n)?(a=n.modifier||a,s=n.type||s):isString(n)&&(a=n||a):2===r.length&&(isString(n)&&(a=n||a),isString(o)&&(s=o||s));const c=i(t,!0)(u),l="vnode"===s&&isArray(c)&&a?c[0]:c;return a?(E=a,e.modifiers?e.modifiers[E]:DEFAULT_MODIFIER)(l,s):l;var E},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:l,normalize:c,values:assign(create(),s,a)};return u}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:n,unresolving:o,messageCompiler:s,fallbackLocale:a,messages:i}=e,[c,l]=parseTranslateArgs(...t),u=isBoolean(l.missingWarn)?l.missingWarn:e.missingWarn,E=isBoolean(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=isBoolean(l.escapeParameter)?l.escapeParameter:e.escapeParameter,_=!!l.resolvedMessage,m=isString(l.default)||isBoolean(l.default)?isBoolean(l.default)?s?c:()=>c:l.default:r?s?c:()=>c:null,p=r||null!=m&&(isString(m)||isFunction(m)),C=getLocale(e,l);f&&escapeParams(l);let[d,g,T]=_?[c,C,i[C]||create()]:resolveMessageFormat(e,c,C,a,E,u),A=d,N=c;if(_||isString(A)||isMessageAST(A)||isMessageFunction(A)||p&&(A=m,N=A),!(_||(isString(A)||isMessageAST(A)||isMessageFunction(A))&&isString(g)))return o?-1:c;let O=!1;const S=isMessageFunction(A)?A:compileMessageFormat(e,c,g,A,N,(()=>{O=!0}));if(O)return A;const L=evaluateMessage(e,S,createMessageContext(getMessageContextOptions(e,g,T,l)));let P=n?n(L,c):L;return f&&isString(P)&&(P=sanitizeTranslatedHtml(P)),P}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,n,o,s){const{messages:a,onWarn:i,messageResolver:c,localeFallbacker:l}=e,u=l(e,n,r);let E,f=create(),_=null;for(let m=0;m<u.length&&(E=u[m],f=a[E]||create(),null===(_=c(f,t))&&(_=f[t]),!(isString(_)||isMessageAST(_)||isMessageFunction(_)));m++)if(!isImplicitFallback(E,u)){const r=handleMissing(e,t,E,s,"translate");r!==t&&(_=r)}return[_,E,f]}function compileMessageFormat(e,t,r,n,o,s){const{messageCompiler:a,warnHtmlMessage:i}=e;if(isMessageFunction(n)){const e=n;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==a){const e=()=>n;return e.locale=r,e.key=t,e}const c=a(n,getCompileContext(e,r,o,n,i,s));return c.locale=r,c.key=t,c.source=n,c}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,n]=e,o=create();if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?o.plural=r:isString(r)?o.default=r:isPlainObject(r)&&!isEmptyObject(r)?o.named=r:isArray(r)&&(o.list=r),isNumber(n)?o.plural=n:isString(n)?o.default=n:isPlainObject(n)&&assign(o,n),[s,o]}function getCompileContext(e,t,r,n,o,s){return{locale:t,key:r,warnHtmlMessage:o,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,n){const{modifiers:o,pluralRules:s,messageResolver:a,fallbackLocale:i,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,E={locale:t,modifiers:o,pluralRules:s,messages:(n,o)=>{let s=a(r,n);if(null==s&&(u||o)){const[,,r]=resolveMessageFormat(u||e,n,t,i,c,l);s=a(r,n)}if(isString(s)||isMessageAST(s)){let r=!1;const o=compileMessageFormat(e,n,t,s,n,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:o}return isMessageFunction(s)?s:NOOP_MESSAGE_FUNCTION}};return e.processor&&(E.processor=e.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),isNumber(n.plural)&&(E.pluralIndex=n.plural),E}registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain);export{AST_NODE_PROPS_KEYS,CORE_ERROR_CODES_EXTEND_POINT,CORE_WARN_CODES_EXTEND_POINT,CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getLocale,getWarnMessage,handleMissing,initI18nDevTools,isAlmostSameLocale,isImplicitFallback,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveLocale,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale};
@@ -1,11 +1,21 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
6
  var IntlifyCore = (function (exports) {
7
7
  'use strict';
8
8
 
9
+ function warn(msg, err) {
10
+ if (typeof console !== 'undefined') {
11
+ console.warn(`[intlify] ` + msg);
12
+ /* istanbul ignore if */
13
+ if (err) {
14
+ console.warn(err.stack);
15
+ }
16
+ }
17
+ }
18
+
9
19
  /**
10
20
  * Original Utilities
11
21
  * written by kazuya kawaguchi
@@ -58,10 +68,49 @@ var IntlifyCore = (function (exports) {
58
68
  const create = (obj = null) => _create(obj);
59
69
  function escapeHtml(rawText) {
60
70
  return rawText
71
+ .replace(/&/g, '&amp;') // escape `&` first to avoid double escaping
61
72
  .replace(/</g, '&lt;')
62
73
  .replace(/>/g, '&gt;')
63
74
  .replace(/"/g, '&quot;')
64
- .replace(/'/g, '&apos;');
75
+ .replace(/'/g, '&apos;')
76
+ .replace(/\//g, '&#x2F;') // escape `/` to prevent closing tags or JavaScript URLs
77
+ .replace(/=/g, '&#x3D;'); // escape `=` to prevent attribute injection
78
+ }
79
+ function escapeAttributeValue(value) {
80
+ return value
81
+ .replace(/&(?![a-zA-Z0-9#]{2,6};)/g, '&amp;') // escape unescaped `&`
82
+ .replace(/"/g, '&quot;')
83
+ .replace(/'/g, '&apos;')
84
+ .replace(/</g, '&lt;')
85
+ .replace(/>/g, '&gt;');
86
+ }
87
+ function sanitizeTranslatedHtml(html) {
88
+ // Escape dangerous characters in attribute values
89
+ // Process attributes with double quotes
90
+ html = html.replace(/(\w+)\s*=\s*"([^"]*)"/g, (_, attrName, attrValue) => `${attrName}="${escapeAttributeValue(attrValue)}"`);
91
+ // Process attributes with single quotes
92
+ html = html.replace(/(\w+)\s*=\s*'([^']*)'/g, (_, attrName, attrValue) => `${attrName}='${escapeAttributeValue(attrValue)}'`);
93
+ // Detect and neutralize event handler attributes
94
+ const eventHandlerPattern = /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi;
95
+ if (eventHandlerPattern.test(html)) {
96
+ {
97
+ warn('Potentially dangerous event handlers detected in translation. ' +
98
+ 'Consider removing onclick, onerror, etc. from your translation messages.');
99
+ }
100
+ // Neutralize event handler attributes by escaping 'on'
101
+ html = html.replace(/(\s+)(on)(\w+\s*=)/gi, '$1&#111;n$3');
102
+ }
103
+ // Disable javascript: URLs in various contexts
104
+ const javascriptUrlPattern = [
105
+ // In href, src, action, formaction attributes
106
+ /(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,
107
+ // In style attributes within url()
108
+ /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi
109
+ ];
110
+ javascriptUrlPattern.forEach(pattern => {
111
+ html = html.replace(pattern, '$1javascript&#58;');
112
+ });
113
+ return html;
65
114
  }
66
115
  const hasOwnProperty = Object.prototype.hasOwnProperty;
67
116
  function hasOwn(obj, key) {
@@ -133,16 +182,6 @@ var IntlifyCore = (function (exports) {
133
182
  return res.join('\n');
134
183
  }
135
184
 
136
- function warn(msg, err) {
137
- if (typeof console !== 'undefined') {
138
- console.warn(`[intlify] ` + msg);
139
- /* istanbul ignore if */
140
- if (err) {
141
- console.warn(err.stack);
142
- }
143
- }
144
- }
145
-
146
185
  function createPosition(line, column, offset) {
147
186
  return { line, column, offset };
148
187
  }
@@ -2373,7 +2412,7 @@ var IntlifyCore = (function (exports) {
2373
2412
  * Intlify core-base version
2374
2413
  * @internal
2375
2414
  */
2376
- const VERSION = '10.0.7';
2415
+ const VERSION = '10.0.8';
2377
2416
  const NOT_REOSLVED = -1;
2378
2417
  const DEFAULT_LOCALE = 'en-US';
2379
2418
  const MISSING_RESOLVE_VALUE = '';
@@ -3162,9 +3201,13 @@ var IntlifyCore = (function (exports) {
3162
3201
  const msgContext = createMessageContext(ctxOptions);
3163
3202
  const messaged = evaluateMessage(context, msg, msgContext);
3164
3203
  // if use post translation option, proceed it with handler
3165
- const ret = postTranslation
3204
+ let ret = postTranslation
3166
3205
  ? postTranslation(messaged, key)
3167
3206
  : messaged;
3207
+ // apply HTML sanitization for security
3208
+ if (escapeParameter && isString(ret)) {
3209
+ ret = sanitizeTranslatedHtml(ret);
3210
+ }
3168
3211
  // NOTE: experimental !!
3169
3212
  {
3170
3213
  // prettier-ignore
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
- var IntlifyCore=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=(e,t,n)=>r({l:e,k:t,s:n}),r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),c=e=>"[object Date]"===C(e),s=e=>"[object RegExp]"===C(e),a=e=>k(e)&&0===Object.keys(e).length,l=Object.assign,i=Object.create,u=(e=null)=>i(e);function f(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const E=Object.prototype.hasOwnProperty;function _(e,t){return E.call(e,t)}const m=Array.isArray,d=e=>"function"==typeof e,p=e=>"string"==typeof e,N=e=>"boolean"==typeof e,L=e=>null!==e&&"object"==typeof e,T=e=>L(e)&&d(e.then)&&d(e.catch),A=Object.prototype.toString,C=e=>A.call(e),k=e=>"[object Object]"===C(e);function h(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}function O(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function I(e,t,n){return{start:e,end:t}}const g={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};function S(e,t,n={}){const{domain:r,messages:o,args:c}=n,s=new SyntaxError(String(e));return s.code=e,t&&(s.location=t),s.domain=r,s}function y(e){throw e}g.EXPECTED_TOKEN,g.INVALID_TOKEN_IN_PLACEHOLDER,g.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,g.UNKNOWN_ESCAPE_SEQUENCE,g.INVALID_UNICODE_ESCAPE_SEQUENCE,g.UNBALANCED_CLOSING_BRACE,g.UNTERMINATED_CLOSING_BRACE,g.EMPTY_PLACEHOLDER,g.NOT_ALLOW_NEST_PLACEHOLDER,g.INVALID_LINKED_FORMAT,g.MUST_HAVE_MESSAGES_IN_PLURAL,g.UNEXPECTED_EMPTY_LINKED_MODIFIER,g.UNEXPECTED_EMPTY_LINKED_KEY,g.UNEXPECTED_LEXICAL_ANALYSIS,g.UNHANDLED_CODEGEN_NODE_TYPE,g.UNHANDLED_MINIFIER_NODE_TYPE;const b=" ",D="\r",P="\n",R=String.fromCharCode(8232),M=String.fromCharCode(8233);function U(e){const t=e;let n=0,r=1,o=1,c=0;const s=e=>t[e]===D&&t[e+1]===P,a=e=>t[e]===M,l=e=>t[e]===R,i=e=>s(e)||(e=>t[e]===P)(e)||a(e)||l(e),u=e=>s(e)||a(e)||l(e)?P:t[e];function f(){return c=0,i(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>c,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+c),next:f,peek:function(){return s(n+c)&&c++,c++,t[n+c]},reset:function(){n=0,r=1,o=1,c=0},resetPeek:function(e=0){c=e},skipToPeek:function(){const e=n+c;for(;e!==n;)f();c=0}}}const v=void 0,x="'";function F(e,t={}){const n=!1!==t.location,r=U(e),o=()=>r.index(),c=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=c(),a=o(),l={currentType:13,offset:a,startLoc:s,endLoc:s,lastType:13,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},i=()=>l,{onError:u}=t;function f(e,t,r){e.endLoc=c(),e.currentType=t;const o={type:t};return n&&(o.loc=I(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const E=e=>f(e,13);function _(e,t){return e.currentChar()===t?(e.next(),t):(g.EXPECTED_TOKEN,c(),"")}function m(e){let t="";for(;e.currentPeek()===b||e.currentPeek()===P;)t+=e.currentPeek(),e.peek();return t}function d(e){const t=m(e);return e.skipToPeek(),t}function p(e){if(e===v)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function N(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=function(e){if(e===v)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function L(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const n=(t=!1,r="")=>{const o=e.currentPeek();return"{"===o?t:"@"!==o&&o?"|"===o?!(r===b||r===P):o===b?(e.peek(),n(!0,b)):o!==P||(e.peek(),n(!0,P)):t},r=n();return t&&e.resetPeek(),r}function A(e,t){const n=e.currentChar();return n===v?v:t(n)?(e.next(),n):null}function C(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}function k(e){return A(e,C)}function h(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t||45===t}function O(e){return A(e,h)}function S(e){const t=e.charCodeAt(0);return t>=48&&t<=57}function y(e){return A(e,S)}function D(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function R(e){return A(e,D)}function M(e){let t="",n="";for(;t=y(e);)n+=t;return n}function F(e){return e!==x&&e!==P}function w(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return W(e,t,4);case"U":return W(e,t,6);default:return g.UNKNOWN_ESCAPE_SEQUENCE,c(),""}}function W(e,t,n){_(e,t);let r="";for(let o=0;o<n;o++){const t=R(e);if(!t){g.INVALID_UNICODE_ESCAPE_SEQUENCE,c(),e.currentChar();break}r+=t}return`\\${t}${r}`}function Y(e){return"{"!==e&&"}"!==e&&e!==b&&e!==P}function K(e){d(e);const t=_(e,"|");return d(e),t}function G(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(g.NOT_ALLOW_NEST_PLACEHOLDER,c()),e.next(),n=f(t,2,"{"),d(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&(g.EMPTY_PLACEHOLDER,c()),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&d(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&(g.UNTERMINATED_CLOSING_BRACE,c()),n=X(e,t)||E(t),t.braceNest=0,n;default:{let r=!0,o=!0,s=!0;if(L(e))return t.braceNest>0&&(g.UNTERMINATED_CLOSING_BRACE,c()),n=f(t,1,K(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(4===t.currentType||5===t.currentType||6===t.currentType))return g.UNTERMINATED_CLOSING_BRACE,c(),t.braceNest=0,$(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,4,function(e){d(e);let t="",n="";for(;t=O(e);)n+=t;return e.currentChar()===v&&(g.UNTERMINATED_CLOSING_BRACE,c()),n}(e)),d(e),n;if(o=N(e,t))return n=f(t,5,function(e){d(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${M(e)}`):t+=M(e),e.currentChar()===v&&(g.UNTERMINATED_CLOSING_BRACE,c()),t}(e)),d(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=e.currentPeek()===x;return e.resetPeek(),r}(e,t))return n=f(t,6,function(e){d(e),_(e,"'");let t="",n="";for(;t=A(e,F);)n+="\\"===t?w(e):t;const r=e.currentChar();return r===P||r===v?(g.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,c(),r===P&&(e.next(),_(e,"'")),n):(_(e,"'"),n)}(e)),d(e),n;if(!r&&!o&&!s)return n=f(t,12,function(e){d(e);let t="",n="";for(;t=A(e,Y);)n+=t;return n}(e)),g.INVALID_TOKEN_IN_PLACEHOLDER,c(),n.value,d(e),n;break}}return n}function X(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(7!==n&&8!==n&&11!==n&&9!==n||o!==P&&o!==b||(g.INVALID_LINKED_FORMAT,c()),o){case"@":return e.next(),r=f(t,7,"@"),t.inLinked=!0,r;case".":return d(e),e.next(),f(t,8,".");case":":return d(e),e.next(),f(t,9,":");default:return L(e)?(r=f(t,1,K(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(7!==n)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(7!==n&&11!==n)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(d(e),X(e,t)):function(e,t){const{currentType:n}=t;if(8!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t)?(d(e),f(t,11,function(e){let t="",n="";for(;t=k(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(9!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?p(e.peek()):!("@"===t||"|"===t||":"===t||"."===t||t===b||!t)&&(t===P?(e.peek(),r()):T(e,!1))},o=r();return e.resetPeek(),o}(e,t)?(d(e),"{"===o?G(e,t)||r:f(t,10,function(e){const t=n=>{const r=e.currentChar();return"{"!==r&&"@"!==r&&"|"!==r&&"("!==r&&")"!==r&&r?r===b?n:(n+=r,e.next(),t(n)):n};return t("")}(e))):(7===n&&(g.INVALID_LINKED_FORMAT,c()),t.braceNest=0,t.inLinked=!1,$(e,t))}}function $(e,t){let n={type:13};if(t.braceNest>0)return G(e,t)||E(t);if(t.inLinked)return X(e,t)||E(t);switch(e.currentChar()){case"{":return G(e,t)||E(t);case"}":return g.UNBALANCED_CLOSING_BRACE,c(),e.next(),f(t,3,"}");case"@":return X(e,t)||E(t);default:if(L(e))return n=f(t,1,K(e)),t.braceNest=0,t.inLinked=!1,n;if(T(e))return f(t,0,function(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if(n===b||n===P)if(T(e))t+=n,e.next();else{if(L(e))break;t+=n,e.next()}else t+=n,e.next()}return t}(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=s,l.offset=o(),l.startLoc=c(),r.currentChar()===v?f(l,13):$(r,l)},currentOffset:o,currentPosition:c,context:i}}const w=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function W(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function Y(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e};return t&&(o.start=n,o.end=n,o.loc={start:r,end:r}),o}function o(e,n,r,o){t&&(e.end=n,e.loc&&(e.loc.end=r))}function c(e,t){const n=e.context(),c=r(3,n.offset,n.startLoc);return c.value=t,o(c,e.currentOffset(),e.currentPosition()),c}function s(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(5,c,s);return a.index=parseInt(t,10),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function a(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(4,c,s);return a.key=t,e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function i(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(9,c,s);return a.value=t.replace(w,W),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function u(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let c=e.nextToken();if(8===c.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(8,c,s);return 11!==t.type?(g.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,a.value="",o(a,c,s),{nextConsumeToken:t,node:a}):(null==t.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,K(t)),a.value=t.value||"",o(a,e.currentOffset(),e.currentPosition()),{node:a})}(e);n.modifier=t.node,c=t.nextConsumeToken||e.nextToken()}switch(9!==c.type&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(c)),c=e.nextToken(),2===c.type&&(c=e.nextToken()),c.type){case 10:null==c.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(c)),n.key=function(e,t){const n=e.context(),c=r(7,n.offset,n.startLoc);return c.value=t,o(c,e.currentOffset(),e.currentPosition()),c}(e,c.value||"");break;case 4:null==c.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(c)),n.key=a(e,c.value||"");break;case 5:null==c.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(c)),n.key=s(e,c.value||"");break;case 6:null==c.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(c)),n.key=i(e,c.value||"");break;default:{g.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const s=e.context(),a=r(7,s.offset,s.startLoc);return a.value="",o(a,s.offset,s.startLoc),n.key=a,o(n,s.offset,s.startLoc),{nextConsumeToken:c,node:n}}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function f(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let l=null;do{const r=l||e.nextToken();switch(l=null,r.type){case 0:null==r.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(c(e,r.value||""));break;case 5:null==r.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(s(e,r.value||""));break;case 4:null==r.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(a(e,r.value||""));break;case 6:null==r.value&&(g.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(i(e,r.value||""));break;case 7:{const t=u(e);n.items.push(t.node),l=t.nextConsumeToken||null;break}}}while(13!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function E(e){const t=e.context(),{offset:n,startLoc:c}=t,s=f(e);return 13===t.currentType?s:function(e,t,n,c){const s=e.context();let a=0===c.items.length;const l=r(1,t,n);l.cases=[],l.cases.push(c);do{const t=f(e);a||(a=0===t.items.length),l.cases.push(t)}while(13!==s.currentType);return a&&g.MUST_HAVE_MESSAGES_IN_PLURAL,o(l,e.currentOffset(),e.currentPosition()),l}(e,n,c,s)}return{parse:function(n){const c=F(n,l({},e)),s=c.context(),a=r(0,s.offset,s.startLoc);return t&&a.loc&&(a.loc.source=n),a.body=E(c),e.onCacheKey&&(a.cacheKey=e.onCacheKey(n)),13!==s.currentType&&(g.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,n[s.offset]),o(a,c.currentOffset(),c.currentPosition()),a}}}function K(e){if(13===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function G(e,t){for(let n=0;n<e.length;n++)X(e[n],t)}function X(e,t){switch(e.type){case 1:G(e.cases,t),t.helper("plural");break;case 2:G(e.items,t);break;case 6:X(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function $(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&X(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function V(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];if(3!==r.type&&9!==r.type)break;if(null==r.value)break;t.push(r.value)}if(t.length===e.items.length){e.static=h(t);for(let t=0;t<e.items.length;t++){const n=e.items[t];3!==n.type&&9!==n.type||delete n.value}}}}function H(e){switch(e.t=e.type,e.type){case 0:{const t=e;H(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let e=0;e<n.length;e++)H(n[e]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let e=0;e<n.length;e++)H(n[e]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;H(t.key),t.k=t.key,delete t.key,t.modifier&&(H(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function B(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?B(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&(B(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let c=0;c<o&&(B(e,t.items[c]),c!==o-1);c++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),B(e,t.key),t.modifier?(e.push(", "),B(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const j=(e,t={})=>{const n=p(t.mode)?t.mode:"normal",r=p(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,c=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,a=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:c}=t,s=!1!==t.location,a={filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:c,indentLevel:0};function l(e,t){a.code+=e}function i(e,t=!0){const n=t?o:"";l(c?n+" ".repeat(e):n)}return s&&e.loc&&(a.source=e.loc.source),{context:()=>a,push:l,indent:function(e=!0){const t=++a.indentLevel;e&&i(t)},deindent:function(e=!0){const t=--a.indentLevel;e&&i(t)},newline:function(){i(a.indentLevel)},helper:e=>`_${e}`,needIndent:()=>a.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:c,needIndent:s});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),a.length>0&&(l.push(`const { ${h(a.map((e=>`${e}: _${e}`)),", ")} } = ctx`),l.newline()),l.push("return "),B(l,e),l.deindent(s),l.push("}"),delete e.helpers;const{code:i,map:u}=l.context();return{ast:e,code:i,map:u?u.toJSON():void 0}};function z(e,t={}){const n=l({},t),r=!!n.jit,o=!!n.minify,c=null==n.optimize||n.optimize,s=Y(n).parse(e);return r?(c&&function(e){const t=e.body;2===t.type?V(t):t.cases.forEach((e=>V(e)))}(s),o&&H(s),{ast:s,code:""}):($(s,n),j(s,n))}function Q(e){return L(e)&&0===ne(e)&&(_(e,"b")||_(e,"body"))}const J=["b","body"];const Z=["c","cases"];const q=["s","static"];const ee=["i","items"];const te=["t","type"];function ne(e){return ae(e,te)}const re=["v","value"];function oe(e,t){const n=ae(e,re);if(null!=n)return n;throw ie(t)}const ce=["m","modifier"];const se=["k","key"];function ae(e,t,n){for(let r=0;r<t.length;r++){const n=t[r];if(_(e,n)&&null!=e[n])return e[n]}return n}const le=[...J,...Z,...q,...ee,...se,...ce,...re,...te];function ie(e){return new Error(`unhandled node type: ${e}`)}function ue(e){return t=>function(e,t){const n=(r=t,ae(r,J));var r;if(null==n)throw ie(0);if(1===ne(n)){const t=function(e){return ae(e,Z,[])}(n);return e.plural(t.reduce(((t,n)=>[...t,fe(e,n)]),[]))}return fe(e,n)}(t,e)}function fe(e,t){const n=function(e){return ae(e,q)}(t);if(null!=n)return"text"===e.type?n:e.normalize([n]);{const n=function(e){return ae(e,ee,[])}(t).reduce(((t,n)=>[...t,Ee(e,n)]),[]);return e.normalize(n)}}function Ee(e,t){const n=ne(t);switch(n){case 3:case 9:case 7:case 8:return oe(t,n);case 4:{const r=t;if(_(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(_(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw ie(n)}case 5:{const r=t;if(_(r,"i")&&o(r.i))return e.interpolate(e.list(r.i));if(_(r,"index")&&o(r.index))return e.interpolate(e.list(r.index));throw ie(n)}case 6:{const n=t,r=function(e){return ae(e,ce)}(n),o=function(e){const t=ae(e,se);if(t)return t;throw ie(6)}(n);return e.linked(Ee(e,o),r?Ee(e,r):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${n}`)}}const _e=e=>e;let me=u();function de(e,t){if(p(e)){!N(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||_e)(e),r=me[n];if(r)return r;const{ast:o,detectError:c}=function(e,t={}){let n=!1;const r=t.onError||y;return t.onError=e=>{n=!0,r(e)},{...z(e,t),detectError:n}}(e,{...t,location:!1,jit:!0}),s=ue(o);return c?s:me[n]=s}{const t=e.cacheKey;if(t){const n=me[t];return n||(me[t]=ue(e))}return ue(e)}}let pe=null;const Ne=Le("function:translate");function Le(e){return t=>pe&&pe.emit(e,t)}const Te={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function Ae(e,t){return null!=t.locale?ke(t.locale):ke(e.locale)}let Ce;function ke(e){if(p(e))return e;if(d(e)){if(e.resolvedOnce&&null!=Ce)return Ce;if("Function"===e.constructor.name){const t=e();if(T(t))throw Error(Te.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ce=t}throw Error(Te.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(Te.NOT_SUPPORT_LOCALE_TYPE)}function he(e,t,n){return[...new Set([n,...m(t)?t:L(t)?Object.keys(t):p(t)?[t]:[n]])]}function Oe(e,t,n){const r=p(n)?n:We,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let c=o.__localeChainCache.get(r);if(!c){c=[];let e=[n];for(;m(e);)e=Ie(c,e,t);const s=m(t)||!k(t)?t:t.default?t.default:null;e=p(s)?[s]:s,m(e)&&Ie(c,e,!1),o.__localeChainCache.set(r,c)}return c}function Ie(e,t,n){let r=!0;for(let o=0;o<t.length&&N(r);o++){const c=t[o];p(c)&&(r=ge(e,t[o],n))}return r}function ge(e,t,n){let r;const o=t.split("-");do{r=Se(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function Se(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(m(n)||k(n))&&n[o]&&(r=n[o])}return r}Te.INVALID_ARGUMENT,Te.INVALID_DATE_ARGUMENT,Te.INVALID_ISO_DATE_ARGUMENT,Te.NOT_SUPPORT_NON_STRING_MESSAGE,Te.NOT_SUPPORT_LOCALE_PROMISE_VALUE,Te.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,Te.NOT_SUPPORT_LOCALE_TYPE;const ye=[];ye[0]={w:[0],i:[3,0],"[":[4],o:[7]},ye[1]={w:[1],".":[2],"[":[4],o:[7]},ye[2]={w:[2],i:[3,0],0:[3,0]},ye[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},ye[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},ye[5]={"'":[4,0],o:8,l:[5,0]},ye[6]={'"':[4,0],o:8,l:[6,0]};const be=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function De(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 Pe(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,be.test(n)?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 n}function Re(e){const t=[];let n,r,o,c,s,a,l,i=-1,u=0,f=0;const E=[];function _(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,o="\\"+t,E[0](),!0}for(E[0]=()=>{void 0===r?r=o:r+=o},E[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},E[2]=()=>{E[0](),f++},E[3]=()=>{if(f>0)f--,u=4,E[0]();else{if(f=0,void 0===r)return!1;if(r=Pe(r),!1===r)return!1;E[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!_()){if(c=De(n),l=ye[u],s=l[c]||l.l||8,8===s)return;if(u=s[0],void 0!==s[1]&&(a=E[s[1]],a&&(o=n,!1===a())))return;if(7===u)return t}}const Me=new Map;function Ue(e,t){return L(e)?e[t]:null}function ve(e,t){if(!L(e))return null;let n=Me.get(t);if(n||(n=Re(t),n&&Me.set(t,n)),!n)return null;const r=n.length;let o=e,c=0;for(;c<r;){const e=n[c];if(le.includes(e)&&Q(o))return null;const t=o[e];if(void 0===t)return null;if(d(o))return null;o=t,c++}return o}const xe={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},Fe={[xe.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[xe.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[xe.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[xe.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[xe.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[xe.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[xe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};const we="10.0.7",We="en-US",Ye=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let Ke,Ge,Xe;function $e(e){Ke=e}function Ve(e){Ge=e}function He(e){Xe=e}let Be=null;let je=null;let ze=0;const Qe=e=>({[e]:u()});function Je(e,t,n,r,o){const{missing:c,onWarn:s}=e;if(null!==c){const r=c(e,n,t,o);return p(r)?r:t}return t}function Ze(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function qe(e,t){const n=t.indexOf(e);if(-1===n)return!1;for(let r=n+1;r<t.length;r++)if(Ze(e,t[r]))return!0;return!1}const et=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function tt(...e){const[t,n,r,s]=e,a=u();let l,i=u();if(p(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(Te.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();l=new Date(n);try{l.toISOString()}catch{throw Error(Te.INVALID_ISO_DATE_ARGUMENT)}}else if(c(t)){if(isNaN(t.getTime()))throw Error(Te.INVALID_DATE_ARGUMENT);l=t}else{if(!o(t))throw Error(Te.INVALID_ARGUMENT);l=t}return p(n)?a.key=n:k(n)&&Object.keys(n).forEach((e=>{et.includes(e)?i[e]=n[e]:a[e]=n[e]})),p(r)?a.locale=r:k(r)&&(i=r),k(s)&&(i=s),[a.key||"",l,a,i]}const nt=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function rt(...e){const[t,n,r,c]=e,s=u();let a=u();if(!o(t))throw Error(Te.INVALID_ARGUMENT);const l=t;return p(n)?s.key=n:k(n)&&Object.keys(n).forEach((e=>{nt.includes(e)?a[e]=n[e]:s[e]=n[e]})),p(r)?s.locale=r:k(r)&&(a=r),k(c)&&(a=c),[s.key||"",l,s,a]}const ot=e=>e,ct=e=>"",st="text",at=e=>0===e.length?"":h(e),lt=e=>null==e?"":m(e)||k(e)&&e.toString===A?JSON.stringify(e,null,2):String(e);function it(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function ut(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=L(e.pluralRules)&&p(t)&&d(e.pluralRules[t])?e.pluralRules[t]:it,c=L(e.pluralRules)&&p(t)&&d(e.pluralRules[t])?it:void 0,s=e.list||[],a=e.named||u();o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,a);function i(t,n){const r=d(e.messages)?e.messages(t,!!n):!!L(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):ct)}const f=k(e.processor)&&d(e.processor.normalize)?e.processor.normalize:at,E=k(e.processor)&&d(e.processor.interpolate)?e.processor.interpolate:lt,_={list:e=>s[e],named:e=>a[e],plural:e=>e[r(n,e.length,c)],linked:(t,...n)=>{const[r,o]=n;let c="text",s="";1===n.length?L(r)?(s=r.modifier||s,c=r.type||c):p(r)&&(s=r||s):2===n.length&&(p(r)&&(s=r||s),p(o)&&(c=o||c));const a=i(t,!0)(_),l="vnode"===c&&m(a)&&s?a[0]:a;return s?(u=s,e.modifiers?e.modifiers[u]:ot)(l,c):l;var u},message:i,type:k(e.processor)&&p(e.processor.type)?e.processor.type:st,interpolate:E,normalize:f,values:l(u(),s,a)};return _}const ft=()=>"",Et=e=>d(e);function _t(e,t,n,r,o,c){const{messages:s,onWarn:a,messageResolver:l,localeFallbacker:i}=e,f=i(e,r,n);let E,_=u(),m=null;for(let d=0;d<f.length&&(E=f[d],_=s[E]||u(),null===(m=l(_,t))&&(m=_[t]),!(p(m)||Q(m)||Et(m)));d++)if(!qe(E,f)){const n=Je(e,t,E,0,"translate");n!==t&&(m=n)}return[m,E,_]}function mt(e,t,r,o,c,s){const{messageCompiler:a,warnHtmlMessage:l}=e;if(Et(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==a){const e=()=>o;return e.locale=r,e.key=t,e}const i=a(o,function(e,t,r,o,c,s){return{locale:t,key:r,warnHtmlMessage:c,onError:e=>{throw s&&s(e),e},onCacheKey:e=>n(t,r,e)}}(0,r,c,0,l,s));return i.locale=r,i.key=t,i.source=o,i}function dt(...e){const[t,n,r]=e,c=u();if(!(p(t)||o(t)||Et(t)||Q(t)))throw Error(Te.INVALID_ARGUMENT);const s=o(t)?String(t):(Et(t),t);return o(n)?c.plural=n:p(n)?c.default=n:k(n)&&!a(n)?c.named=n:m(n)&&(c.list=n),o(r)?c.plural=r:p(r)?c.default=r:k(r)&&l(c,r),[s,c]}return $e(de),Ve(ve),He(Oe),e.AST_NODE_PROPS_KEYS=le,e.CORE_ERROR_CODES_EXTEND_POINT=24,e.CORE_WARN_CODES_EXTEND_POINT=8,e.CompileErrorCodes=g,e.CoreErrorCodes=Te,e.CoreWarnCodes=xe,e.DATETIME_FORMAT_OPTIONS_KEYS=et,e.DEFAULT_LOCALE=We,e.DEFAULT_MESSAGE_DATA_TYPE=st,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=nt,e.VERSION=we,e.clearCompileCache=function(){me=u()},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=de,e.createCompileError=S,e.createCoreContext=function(e={}){const t=d(e.onWarn)?e.onWarn:O,n=p(e.version)?e.version:we,r=p(e.locale)||d(e.locale)?e.locale:We,o=d(r)?We:r,c=m(e.fallbackLocale)||k(e.fallbackLocale)||p(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,a=k(e.messages)?e.messages:Qe(o),i=k(e.datetimeFormats)?e.datetimeFormats:Qe(o),f=k(e.numberFormats)?e.numberFormats:Qe(o),E=l(u(),e.modifiers,{upper:(e,t)=>"text"===t&&p(e)?e.toUpperCase():"vnode"===t&&L(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&p(e)?e.toLowerCase():"vnode"===t&&L(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&p(e)?Ye(e):"vnode"===t&&L(e)&&"__v_isVNode"in e?Ye(e.children):e}),_=e.pluralRules||u(),T=d(e.missing)?e.missing:null,A=!N(e.missingWarn)&&!s(e.missingWarn)||e.missingWarn,C=!N(e.fallbackWarn)&&!s(e.fallbackWarn)||e.fallbackWarn,h=!!e.fallbackFormat,I=!!e.unresolving,g=d(e.postTranslation)?e.postTranslation:null,S=k(e.processor)?e.processor:null,y=!N(e.warnHtmlMessage)||e.warnHtmlMessage,b=!!e.escapeParameter,D=d(e.messageCompiler)?e.messageCompiler:Ke,P=d(e.messageResolver)?e.messageResolver:Ge||Ue,R=d(e.localeFallbacker)?e.localeFallbacker:Xe||he,M=L(e.fallbackContext)?e.fallbackContext:void 0,U=e,v=L(U.__datetimeFormatters)?U.__datetimeFormatters:new Map,x=L(U.__numberFormatters)?U.__numberFormatters:new Map,F=L(U.__meta)?U.__meta:{};ze++;const w={version:n,cid:ze,locale:r,fallbackLocale:c,messages:a,modifiers:E,pluralRules:_,missing:T,missingWarn:A,fallbackWarn:C,fallbackFormat:h,unresolving:I,postTranslation:g,processor:S,warnHtmlMessage:y,escapeParameter:b,messageCompiler:D,messageResolver:P,localeFallbacker:R,fallbackContext:M,onWarn:t,__meta:F};return w.datetimeFormats=i,w.numberFormats=f,w.__datetimeFormatters=v,w.__numberFormatters=x,w},e.createCoreError=function(e){return S(e,null,void 0)},e.createMessageContext=ut,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:c,localeFallbacker:s}=e,{__datetimeFormatters:i}=e,[u,f,E,_]=tt(...t);N(E.missingWarn)?E.missingWarn:e.missingWarn,N(E.fallbackWarn)?E.fallbackWarn:e.fallbackWarn;const m=!!E.part,d=Ae(e,E),L=s(e,o,d);if(!p(u)||""===u)return new Intl.DateTimeFormat(d,_).format(f);let T,A={},C=null;for(let a=0;a<L.length&&(T=L[a],A=n[T]||{},C=A[u],!k(C));a++)Je(e,u,T,0,"datetime format");if(!k(C)||!p(T))return r?-1:u;let h=`${T}__${u}`;a(_)||(h=`${h}__${JSON.stringify(_)}`);let O=i.get(h);return O||(O=new Intl.DateTimeFormat(T,l({},C,_)),i.set(h,O)),m?O.formatToParts(f):O.format(f)},e.fallbackWithLocaleChain=Oe,e.fallbackWithSimple=he,e.getAdditionalMeta=()=>Be,e.getDevToolsHook=function(){return pe},e.getFallbackContext=()=>je,e.getLocale=Ae,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&L(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(Fe[e],...n)},e.handleMissing=Je,e.initI18nDevTools=function(e,t,n){pe&&pe.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isAlmostSameLocale=Ze,e.isImplicitFallback=qe,e.isMessageAST=Q,e.isMessageFunction=Et,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:c,localeFallbacker:s}=e,{__numberFormatters:i}=e,[u,f,E,_]=rt(...t);N(E.missingWarn)?E.missingWarn:e.missingWarn,N(E.fallbackWarn)?E.fallbackWarn:e.fallbackWarn;const m=!!E.part,d=Ae(e,E),L=s(e,o,d);if(!p(u)||""===u)return new Intl.NumberFormat(d,_).format(f);let T,A={},C=null;for(let a=0;a<L.length&&(T=L[a],A=n[T]||{},C=A[u],!k(C));a++)Je(e,u,T,0,"number format");if(!k(C)||!p(T))return r?-1:u;let h=`${T}__${u}`;a(_)||(h=`${h}__${JSON.stringify(_)}`);let O=i.get(h);return O||(O=new Intl.NumberFormat(T,l({},C,_)),i.set(h,O)),m?O.formatToParts(f):O.format(f)},e.parse=Re,e.parseDateTimeArgs=tt,e.parseNumberArgs=rt,e.parseTranslateArgs=dt,e.registerLocaleFallbacker=He,e.registerMessageCompiler=$e,e.registerMessageResolver=Ve,e.resolveLocale=ke,e.resolveValue=ve,e.resolveWithKeyValue=Ue,e.setAdditionalMeta=e=>{Be=e},e.setDevToolsHook=function(e){pe=e},e.setFallbackContext=e=>{je=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:c,messageCompiler:s,fallbackLocale:a,messages:l}=e,[i,E]=dt(...t),_=N(E.missingWarn)?E.missingWarn:e.missingWarn,T=N(E.fallbackWarn)?E.fallbackWarn:e.fallbackWarn,A=N(E.escapeParameter)?E.escapeParameter:e.escapeParameter,C=!!E.resolvedMessage,k=p(E.default)||N(E.default)?N(E.default)?s?i:()=>i:E.default:n?s?i:()=>i:null,h=n||null!=k&&(p(k)||d(k)),O=Ae(e,E);A&&function(e){m(e.list)?e.list=e.list.map((e=>p(e)?f(e):e)):L(e.named)&&Object.keys(e.named).forEach((t=>{p(e.named[t])&&(e.named[t]=f(e.named[t]))}))}(E);let[I,g,S]=C?[i,O,l[O]||u()]:_t(e,i,O,a,T,_),y=I,b=i;if(C||p(y)||Q(y)||Et(y)||h&&(y=k,b=y),!(C||(p(y)||Q(y)||Et(y))&&p(g)))return c?-1:i;let D=!1;const P=Et(y)?y:mt(e,i,g,y,b,(()=>{D=!0}));if(D)return y;const R=function(e,t,n,r){const{modifiers:c,pluralRules:s,messageResolver:a,fallbackLocale:l,fallbackWarn:i,missingWarn:u,fallbackContext:f}=e,E=(r,o)=>{let c=a(n,r);if(null==c&&(f||o)){const[,,n]=_t(f||e,r,t,l,i,u);c=a(n,r)}if(p(c)||Q(c)){let n=!1;const o=mt(e,r,t,c,r,(()=>{n=!0}));return n?ft:o}return Et(c)?c:ft},_={locale:t,modifiers:c,pluralRules:s,messages:E};e.processor&&(_.processor=e.processor);r.list&&(_.list=r.list);r.named&&(_.named=r.named);o(r.plural)&&(_.pluralIndex=r.plural);return _}(e,g,S,E),M=function(e,t,n){const r=t(n);return r}(0,P,ut(R));return r?r(M,i):M},e.translateDevTools=Ne,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({});
6
+ var IntlifyCore=function(e){"use strict";function t(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const n=/\{([0-9a-zA-Z]+)\}/g;const r=(e,t,n)=>o({l:e,k:t,s:n}),o=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),a=e=>"number"==typeof e&&isFinite(e),s=e=>"[object Date]"===k(e),c=e=>"[object RegExp]"===k(e),l=e=>O(e)&&0===Object.keys(e).length,i=Object.assign,u=Object.create,f=(e=null)=>u(e);function E(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function _(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const m=Object.prototype.hasOwnProperty;function p(e,t){return m.call(e,t)}const d=Array.isArray,N=e=>"function"==typeof e,L=e=>"string"==typeof e,T=e=>"boolean"==typeof e,A=e=>null!==e&&"object"==typeof e,C=e=>A(e)&&N(e.then)&&N(e.catch),h=Object.prototype.toString,k=e=>h.call(e),O=e=>"[object Object]"===k(e);function g(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}function I(e,t,n){return{start:e,end:t}}const S={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};function y(e,t,n={}){const{domain:r,messages:o,args:a}=n,s=new SyntaxError(String(e));return s.code=e,t&&(s.location=t),s.domain=r,s}function b(e){throw e}S.EXPECTED_TOKEN,S.INVALID_TOKEN_IN_PLACEHOLDER,S.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,S.UNKNOWN_ESCAPE_SEQUENCE,S.INVALID_UNICODE_ESCAPE_SEQUENCE,S.UNBALANCED_CLOSING_BRACE,S.UNTERMINATED_CLOSING_BRACE,S.EMPTY_PLACEHOLDER,S.NOT_ALLOW_NEST_PLACEHOLDER,S.INVALID_LINKED_FORMAT,S.MUST_HAVE_MESSAGES_IN_PLURAL,S.UNEXPECTED_EMPTY_LINKED_MODIFIER,S.UNEXPECTED_EMPTY_LINKED_KEY,S.UNEXPECTED_LEXICAL_ANALYSIS,S.UNHANDLED_CODEGEN_NODE_TYPE,S.UNHANDLED_MINIFIER_NODE_TYPE;const D=" ",P="\r",R="\n",M=String.fromCharCode(8232),U=String.fromCharCode(8233);function v(e){const t=e;let n=0,r=1,o=1,a=0;const s=e=>t[e]===P&&t[e+1]===R,c=e=>t[e]===U,l=e=>t[e]===M,i=e=>s(e)||(e=>t[e]===R)(e)||c(e)||l(e),u=e=>s(e)||c(e)||l(e)?R:t[e];function f(){return a=0,i(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>a,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+a),next:f,peek:function(){return s(n+a)&&a++,a++,t[n+a]},reset:function(){n=0,r=1,o=1,a=0},resetPeek:function(e=0){a=e},skipToPeek:function(){const e=n+a;for(;e!==n;)f();a=0}}}const x=void 0,F="'";function w(e,t={}){const n=!1!==t.location,r=v(e),o=()=>r.index(),a=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=a(),c=o(),l={currentType:13,offset:c,startLoc:s,endLoc:s,lastType:13,lastOffset:c,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},i=()=>l,{onError:u}=t;function f(e,t,r){e.endLoc=a(),e.currentType=t;const o={type:t};return n&&(o.loc=I(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const E=e=>f(e,13);function _(e,t){return e.currentChar()===t?(e.next(),t):(S.EXPECTED_TOKEN,a(),"")}function m(e){let t="";for(;e.currentPeek()===D||e.currentPeek()===R;)t+=e.currentPeek(),e.peek();return t}function p(e){const t=m(e);return e.skipToPeek(),t}function d(e){if(e===x)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function N(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=function(e){if(e===x)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function L(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const n=(t=!1,r="")=>{const o=e.currentPeek();return"{"===o?t:"@"!==o&&o?"|"===o?!(r===D||r===R):o===D?(e.peek(),n(!0,D)):o!==R||(e.peek(),n(!0,R)):t},r=n();return t&&e.resetPeek(),r}function A(e,t){const n=e.currentChar();return n===x?x:t(n)?(e.next(),n):null}function C(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}function h(e){return A(e,C)}function k(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t||45===t}function O(e){return A(e,k)}function g(e){const t=e.charCodeAt(0);return t>=48&&t<=57}function y(e){return A(e,g)}function b(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function P(e){return A(e,b)}function M(e){let t="",n="";for(;t=y(e);)n+=t;return n}function U(e){return e!==F&&e!==R}function w(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return W(e,t,4);case"U":return W(e,t,6);default:return S.UNKNOWN_ESCAPE_SEQUENCE,a(),""}}function W(e,t,n){_(e,t);let r="";for(let o=0;o<n;o++){const t=P(e);if(!t){S.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),e.currentChar();break}r+=t}return`\\${t}${r}`}function $(e){return"{"!==e&&"}"!==e&&e!==D&&e!==R}function Y(e){p(e);const t=_(e,"|");return p(e),t}function K(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(S.NOT_ALLOW_NEST_PLACEHOLDER,a()),e.next(),n=f(t,2,"{"),p(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&(S.EMPTY_PLACEHOLDER,a()),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&p(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&(S.UNTERMINATED_CLOSING_BRACE,a()),n=G(e,t)||E(t),t.braceNest=0,n;default:{let r=!0,o=!0,s=!0;if(L(e))return t.braceNest>0&&(S.UNTERMINATED_CLOSING_BRACE,a()),n=f(t,1,Y(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(4===t.currentType||5===t.currentType||6===t.currentType))return S.UNTERMINATED_CLOSING_BRACE,a(),t.braceNest=0,X(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=d(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,4,function(e){p(e);let t="",n="";for(;t=O(e);)n+=t;return e.currentChar()===x&&(S.UNTERMINATED_CLOSING_BRACE,a()),n}(e)),p(e),n;if(o=N(e,t))return n=f(t,5,function(e){p(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${M(e)}`):t+=M(e),e.currentChar()===x&&(S.UNTERMINATED_CLOSING_BRACE,a()),t}(e)),p(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=e.currentPeek()===F;return e.resetPeek(),r}(e,t))return n=f(t,6,function(e){p(e),_(e,"'");let t="",n="";for(;t=A(e,U);)n+="\\"===t?w(e):t;const r=e.currentChar();return r===R||r===x?(S.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),r===R&&(e.next(),_(e,"'")),n):(_(e,"'"),n)}(e)),p(e),n;if(!r&&!o&&!s)return n=f(t,12,function(e){p(e);let t="",n="";for(;t=A(e,$);)n+=t;return n}(e)),S.INVALID_TOKEN_IN_PLACEHOLDER,a(),n.value,p(e),n;break}}return n}function G(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(7!==n&&8!==n&&11!==n&&9!==n||o!==R&&o!==D||(S.INVALID_LINKED_FORMAT,a()),o){case"@":return e.next(),r=f(t,7,"@"),t.inLinked=!0,r;case".":return p(e),e.next(),f(t,8,".");case":":return p(e),e.next(),f(t,9,":");default:return L(e)?(r=f(t,1,Y(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(7!==n)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(7!==n&&11!==n)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(p(e),G(e,t)):function(e,t){const{currentType:n}=t;if(8!==n)return!1;m(e);const r=d(e.currentPeek());return e.resetPeek(),r}(e,t)?(p(e),f(t,11,function(e){let t="",n="";for(;t=h(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(9!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?d(e.peek()):!("@"===t||"|"===t||":"===t||"."===t||t===D||!t)&&(t===R?(e.peek(),r()):T(e,!1))},o=r();return e.resetPeek(),o}(e,t)?(p(e),"{"===o?K(e,t)||r:f(t,10,function(e){const t=n=>{const r=e.currentChar();return"{"!==r&&"@"!==r&&"|"!==r&&"("!==r&&")"!==r&&r?r===D?n:(n+=r,e.next(),t(n)):n};return t("")}(e))):(7===n&&(S.INVALID_LINKED_FORMAT,a()),t.braceNest=0,t.inLinked=!1,X(e,t))}}function X(e,t){let n={type:13};if(t.braceNest>0)return K(e,t)||E(t);if(t.inLinked)return G(e,t)||E(t);switch(e.currentChar()){case"{":return K(e,t)||E(t);case"}":return S.UNBALANCED_CLOSING_BRACE,a(),e.next(),f(t,3,"}");case"@":return G(e,t)||E(t);default:if(L(e))return n=f(t,1,Y(e)),t.braceNest=0,t.inLinked=!1,n;if(T(e))return f(t,0,function(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if(n===D||n===R)if(T(e))t+=n,e.next();else{if(L(e))break;t+=n,e.next()}else t+=n,e.next()}return t}(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=s,l.offset=o(),l.startLoc=a(),r.currentChar()===x?f(l,13):X(r,l)},currentOffset:o,currentPosition:a,context:i}}const W=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function $(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function Y(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e};return t&&(o.start=n,o.end=n,o.loc={start:r,end:r}),o}function o(e,n,r,o){t&&(e.end=n,e.loc&&(e.loc.end=r))}function a(e,t){const n=e.context(),a=r(3,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}function s(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(5,a,s);return c.index=parseInt(t,10),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function c(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(4,a,s);return c.key=t,e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function l(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(9,a,s);return c.value=t.replace(W,$),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function u(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let a=e.nextToken();if(8===a.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(8,a,s);return 11!==t.type?(S.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,c.value="",o(c,a,s),{nextConsumeToken:t,node:c}):(null==t.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,K(t)),c.value=t.value||"",o(c,e.currentOffset(),e.currentPosition()),{node:c})}(e);n.modifier=t.node,a=t.nextConsumeToken||e.nextToken()}switch(9!==a.type&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(a)),a=e.nextToken(),2===a.type&&(a=e.nextToken()),a.type){case 10:null==a.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(a)),n.key=function(e,t){const n=e.context(),a=r(7,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}(e,a.value||"");break;case 4:null==a.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(a)),n.key=c(e,a.value||"");break;case 5:null==a.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(a)),n.key=s(e,a.value||"");break;case 6:null==a.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(a)),n.key=l(e,a.value||"");break;default:{S.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const s=e.context(),c=r(7,s.offset,s.startLoc);return c.value="",o(c,s.offset,s.startLoc),n.key=c,o(n,s.offset,s.startLoc),{nextConsumeToken:a,node:n}}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function f(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let i=null;do{const r=i||e.nextToken();switch(i=null,r.type){case 0:null==r.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(a(e,r.value||""));break;case 5:null==r.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(s(e,r.value||""));break;case 4:null==r.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(c(e,r.value||""));break;case 6:null==r.value&&(S.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,K(r)),n.items.push(l(e,r.value||""));break;case 7:{const t=u(e);n.items.push(t.node),i=t.nextConsumeToken||null;break}}}while(13!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function E(e){const t=e.context(),{offset:n,startLoc:a}=t,s=f(e);return 13===t.currentType?s:function(e,t,n,a){const s=e.context();let c=0===a.items.length;const l=r(1,t,n);l.cases=[],l.cases.push(a);do{const t=f(e);c||(c=0===t.items.length),l.cases.push(t)}while(13!==s.currentType);return c&&S.MUST_HAVE_MESSAGES_IN_PLURAL,o(l,e.currentOffset(),e.currentPosition()),l}(e,n,a,s)}return{parse:function(n){const a=w(n,i({},e)),s=a.context(),c=r(0,s.offset,s.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=E(a),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),13!==s.currentType&&(S.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,n[s.offset]),o(c,a.currentOffset(),a.currentPosition()),c}}}function K(e){if(13===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function G(e,t){for(let n=0;n<e.length;n++)X(e[n],t)}function X(e,t){switch(e.type){case 1:G(e.cases,t),t.helper("plural");break;case 2:G(e.items,t);break;case 6:X(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function V(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&X(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function H(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];if(3!==r.type&&9!==r.type)break;if(null==r.value)break;t.push(r.value)}if(t.length===e.items.length){e.static=g(t);for(let t=0;t<e.items.length;t++){const n=e.items[t];3!==n.type&&9!==n.type||delete n.value}}}}function B(e){switch(e.t=e.type,e.type){case 0:{const t=e;B(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let e=0;e<n.length;e++)B(n[e]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let e=0;e<n.length;e++)B(n[e]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;B(t.key),t.k=t.key,delete t.key,t.modifier&&(B(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function j(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?j(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&(j(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let a=0;a<o&&(j(e,t.items[a]),a!==o-1);a++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),j(e,t.key),t.modifier?(e.push(", "),j(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const z=(e,t={})=>{const n=L(t.mode)?t.mode:"normal",r=L(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,a=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:a}=t,s=!1!==t.location,c={filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:a,indentLevel:0};function l(e,t){c.code+=e}function i(e,t=!0){const n=t?o:"";l(a?n+" ".repeat(e):n)}return s&&e.loc&&(c.source=e.loc.source),{context:()=>c,push:l,indent:function(e=!0){const t=++c.indentLevel;e&&i(t)},deindent:function(e=!0){const t=--c.indentLevel;e&&i(t)},newline:function(){i(c.indentLevel)},helper:e=>`_${e}`,needIndent:()=>c.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:a,needIndent:s});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),c.length>0&&(l.push(`const { ${g(c.map((e=>`${e}: _${e}`)),", ")} } = ctx`),l.newline()),l.push("return "),j(l,e),l.deindent(s),l.push("}"),delete e.helpers;const{code:i,map:u}=l.context();return{ast:e,code:i,map:u?u.toJSON():void 0}};function Q(e,t={}){const n=i({},t),r=!!n.jit,o=!!n.minify,a=null==n.optimize||n.optimize,s=Y(n).parse(e);return r?(a&&function(e){const t=e.body;2===t.type?H(t):t.cases.forEach((e=>H(e)))}(s),o&&B(s),{ast:s,code:""}):(V(s,n),z(s,n))}function J(e){return A(e)&&0===re(e)&&(p(e,"b")||p(e,"body"))}const Z=["b","body"];const q=["c","cases"];const ee=["s","static"];const te=["i","items"];const ne=["t","type"];function re(e){return le(e,ne)}const oe=["v","value"];function ae(e,t){const n=le(e,oe);if(null!=n)return n;throw ue(t)}const se=["m","modifier"];const ce=["k","key"];function le(e,t,n){for(let r=0;r<t.length;r++){const n=t[r];if(p(e,n)&&null!=e[n])return e[n]}return n}const ie=[...Z,...q,...ee,...te,...ce,...se,...oe,...ne];function ue(e){return new Error(`unhandled node type: ${e}`)}function fe(e){return t=>function(e,t){const n=(r=t,le(r,Z));var r;if(null==n)throw ue(0);if(1===re(n)){const t=function(e){return le(e,q,[])}(n);return e.plural(t.reduce(((t,n)=>[...t,Ee(e,n)]),[]))}return Ee(e,n)}(t,e)}function Ee(e,t){const n=function(e){return le(e,ee)}(t);if(null!=n)return"text"===e.type?n:e.normalize([n]);{const n=function(e){return le(e,te,[])}(t).reduce(((t,n)=>[...t,_e(e,n)]),[]);return e.normalize(n)}}function _e(e,t){const n=re(t);switch(n){case 3:case 9:case 7:case 8:return ae(t,n);case 4:{const r=t;if(p(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(p(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw ue(n)}case 5:{const r=t;if(p(r,"i")&&a(r.i))return e.interpolate(e.list(r.i));if(p(r,"index")&&a(r.index))return e.interpolate(e.list(r.index));throw ue(n)}case 6:{const n=t,r=function(e){return le(e,se)}(n),o=function(e){const t=le(e,ce);if(t)return t;throw ue(6)}(n);return e.linked(_e(e,o),r?_e(e,r):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${n}`)}}const me=e=>e;let pe=f();function de(e,t){if(L(e)){!T(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||me)(e),r=pe[n];if(r)return r;const{ast:o,detectError:a}=function(e,t={}){let n=!1;const r=t.onError||b;return t.onError=e=>{n=!0,r(e)},{...Q(e,t),detectError:n}}(e,{...t,location:!1,jit:!0}),s=fe(o);return a?s:pe[n]=s}{const t=e.cacheKey;if(t){const n=pe[t];return n||(pe[t]=fe(e))}return fe(e)}}let Ne=null;const Le=Te("function:translate");function Te(e){return t=>Ne&&Ne.emit(e,t)}const Ae={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function Ce(e,t){return null!=t.locale?ke(t.locale):ke(e.locale)}let he;function ke(e){if(L(e))return e;if(N(e)){if(e.resolvedOnce&&null!=he)return he;if("Function"===e.constructor.name){const t=e();if(C(t))throw Error(Ae.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return he=t}throw Error(Ae.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(Ae.NOT_SUPPORT_LOCALE_TYPE)}function Oe(e,t,n){return[...new Set([n,...d(t)?t:A(t)?Object.keys(t):L(t)?[t]:[n]])]}function ge(e,t,n){const r=L(n)?n:$e,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let a=o.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;d(e);)e=Ie(a,e,t);const s=d(t)||!O(t)?t:t.default?t.default:null;e=L(s)?[s]:s,d(e)&&Ie(a,e,!1),o.__localeChainCache.set(r,a)}return a}function Ie(e,t,n){let r=!0;for(let o=0;o<t.length&&T(r);o++){const a=t[o];L(a)&&(r=Se(e,t[o],n))}return r}function Se(e,t,n){let r;const o=t.split("-");do{r=ye(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function ye(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(d(n)||O(n))&&n[o]&&(r=n[o])}return r}Ae.INVALID_ARGUMENT,Ae.INVALID_DATE_ARGUMENT,Ae.INVALID_ISO_DATE_ARGUMENT,Ae.NOT_SUPPORT_NON_STRING_MESSAGE,Ae.NOT_SUPPORT_LOCALE_PROMISE_VALUE,Ae.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,Ae.NOT_SUPPORT_LOCALE_TYPE;const be=[];be[0]={w:[0],i:[3,0],"[":[4],o:[7]},be[1]={w:[1],".":[2],"[":[4],o:[7]},be[2]={w:[2],i:[3,0],0:[3,0]},be[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},be[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},be[5]={"'":[4,0],o:8,l:[5,0]},be[6]={'"':[4,0],o:8,l:[6,0]};const De=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Pe(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 Re(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,De.test(n)?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 n}function Me(e){const t=[];let n,r,o,a,s,c,l,i=-1,u=0,f=0;const E=[];function _(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,o="\\"+t,E[0](),!0}for(E[0]=()=>{void 0===r?r=o:r+=o},E[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},E[2]=()=>{E[0](),f++},E[3]=()=>{if(f>0)f--,u=4,E[0]();else{if(f=0,void 0===r)return!1;if(r=Re(r),!1===r)return!1;E[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!_()){if(a=Pe(n),l=be[u],s=l[a]||l.l||8,8===s)return;if(u=s[0],void 0!==s[1]&&(c=E[s[1]],c&&(o=n,!1===c())))return;if(7===u)return t}}const Ue=new Map;function ve(e,t){return A(e)?e[t]:null}function xe(e,t){if(!A(e))return null;let n=Ue.get(t);if(n||(n=Me(t),n&&Ue.set(t,n)),!n)return null;const r=n.length;let o=e,a=0;for(;a<r;){const e=n[a];if(ie.includes(e)&&J(o))return null;const t=o[e];if(void 0===t)return null;if(N(o))return null;o=t,a++}return o}const Fe={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},we={[Fe.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[Fe.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[Fe.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[Fe.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[Fe.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[Fe.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[Fe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};const We="10.0.8",$e="en-US",Ye=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let Ke,Ge,Xe;function Ve(e){Ke=e}function He(e){Ge=e}function Be(e){Xe=e}let je=null;let ze=null;let Qe=0;const Je=e=>({[e]:f()});function Ze(e,t,n,r,o){const{missing:a,onWarn:s}=e;if(null!==a){const r=a(e,n,t,o);return L(r)?r:t}return t}function qe(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function et(e,t){const n=t.indexOf(e);if(-1===n)return!1;for(let r=n+1;r<t.length;r++)if(qe(e,t[r]))return!0;return!1}const tt=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function nt(...e){const[t,n,r,o]=e,c=f();let l,i=f();if(L(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(Ae.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();l=new Date(n);try{l.toISOString()}catch{throw Error(Ae.INVALID_ISO_DATE_ARGUMENT)}}else if(s(t)){if(isNaN(t.getTime()))throw Error(Ae.INVALID_DATE_ARGUMENT);l=t}else{if(!a(t))throw Error(Ae.INVALID_ARGUMENT);l=t}return L(n)?c.key=n:O(n)&&Object.keys(n).forEach((e=>{tt.includes(e)?i[e]=n[e]:c[e]=n[e]})),L(r)?c.locale=r:O(r)&&(i=r),O(o)&&(i=o),[c.key||"",l,c,i]}const rt=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function ot(...e){const[t,n,r,o]=e,s=f();let c=f();if(!a(t))throw Error(Ae.INVALID_ARGUMENT);const l=t;return L(n)?s.key=n:O(n)&&Object.keys(n).forEach((e=>{rt.includes(e)?c[e]=n[e]:s[e]=n[e]})),L(r)?s.locale=r:O(r)&&(c=r),O(o)&&(c=o),[s.key||"",l,s,c]}const at=e=>e,st=e=>"",ct="text",lt=e=>0===e.length?"":g(e),it=e=>null==e?"":d(e)||O(e)&&e.toString===h?JSON.stringify(e,null,2):String(e);function ut(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function ft(e={}){const t=e.locale,n=function(e){const t=a(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(a(e.named.count)||a(e.named.n))?a(e.named.count)?e.named.count:a(e.named.n)?e.named.n:t:t}(e),r=A(e.pluralRules)&&L(t)&&N(e.pluralRules[t])?e.pluralRules[t]:ut,o=A(e.pluralRules)&&L(t)&&N(e.pluralRules[t])?ut:void 0,s=e.list||[],c=e.named||f();a(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,c);function l(t,n){const r=N(e.messages)?e.messages(t,!!n):!!A(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):st)}const u=O(e.processor)&&N(e.processor.normalize)?e.processor.normalize:lt,E=O(e.processor)&&N(e.processor.interpolate)?e.processor.interpolate:it,_={list:e=>s[e],named:e=>c[e],plural:e=>e[r(n,e.length,o)],linked:(t,...n)=>{const[r,o]=n;let a="text",s="";1===n.length?A(r)?(s=r.modifier||s,a=r.type||a):L(r)&&(s=r||s):2===n.length&&(L(r)&&(s=r||s),L(o)&&(a=o||a));const c=l(t,!0)(_),i="vnode"===a&&d(c)&&s?c[0]:c;return s?(u=s,e.modifiers?e.modifiers[u]:at)(i,a):i;var u},message:l,type:O(e.processor)&&L(e.processor.type)?e.processor.type:ct,interpolate:E,normalize:u,values:i(f(),s,c)};return _}const Et=()=>"",_t=e=>N(e);function mt(e,t,n,r,o,a){const{messages:s,onWarn:c,messageResolver:l,localeFallbacker:i}=e,u=i(e,r,n);let E,_=f(),m=null;for(let p=0;p<u.length&&(E=u[p],_=s[E]||f(),null===(m=l(_,t))&&(m=_[t]),!(L(m)||J(m)||_t(m)));p++)if(!et(E,u)){const n=Ze(e,t,E,0,"translate");n!==t&&(m=n)}return[m,E,_]}function pt(e,t,n,o,a,s){const{messageCompiler:c,warnHtmlMessage:l}=e;if(_t(o)){const e=o;return e.locale=e.locale||n,e.key=e.key||t,e}if(null==c){const e=()=>o;return e.locale=n,e.key=t,e}const i=c(o,function(e,t,n,o,a,s){return{locale:t,key:n,warnHtmlMessage:a,onError:e=>{throw s&&s(e),e},onCacheKey:e=>r(t,n,e)}}(0,n,a,0,l,s));return i.locale=n,i.key=t,i.source=o,i}function dt(...e){const[t,n,r]=e,o=f();if(!(L(t)||a(t)||_t(t)||J(t)))throw Error(Ae.INVALID_ARGUMENT);const s=a(t)?String(t):(_t(t),t);return a(n)?o.plural=n:L(n)?o.default=n:O(n)&&!l(n)?o.named=n:d(n)&&(o.list=n),a(r)?o.plural=r:L(r)?o.default=r:O(r)&&i(o,r),[s,o]}return Ve(de),He(xe),Be(ge),e.AST_NODE_PROPS_KEYS=ie,e.CORE_ERROR_CODES_EXTEND_POINT=24,e.CORE_WARN_CODES_EXTEND_POINT=8,e.CompileErrorCodes=S,e.CoreErrorCodes=Ae,e.CoreWarnCodes=Fe,e.DATETIME_FORMAT_OPTIONS_KEYS=tt,e.DEFAULT_LOCALE=$e,e.DEFAULT_MESSAGE_DATA_TYPE=ct,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=rt,e.VERSION=We,e.clearCompileCache=function(){pe=f()},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=de,e.createCompileError=y,e.createCoreContext=function(e={}){const n=N(e.onWarn)?e.onWarn:t,r=L(e.version)?e.version:We,o=L(e.locale)||N(e.locale)?e.locale:$e,a=N(o)?$e:o,s=d(e.fallbackLocale)||O(e.fallbackLocale)||L(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:a,l=O(e.messages)?e.messages:Je(a),u=O(e.datetimeFormats)?e.datetimeFormats:Je(a),E=O(e.numberFormats)?e.numberFormats:Je(a),_=i(f(),e.modifiers,{upper:(e,t)=>"text"===t&&L(e)?e.toUpperCase():"vnode"===t&&A(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&L(e)?e.toLowerCase():"vnode"===t&&A(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&L(e)?Ye(e):"vnode"===t&&A(e)&&"__v_isVNode"in e?Ye(e.children):e}),m=e.pluralRules||f(),p=N(e.missing)?e.missing:null,C=!T(e.missingWarn)&&!c(e.missingWarn)||e.missingWarn,h=!T(e.fallbackWarn)&&!c(e.fallbackWarn)||e.fallbackWarn,k=!!e.fallbackFormat,g=!!e.unresolving,I=N(e.postTranslation)?e.postTranslation:null,S=O(e.processor)?e.processor:null,y=!T(e.warnHtmlMessage)||e.warnHtmlMessage,b=!!e.escapeParameter,D=N(e.messageCompiler)?e.messageCompiler:Ke,P=N(e.messageResolver)?e.messageResolver:Ge||ve,R=N(e.localeFallbacker)?e.localeFallbacker:Xe||Oe,M=A(e.fallbackContext)?e.fallbackContext:void 0,U=e,v=A(U.__datetimeFormatters)?U.__datetimeFormatters:new Map,x=A(U.__numberFormatters)?U.__numberFormatters:new Map,F=A(U.__meta)?U.__meta:{};Qe++;const w={version:r,cid:Qe,locale:o,fallbackLocale:s,messages:l,modifiers:_,pluralRules:m,missing:p,missingWarn:C,fallbackWarn:h,fallbackFormat:k,unresolving:g,postTranslation:I,processor:S,warnHtmlMessage:y,escapeParameter:b,messageCompiler:D,messageResolver:P,localeFallbacker:R,fallbackContext:M,onWarn:n,__meta:F};return w.datetimeFormats=u,w.numberFormats=E,w.__datetimeFormatters=v,w.__numberFormatters=x,w},e.createCoreError=function(e){return y(e,null,void 0)},e.createMessageContext=ft,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__datetimeFormatters:c}=e,[u,f,E,_]=nt(...t);T(E.missingWarn)?E.missingWarn:e.missingWarn,T(E.fallbackWarn)?E.fallbackWarn:e.fallbackWarn;const m=!!E.part,p=Ce(e,E),d=s(e,o,p);if(!L(u)||""===u)return new Intl.DateTimeFormat(p,_).format(f);let N,A={},C=null;for(let l=0;l<d.length&&(N=d[l],A=n[N]||{},C=A[u],!O(C));l++)Ze(e,u,N,0,"datetime format");if(!O(C)||!L(N))return r?-1:u;let h=`${N}__${u}`;l(_)||(h=`${h}__${JSON.stringify(_)}`);let k=c.get(h);return k||(k=new Intl.DateTimeFormat(N,i({},C,_)),c.set(h,k)),m?k.formatToParts(f):k.format(f)},e.fallbackWithLocaleChain=ge,e.fallbackWithSimple=Oe,e.getAdditionalMeta=()=>je,e.getDevToolsHook=function(){return Ne},e.getFallbackContext=()=>ze,e.getLocale=Ce,e.getWarnMessage=function(e,...t){return function(e,...t){return 1===t.length&&A(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(n,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}(we[e],...t)},e.handleMissing=Ze,e.initI18nDevTools=function(e,t,n){Ne&&Ne.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isAlmostSameLocale=qe,e.isImplicitFallback=et,e.isMessageAST=J,e.isMessageFunction=_t,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__numberFormatters:c}=e,[u,f,E,_]=ot(...t);T(E.missingWarn)?E.missingWarn:e.missingWarn,T(E.fallbackWarn)?E.fallbackWarn:e.fallbackWarn;const m=!!E.part,p=Ce(e,E),d=s(e,o,p);if(!L(u)||""===u)return new Intl.NumberFormat(p,_).format(f);let N,A={},C=null;for(let l=0;l<d.length&&(N=d[l],A=n[N]||{},C=A[u],!O(C));l++)Ze(e,u,N,0,"number format");if(!O(C)||!L(N))return r?-1:u;let h=`${N}__${u}`;l(_)||(h=`${h}__${JSON.stringify(_)}`);let k=c.get(h);return k||(k=new Intl.NumberFormat(N,i({},C,_)),c.set(h,k)),m?k.formatToParts(f):k.format(f)},e.parse=Me,e.parseDateTimeArgs=nt,e.parseNumberArgs=ot,e.parseTranslateArgs=dt,e.registerLocaleFallbacker=Be,e.registerMessageCompiler=Ve,e.registerMessageResolver=He,e.resolveLocale=ke,e.resolveValue=xe,e.resolveWithKeyValue=ve,e.setAdditionalMeta=e=>{je=e},e.setDevToolsHook=function(e){Ne=e},e.setFallbackContext=e=>{ze=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:c,messages:l}=e,[i,u]=dt(...t),m=T(u.missingWarn)?u.missingWarn:e.missingWarn,p=T(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,C=T(u.escapeParameter)?u.escapeParameter:e.escapeParameter,h=!!u.resolvedMessage,k=L(u.default)||T(u.default)?T(u.default)?s?i:()=>i:u.default:n?s?i:()=>i:null,O=n||null!=k&&(L(k)||N(k)),g=Ce(e,u);C&&function(e){d(e.list)?e.list=e.list.map((e=>L(e)?E(e):e)):A(e.named)&&Object.keys(e.named).forEach((t=>{L(e.named[t])&&(e.named[t]=E(e.named[t]))}))}(u);let[I,S,y]=h?[i,g,l[g]||f()]:mt(e,i,g,c,p,m),b=I,D=i;if(h||L(b)||J(b)||_t(b)||O&&(b=k,D=b),!(h||(L(b)||J(b)||_t(b))&&L(S)))return o?-1:i;let P=!1;const R=_t(b)?b:pt(e,i,S,b,D,(()=>{P=!0}));if(P)return b;const M=function(e,t,n,r){const{modifiers:o,pluralRules:s,messageResolver:c,fallbackLocale:l,fallbackWarn:i,missingWarn:u,fallbackContext:f}=e,E=(r,o)=>{let a=c(n,r);if(null==a&&(f||o)){const[,,n]=mt(f||e,r,t,l,i,u);a=c(n,r)}if(L(a)||J(a)){let n=!1;const o=pt(e,r,t,a,r,(()=>{n=!0}));return n?Et:o}return _t(a)?a:Et},_={locale:t,modifiers:o,pluralRules:s,messages:E};e.processor&&(_.processor=e.processor);r.list&&(_.list=r.list);r.named&&(_.named=r.named);a(r.plural)&&(_.pluralIndex=r.plural);return _}(e,S,y,u),U=function(e,t,n){const r=t(n);return r}(0,R,ft(M));let v=r?r(U,i):U;var x;return C&&L(v)&&(x=(x=(x=v).replace(/(\w+)\s*=\s*"([^"]*)"/g,((e,t,n)=>`${t}="${_(n)}"`))).replace(/(\w+)\s*=\s*'([^']*)'/g,((e,t,n)=>`${t}='${_(n)}'`)),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(x)&&(x=x.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach((e=>{x=x.replace(e,"$1javascript&#58;")})),v=x),v},e.translateDevTools=Le,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({});
package/dist/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,8 +1,25 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
+ function warn(msg, err) {
7
+ if (typeof console !== 'undefined') {
8
+ console.warn(`[intlify] ` + msg);
9
+ /* istanbul ignore if */
10
+ if (err) {
11
+ console.warn(err.stack);
12
+ }
13
+ }
14
+ }
15
+ const hasWarned = {};
16
+ function warnOnce(msg) {
17
+ if (!hasWarned[msg]) {
18
+ hasWarned[msg] = true;
19
+ warn(msg);
20
+ }
21
+ }
22
+
6
23
  /**
7
24
  * Original Utilities
8
25
  * written by kazuya kawaguchi
@@ -55,10 +72,49 @@ const _create = Object.create;
55
72
  const create = (obj = null) => _create(obj);
56
73
  function escapeHtml(rawText) {
57
74
  return rawText
75
+ .replace(/&/g, '&amp;') // escape `&` first to avoid double escaping
58
76
  .replace(/</g, '&lt;')
59
77
  .replace(/>/g, '&gt;')
60
78
  .replace(/"/g, '&quot;')
61
- .replace(/'/g, '&apos;');
79
+ .replace(/'/g, '&apos;')
80
+ .replace(/\//g, '&#x2F;') // escape `/` to prevent closing tags or JavaScript URLs
81
+ .replace(/=/g, '&#x3D;'); // escape `=` to prevent attribute injection
82
+ }
83
+ function escapeAttributeValue(value) {
84
+ return value
85
+ .replace(/&(?![a-zA-Z0-9#]{2,6};)/g, '&amp;') // escape unescaped `&`
86
+ .replace(/"/g, '&quot;')
87
+ .replace(/'/g, '&apos;')
88
+ .replace(/</g, '&lt;')
89
+ .replace(/>/g, '&gt;');
90
+ }
91
+ function sanitizeTranslatedHtml(html) {
92
+ // Escape dangerous characters in attribute values
93
+ // Process attributes with double quotes
94
+ html = html.replace(/(\w+)\s*=\s*"([^"]*)"/g, (_, attrName, attrValue) => `${attrName}="${escapeAttributeValue(attrValue)}"`);
95
+ // Process attributes with single quotes
96
+ html = html.replace(/(\w+)\s*=\s*'([^']*)'/g, (_, attrName, attrValue) => `${attrName}='${escapeAttributeValue(attrValue)}'`);
97
+ // Detect and neutralize event handler attributes
98
+ const eventHandlerPattern = /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi;
99
+ if (eventHandlerPattern.test(html)) {
100
+ {
101
+ warn('Potentially dangerous event handlers detected in translation. ' +
102
+ 'Consider removing onclick, onerror, etc. from your translation messages.');
103
+ }
104
+ // Neutralize event handler attributes by escaping 'on'
105
+ html = html.replace(/(\s+)(on)(\w+\s*=)/gi, '$1&#111;n$3');
106
+ }
107
+ // Disable javascript: URLs in various contexts
108
+ const javascriptUrlPattern = [
109
+ // In href, src, action, formaction attributes
110
+ /(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,
111
+ // In style attributes within url()
112
+ /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi
113
+ ];
114
+ javascriptUrlPattern.forEach(pattern => {
115
+ html = html.replace(pattern, '$1javascript&#58;');
116
+ });
117
+ return html;
62
118
  }
63
119
  const hasOwnProperty = Object.prototype.hasOwnProperty;
64
120
  function hasOwn(obj, key) {
@@ -130,23 +186,6 @@ function generateCodeFrame(source, start = 0, end = source.length) {
130
186
  return res.join('\n');
131
187
  }
132
188
 
133
- function warn(msg, err) {
134
- if (typeof console !== 'undefined') {
135
- console.warn(`[intlify] ` + msg);
136
- /* istanbul ignore if */
137
- if (err) {
138
- console.warn(err.stack);
139
- }
140
- }
141
- }
142
- const hasWarned = {};
143
- function warnOnce(msg) {
144
- if (!hasWarned[msg]) {
145
- hasWarned[msg] = true;
146
- warn(msg);
147
- }
148
- }
149
-
150
189
  const CompileErrorCodes = {
151
190
  // tokenizer error codes
152
191
  EXPECTED_TOKEN: 1,
@@ -893,7 +932,7 @@ function getWarnMessage(code, ...args) {
893
932
  * Intlify core-base version
894
933
  * @internal
895
934
  */
896
- const VERSION = '10.0.7';
935
+ const VERSION = '10.0.8';
897
936
  const NOT_REOSLVED = -1;
898
937
  const DEFAULT_LOCALE = 'en-US';
899
938
  const MISSING_RESOLVE_VALUE = '';
@@ -1685,9 +1724,13 @@ function translate(context, ...args) {
1685
1724
  const msgContext = createMessageContext(ctxOptions);
1686
1725
  const messaged = evaluateMessage(context, msg, msgContext);
1687
1726
  // if use post translation option, proceed it with handler
1688
- const ret = postTranslation
1727
+ let ret = postTranslation
1689
1728
  ? postTranslation(messaged, key)
1690
1729
  : messaged;
1730
+ // apply HTML sanitization for security
1731
+ if (escapeParameter && isString(ret)) {
1732
+ ret = sanitizeTranslatedHtml(ret);
1733
+ }
1691
1734
  // NOTE: experimental !!
1692
1735
  {
1693
1736
  // prettier-ignore
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
- const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign,_create=Object.create,create=(e=null)=>_create(e);function escapeHtml(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(e,t){return hasOwnProperty.call(e,t)}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>"[object Object]"===toTypeString(e),toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,n)=>0===n?e+r:e+t+r),"")}function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const CompileErrorCodes={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17;function createCompileError(e,t,r={}){const{domain:n,messages:a,args:s}=r,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=n,o}function isMessageAST(e){return isObject(e)&&0===resolveType(e)&&(hasOwn(e,"b")||hasOwn(e,"body"))}const PROPS_BODY=["b","body"];function resolveBody(e){return resolveProps(e,PROPS_BODY)}const PROPS_CASES=["c","cases"];function resolveCases(e){return resolveProps(e,PROPS_CASES,[])}const PROPS_STATIC=["s","static"];function resolveStatic(e){return resolveProps(e,PROPS_STATIC)}const PROPS_ITEMS=["i","items"];function resolveItems(e){return resolveProps(e,PROPS_ITEMS,[])}const PROPS_TYPE=["t","type"];function resolveType(e){return resolveProps(e,PROPS_TYPE)}const PROPS_VALUE=["v","value"];function resolveValue$1(e,t){const r=resolveProps(e,PROPS_VALUE);if(null!=r)return r;throw createUnhandleNodeError(t)}const PROPS_MODIFIER=["m","modifier"];function resolveLinkedModifier(e){return resolveProps(e,PROPS_MODIFIER)}const PROPS_KEY=["k","key"];function resolveLinkedKey(e){const t=resolveProps(e,PROPS_KEY);if(t)return t;throw createUnhandleNodeError(6)}function resolveProps(e,t,r){for(let n=0;n<t.length;n++){const r=t[n];if(hasOwn(e,r)&&null!=e[r])return e[r]}return r}const AST_NODE_PROPS_KEYS=[...PROPS_BODY,...PROPS_CASES,...PROPS_STATIC,...PROPS_ITEMS,...PROPS_KEY,...PROPS_MODIFIER,...PROPS_VALUE,...PROPS_TYPE];function createUnhandleNodeError(e){return new Error(`unhandled node type: ${e}`)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=resolveBody(t);if(null==r)throw createUnhandleNodeError(0);if(1===resolveType(r)){const t=resolveCases(r);return e.plural(t.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=resolveStatic(t);if(null!=r)return"text"===e.type?r:e.normalize([r]);{const r=resolveItems(t).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=resolveType(t);switch(r){case 3:case 9:case 7:case 8:return resolveValue$1(t,r);case 4:{const n=t;if(hasOwn(n,"k")&&n.k)return e.interpolate(e.named(n.k));if(hasOwn(n,"key")&&n.key)return e.interpolate(e.named(n.key));throw createUnhandleNodeError(r)}case 5:{const n=t;if(hasOwn(n,"i")&&isNumber(n.i))return e.interpolate(e.list(n.i));if(hasOwn(n,"index")&&isNumber(n.index))return e.interpolate(e.list(n.index));throw createUnhandleNodeError(r)}case 6:{const r=t,n=resolveLinkedModifier(r),a=resolveLinkedKey(r);return e.linked(formatMessagePart(e,a),n?formatMessagePart(e,n):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${r}`)}}let compileCache=create();function clearCompileCache(){compileCache=create()}function compile(e,t){{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook("function:translate");function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreErrorCodes={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},CORE_ERROR_CODES_EXTEND_POINT=24;function createCoreError(e){return createCompileError(e,null,void 0)}function getLocale(e,t){return null!=t.locale?resolveLocale(t.locale):resolveLocale(e.locale)}let _resolveLocale;function resolveLocale(e){if(isString(e))return e;if(isFunction(e)){if(e.resolvedOnce&&null!=_resolveLocale)return _resolveLocale;if("Function"===e.constructor.name){const t=e();if(isPromise(t))throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=t}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const n=isString(r)?r:DEFAULT_LOCALE,a=e;a.__localeChainCache||(a.__localeChainCache=new Map);let s=a.__localeChainCache.get(n);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const o=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(o)?[o]:o,isArray(e)&&appendBlockToChain(s,e,!1),a.__localeChainCache.set(n,s)}return s}function appendBlockToChain(e,t,r){let n=!0;for(let a=0;a<t.length&&isBoolean(n);a++){const s=t[a];isString(s)&&(n=appendLocaleToChain(e,t[a],r))}return n}function appendLocaleToChain(e,t,r){let n;const a=t.split("-");do{n=appendItemToChain(e,a.join("-"),r),a.splice(-1,1)}while(a.length&&!0===n);return n}function appendItemToChain(e,t,r){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const a=t.replace(/!/g,"");e.push(a),(isArray(r)||isPlainObject(r))&&r[a]&&(n=r[a])}return n}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE,CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE,CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE;const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(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 formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,n,a,s,o,i,l,c=-1,u=0,m=0;const _=[];function E(){const t=e[c+1];if(5===u&&"'"===t||6===u&&'"'===t)return c++,a="\\"+t,_[0](),!0}for(_[0]=()=>{void 0===n?n=a:n+=a},_[1]=()=>{void 0!==n&&(t.push(n),n=void 0)},_[2]=()=>{_[0](),m++},_[3]=()=>{if(m>0)m--,u=4,_[0]();else{if(m=0,void 0===n)return!1;if(n=formatSubPath(n),!1===n)return!1;_[1]()}};null!==u;)if(c++,r=e[c],"\\"!==r||!E()){if(s=getPathCharType(r),l=pathStateMachine[u],o=l[s]||l.l||8,8===o)return;if(u=o[0],void 0!==o[1]&&(i=_[o[1]],i&&(a=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const n=r.length;let a=e,s=0;for(;s<n;){const e=r[s];if(AST_NODE_PROPS_KEYS.includes(e)&&isMessageAST(a))return null;const t=a[e];if(void 0===t)return null;if(isFunction(a))return null;a=t,s++}return a}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},CORE_WARN_CODES_EXTEND_POINT=8,warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}const VERSION="10.0.7",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:VERSION,n=isString(e.locale)||isFunction(e.locale)?e.locale:DEFAULT_LOCALE,a=isFunction(n)?DEFAULT_LOCALE:n,s=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:a,o=isPlainObject(e.messages)?e.messages:createResources(a),i=isPlainObject(e.datetimeFormats)?e.datetimeFormats:createResources(a),l=isPlainObject(e.numberFormats)?e.numberFormats:createResources(a),c=assign(create(),e.modifiers,getDefaultLinkedModifiers()),u=e.pluralRules||create(),m=isFunction(e.missing)?e.missing:null,_=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,E=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,g=!!e.fallbackFormat,O=!!e.unresolving,f=isFunction(e.postTranslation)?e.postTranslation:null,p=isPlainObject(e.processor)?e.processor:null,S=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,T=!!e.escapeParameter,d=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,A=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,C=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,N=isObject(e.fallbackContext)?e.fallbackContext:void 0,P=e,b=isObject(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,M=isObject(P.__numberFormatters)?P.__numberFormatters:new Map,L=isObject(P.__meta)?P.__meta:{};_cid++;const h={version:r,cid:_cid,locale:n,fallbackLocale:s,messages:o,modifiers:c,pluralRules:u,missing:m,missingWarn:_,fallbackWarn:E,fallbackFormat:g,unresolving:O,postTranslation:f,processor:p,warnHtmlMessage:S,escapeParameter:T,messageCompiler:d,messageResolver:A,localeFallbacker:C,fallbackContext:N,onWarn:t,__meta:L};return h.datetimeFormats=i,h.numberFormats=l,h.__datetimeFormatters=b,h.__numberFormatters=M,h}const createResources=e=>({[e]:create()});function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,n,a){const{missing:s,onWarn:o}=e;if(null!==s){const n=s(e,r,t,a);return isString(n)?n:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function isAlmostSameLocale(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function isImplicitFallback(e,t){const r=t.indexOf(e);if(-1===r)return!1;for(let n=r+1;n<t.length;n++)if(isAlmostSameLocale(e,t[n]))return!0;return!1}function datetime(e,...t){const{datetimeFormats:r,unresolving:n,fallbackLocale:a,onWarn:s,localeFallbacker:o}=e,{__datetimeFormatters:i}=e,[l,c,u,m]=parseDateTimeArgs(...t),_=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const E=!!u.part,g=getLocale(e,u),O=o(e,a,g);if(!isString(l)||""===l)return new Intl.DateTimeFormat(g,m).format(c);let f,p={},S=null;for(let A=0;A<O.length&&(f=O[A],p=r[f]||{},S=p[l],!isPlainObject(S));A++)handleMissing(e,l,f,_,"datetime format");if(!isPlainObject(S)||!isString(f))return n?-1:l;let T=`${f}__${l}`;isEmptyObject(m)||(T=`${T}__${JSON.stringify(m)}`);let d=i.get(T);return d||(d=new Intl.DateTimeFormat(f,assign({},S,m)),i.set(T,d)),E?d.formatToParts(c):d.format(c)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,n,a]=e,s=create();let o,i=create();if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();o=new Date(r);try{o.toISOString()}catch{throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);o=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);o=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(i=n),isPlainObject(a)&&(i=a),[s.key||"",o,s,i]}function clearDateTimeFormat(e,t,r){const n=e;for(const a in r){const e=`${t}__${a}`;n.__datetimeFormatters.has(e)&&n.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:n,fallbackLocale:a,onWarn:s,localeFallbacker:o}=e,{__numberFormatters:i}=e,[l,c,u,m]=parseNumberArgs(...t),_=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const E=!!u.part,g=getLocale(e,u),O=o(e,a,g);if(!isString(l)||""===l)return new Intl.NumberFormat(g,m).format(c);let f,p={},S=null;for(let A=0;A<O.length&&(f=O[A],p=r[f]||{},S=p[l],!isPlainObject(S));A++)handleMissing(e,l,f,_,"number format");if(!isPlainObject(S)||!isString(f))return n?-1:l;let T=`${f}__${l}`;isEmptyObject(m)||(T=`${T}__${JSON.stringify(m)}`);let d=i.get(T);return d||(d=new Intl.NumberFormat(f,assign({},S,m)),i.set(T,d)),E?d.formatToParts(c):d.format(c)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,n,a]=e,s=create();let o=create();if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?o[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(o=n),isPlainObject(a)&&(o=a),[s.key||"",i,s,o]}function clearNumberFormat(e,t,r){const n=e;for(const a in r){const e=`${t}__${a}`;n.__numberFormatters.has(e)&&n.__numberFormatters.delete(e)}}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,a=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],o=e.named||create();isNumber(e.pluralIndex)&&normalizeNamed(r,o);function i(t,r){const n=isFunction(e.messages)?e.messages(t,!!r):!!isObject(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const l=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,c=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>o[e],plural:e=>e[n(r,e.length,a)],linked:(t,...r)=>{const[n,a]=r;let s="text",o="";1===r.length?isObject(n)?(o=n.modifier||o,s=n.type||s):isString(n)&&(o=n||o):2===r.length&&(isString(n)&&(o=n||o),isString(a)&&(s=a||s));const l=i(t,!0)(u),c="vnode"===s&&isArray(l)&&o?l[0]:l;return o?(m=o,e.modifiers?e.modifiers[m]:DEFAULT_MODIFIER)(c,s):c;var m},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:c,normalize:l,values:assign(create(),s,o)};return u}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:n,unresolving:a,messageCompiler:s,fallbackLocale:o,messages:i}=e,[l,c]=parseTranslateArgs(...t),u=isBoolean(c.missingWarn)?c.missingWarn:e.missingWarn,m=isBoolean(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,_=isBoolean(c.escapeParameter)?c.escapeParameter:e.escapeParameter,E=!!c.resolvedMessage,g=isString(c.default)||isBoolean(c.default)?isBoolean(c.default)?s?l:()=>l:c.default:r?s?l:()=>l:null,O=r||null!=g&&(isString(g)||isFunction(g)),f=getLocale(e,c);_&&escapeParams(c);let[p,S,T]=E?[l,f,i[f]||create()]:resolveMessageFormat(e,l,f,o,m,u),d=p,A=l;if(E||isString(d)||isMessageAST(d)||isMessageFunction(d)||O&&(d=g,A=d),!(E||(isString(d)||isMessageAST(d)||isMessageFunction(d))&&isString(S)))return a?-1:l;let C=!1;const N=isMessageFunction(d)?d:compileMessageFormat(e,l,S,d,A,(()=>{C=!0}));if(C)return d;const P=evaluateMessage(e,N,createMessageContext(getMessageContextOptions(e,S,T,c)));return n?n(P,l):P}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,n,a,s){const{messages:o,onWarn:i,messageResolver:l,localeFallbacker:c}=e,u=c(e,n,r);let m,_=create(),E=null;for(let g=0;g<u.length&&(m=u[g],_=o[m]||create(),null===(E=l(_,t))&&(E=_[t]),!(isString(E)||isMessageAST(E)||isMessageFunction(E)));g++)if(!isImplicitFallback(m,u)){const r=handleMissing(e,t,m,s,"translate");r!==t&&(E=r)}return[E,m,_]}function compileMessageFormat(e,t,r,n,a,s){const{messageCompiler:o,warnHtmlMessage:i}=e;if(isMessageFunction(n)){const e=n;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==o){const e=()=>n;return e.locale=r,e.key=t,e}const l=o(n,getCompileContext(e,r,a,n,i,s));return l.locale=r,l.key=t,l.source=n,l}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,n]=e,a=create();if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?a.plural=r:isString(r)?a.default=r:isPlainObject(r)&&!isEmptyObject(r)?a.named=r:isArray(r)&&(a.list=r),isNumber(n)?a.plural=n:isString(n)?a.default=n:isPlainObject(n)&&assign(a,n),[s,a]}function getCompileContext(e,t,r,n,a,s){return{locale:t,key:r,warnHtmlMessage:a,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,n){const{modifiers:a,pluralRules:s,messageResolver:o,fallbackLocale:i,fallbackWarn:l,missingWarn:c,fallbackContext:u}=e,m={locale:t,modifiers:a,pluralRules:s,messages:(n,a)=>{let s=o(r,n);if(null==s&&(u||a)){const[,,r]=resolveMessageFormat(u||e,n,t,i,l,c);s=o(r,n)}if(isString(s)||isMessageAST(s)){let r=!1;const a=compileMessageFormat(e,n,t,s,n,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:a}return isMessageFunction(s)?s:NOOP_MESSAGE_FUNCTION}};return e.processor&&(m.processor=e.processor),n.list&&(m.list=n.list),n.named&&(m.named=n.named),isNumber(n.plural)&&(m.pluralIndex=n.plural),m}registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain);export{AST_NODE_PROPS_KEYS,CORE_ERROR_CODES_EXTEND_POINT,CORE_WARN_CODES_EXTEND_POINT,CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getLocale,getWarnMessage,handleMissing,initI18nDevTools,isAlmostSameLocale,isImplicitFallback,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveLocale,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale};
6
+ function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign,_create=Object.create,create=(e=null)=>_create(e);function escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function escapeAttributeValue(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function sanitizeTranslatedHtml(e){e=(e=e.replace(/(\w+)\s*=\s*"([^"]*)"/g,((e,t,r)=>`${t}="${escapeAttributeValue(r)}"`))).replace(/(\w+)\s*=\s*'([^']*)'/g,((e,t,r)=>`${t}='${escapeAttributeValue(r)}'`));/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3"));return[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach((t=>{e=e.replace(t,"$1javascript&#58;")})),e}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(e,t){return hasOwnProperty.call(e,t)}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>"[object Object]"===toTypeString(e),toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,a)=>0===a?e+r:e+t+r),"")}const CompileErrorCodes={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17;function createCompileError(e,t,r={}){const{domain:a,messages:n,args:s}=r,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=a,o}function isMessageAST(e){return isObject(e)&&0===resolveType(e)&&(hasOwn(e,"b")||hasOwn(e,"body"))}const PROPS_BODY=["b","body"];function resolveBody(e){return resolveProps(e,PROPS_BODY)}const PROPS_CASES=["c","cases"];function resolveCases(e){return resolveProps(e,PROPS_CASES,[])}const PROPS_STATIC=["s","static"];function resolveStatic(e){return resolveProps(e,PROPS_STATIC)}const PROPS_ITEMS=["i","items"];function resolveItems(e){return resolveProps(e,PROPS_ITEMS,[])}const PROPS_TYPE=["t","type"];function resolveType(e){return resolveProps(e,PROPS_TYPE)}const PROPS_VALUE=["v","value"];function resolveValue$1(e,t){const r=resolveProps(e,PROPS_VALUE);if(null!=r)return r;throw createUnhandleNodeError(t)}const PROPS_MODIFIER=["m","modifier"];function resolveLinkedModifier(e){return resolveProps(e,PROPS_MODIFIER)}const PROPS_KEY=["k","key"];function resolveLinkedKey(e){const t=resolveProps(e,PROPS_KEY);if(t)return t;throw createUnhandleNodeError(6)}function resolveProps(e,t,r){for(let a=0;a<t.length;a++){const r=t[a];if(hasOwn(e,r)&&null!=e[r])return e[r]}return r}const AST_NODE_PROPS_KEYS=[...PROPS_BODY,...PROPS_CASES,...PROPS_STATIC,...PROPS_ITEMS,...PROPS_KEY,...PROPS_MODIFIER,...PROPS_VALUE,...PROPS_TYPE];function createUnhandleNodeError(e){return new Error(`unhandled node type: ${e}`)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=resolveBody(t);if(null==r)throw createUnhandleNodeError(0);if(1===resolveType(r)){const t=resolveCases(r);return e.plural(t.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=resolveStatic(t);if(null!=r)return"text"===e.type?r:e.normalize([r]);{const r=resolveItems(t).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=resolveType(t);switch(r){case 3:case 9:case 7:case 8:return resolveValue$1(t,r);case 4:{const a=t;if(hasOwn(a,"k")&&a.k)return e.interpolate(e.named(a.k));if(hasOwn(a,"key")&&a.key)return e.interpolate(e.named(a.key));throw createUnhandleNodeError(r)}case 5:{const a=t;if(hasOwn(a,"i")&&isNumber(a.i))return e.interpolate(e.list(a.i));if(hasOwn(a,"index")&&isNumber(a.index))return e.interpolate(e.list(a.index));throw createUnhandleNodeError(r)}case 6:{const r=t,a=resolveLinkedModifier(r),n=resolveLinkedKey(r);return e.linked(formatMessagePart(e,n),a?formatMessagePart(e,a):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${r}`)}}let compileCache=create();function clearCompileCache(){compileCache=create()}function compile(e,t){{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook("function:translate");function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreErrorCodes={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},CORE_ERROR_CODES_EXTEND_POINT=24;function createCoreError(e){return createCompileError(e,null,void 0)}function getLocale(e,t){return null!=t.locale?resolveLocale(t.locale):resolveLocale(e.locale)}let _resolveLocale;function resolveLocale(e){if(isString(e))return e;if(isFunction(e)){if(e.resolvedOnce&&null!=_resolveLocale)return _resolveLocale;if("Function"===e.constructor.name){const t=e();if(isPromise(t))throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=t}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const a=isString(r)?r:DEFAULT_LOCALE,n=e;n.__localeChainCache||(n.__localeChainCache=new Map);let s=n.__localeChainCache.get(a);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const o=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(o)?[o]:o,isArray(e)&&appendBlockToChain(s,e,!1),n.__localeChainCache.set(a,s)}return s}function appendBlockToChain(e,t,r){let a=!0;for(let n=0;n<t.length&&isBoolean(a);n++){const s=t[n];isString(s)&&(a=appendLocaleToChain(e,t[n],r))}return a}function appendLocaleToChain(e,t,r){let a;const n=t.split("-");do{a=appendItemToChain(e,n.join("-"),r),n.splice(-1,1)}while(n.length&&!0===a);return a}function appendItemToChain(e,t,r){let a=!1;if(!e.includes(t)&&(a=!0,t)){a="!"!==t[t.length-1];const n=t.replace(/!/g,"");e.push(n),(isArray(r)||isPlainObject(r))&&r[n]&&(a=r[n])}return a}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE,CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE,CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE;const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(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 formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,a,n,s,o,i,l,c=-1,u=0,m=0;const _=[];function E(){const t=e[c+1];if(5===u&&"'"===t||6===u&&'"'===t)return c++,n="\\"+t,_[0](),!0}for(_[0]=()=>{void 0===a?a=n:a+=n},_[1]=()=>{void 0!==a&&(t.push(a),a=void 0)},_[2]=()=>{_[0](),m++},_[3]=()=>{if(m>0)m--,u=4,_[0]();else{if(m=0,void 0===a)return!1;if(a=formatSubPath(a),!1===a)return!1;_[1]()}};null!==u;)if(c++,r=e[c],"\\"!==r||!E()){if(s=getPathCharType(r),l=pathStateMachine[u],o=l[s]||l.l||8,8===o)return;if(u=o[0],void 0!==o[1]&&(i=_[o[1]],i&&(n=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const a=r.length;let n=e,s=0;for(;s<a;){const e=r[s];if(AST_NODE_PROPS_KEYS.includes(e)&&isMessageAST(n))return null;const t=n[e];if(void 0===t)return null;if(isFunction(n))return null;n=t,s++}return n}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},CORE_WARN_CODES_EXTEND_POINT=8,warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}const VERSION="10.0.8",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:VERSION,a=isString(e.locale)||isFunction(e.locale)?e.locale:DEFAULT_LOCALE,n=isFunction(a)?DEFAULT_LOCALE:a,s=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,o=isPlainObject(e.messages)?e.messages:createResources(n),i=isPlainObject(e.datetimeFormats)?e.datetimeFormats:createResources(n),l=isPlainObject(e.numberFormats)?e.numberFormats:createResources(n),c=assign(create(),e.modifiers,getDefaultLinkedModifiers()),u=e.pluralRules||create(),m=isFunction(e.missing)?e.missing:null,_=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,E=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,g=!!e.fallbackFormat,f=!!e.unresolving,O=isFunction(e.postTranslation)?e.postTranslation:null,p=isPlainObject(e.processor)?e.processor:null,T=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,S=!!e.escapeParameter,d=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,A=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,C=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,N=isObject(e.fallbackContext)?e.fallbackContext:void 0,P=e,b=isObject(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,M=isObject(P.__numberFormatters)?P.__numberFormatters:new Map,h=isObject(P.__meta)?P.__meta:{};_cid++;const L={version:r,cid:_cid,locale:a,fallbackLocale:s,messages:o,modifiers:c,pluralRules:u,missing:m,missingWarn:_,fallbackWarn:E,fallbackFormat:g,unresolving:f,postTranslation:O,processor:p,warnHtmlMessage:T,escapeParameter:S,messageCompiler:d,messageResolver:A,localeFallbacker:C,fallbackContext:N,onWarn:t,__meta:h};return L.datetimeFormats=i,L.numberFormats=l,L.__datetimeFormatters=b,L.__numberFormatters=M,L}const createResources=e=>({[e]:create()});function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,a,n){const{missing:s,onWarn:o}=e;if(null!==s){const a=s(e,r,t,n);return isString(a)?a:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function isAlmostSameLocale(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function isImplicitFallback(e,t){const r=t.indexOf(e);if(-1===r)return!1;for(let a=r+1;a<t.length;a++)if(isAlmostSameLocale(e,t[a]))return!0;return!1}function datetime(e,...t){const{datetimeFormats:r,unresolving:a,fallbackLocale:n,onWarn:s,localeFallbacker:o}=e,{__datetimeFormatters:i}=e,[l,c,u,m]=parseDateTimeArgs(...t),_=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const E=!!u.part,g=getLocale(e,u),f=o(e,n,g);if(!isString(l)||""===l)return new Intl.DateTimeFormat(g,m).format(c);let O,p={},T=null;for(let A=0;A<f.length&&(O=f[A],p=r[O]||{},T=p[l],!isPlainObject(T));A++)handleMissing(e,l,O,_,"datetime format");if(!isPlainObject(T)||!isString(O))return a?-1:l;let S=`${O}__${l}`;isEmptyObject(m)||(S=`${S}__${JSON.stringify(m)}`);let d=i.get(S);return d||(d=new Intl.DateTimeFormat(O,assign({},T,m)),i.set(S,d)),E?d.formatToParts(c):d.format(c)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,a,n]=e,s=create();let o,i=create();if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();o=new Date(r);try{o.toISOString()}catch{throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);o=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);o=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(a)?s.locale=a:isPlainObject(a)&&(i=a),isPlainObject(n)&&(i=n),[s.key||"",o,s,i]}function clearDateTimeFormat(e,t,r){const a=e;for(const n in r){const e=`${t}__${n}`;a.__datetimeFormatters.has(e)&&a.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:a,fallbackLocale:n,onWarn:s,localeFallbacker:o}=e,{__numberFormatters:i}=e,[l,c,u,m]=parseNumberArgs(...t),_=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const E=!!u.part,g=getLocale(e,u),f=o(e,n,g);if(!isString(l)||""===l)return new Intl.NumberFormat(g,m).format(c);let O,p={},T=null;for(let A=0;A<f.length&&(O=f[A],p=r[O]||{},T=p[l],!isPlainObject(T));A++)handleMissing(e,l,O,_,"number format");if(!isPlainObject(T)||!isString(O))return a?-1:l;let S=`${O}__${l}`;isEmptyObject(m)||(S=`${S}__${JSON.stringify(m)}`);let d=i.get(S);return d||(d=new Intl.NumberFormat(O,assign({},T,m)),i.set(S,d)),E?d.formatToParts(c):d.format(c)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,a,n]=e,s=create();let o=create();if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?o[e]=r[e]:s[e]=r[e]})),isString(a)?s.locale=a:isPlainObject(a)&&(o=a),isPlainObject(n)&&(o=n),[s.key||"",i,s,o]}function clearNumberFormat(e,t,r){const a=e;for(const n in r){const e=`${t}__${n}`;a.__numberFormatters.has(e)&&a.__numberFormatters.delete(e)}}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),a=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],o=e.named||create();isNumber(e.pluralIndex)&&normalizeNamed(r,o);function i(t,r){const a=isFunction(e.messages)?e.messages(t,!!r):!!isObject(e.messages)&&e.messages[t];return a||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const l=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,c=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>o[e],plural:e=>e[a(r,e.length,n)],linked:(t,...r)=>{const[a,n]=r;let s="text",o="";1===r.length?isObject(a)?(o=a.modifier||o,s=a.type||s):isString(a)&&(o=a||o):2===r.length&&(isString(a)&&(o=a||o),isString(n)&&(s=n||s));const l=i(t,!0)(u),c="vnode"===s&&isArray(l)&&o?l[0]:l;return o?(m=o,e.modifiers?e.modifiers[m]:DEFAULT_MODIFIER)(c,s):c;var m},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:c,normalize:l,values:assign(create(),s,o)};return u}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:a,unresolving:n,messageCompiler:s,fallbackLocale:o,messages:i}=e,[l,c]=parseTranslateArgs(...t),u=isBoolean(c.missingWarn)?c.missingWarn:e.missingWarn,m=isBoolean(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,_=isBoolean(c.escapeParameter)?c.escapeParameter:e.escapeParameter,E=!!c.resolvedMessage,g=isString(c.default)||isBoolean(c.default)?isBoolean(c.default)?s?l:()=>l:c.default:r?s?l:()=>l:null,f=r||null!=g&&(isString(g)||isFunction(g)),O=getLocale(e,c);_&&escapeParams(c);let[p,T,S]=E?[l,O,i[O]||create()]:resolveMessageFormat(e,l,O,o,m,u),d=p,A=l;if(E||isString(d)||isMessageAST(d)||isMessageFunction(d)||f&&(d=g,A=d),!(E||(isString(d)||isMessageAST(d)||isMessageFunction(d))&&isString(T)))return n?-1:l;let C=!1;const N=isMessageFunction(d)?d:compileMessageFormat(e,l,T,d,A,(()=>{C=!0}));if(C)return d;const P=evaluateMessage(e,N,createMessageContext(getMessageContextOptions(e,T,S,c)));let b=a?a(P,l):P;return _&&isString(b)&&(b=sanitizeTranslatedHtml(b)),b}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,a,n,s){const{messages:o,onWarn:i,messageResolver:l,localeFallbacker:c}=e,u=c(e,a,r);let m,_=create(),E=null;for(let g=0;g<u.length&&(m=u[g],_=o[m]||create(),null===(E=l(_,t))&&(E=_[t]),!(isString(E)||isMessageAST(E)||isMessageFunction(E)));g++)if(!isImplicitFallback(m,u)){const r=handleMissing(e,t,m,s,"translate");r!==t&&(E=r)}return[E,m,_]}function compileMessageFormat(e,t,r,a,n,s){const{messageCompiler:o,warnHtmlMessage:i}=e;if(isMessageFunction(a)){const e=a;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==o){const e=()=>a;return e.locale=r,e.key=t,e}const l=o(a,getCompileContext(e,r,n,a,i,s));return l.locale=r,l.key=t,l.source=a,l}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,a]=e,n=create();if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?n.plural=r:isString(r)?n.default=r:isPlainObject(r)&&!isEmptyObject(r)?n.named=r:isArray(r)&&(n.list=r),isNumber(a)?n.plural=a:isString(a)?n.default=a:isPlainObject(a)&&assign(n,a),[s,n]}function getCompileContext(e,t,r,a,n,s){return{locale:t,key:r,warnHtmlMessage:n,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,a){const{modifiers:n,pluralRules:s,messageResolver:o,fallbackLocale:i,fallbackWarn:l,missingWarn:c,fallbackContext:u}=e,m={locale:t,modifiers:n,pluralRules:s,messages:(a,n)=>{let s=o(r,a);if(null==s&&(u||n)){const[,,r]=resolveMessageFormat(u||e,a,t,i,l,c);s=o(r,a)}if(isString(s)||isMessageAST(s)){let r=!1;const n=compileMessageFormat(e,a,t,s,a,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:n}return isMessageFunction(s)?s:NOOP_MESSAGE_FUNCTION}};return e.processor&&(m.processor=e.processor),a.list&&(m.list=a.list),a.named&&(m.named=a.named),isNumber(a.plural)&&(m.pluralIndex=a.plural),m}registerMessageCompiler(compile),registerMessageResolver(resolveValue),registerLocaleFallbacker(fallbackWithLocaleChain);export{AST_NODE_PROPS_KEYS,CORE_ERROR_CODES_EXTEND_POINT,CORE_WARN_CODES_EXTEND_POINT,CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getLocale,getWarnMessage,handleMissing,initI18nDevTools,isAlmostSameLocale,isImplicitFallback,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveLocale,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale};
@@ -1,11 +1,21 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
6
  var IntlifyCore = (function (exports) {
7
7
  'use strict';
8
8
 
9
+ function warn(msg, err) {
10
+ if (typeof console !== 'undefined') {
11
+ console.warn(`[intlify] ` + msg);
12
+ /* istanbul ignore if */
13
+ if (err) {
14
+ console.warn(err.stack);
15
+ }
16
+ }
17
+ }
18
+
9
19
  /**
10
20
  * Original Utilities
11
21
  * written by kazuya kawaguchi
@@ -58,10 +68,49 @@ var IntlifyCore = (function (exports) {
58
68
  const create = (obj = null) => _create(obj);
59
69
  function escapeHtml(rawText) {
60
70
  return rawText
71
+ .replace(/&/g, '&amp;') // escape `&` first to avoid double escaping
61
72
  .replace(/</g, '&lt;')
62
73
  .replace(/>/g, '&gt;')
63
74
  .replace(/"/g, '&quot;')
64
- .replace(/'/g, '&apos;');
75
+ .replace(/'/g, '&apos;')
76
+ .replace(/\//g, '&#x2F;') // escape `/` to prevent closing tags or JavaScript URLs
77
+ .replace(/=/g, '&#x3D;'); // escape `=` to prevent attribute injection
78
+ }
79
+ function escapeAttributeValue(value) {
80
+ return value
81
+ .replace(/&(?![a-zA-Z0-9#]{2,6};)/g, '&amp;') // escape unescaped `&`
82
+ .replace(/"/g, '&quot;')
83
+ .replace(/'/g, '&apos;')
84
+ .replace(/</g, '&lt;')
85
+ .replace(/>/g, '&gt;');
86
+ }
87
+ function sanitizeTranslatedHtml(html) {
88
+ // Escape dangerous characters in attribute values
89
+ // Process attributes with double quotes
90
+ html = html.replace(/(\w+)\s*=\s*"([^"]*)"/g, (_, attrName, attrValue) => `${attrName}="${escapeAttributeValue(attrValue)}"`);
91
+ // Process attributes with single quotes
92
+ html = html.replace(/(\w+)\s*=\s*'([^']*)'/g, (_, attrName, attrValue) => `${attrName}='${escapeAttributeValue(attrValue)}'`);
93
+ // Detect and neutralize event handler attributes
94
+ const eventHandlerPattern = /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi;
95
+ if (eventHandlerPattern.test(html)) {
96
+ {
97
+ warn('Potentially dangerous event handlers detected in translation. ' +
98
+ 'Consider removing onclick, onerror, etc. from your translation messages.');
99
+ }
100
+ // Neutralize event handler attributes by escaping 'on'
101
+ html = html.replace(/(\s+)(on)(\w+\s*=)/gi, '$1&#111;n$3');
102
+ }
103
+ // Disable javascript: URLs in various contexts
104
+ const javascriptUrlPattern = [
105
+ // In href, src, action, formaction attributes
106
+ /(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,
107
+ // In style attributes within url()
108
+ /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi
109
+ ];
110
+ javascriptUrlPattern.forEach(pattern => {
111
+ html = html.replace(pattern, '$1javascript&#58;');
112
+ });
113
+ return html;
65
114
  }
66
115
  const hasOwnProperty = Object.prototype.hasOwnProperty;
67
116
  function hasOwn(obj, key) {
@@ -133,16 +182,6 @@ var IntlifyCore = (function (exports) {
133
182
  return res.join('\n');
134
183
  }
135
184
 
136
- function warn(msg, err) {
137
- if (typeof console !== 'undefined') {
138
- console.warn(`[intlify] ` + msg);
139
- /* istanbul ignore if */
140
- if (err) {
141
- console.warn(err.stack);
142
- }
143
- }
144
- }
145
-
146
185
  const CompileErrorCodes = {
147
186
  // tokenizer error codes
148
187
  EXPECTED_TOKEN: 1,
@@ -889,7 +928,7 @@ var IntlifyCore = (function (exports) {
889
928
  * Intlify core-base version
890
929
  * @internal
891
930
  */
892
- const VERSION = '10.0.7';
931
+ const VERSION = '10.0.8';
893
932
  const NOT_REOSLVED = -1;
894
933
  const DEFAULT_LOCALE = 'en-US';
895
934
  const MISSING_RESOLVE_VALUE = '';
@@ -1678,9 +1717,13 @@ var IntlifyCore = (function (exports) {
1678
1717
  const msgContext = createMessageContext(ctxOptions);
1679
1718
  const messaged = evaluateMessage(context, msg, msgContext);
1680
1719
  // if use post translation option, proceed it with handler
1681
- const ret = postTranslation
1720
+ let ret = postTranslation
1682
1721
  ? postTranslation(messaged, key)
1683
1722
  : messaged;
1723
+ // apply HTML sanitization for security
1724
+ if (escapeParameter && isString(ret)) {
1725
+ ret = sanitizeTranslatedHtml(ret);
1726
+ }
1684
1727
  // NOTE: experimental !!
1685
1728
  {
1686
1729
  // prettier-ignore
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
6
- var IntlifyCore=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=(e,t,n)=>r({l:e,k:t,s:n}),r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),a=e=>"number"==typeof e&&isFinite(e),o=e=>"[object Date]"===O(e),l=e=>"[object RegExp]"===O(e),s=e=>C(e)&&0===Object.keys(e).length,i=Object.assign,c=Object.create,u=(e=null)=>c(e);function m(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const f=Object.prototype.hasOwnProperty;function _(e,t){return f.call(e,t)}const E=Array.isArray,g=e=>"function"==typeof e,p=e=>"string"==typeof e,d=e=>"boolean"==typeof e,T=e=>null!==e&&"object"==typeof e,N=e=>T(e)&&g(e.then)&&g(e.catch),A=Object.prototype.toString,O=e=>A.call(e),C=e=>"[object Object]"===O(e);function L(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const h={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};function b(e,t,n={}){const{domain:r,messages:a,args:o}=n,l=new SyntaxError(String(e));return l.code=e,t&&(l.location=t),l.domain=r,l}function I(e){return T(e)&&0===y(e)&&(_(e,"b")||_(e,"body"))}const R=["b","body"];const S=["c","cases"];const k=["s","static"];const D=["i","items"];const M=["t","type"];function y(e){return v(e,M)}const F=["v","value"];function P(e,t){const n=v(e,F);if(null!=n)return n;throw x(t)}const U=["m","modifier"];const w=["k","key"];function v(e,t,n){for(let r=0;r<t.length;r++){const n=t[r];if(_(e,n)&&null!=e[n])return e[n]}return n}const W=[...R,...S,...k,...D,...w,...U,...F,...M];function x(e){return new Error(`unhandled node type: ${e}`)}function V(e){return t=>function(e,t){const n=(r=t,v(r,R));var r;if(null==n)throw x(0);if(1===y(n)){const t=function(e){return v(e,S,[])}(n);return e.plural(t.reduce(((t,n)=>[...t,G(e,n)]),[]))}return G(e,n)}(t,e)}function G(e,t){const n=function(e){return v(e,k)}(t);if(null!=n)return"text"===e.type?n:e.normalize([n]);{const n=function(e){return v(e,D,[])}(t).reduce(((t,n)=>[...t,K(e,n)]),[]);return e.normalize(n)}}function K(e,t){const n=y(t);switch(n){case 3:case 9:case 7:case 8:return P(t,n);case 4:{const r=t;if(_(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(_(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw x(n)}case 5:{const r=t;if(_(r,"i")&&a(r.i))return e.interpolate(e.list(r.i));if(_(r,"index")&&a(r.index))return e.interpolate(e.list(r.index));throw x(n)}case 6:{const n=t,r=function(e){return v(e,U)}(n),a=function(e){const t=v(e,w);if(t)return t;throw x(6)}(n);return e.linked(K(e,a),r?K(e,r):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${n}`)}}let $=u();function Y(e,t){{const t=e.cacheKey;if(t){const n=$[t];return n||($[t]=V(e))}return V(e)}}let j=null;const B=H("function:translate");function H(e){return t=>j&&j.emit(e,t)}const X={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function z(e,t){return null!=t.locale?Z(t.locale):Z(e.locale)}let J;function Z(e){if(p(e))return e;if(g(e)){if(e.resolvedOnce&&null!=J)return J;if("Function"===e.constructor.name){const t=e();if(N(t))throw Error(X.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return J=t}throw Error(X.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(X.NOT_SUPPORT_LOCALE_TYPE)}function Q(e,t,n){return[...new Set([n,...E(t)?t:T(t)?Object.keys(t):p(t)?[t]:[n]])]}function q(e,t,n){const r=p(n)?n:Ee,a=e;a.__localeChainCache||(a.__localeChainCache=new Map);let o=a.__localeChainCache.get(r);if(!o){o=[];let e=[n];for(;E(e);)e=ee(o,e,t);const l=E(t)||!C(t)?t:t.default?t.default:null;e=p(l)?[l]:l,E(e)&&ee(o,e,!1),a.__localeChainCache.set(r,o)}return o}function ee(e,t,n){let r=!0;for(let a=0;a<t.length&&d(r);a++){const o=t[a];p(o)&&(r=te(e,t[a],n))}return r}function te(e,t,n){let r;const a=t.split("-");do{r=ne(e,a.join("-"),n),a.splice(-1,1)}while(a.length&&!0===r);return r}function ne(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const a=t.replace(/!/g,"");e.push(a),(E(n)||C(n))&&n[a]&&(r=n[a])}return r}X.INVALID_ARGUMENT,X.INVALID_DATE_ARGUMENT,X.INVALID_ISO_DATE_ARGUMENT,X.NOT_SUPPORT_NON_STRING_MESSAGE,X.NOT_SUPPORT_LOCALE_PROMISE_VALUE,X.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,X.NOT_SUPPORT_LOCALE_TYPE;const re=[];re[0]={w:[0],i:[3,0],"[":[4],o:[7]},re[1]={w:[1],".":[2],"[":[4],o:[7]},re[2]={w:[2],i:[3,0],0:[3,0]},re[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},re[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},re[5]={"'":[4,0],o:8,l:[5,0]},re[6]={'"':[4,0],o:8,l:[6,0]};const ae=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function oe(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 le(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,ae.test(n)?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 n}function se(e){const t=[];let n,r,a,o,l,s,i,c=-1,u=0,m=0;const f=[];function _(){const t=e[c+1];if(5===u&&"'"===t||6===u&&'"'===t)return c++,a="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===r?r=a:r+=a},f[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),m++},f[3]=()=>{if(m>0)m--,u=4,f[0]();else{if(m=0,void 0===r)return!1;if(r=le(r),!1===r)return!1;f[1]()}};null!==u;)if(c++,n=e[c],"\\"!==n||!_()){if(o=oe(n),i=re[u],l=i[o]||i.l||8,8===l)return;if(u=l[0],void 0!==l[1]&&(s=f[l[1]],s&&(a=n,!1===s())))return;if(7===u)return t}}const ie=new Map;function ce(e,t){return T(e)?e[t]:null}function ue(e,t){if(!T(e))return null;let n=ie.get(t);if(n||(n=se(t),n&&ie.set(t,n)),!n)return null;const r=n.length;let a=e,o=0;for(;o<r;){const e=n[o];if(W.includes(e)&&I(a))return null;const t=a[e];if(void 0===t)return null;if(g(a))return null;a=t,o++}return a}const me={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},fe={[me.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[me.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[me.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[me.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[me.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[me.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[me.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};const _e="10.0.7",Ee="en-US",ge=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let pe,de,Te;function Ne(e){pe=e}function Ae(e){de=e}function Oe(e){Te=e}let Ce=null;let Le=null;let he=0;const be=e=>({[e]:u()});function Ie(e,t,n,r,a){const{missing:o,onWarn:l}=e;if(null!==o){const r=o(e,n,t,a);return p(r)?r:t}return t}function Re(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function Se(e,t){const n=t.indexOf(e);if(-1===n)return!1;for(let r=n+1;r<t.length;r++)if(Re(e,t[r]))return!0;return!1}const ke=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function De(...e){const[t,n,r,l]=e,s=u();let i,c=u();if(p(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(X.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();i=new Date(n);try{i.toISOString()}catch{throw Error(X.INVALID_ISO_DATE_ARGUMENT)}}else if(o(t)){if(isNaN(t.getTime()))throw Error(X.INVALID_DATE_ARGUMENT);i=t}else{if(!a(t))throw Error(X.INVALID_ARGUMENT);i=t}return p(n)?s.key=n:C(n)&&Object.keys(n).forEach((e=>{ke.includes(e)?c[e]=n[e]:s[e]=n[e]})),p(r)?s.locale=r:C(r)&&(c=r),C(l)&&(c=l),[s.key||"",i,s,c]}const Me=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function ye(...e){const[t,n,r,o]=e,l=u();let s=u();if(!a(t))throw Error(X.INVALID_ARGUMENT);const i=t;return p(n)?l.key=n:C(n)&&Object.keys(n).forEach((e=>{Me.includes(e)?s[e]=n[e]:l[e]=n[e]})),p(r)?l.locale=r:C(r)&&(s=r),C(o)&&(s=o),[l.key||"",i,l,s]}const Fe=e=>e,Pe=e=>"",Ue="text",we=e=>0===e.length?"":function(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}(e),ve=e=>null==e?"":E(e)||C(e)&&e.toString===A?JSON.stringify(e,null,2):String(e);function We(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function xe(e={}){const t=e.locale,n=function(e){const t=a(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(a(e.named.count)||a(e.named.n))?a(e.named.count)?e.named.count:a(e.named.n)?e.named.n:t:t}(e),r=T(e.pluralRules)&&p(t)&&g(e.pluralRules[t])?e.pluralRules[t]:We,o=T(e.pluralRules)&&p(t)&&g(e.pluralRules[t])?We:void 0,l=e.list||[],s=e.named||u();a(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,s);function c(t,n){const r=g(e.messages)?e.messages(t,!!n):!!T(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):Pe)}const m=C(e.processor)&&g(e.processor.normalize)?e.processor.normalize:we,f=C(e.processor)&&g(e.processor.interpolate)?e.processor.interpolate:ve,_={list:e=>l[e],named:e=>s[e],plural:e=>e[r(n,e.length,o)],linked:(t,...n)=>{const[r,a]=n;let o="text",l="";1===n.length?T(r)?(l=r.modifier||l,o=r.type||o):p(r)&&(l=r||l):2===n.length&&(p(r)&&(l=r||l),p(a)&&(o=a||o));const s=c(t,!0)(_),i="vnode"===o&&E(s)&&l?s[0]:s;return l?(u=l,e.modifiers?e.modifiers[u]:Fe)(i,o):i;var u},message:c,type:C(e.processor)&&p(e.processor.type)?e.processor.type:Ue,interpolate:f,normalize:m,values:i(u(),l,s)};return _}const Ve=()=>"",Ge=e=>g(e);function Ke(e,t,n,r,a,o){const{messages:l,onWarn:s,messageResolver:i,localeFallbacker:c}=e,m=c(e,r,n);let f,_=u(),E=null;for(let g=0;g<m.length&&(f=m[g],_=l[f]||u(),null===(E=i(_,t))&&(E=_[t]),!(p(E)||I(E)||Ge(E)));g++)if(!Se(f,m)){const n=Ie(e,t,f,0,"translate");n!==t&&(E=n)}return[E,f,_]}function $e(e,t,r,a,o,l){const{messageCompiler:s,warnHtmlMessage:i}=e;if(Ge(a)){const e=a;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==s){const e=()=>a;return e.locale=r,e.key=t,e}const c=s(a,function(e,t,r,a,o,l){return{locale:t,key:r,warnHtmlMessage:o,onError:e=>{throw l&&l(e),e},onCacheKey:e=>n(t,r,e)}}(0,r,o,0,i,l));return c.locale=r,c.key=t,c.source=a,c}function Ye(...e){const[t,n,r]=e,o=u();if(!(p(t)||a(t)||Ge(t)||I(t)))throw Error(X.INVALID_ARGUMENT);const l=a(t)?String(t):(Ge(t),t);return a(n)?o.plural=n:p(n)?o.default=n:C(n)&&!s(n)?o.named=n:E(n)&&(o.list=n),a(r)?o.plural=r:p(r)?o.default=r:C(r)&&i(o,r),[l,o]}return Ne(Y),Ae(ue),Oe(q),e.AST_NODE_PROPS_KEYS=W,e.CORE_ERROR_CODES_EXTEND_POINT=24,e.CORE_WARN_CODES_EXTEND_POINT=8,e.CompileErrorCodes=h,e.CoreErrorCodes=X,e.CoreWarnCodes=me,e.DATETIME_FORMAT_OPTIONS_KEYS=ke,e.DEFAULT_LOCALE=Ee,e.DEFAULT_MESSAGE_DATA_TYPE=Ue,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=Me,e.VERSION=_e,e.clearCompileCache=function(){$=u()},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const a in n){const e=`${t}__${a}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const a in n){const e=`${t}__${a}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=Y,e.createCompileError=b,e.createCoreContext=function(e={}){const t=g(e.onWarn)?e.onWarn:L,n=p(e.version)?e.version:_e,r=p(e.locale)||g(e.locale)?e.locale:Ee,a=g(r)?Ee:r,o=E(e.fallbackLocale)||C(e.fallbackLocale)||p(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:a,s=C(e.messages)?e.messages:be(a),c=C(e.datetimeFormats)?e.datetimeFormats:be(a),m=C(e.numberFormats)?e.numberFormats:be(a),f=i(u(),e.modifiers,{upper:(e,t)=>"text"===t&&p(e)?e.toUpperCase():"vnode"===t&&T(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&p(e)?e.toLowerCase():"vnode"===t&&T(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&p(e)?ge(e):"vnode"===t&&T(e)&&"__v_isVNode"in e?ge(e.children):e}),_=e.pluralRules||u(),N=g(e.missing)?e.missing:null,A=!d(e.missingWarn)&&!l(e.missingWarn)||e.missingWarn,O=!d(e.fallbackWarn)&&!l(e.fallbackWarn)||e.fallbackWarn,h=!!e.fallbackFormat,b=!!e.unresolving,I=g(e.postTranslation)?e.postTranslation:null,R=C(e.processor)?e.processor:null,S=!d(e.warnHtmlMessage)||e.warnHtmlMessage,k=!!e.escapeParameter,D=g(e.messageCompiler)?e.messageCompiler:pe,M=g(e.messageResolver)?e.messageResolver:de||ce,y=g(e.localeFallbacker)?e.localeFallbacker:Te||Q,F=T(e.fallbackContext)?e.fallbackContext:void 0,P=e,U=T(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,w=T(P.__numberFormatters)?P.__numberFormatters:new Map,v=T(P.__meta)?P.__meta:{};he++;const W={version:n,cid:he,locale:r,fallbackLocale:o,messages:s,modifiers:f,pluralRules:_,missing:N,missingWarn:A,fallbackWarn:O,fallbackFormat:h,unresolving:b,postTranslation:I,processor:R,warnHtmlMessage:S,escapeParameter:k,messageCompiler:D,messageResolver:M,localeFallbacker:y,fallbackContext:F,onWarn:t,__meta:v};return W.datetimeFormats=c,W.numberFormats=m,W.__datetimeFormatters=U,W.__numberFormatters=w,W},e.createCoreError=function(e){return b(e,null,void 0)},e.createMessageContext=xe,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:a,onWarn:o,localeFallbacker:l}=e,{__datetimeFormatters:c}=e,[u,m,f,_]=De(...t);d(f.missingWarn)?f.missingWarn:e.missingWarn,d(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn;const E=!!f.part,g=z(e,f),T=l(e,a,g);if(!p(u)||""===u)return new Intl.DateTimeFormat(g,_).format(m);let N,A={},O=null;for(let s=0;s<T.length&&(N=T[s],A=n[N]||{},O=A[u],!C(O));s++)Ie(e,u,N,0,"datetime format");if(!C(O)||!p(N))return r?-1:u;let L=`${N}__${u}`;s(_)||(L=`${L}__${JSON.stringify(_)}`);let h=c.get(L);return h||(h=new Intl.DateTimeFormat(N,i({},O,_)),c.set(L,h)),E?h.formatToParts(m):h.format(m)},e.fallbackWithLocaleChain=q,e.fallbackWithSimple=Q,e.getAdditionalMeta=()=>Ce,e.getDevToolsHook=function(){return j},e.getFallbackContext=()=>Le,e.getLocale=z,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&T(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(fe[e],...n)},e.handleMissing=Ie,e.initI18nDevTools=function(e,t,n){j&&j.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isAlmostSameLocale=Re,e.isImplicitFallback=Se,e.isMessageAST=I,e.isMessageFunction=Ge,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:a,onWarn:o,localeFallbacker:l}=e,{__numberFormatters:c}=e,[u,m,f,_]=ye(...t);d(f.missingWarn)?f.missingWarn:e.missingWarn,d(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn;const E=!!f.part,g=z(e,f),T=l(e,a,g);if(!p(u)||""===u)return new Intl.NumberFormat(g,_).format(m);let N,A={},O=null;for(let s=0;s<T.length&&(N=T[s],A=n[N]||{},O=A[u],!C(O));s++)Ie(e,u,N,0,"number format");if(!C(O)||!p(N))return r?-1:u;let L=`${N}__${u}`;s(_)||(L=`${L}__${JSON.stringify(_)}`);let h=c.get(L);return h||(h=new Intl.NumberFormat(N,i({},O,_)),c.set(L,h)),E?h.formatToParts(m):h.format(m)},e.parse=se,e.parseDateTimeArgs=De,e.parseNumberArgs=ye,e.parseTranslateArgs=Ye,e.registerLocaleFallbacker=Oe,e.registerMessageCompiler=Ne,e.registerMessageResolver=Ae,e.resolveLocale=Z,e.resolveValue=ue,e.resolveWithKeyValue=ce,e.setAdditionalMeta=e=>{Ce=e},e.setDevToolsHook=function(e){j=e},e.setFallbackContext=e=>{Le=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:l,fallbackLocale:s,messages:i}=e,[c,f]=Ye(...t),_=d(f.missingWarn)?f.missingWarn:e.missingWarn,N=d(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn,A=d(f.escapeParameter)?f.escapeParameter:e.escapeParameter,O=!!f.resolvedMessage,C=p(f.default)||d(f.default)?d(f.default)?l?c:()=>c:f.default:n?l?c:()=>c:null,L=n||null!=C&&(p(C)||g(C)),h=z(e,f);A&&function(e){E(e.list)?e.list=e.list.map((e=>p(e)?m(e):e)):T(e.named)&&Object.keys(e.named).forEach((t=>{p(e.named[t])&&(e.named[t]=m(e.named[t]))}))}(f);let[b,R,S]=O?[c,h,i[h]||u()]:Ke(e,c,h,s,N,_),k=b,D=c;if(O||p(k)||I(k)||Ge(k)||L&&(k=C,D=k),!(O||(p(k)||I(k)||Ge(k))&&p(R)))return o?-1:c;let M=!1;const y=Ge(k)?k:$e(e,c,R,k,D,(()=>{M=!0}));if(M)return k;const F=function(e,t,n,r){const{modifiers:o,pluralRules:l,messageResolver:s,fallbackLocale:i,fallbackWarn:c,missingWarn:u,fallbackContext:m}=e,f=(r,a)=>{let o=s(n,r);if(null==o&&(m||a)){const[,,n]=Ke(m||e,r,t,i,c,u);o=s(n,r)}if(p(o)||I(o)){let n=!1;const a=$e(e,r,t,o,r,(()=>{n=!0}));return n?Ve:a}return Ge(o)?o:Ve},_={locale:t,modifiers:o,pluralRules:l,messages:f};e.processor&&(_.processor=e.processor);r.list&&(_.list=r.list);r.named&&(_.named=r.named);a(r.plural)&&(_.pluralIndex=r.plural);return _}(e,R,S,f),P=function(e,t,n){const r=t(n);return r}(0,y,xe(F));return r?r(P,c):P},e.translateDevTools=B,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({});
6
+ var IntlifyCore=function(e){"use strict";function t(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const n=/\{([0-9a-zA-Z]+)\}/g;const r=(e,t,n)=>a({l:e,k:t,s:n}),a=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),l=e=>"[object Date]"===L(e),s=e=>"[object RegExp]"===L(e),i=e=>h(e)&&0===Object.keys(e).length,c=Object.assign,u=Object.create,m=(e=null)=>u(e);function f(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function _(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const E=Object.prototype.hasOwnProperty;function p(e,t){return E.call(e,t)}const g=Array.isArray,d=e=>"function"==typeof e,T=e=>"string"==typeof e,N=e=>"boolean"==typeof e,A=e=>null!==e&&"object"==typeof e,O=e=>A(e)&&d(e.then)&&d(e.catch),C=Object.prototype.toString,L=e=>C.call(e),h=e=>"[object Object]"===L(e);const b={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,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};function I(e,t,n={}){const{domain:r,messages:a,args:o}=n,l=new SyntaxError(String(e));return l.code=e,t&&(l.location=t),l.domain=r,l}function R(e){return A(e)&&0===F(e)&&(p(e,"b")||p(e,"body"))}const S=["b","body"];const k=["c","cases"];const D=["s","static"];const M=["i","items"];const y=["t","type"];function F(e){return W(e,y)}const P=["v","value"];function w(e,t){const n=W(e,P);if(null!=n)return n;throw V(t)}const U=["m","modifier"];const v=["k","key"];function W(e,t,n){for(let r=0;r<t.length;r++){const n=t[r];if(p(e,n)&&null!=e[n])return e[n]}return n}const x=[...S,...k,...D,...M,...v,...U,...P,...y];function V(e){return new Error(`unhandled node type: ${e}`)}function $(e){return t=>function(e,t){const n=(r=t,W(r,S));var r;if(null==n)throw V(0);if(1===F(n)){const t=function(e){return W(e,k,[])}(n);return e.plural(t.reduce(((t,n)=>[...t,G(e,n)]),[]))}return G(e,n)}(t,e)}function G(e,t){const n=function(e){return W(e,D)}(t);if(null!=n)return"text"===e.type?n:e.normalize([n]);{const n=function(e){return W(e,M,[])}(t).reduce(((t,n)=>[...t,K(e,n)]),[]);return e.normalize(n)}}function K(e,t){const n=F(t);switch(n){case 3:case 9:case 7:case 8:return w(t,n);case 4:{const r=t;if(p(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(p(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw V(n)}case 5:{const r=t;if(p(r,"i")&&o(r.i))return e.interpolate(e.list(r.i));if(p(r,"index")&&o(r.index))return e.interpolate(e.list(r.index));throw V(n)}case 6:{const n=t,r=function(e){return W(e,U)}(n),a=function(e){const t=W(e,v);if(t)return t;throw V(6)}(n);return e.linked(K(e,a),r?K(e,r):void 0,e.type)}default:throw new Error(`unhandled node on format message part: ${n}`)}}let j=m();function Y(e,t){{const t=e.cacheKey;if(t){const n=j[t];return n||(j[t]=$(e))}return $(e)}}let B=null;const H=X("function:translate");function X(e){return t=>B&&B.emit(e,t)}const z={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function Z(e,t){return null!=t.locale?Q(t.locale):Q(e.locale)}let J;function Q(e){if(T(e))return e;if(d(e)){if(e.resolvedOnce&&null!=J)return J;if("Function"===e.constructor.name){const t=e();if(O(t))throw Error(z.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return J=t}throw Error(z.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(z.NOT_SUPPORT_LOCALE_TYPE)}function q(e,t,n){return[...new Set([n,...g(t)?t:A(t)?Object.keys(t):T(t)?[t]:[n]])]}function ee(e,t,n){const r=T(n)?n:pe,a=e;a.__localeChainCache||(a.__localeChainCache=new Map);let o=a.__localeChainCache.get(r);if(!o){o=[];let e=[n];for(;g(e);)e=te(o,e,t);const l=g(t)||!h(t)?t:t.default?t.default:null;e=T(l)?[l]:l,g(e)&&te(o,e,!1),a.__localeChainCache.set(r,o)}return o}function te(e,t,n){let r=!0;for(let a=0;a<t.length&&N(r);a++){const o=t[a];T(o)&&(r=ne(e,t[a],n))}return r}function ne(e,t,n){let r;const a=t.split("-");do{r=re(e,a.join("-"),n),a.splice(-1,1)}while(a.length&&!0===r);return r}function re(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const a=t.replace(/!/g,"");e.push(a),(g(n)||h(n))&&n[a]&&(r=n[a])}return r}z.INVALID_ARGUMENT,z.INVALID_DATE_ARGUMENT,z.INVALID_ISO_DATE_ARGUMENT,z.NOT_SUPPORT_NON_STRING_MESSAGE,z.NOT_SUPPORT_LOCALE_PROMISE_VALUE,z.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,z.NOT_SUPPORT_LOCALE_TYPE;const ae=[];ae[0]={w:[0],i:[3,0],"[":[4],o:[7]},ae[1]={w:[1],".":[2],"[":[4],o:[7]},ae[2]={w:[2],i:[3,0],0:[3,0]},ae[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},ae[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},ae[5]={"'":[4,0],o:8,l:[5,0]},ae[6]={'"':[4,0],o:8,l:[6,0]};const oe=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function le(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 se(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,oe.test(n)?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 n}function ie(e){const t=[];let n,r,a,o,l,s,i,c=-1,u=0,m=0;const f=[];function _(){const t=e[c+1];if(5===u&&"'"===t||6===u&&'"'===t)return c++,a="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===r?r=a:r+=a},f[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),m++},f[3]=()=>{if(m>0)m--,u=4,f[0]();else{if(m=0,void 0===r)return!1;if(r=se(r),!1===r)return!1;f[1]()}};null!==u;)if(c++,n=e[c],"\\"!==n||!_()){if(o=le(n),i=ae[u],l=i[o]||i.l||8,8===l)return;if(u=l[0],void 0!==l[1]&&(s=f[l[1]],s&&(a=n,!1===s())))return;if(7===u)return t}}const ce=new Map;function ue(e,t){return A(e)?e[t]:null}function me(e,t){if(!A(e))return null;let n=ce.get(t);if(n||(n=ie(t),n&&ce.set(t,n)),!n)return null;const r=n.length;let a=e,o=0;for(;o<r;){const e=n[o];if(x.includes(e)&&R(a))return null;const t=a[e];if(void 0===t)return null;if(d(a))return null;a=t,o++}return a}const fe={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},_e={[fe.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[fe.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[fe.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[fe.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[fe.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[fe.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[fe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};const Ee="10.0.8",pe="en-US",ge=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let de,Te,Ne;function Ae(e){de=e}function Oe(e){Te=e}function Ce(e){Ne=e}let Le=null;let he=null;let be=0;const Ie=e=>({[e]:m()});function Re(e,t,n,r,a){const{missing:o,onWarn:l}=e;if(null!==o){const r=o(e,n,t,a);return T(r)?r:t}return t}function Se(e,t){return e!==t&&e.split("-")[0]===t.split("-")[0]}function ke(e,t){const n=t.indexOf(e);if(-1===n)return!1;for(let r=n+1;r<t.length;r++)if(Se(e,t[r]))return!0;return!1}const De=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Me(...e){const[t,n,r,a]=e,s=m();let i,c=m();if(T(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(z.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();i=new Date(n);try{i.toISOString()}catch{throw Error(z.INVALID_ISO_DATE_ARGUMENT)}}else if(l(t)){if(isNaN(t.getTime()))throw Error(z.INVALID_DATE_ARGUMENT);i=t}else{if(!o(t))throw Error(z.INVALID_ARGUMENT);i=t}return T(n)?s.key=n:h(n)&&Object.keys(n).forEach((e=>{De.includes(e)?c[e]=n[e]:s[e]=n[e]})),T(r)?s.locale=r:h(r)&&(c=r),h(a)&&(c=a),[s.key||"",i,s,c]}const ye=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Fe(...e){const[t,n,r,a]=e,l=m();let s=m();if(!o(t))throw Error(z.INVALID_ARGUMENT);const i=t;return T(n)?l.key=n:h(n)&&Object.keys(n).forEach((e=>{ye.includes(e)?s[e]=n[e]:l[e]=n[e]})),T(r)?l.locale=r:h(r)&&(s=r),h(a)&&(s=a),[l.key||"",i,l,s]}const Pe=e=>e,we=e=>"",Ue="text",ve=e=>0===e.length?"":function(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}(e),We=e=>null==e?"":g(e)||h(e)&&e.toString===C?JSON.stringify(e,null,2):String(e);function xe(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function Ve(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=A(e.pluralRules)&&T(t)&&d(e.pluralRules[t])?e.pluralRules[t]:xe,a=A(e.pluralRules)&&T(t)&&d(e.pluralRules[t])?xe:void 0,l=e.list||[],s=e.named||m();o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,s);function i(t,n){const r=d(e.messages)?e.messages(t,!!n):!!A(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):we)}const u=h(e.processor)&&d(e.processor.normalize)?e.processor.normalize:ve,f=h(e.processor)&&d(e.processor.interpolate)?e.processor.interpolate:We,_={list:e=>l[e],named:e=>s[e],plural:e=>e[r(n,e.length,a)],linked:(t,...n)=>{const[r,a]=n;let o="text",l="";1===n.length?A(r)?(l=r.modifier||l,o=r.type||o):T(r)&&(l=r||l):2===n.length&&(T(r)&&(l=r||l),T(a)&&(o=a||o));const s=i(t,!0)(_),c="vnode"===o&&g(s)&&l?s[0]:s;return l?(u=l,e.modifiers?e.modifiers[u]:Pe)(c,o):c;var u},message:i,type:h(e.processor)&&T(e.processor.type)?e.processor.type:Ue,interpolate:f,normalize:u,values:c(m(),l,s)};return _}const $e=()=>"",Ge=e=>d(e);function Ke(e,t,n,r,a,o){const{messages:l,onWarn:s,messageResolver:i,localeFallbacker:c}=e,u=c(e,r,n);let f,_=m(),E=null;for(let p=0;p<u.length&&(f=u[p],_=l[f]||m(),null===(E=i(_,t))&&(E=_[t]),!(T(E)||R(E)||Ge(E)));p++)if(!ke(f,u)){const n=Re(e,t,f,0,"translate");n!==t&&(E=n)}return[E,f,_]}function je(e,t,n,a,o,l){const{messageCompiler:s,warnHtmlMessage:i}=e;if(Ge(a)){const e=a;return e.locale=e.locale||n,e.key=e.key||t,e}if(null==s){const e=()=>a;return e.locale=n,e.key=t,e}const c=s(a,function(e,t,n,a,o,l){return{locale:t,key:n,warnHtmlMessage:o,onError:e=>{throw l&&l(e),e},onCacheKey:e=>r(t,n,e)}}(0,n,o,0,i,l));return c.locale=n,c.key=t,c.source=a,c}function Ye(...e){const[t,n,r]=e,a=m();if(!(T(t)||o(t)||Ge(t)||R(t)))throw Error(z.INVALID_ARGUMENT);const l=o(t)?String(t):(Ge(t),t);return o(n)?a.plural=n:T(n)?a.default=n:h(n)&&!i(n)?a.named=n:g(n)&&(a.list=n),o(r)?a.plural=r:T(r)?a.default=r:h(r)&&c(a,r),[l,a]}return Ae(Y),Oe(me),Ce(ee),e.AST_NODE_PROPS_KEYS=x,e.CORE_ERROR_CODES_EXTEND_POINT=24,e.CORE_WARN_CODES_EXTEND_POINT=8,e.CompileErrorCodes=b,e.CoreErrorCodes=z,e.CoreWarnCodes=fe,e.DATETIME_FORMAT_OPTIONS_KEYS=De,e.DEFAULT_LOCALE=pe,e.DEFAULT_MESSAGE_DATA_TYPE=Ue,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=ye,e.VERSION=Ee,e.clearCompileCache=function(){j=m()},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const a in n){const e=`${t}__${a}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const a in n){const e=`${t}__${a}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=Y,e.createCompileError=I,e.createCoreContext=function(e={}){const n=d(e.onWarn)?e.onWarn:t,r=T(e.version)?e.version:Ee,a=T(e.locale)||d(e.locale)?e.locale:pe,o=d(a)?pe:a,l=g(e.fallbackLocale)||h(e.fallbackLocale)||T(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,i=h(e.messages)?e.messages:Ie(o),u=h(e.datetimeFormats)?e.datetimeFormats:Ie(o),f=h(e.numberFormats)?e.numberFormats:Ie(o),_=c(m(),e.modifiers,{upper:(e,t)=>"text"===t&&T(e)?e.toUpperCase():"vnode"===t&&A(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&T(e)?e.toLowerCase():"vnode"===t&&A(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&T(e)?ge(e):"vnode"===t&&A(e)&&"__v_isVNode"in e?ge(e.children):e}),E=e.pluralRules||m(),p=d(e.missing)?e.missing:null,O=!N(e.missingWarn)&&!s(e.missingWarn)||e.missingWarn,C=!N(e.fallbackWarn)&&!s(e.fallbackWarn)||e.fallbackWarn,L=!!e.fallbackFormat,b=!!e.unresolving,I=d(e.postTranslation)?e.postTranslation:null,R=h(e.processor)?e.processor:null,S=!N(e.warnHtmlMessage)||e.warnHtmlMessage,k=!!e.escapeParameter,D=d(e.messageCompiler)?e.messageCompiler:de,M=d(e.messageResolver)?e.messageResolver:Te||ue,y=d(e.localeFallbacker)?e.localeFallbacker:Ne||q,F=A(e.fallbackContext)?e.fallbackContext:void 0,P=e,w=A(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,U=A(P.__numberFormatters)?P.__numberFormatters:new Map,v=A(P.__meta)?P.__meta:{};be++;const W={version:r,cid:be,locale:a,fallbackLocale:l,messages:i,modifiers:_,pluralRules:E,missing:p,missingWarn:O,fallbackWarn:C,fallbackFormat:L,unresolving:b,postTranslation:I,processor:R,warnHtmlMessage:S,escapeParameter:k,messageCompiler:D,messageResolver:M,localeFallbacker:y,fallbackContext:F,onWarn:n,__meta:v};return W.datetimeFormats=u,W.numberFormats=f,W.__datetimeFormatters=w,W.__numberFormatters=U,W},e.createCoreError=function(e){return I(e,null,void 0)},e.createMessageContext=Ve,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:a,onWarn:o,localeFallbacker:l}=e,{__datetimeFormatters:s}=e,[u,m,f,_]=Me(...t);N(f.missingWarn)?f.missingWarn:e.missingWarn,N(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn;const E=!!f.part,p=Z(e,f),g=l(e,a,p);if(!T(u)||""===u)return new Intl.DateTimeFormat(p,_).format(m);let d,A={},O=null;for(let i=0;i<g.length&&(d=g[i],A=n[d]||{},O=A[u],!h(O));i++)Re(e,u,d,0,"datetime format");if(!h(O)||!T(d))return r?-1:u;let C=`${d}__${u}`;i(_)||(C=`${C}__${JSON.stringify(_)}`);let L=s.get(C);return L||(L=new Intl.DateTimeFormat(d,c({},O,_)),s.set(C,L)),E?L.formatToParts(m):L.format(m)},e.fallbackWithLocaleChain=ee,e.fallbackWithSimple=q,e.getAdditionalMeta=()=>Le,e.getDevToolsHook=function(){return B},e.getFallbackContext=()=>he,e.getLocale=Z,e.getWarnMessage=function(e,...t){return function(e,...t){return 1===t.length&&A(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(n,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}(_e[e],...t)},e.handleMissing=Re,e.initI18nDevTools=function(e,t,n){B&&B.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isAlmostSameLocale=Se,e.isImplicitFallback=ke,e.isMessageAST=R,e.isMessageFunction=Ge,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:a,onWarn:o,localeFallbacker:l}=e,{__numberFormatters:s}=e,[u,m,f,_]=Fe(...t);N(f.missingWarn)?f.missingWarn:e.missingWarn,N(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn;const E=!!f.part,p=Z(e,f),g=l(e,a,p);if(!T(u)||""===u)return new Intl.NumberFormat(p,_).format(m);let d,A={},O=null;for(let i=0;i<g.length&&(d=g[i],A=n[d]||{},O=A[u],!h(O));i++)Re(e,u,d,0,"number format");if(!h(O)||!T(d))return r?-1:u;let C=`${d}__${u}`;i(_)||(C=`${C}__${JSON.stringify(_)}`);let L=s.get(C);return L||(L=new Intl.NumberFormat(d,c({},O,_)),s.set(C,L)),E?L.formatToParts(m):L.format(m)},e.parse=ie,e.parseDateTimeArgs=Me,e.parseNumberArgs=Fe,e.parseTranslateArgs=Ye,e.registerLocaleFallbacker=Ce,e.registerMessageCompiler=Ae,e.registerMessageResolver=Oe,e.resolveLocale=Q,e.resolveValue=me,e.resolveWithKeyValue=ue,e.setAdditionalMeta=e=>{Le=e},e.setDevToolsHook=function(e){B=e},e.setFallbackContext=e=>{he=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:a,messageCompiler:l,fallbackLocale:s,messages:i}=e,[c,u]=Ye(...t),E=N(u.missingWarn)?u.missingWarn:e.missingWarn,p=N(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,O=N(u.escapeParameter)?u.escapeParameter:e.escapeParameter,C=!!u.resolvedMessage,L=T(u.default)||N(u.default)?N(u.default)?l?c:()=>c:u.default:n?l?c:()=>c:null,h=n||null!=L&&(T(L)||d(L)),b=Z(e,u);O&&function(e){g(e.list)?e.list=e.list.map((e=>T(e)?f(e):e)):A(e.named)&&Object.keys(e.named).forEach((t=>{T(e.named[t])&&(e.named[t]=f(e.named[t]))}))}(u);let[I,S,k]=C?[c,b,i[b]||m()]:Ke(e,c,b,s,p,E),D=I,M=c;if(C||T(D)||R(D)||Ge(D)||h&&(D=L,M=D),!(C||(T(D)||R(D)||Ge(D))&&T(S)))return a?-1:c;let y=!1;const F=Ge(D)?D:je(e,c,S,D,M,(()=>{y=!0}));if(y)return D;const P=function(e,t,n,r){const{modifiers:a,pluralRules:l,messageResolver:s,fallbackLocale:i,fallbackWarn:c,missingWarn:u,fallbackContext:m}=e,f=(r,a)=>{let o=s(n,r);if(null==o&&(m||a)){const[,,n]=Ke(m||e,r,t,i,c,u);o=s(n,r)}if(T(o)||R(o)){let n=!1;const a=je(e,r,t,o,r,(()=>{n=!0}));return n?$e:a}return Ge(o)?o:$e},_={locale:t,modifiers:a,pluralRules:l,messages:f};e.processor&&(_.processor=e.processor);r.list&&(_.list=r.list);r.named&&(_.named=r.named);o(r.plural)&&(_.pluralIndex=r.plural);return _}(e,S,k,u),w=function(e,t,n){const r=t(n);return r}(0,F,Ve(P));let U=r?r(w,c):w;var v;return O&&T(U)&&(v=(v=(v=U).replace(/(\w+)\s*=\s*"([^"]*)"/g,((e,t,n)=>`${t}="${_(n)}"`))).replace(/(\w+)\s*=\s*'([^']*)'/g,((e,t,n)=>`${t}='${_(n)}'`)),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(v)&&(v=v.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach((e=>{v=v.replace(e,"$1javascript&#58;")})),U=v),U},e.translateDevTools=H,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core v10.0.7
2
+ * core v10.0.8
3
3
  * (c) 2025 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlify/core",
3
- "version": "10.0.7",
3
+ "version": "10.0.8",
4
4
  "description": "@intlify/core",
5
5
  "keywords": [
6
6
  "core",
@@ -33,8 +33,8 @@
33
33
  "jsdelivr": "dist/core.global.js",
34
34
  "types": "dist/core.d.ts",
35
35
  "dependencies": {
36
- "@intlify/core-base": "10.0.7",
37
- "@intlify/shared": "10.0.7"
36
+ "@intlify/core-base": "10.0.8",
37
+ "@intlify/shared": "10.0.8"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">= 16"