Socket
Socket
Sign inDemoInstall

intl-messageformat-parser

Package Overview
Dependencies
Maintainers
4
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intl-messageformat-parser - npm Package Compare versions

Comparing version 3.5.3 to 3.6.0

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

# [3.6.0](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@3.5.3...intl-messageformat-parser@3.6.0) (2020-01-06)
### Features
* **intl-messageformat-parser:** allow unclosed apostrophe escape sequence ([54b442f](https://github.com/formatjs/formatjs/commit/54b442f8851bd6c7cbc57e2666df294f1c799bd4))
* **intl-messageformat-parser:** pound symbol escaping ([19fd028](https://github.com/formatjs/formatjs/commit/19fd028030356deba7b409af3c88ab24017556fc))
## [3.5.3](https://github.com/formatjs/formatjs/compare/intl-messageformat-parser@3.5.2...intl-messageformat-parser@3.5.3) (2019-12-27)

@@ -8,0 +20,0 @@

1

dist/printer.d.ts
import { MessageFormatElement, DateTimeSkeleton } from './types';
export declare function printAST(ast: MessageFormatElement[]): string;
export declare function doPrintAST(ast: MessageFormatElement[], isInPlural: boolean): string;
export declare function printDateTimeSkeleton(style: DateTimeSkeleton): string;

20

dist/printer.js

@@ -17,5 +17,9 @@ "use strict";

function printAST(ast) {
return doPrintAST(ast, false);
}
exports.printAST = printAST;
function doPrintAST(ast, isInPlural) {
var printedNodes = ast.map(function (el) {
if (types_1.isLiteralElement(el)) {
return printLiteralElement(el);
return printLiteralElement(el, isInPlural);
}

@@ -34,12 +38,16 @@ if (types_1.isArgumentElement(el)) {

}
if (types_1.isPoundElement(el)) {
return '#';
}
});
return printedNodes.join('');
}
exports.printAST = printAST;
exports.doPrintAST = doPrintAST;
function printEscapedMessage(message) {
return message.replace(/([{}](?:.*[{}])?)/su, "'$1'");
}
function printLiteralElement(_a) {
function printLiteralElement(_a, isInPlural) {
var value = _a.value;
return printEscapedMessage(value);
var escaped = printEscapedMessage(value);
return isInPlural ? escaped.replace('#', "'#'") : escaped;
}

@@ -79,3 +87,3 @@ function printArgumentElement(_a) {

Object.keys(el.options)
.map(function (id) { return id + "{" + printAST(el.options[id].value) + "}"; })
.map(function (id) { return id + "{" + doPrintAST(el.options[id].value, false) + "}"; })
.join(' '),

@@ -92,3 +100,3 @@ ].join(',');

el.offset ? "offset:" + el.offset : ''
], Object.keys(el.options).map(function (id) { return id + "{" + printAST(el.options[id].value) + "}"; })).filter(Boolean)
], Object.keys(el.options).map(function (id) { return id + "{" + doPrintAST(el.options[id].value, true) + "}"; })).filter(Boolean)
.join(' '),

@@ -95,0 +103,0 @@ ].join(',');

@@ -29,3 +29,8 @@ export declare enum TYPE {

*/
plural = 6
plural = 6,
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
pound = 7
}

@@ -76,3 +81,7 @@ export declare const enum SKELETON_TYPE {

}
export declare type MessageFormatElement = LiteralElement | ArgumentElement | NumberElement | DateElement | TimeElement | SelectElement | PluralElement;
export interface PoundElement {
type: TYPE.pound;
location?: Location;
}
export declare type MessageFormatElement = LiteralElement | ArgumentElement | NumberElement | DateElement | TimeElement | SelectElement | PluralElement | PoundElement;
export interface NumberSkeletonToken {

@@ -103,2 +112,3 @@ stem: string;

export declare function isPluralElement(el: MessageFormatElement): el is PluralElement;
export declare function isPoundElement(el: MessageFormatElement): el is PoundElement;
export declare function isNumberSkeleton(el: NumberElement['style']): el is NumberSkeleton;

@@ -105,0 +115,0 @@ export declare function isDateTimeSkeleton(el?: DateElement['style'] | TimeElement['style']): el is DateTimeSkeleton;

@@ -33,2 +33,7 @@ "use strict";

TYPE[TYPE["plural"] = 6] = "plural";
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
TYPE[TYPE["pound"] = 7] = "pound";
})(TYPE = exports.TYPE || (exports.TYPE = {}));

@@ -66,2 +71,6 @@ /**

exports.isPluralElement = isPluralElement;
function isPoundElement(el) {
return el.type === TYPE.pound;
}
exports.isPoundElement = isPoundElement;
function isNumberSkeleton(el) {

@@ -68,0 +77,0 @@ return !!(el && typeof el === 'object' && el.type === 0 /* number */);

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormatParser={})}(this,function(Ct){"use strict";var e;function f(e){return e.type===Ct.TYPE.literal}function n(e){return e.type===Ct.TYPE.select}function a(e){return e.type===Ct.TYPE.plural}(e=Ct.TYPE||(Ct.TYPE={}))[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural";var i,u,t=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),kt=function(){return(kt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Dt=(u=Error,t(o,u),o.buildMessage=function(e,t){function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function i(e){switch(e.type){case"literal":return'"'+n(e.text)+'"';case"class":var t=e.parts.map(function(e){return Array.isArray(e)?a(e[0])+"-"+a(e[1]):a(e)});return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,r,n=e.map(i);if(n.sort(),0<n.length){for(r=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((u=t)?'"'+n(u)+'"':"end of input")+" found.";var u},o);function o(e,t,r,n){var a=u.call(this)||this;return a.message=e,a.expected=t,a.found=r,a.location=n,a.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a,o),a}var p=function(f,e){e=void 0!==e?e:{};var t,r,n,a,p={},i={start:rt},u=rt,o=function(e){return e.join("")},c=function(e){return kt({type:Ct.TYPE.literal,value:e},xt())},s=Xe("argumentElement"),h="{",g=Ve("{",!1),m="}",d=Ve("}",!1),l=function(e){return kt({type:Ct.TYPE.argument,value:e},xt())},y=Xe("numberSkeletonId"),v=/^['\/{}]/,A=We(["'","/","{","}"],!1,!1),b={type:"any"},w=Xe("numberSkeletonTokenOption"),E="/",x=Ve("/",!1),C=function(e){return e},k=Xe("numberSkeletonToken"),D=function(e,t){return{stem:e,options:t}},F=function(e){return kt({type:0,tokens:e},xt())},P="::",T=Ve("::",!1),S=function(e){return e},Y=function(e){return e.replace(/\s*$/,"")},O=",",j=Ve(",",!1),R="number",B=Ve("number",!1),Z=function(e,t,r){return kt({type:"number"===t?Ct.TYPE.number:"date"===t?Ct.TYPE.date:Ct.TYPE.time,style:r&&r[2],value:e},xt())},z="'",N=Ve("'",!1),_=/^[^']/,M=We(["'"],!0,!1),L=/^[^a-zA-Z'{}]/,$=We([["a","z"],["A","Z"],"'","{","}"],!0,!1),q=/^[a-zA-Z]/,H=We([["a","z"],["A","Z"]],!1,!1),I=function(e){return kt({type:1,pattern:e},xt())},U="date",G=Ve("date",!1),K="time",Q=Ve("time",!1),V="plural",W=Ve("plural",!1),X="selectordinal",J=Ve("selectordinal",!1),ee="offset:",te=Ve("offset:",!1),re=function(e,t,r,n){return kt({type:Ct.TYPE.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:r?r[2]:0,options:n.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Qe('Duplicate option "'+r+'" in plural element: "'+Ge()+'"',Ke()),e[r]={value:n,location:a},e},{})},xt())},ne="select",ae=Ve("select",!1),ie=function(e,t){return kt({type:Ct.TYPE.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Qe('Duplicate option "'+r+'" in select element: "'+Ge()+'"',Ke()),e[r]={value:n,location:a},e},{})},xt())},ue="=",oe=Ve("=",!1),ce=function(e,t){return kt({id:e,value:t},xt())},se=function(e,t){return kt({id:e,value:t},xt())},le=Xe("whitespace pattern"),fe=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,pe=We([["\t","\r"]," ","…","‎","‏","\u2028","\u2029"],!1,!1),he=Xe("syntax pattern"),ge=/^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,me=We([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←","⑟"],["─","❵"],["➔","⯿"],["⸀","⹿"],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),de=Xe("optional whitespace"),ye=Xe("number"),ve="-",Ae=Ve("-",!1),be=function(e,t){return t?e?-t:t:0},we=Xe("double apostrophes"),Ee="''",xe=Ve("''",!1),Ce=function(){return"'"},ke=/^[{}]/,De=We(["{","}"],!1,!1),Fe=function(e,t){return e+t.replace("''","'")},Pe=/^[^{}]/,Te=We(["{","}"],!0,!1),Se=Xe("argNameOrNumber"),Ye=Xe("argNumber"),Oe="0",je=Ve("0",!1),Re=function(){return 0},Be=/^[1-9]/,Ze=We([["1","9"]],!1,!1),ze=/^[0-9]/,Ne=We([["0","9"]],!1,!1),_e=function(e){return parseInt(e.join(""),10)},Me=Xe("argName"),Le=0,$e=0,qe=[{line:1,column:1}],He=0,Ie=[],Ue=0;if(void 0!==e.startRule){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');u=i[e.startRule]}function Ge(){return f.substring($e,Le)}function Ke(){return et($e,Le)}function Qe(e,t){throw function(e,t){return new Dt(e,[],"",t)}(e,t=void 0!==t?t:et($e,Le))}function Ve(e,t){return{type:"literal",text:e,ignoreCase:t}}function We(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Xe(e){return{type:"other",description:e}}function Je(e){var t,r=qe[e];if(r)return r;for(t=e-1;!qe[t];)t--;for(r={line:(r=qe[t]).line,column:r.column};t<e;)10===f.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return qe[e]=r}function et(e,t){var r=Je(e),n=Je(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function tt(e){Le<He||(He<Le&&(He=Le,Ie=[]),Ie.push(e))}function rt(){return nt()}function nt(){var e,t;for(e=[],t=at();t!==p;)e.push(t),t=at();return e}function at(){var e;return(e=function(){var e,t;e=Le,(t=it())!==p&&($e=e,t=c(t));return e=t}())===p&&(e=function(){var e,t,r,n,a;Ue++,e=Le,123===f.charCodeAt(Le)?(t=h,Le++):(t=p,0===Ue&&tt(g));e=t!==p?(r=mt(),r!==p?(n=bt())!==p?mt()!==p?(125===f.charCodeAt(Le)?(a=m,Le++):(a=p,0===Ue&&tt(d)),a!==p?($e=e,t=l(n)):(Le=e,p)):(Le=e,p):(Le=e,p):(Le=e,p)):(Le=e,p);Ue--,e===p&&(t=p,0===Ue&&tt(s));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,a,i,u,o,c,s;e=Le,123===f.charCodeAt(Le)?(t=h,Le++):(t=p,0===Ue&&tt(g));e=t!==p?(r=mt(),r!==p?(n=bt())!==p?mt()!==p?(44===f.charCodeAt(Le)?(a=O,Le++):(a=p,0===Ue&&tt(j)),a!==p?mt()!==p?(f.substr(Le,6)===R?(i=R,Le+=6):(i=p,0===Ue&&tt(B)),i!==p?mt()!==p?(u=Le,44===f.charCodeAt(Le)?(o=O,Le++):(o=p,0===Ue&&tt(j)),(u=o!==p?(c=mt())!==p?(s=function(){var e,t,r;e=Le,f.substr(Le,2)===P?(t=P,Le+=2):(t=p,0===Ue&&tt(T));e=t!==p?(r=function(){var e,t,r;if(e=Le,t=[],(r=ct())!==p)for(;r!==p;)t.push(r),r=ct();else t=p;t!==p&&($e=e,t=F(t));return e=t}(),r!==p?($e=e,t=S(r)):(Le=e,p)):(Le=e,p);e===p&&(e=Le,(t=it())!==p&&($e=e,t=Y(t)),e=t);return e}())!==p?o=[o,c,s]:(Le=u,p):(Le=u,p):(Le=u,p))===p&&(u=null),u!==p?(o=mt())!==p?(125===f.charCodeAt(Le)?(c=m,Le++):(c=p,0===Ue&&tt(d)),c!==p?($e=e,t=Z(n,i,u)):(Le=e,p)):(Le=e,p):(Le=e,p)):(Le=e,p):(Le=e,p)):(Le=e,p):(Le=e,p)):(Le=e,p):(Le=e,p):(Le=e,p)):(Le=e,p);return e}())===p&&(e=function(){var e,t,r,n,a,i,u,o,c,s;e=Le,123===f.charCodeAt(Le)?(t=h,Le++):(t=p,0===Ue&&tt(g));e=t!==p?(r=mt(),r!==p?(n=bt())!==p?mt()!==p?(44===f.charCodeAt(Le)?(a=O,Le++):(a=p,0===Ue&&tt(j)),a!==p?mt()!==p?(f.substr(Le,4)===U?(i=U,Le+=4):(i=p,0===Ue&&tt(G)),i===p&&(f.substr(Le,4)===K?(i=K,Le+=4):(i=p,0===Ue&&tt(Q))),i!==p?mt()!==p?(u=Le,44===f.charCodeAt(Le)?(o=O,Le++):(o=p,0===Ue&&tt(j)),(u=o!==p?(c=mt())!==p?(s=function(){var e,t,r;e=Le,f.substr(Le,2)===P?(t=P,Le+=2):(t=p,0===Ue&&tt(T));e=t!==p?(r=function(){var e,t,r,n;t=e=Le,r=[],(n=st())===p&&(n=lt());if(n!==p)for(;n!==p;)r.push(n),(n=st())===p&&(n=lt());else r=p;t=r!==p?f.substring(t,Le):r;t!==p&&($e=e,t=I(t));return e=t}(),r!==p?($e=e,t=S(r)):(Le=e,p)):(Le=e,p);e===p&&(e=Le,(t=it())!==p&&($e=e,t=Y(t)),e=t);return e}())!==p?o=[o,c,s]:(Le=u,p):(Le=u,p):(Le=u,p))===p&&(u=null),u!==p?(o=mt())!==p?(125===f.charCodeAt(Le)?(c=m,Le++):(c=p,0===Ue&&tt(d)),c!==p?($e=e,t=Z(n,i,u)):(Le=e,p)):(Le=e,p):(Le=e,p)):(Le=e,p):(Le=e,p)):(Le=e,p):(Le=e,p)):(Le=e,p):(Le=e,p):(Le=e,p)):(Le=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,a,i,u,o,c,s,l;e=Le,123===f.charCodeAt(Le)?(t=h,Le++):(t=p,0===Ue&&tt(g));if(t!==p)if(mt()!==p)if((r=bt())!==p)if(mt()!==p)if(44===f.charCodeAt(Le)?(n=O,Le++):(n=p,0===Ue&&tt(j)),n!==p)if(mt()!==p)if(f.substr(Le,6)===V?(a=V,Le+=6):(a=p,0===Ue&&tt(W)),a===p&&(f.substr(Le,13)===X?(a=X,Le+=13):(a=p,0===Ue&&tt(J))),a!==p)if(mt()!==p)if(44===f.charCodeAt(Le)?(i=O,Le++):(i=p,0===Ue&&tt(j)),i!==p)if(mt()!==p)if(u=Le,f.substr(Le,7)===ee?(o=ee,Le+=7):(o=p,0===Ue&&tt(te)),(u=o!==p?(c=mt())!==p?(s=dt())!==p?o=[o,c,s]:(Le=u,p):(Le=u,p):(Le=u,p))===p&&(u=null),u!==p)if((o=mt())!==p){if(c=[],(s=pt())!==p)for(;s!==p;)c.push(s),s=pt();else c=p;e=c!==p?(s=mt())!==p?(125===f.charCodeAt(Le)?(l=m,Le++):(l=p,0===Ue&&tt(d)),l!==p?($e=e,t=re(r,a,u,c)):(Le=e,p)):(Le=e,p):(Le=e,p)}else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,a,i,u,o,c;e=Le,123===f.charCodeAt(Le)?(t=h,Le++):(t=p,0===Ue&&tt(g));if(t!==p)if(mt()!==p)if((r=bt())!==p)if(mt()!==p)if(44===f.charCodeAt(Le)?(n=O,Le++):(n=p,0===Ue&&tt(j)),n!==p)if(mt()!==p)if(f.substr(Le,6)===ne?(a=ne,Le+=6):(a=p,0===Ue&&tt(ae)),a!==p)if(mt()!==p)if(44===f.charCodeAt(Le)?(i=O,Le++):(i=p,0===Ue&&tt(j)),i!==p)if(mt()!==p){if(u=[],(o=ft())!==p)for(;o!==p;)u.push(o),o=ft();else u=p;e=u!==p?(o=mt())!==p?(125===f.charCodeAt(Le)?(c=m,Le++):(c=p,0===Ue&&tt(d)),c!==p?($e=e,t=ie(r,u)):(Le=e,p)):(Le=e,p):(Le=e,p)}else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;else Le=e,e=p;return e}()),e}function it(){var e,t,r;if(e=Le,t=[],(r=yt())===p&&(r=vt())===p&&(r=At()),r!==p)for(;r!==p;)t.push(r),(r=yt())===p&&(r=vt())===p&&(r=At());else t=p;return t!==p&&($e=e,t=o(t)),e=t}function ut(){var e,t,r,n,a;if(Ue++,t=[],n=r=e=Le,Ue++,(a=ht())===p&&(v.test(f.charAt(Le))?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(A))),Ue--,(r=(n=a===p?void 0:(Le=n,p))!==p?(f.length>Le?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(b)),a!==p?n=[n,a]:(Le=r,p)):(Le=r,p))!==p)for(;r!==p;)t.push(r),n=r=Le,Ue++,(a=ht())===p&&(v.test(f.charAt(Le))?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(A))),Ue--,r=(n=a===p?void 0:(Le=n,p))!==p?(f.length>Le?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(b)),a!==p?n=[n,a]:(Le=r,p)):(Le=r,p);else t=p;return e=t!==p?f.substring(e,Le):t,Ue--,e===p&&(t=p,0===Ue&&tt(y)),e}function ot(){var e,t,r;return Ue++,e=Le,47===f.charCodeAt(Le)?(t=E,Le++):(t=p,0===Ue&&tt(x)),e=t!==p&&(r=ut())!==p?($e=e,t=C(r)):(Le=e,p),Ue--,e===p&&(t=p,0===Ue&&tt(w)),e}function ct(){var e,t,r,n;if(Ue++,e=Le,mt()!==p)if((t=ut())!==p){for(r=[],n=ot();n!==p;)r.push(n),n=ot();e=r!==p?($e=e,D(t,r)):(Le=e,p)}else Le=e,e=p;else Le=e,e=p;return Ue--,e===p&&(p,0===Ue&&tt(k)),e}function st(){var e,t,r,n;if(e=Le,39===f.charCodeAt(Le)?(t=z,Le++):(t=p,0===Ue&&tt(N)),t!==p){if(r=[],(n=yt())===p&&(_.test(f.charAt(Le))?(n=f.charAt(Le),Le++):(n=p,0===Ue&&tt(M))),n!==p)for(;n!==p;)r.push(n),(n=yt())===p&&(_.test(f.charAt(Le))?(n=f.charAt(Le),Le++):(n=p,0===Ue&&tt(M)));else r=p;e=r!==p?(39===f.charCodeAt(Le)?(n=z,Le++):(n=p,0===Ue&&tt(N)),n!==p?t=[t,r,n]:(Le=e,p)):(Le=e,p)}else Le=e,e=p;if(e===p)if(e=[],(t=yt())===p&&(L.test(f.charAt(Le))?(t=f.charAt(Le),Le++):(t=p,0===Ue&&tt($))),t!==p)for(;t!==p;)e.push(t),(t=yt())===p&&(L.test(f.charAt(Le))?(t=f.charAt(Le),Le++):(t=p,0===Ue&&tt($)));else e=p;return e}function lt(){var e,t;if(e=[],q.test(f.charAt(Le))?(t=f.charAt(Le),Le++):(t=p,0===Ue&&tt(H)),t!==p)for(;t!==p;)e.push(t),q.test(f.charAt(Le))?(t=f.charAt(Le),Le++):(t=p,0===Ue&&tt(H));else e=p;return e}function ft(){var e,t,r,n,a;return e=Le,e=mt()!==p&&(t=Et())!==p&&mt()!==p?(123===f.charCodeAt(Le)?(r=h,Le++):(r=p,0===Ue&&tt(g)),r!==p&&(n=nt())!==p?(125===f.charCodeAt(Le)?(a=m,Le++):(a=p,0===Ue&&tt(d)),a!==p?($e=e,ce(t,n)):(Le=e,p)):(Le=e,p)):(Le=e,p)}function pt(){var e,t,r,n,a;return e=Le,e=mt()!==p&&(t=function(){var e,t,r,n;return t=e=Le,61===f.charCodeAt(Le)?(r=ue,Le++):(r=p,0===Ue&&tt(oe)),(e=(t=r!==p&&(n=dt())!==p?r=[r,n]:(Le=t,p))!==p?f.substring(e,Le):t)===p&&(e=Et()),e}())!==p&&mt()!==p?(123===f.charCodeAt(Le)?(r=h,Le++):(r=p,0===Ue&&tt(g)),r!==p&&(n=nt())!==p?(125===f.charCodeAt(Le)?(a=m,Le++):(a=p,0===Ue&&tt(d)),a!==p?($e=e,se(t,n)):(Le=e,p)):(Le=e,p)):(Le=e,p)}function ht(){var e;return Ue++,fe.test(f.charAt(Le))?(e=f.charAt(Le),Le++):(e=p,0===Ue&&tt(pe)),Ue--,e===p&&0===Ue&&tt(le),e}function gt(){var e;return Ue++,ge.test(f.charAt(Le))?(e=f.charAt(Le),Le++):(e=p,0===Ue&&tt(me)),Ue--,e===p&&0===Ue&&tt(he),e}function mt(){var e,t,r;for(Ue++,e=Le,t=[],r=ht();r!==p;)t.push(r),r=ht();return e=t!==p?f.substring(e,Le):t,Ue--,e===p&&(t=p,0===Ue&&tt(de)),e}function dt(){var e,t,r;return Ue++,e=Le,45===f.charCodeAt(Le)?(t=ve,Le++):(t=p,0===Ue&&tt(Ae)),t===p&&(t=null),e=t!==p&&(r=wt())!==p?($e=e,t=be(t,r)):(Le=e,p),Ue--,e===p&&(t=p,0===Ue&&tt(ye)),e}function yt(){var e,t;return Ue++,e=Le,f.substr(Le,2)===Ee?(t=Ee,Le+=2):(t=p,0===Ue&&tt(xe)),t!==p&&($e=e,t=Ce()),Ue--,(e=t)===p&&(t=p,0===Ue&&tt(we)),e}function vt(){var e,t,r,n,a,i;if(e=Le,39===f.charCodeAt(Le)?(t=z,Le++):(t=p,0===Ue&&tt(N)),t!==p)if(ke.test(f.charAt(Le))?(r=f.charAt(Le),Le++):(r=p,0===Ue&&tt(De)),r!==p){for(n=Le,a=[],f.substr(Le,2)===Ee?(i=Ee,Le+=2):(i=p,0===Ue&&tt(xe)),i===p&&(_.test(f.charAt(Le))?(i=f.charAt(Le),Le++):(i=p,0===Ue&&tt(M)));i!==p;)a.push(i),f.substr(Le,2)===Ee?(i=Ee,Le+=2):(i=p,0===Ue&&tt(xe)),i===p&&(_.test(f.charAt(Le))?(i=f.charAt(Le),Le++):(i=p,0===Ue&&tt(M)));e=(n=a!==p?f.substring(n,Le):a)!==p?(39===f.charCodeAt(Le)?(a=z,Le++):(a=p,0===Ue&&tt(N)),a!==p?($e=e,t=Fe(r,n)):(Le=e,p)):(Le=e,p)}else Le=e,e=p;else Le=e,e=p;return e}function At(){var e,t;return e=Le,Pe.test(f.charAt(Le))?(t=f.charAt(Le),Le++):(t=p,0===Ue&&tt(Te)),e=t!==p?f.substring(e,Le):t}function bt(){var e,t;return Ue++,e=Le,(t=wt())===p&&(t=Et()),e=t!==p?f.substring(e,Le):t,Ue--,e===p&&(t=p,0===Ue&&tt(Se)),e}function wt(){var e,t,r,n,a;if(Ue++,e=Le,48===f.charCodeAt(Le)?(t=Oe,Le++):(t=p,0===Ue&&tt(je)),t!==p&&($e=e,t=Re()),(e=t)===p){if(t=e=Le,Be.test(f.charAt(Le))?(r=f.charAt(Le),Le++):(r=p,0===Ue&&tt(Ze)),r!==p){for(n=[],ze.test(f.charAt(Le))?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(Ne));a!==p;)n.push(a),ze.test(f.charAt(Le))?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(Ne));t=n!==p?r=[r,n]:(Le=t,p)}else Le=t,t=p;t!==p&&($e=e,t=_e(t)),e=t}return Ue--,e===p&&(t=p,0===Ue&&tt(Ye)),e}function Et(){var e,t,r,n,a;if(Ue++,t=[],n=r=e=Le,Ue++,(a=ht())===p&&(a=gt()),Ue--,(r=(n=a===p?void 0:(Le=n,p))!==p?(f.length>Le?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(b)),a!==p?n=[n,a]:(Le=r,p)):(Le=r,p))!==p)for(;r!==p;)t.push(r),n=r=Le,Ue++,(a=ht())===p&&(a=gt()),Ue--,r=(n=a===p?void 0:(Le=n,p))!==p?(f.length>Le?(a=f.charAt(Le),Le++):(a=p,0===Ue&&tt(b)),a!==p?n=[n,a]:(Le=r,p)):(Le=r,p);else t=p;return e=t!==p?f.substring(e,Le):t,Ue--,e===p&&(t=p,0===Ue&&tt(Me)),e}function xt(){return e&&e.captureLocation?{location:Ke()}:{}}if((t=u())!==p&&Le===f.length)return t;throw t!==p&&Le<f.length&&tt({type:"end"}),r=Ie,n=He<f.length?f.charAt(He):null,a=He<f.length?et(He,He+1):et(He,He),new Dt(Dt.buildMessage(r,n),r,n,a)},h=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var i=arguments[t],u=0,o=i.length;u<o;u++,a++)n[a]=i[u];return n},g=/(^|[^\\])#/g;var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},s=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;var l=/^\.(?:(0+)(\+|#+)?)?$/g,m=/^(@+)?(\+|#+)?$/g;function d(e){var n={};return e.replace(m,function(e,t,r){return"string"!=typeof r?(n.minimumSignificantDigits=t.length,n.maximumSignificantDigits=t.length):"+"===r?n.minimumSignificantDigits=t.length:"#"===t[0]?n.maximumSignificantDigits=t.length:(n.minimumSignificantDigits=t.length,n.maximumSignificantDigits=t.length+("string"==typeof r?r.length:0)),""}),n}function y(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":return{currencySign:"accounting"};case"sign-always":return{signDisplay:"always"};case"sign-accounting-always":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":return{signDisplay:"never"}}}function v(e){var t=y(e);return t||{}}Ct.SyntaxError=Dt,Ct.convertNumberSkeletonToNumberFormatOptions=function(e){for(var n={},t=0,r=e;t<r.length;t++){var a=r[t];switch(a.stem){case"percent":n.style="percent";continue;case"currency":n.style="currency",n.currency=a.options[0];continue;case"group-off":n.useGrouping=!1;continue;case"precision-integer":n.maximumFractionDigits=0;continue;case"measure-unit":n.style="unit",n.unit=a.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":n.notation="compact",n.compactDisplay="short";continue;case"compact-long":n.notation="compact",n.compactDisplay="long";continue;case"scientific":n=c(c(c({},n),{notation:"scientific"}),a.options.reduce(function(e,t){return c(c({},e),v(t))},{}));continue;case"engineering":n=c(c(c({},n),{notation:"engineering"}),a.options.reduce(function(e,t){return c(c({},e),v(t))},{}));continue;case"notation-simple":n.notation="standard";continue;case"unit-width-narrow":n.currencyDisplay="narrowSymbol",n.unitDisplay="narrow";continue;case"unit-width-short":n.currencyDisplay="code",n.unitDisplay="short";continue;case"unit-width-full-name":n.currencyDisplay="name",n.unitDisplay="long";continue;case"unit-width-iso-code":n.currencyDisplay="symbol";continue}if(l.test(a.stem)){if(1<a.options.length)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(l,function(e,t,r){return"."===e?n.maximumFractionDigits=0:"+"===r?n.minimumFractionDigits=r.length:"#"===t[0]?n.maximumFractionDigits=t.length:(n.minimumFractionDigits=t.length,n.maximumFractionDigits=t.length+("string"==typeof r?r.length:0)),""}),a.options.length&&(n=c(c({},n),d(a.options[0])))}else if(m.test(a.stem))n=c(c({},n),d(a.stem));else{var i=y(a.stem);i&&(n=c(c({},n),i))}}return n},Ct.createLiteralElement=function(e){return{type:Ct.TYPE.literal,value:e}},Ct.createNumberElement=function(e,t){return{type:Ct.TYPE.number,value:e,style:t}},Ct.isArgumentElement=function(e){return e.type===Ct.TYPE.argument},Ct.isDateElement=function(e){return e.type===Ct.TYPE.date},Ct.isDateTimeSkeleton=function(e){return!(!e||"object"!=typeof e||1!==e.type)},Ct.isLiteralElement=f,Ct.isNumberElement=function(e){return e.type===Ct.TYPE.number},Ct.isNumberSkeleton=function(e){return!(!e||"object"!=typeof e||0!==e.type)},Ct.isPluralElement=a,Ct.isSelectElement=n,Ct.isTimeElement=function(e){return e.type===Ct.TYPE.time},Ct.parse=function(e,t){var r=p(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(s){(a(s)||n(s))&&Object.keys(s.options).forEach(function(e){for(var t,r=s.options[e],n=-1,a=void 0,i=0;i<r.value.length;i++){var u=r.value[i];if(f(u)&&g.test(u.value)){n=i,a=u;break}}if(a){var o=a.value.replace(g,"$1{"+s.value+", number}"),c=p(o);(t=r.value).splice.apply(t,h([n,1],c))}l(r.value)})})}(r),r},Ct.parseDateTimeSkeleton=function(e){var r={};return e.replace(s,function(e){var t=e.length;switch(e[0]){case"G":r.era=4===t?"long":5===t?"narrow":"short";break;case"y":r.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":r.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":r.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":r.weekday=4===t?"short":5===t?"narrow":"short";break;case"e":if(t<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");r.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");r.weekday=["short","long","narrow","short"][t-4];break;case"a":r.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":r.hourCycle="h12",r.hour=["numeric","2-digit"][t-1];break;case"H":r.hourCycle="h23",r.hour=["numeric","2-digit"][t-1];break;case"K":r.hourCycle="h11",r.hour=["numeric","2-digit"][t-1];break;case"k":r.hourCycle="h24",r.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":r.minute=["numeric","2-digit"][t-1];break;case"s":r.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw new RangeError("`S/A` (second) pattenrs are not supported, use `s` instead");case"z":r.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) pattenrs are not supported, use `z` instead")}return""}),r},Ct.pegParse=p,Object.defineProperty(Ct,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormatParser={})}(this,function(jt){"use strict";var e;function f(e){return e.type===jt.TYPE.literal}function n(e){return e.type===jt.TYPE.select}function a(e){return e.type===jt.TYPE.plural}(e=jt.TYPE||(jt.TYPE={}))[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound";var u,i,t=(u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Rt=function(){return(Rt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Bt=(i=Error,t(o,i),o.buildMessage=function(e,t){function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function u(e){switch(e.type){case"literal":return'"'+n(e.text)+'"';case"class":var t=e.parts.map(function(e){return Array.isArray(e)?a(e[0])+"-"+a(e[1]):a(e)});return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,r,n=e.map(u);if(n.sort(),0<n.length){for(r=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((i=t)?'"'+n(i)+'"':"end of input")+" found.";var i},o);function o(e,t,r,n){var a=i.call(this)||this;return a.message=e,a.expected=t,a.found=r,a.location=n,a.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a,o),a}var p=function(f,e){e=void 0!==e?e:{};var t,p={},r={start:it},n=it,a=function(e){return e.join("")},u=function(e){return Rt({type:jt.TYPE.literal,value:e},Ot())},i="#",o=et("#",!1),c=function(){return Rt({type:jt.TYPE.pound},Ot())},s=rt("argumentElement"),h="{",g=et("{",!1),d="}",m=et("}",!1),l=function(e){return Rt({type:jt.TYPE.argument,value:e},Ot())},y=rt("numberSkeletonId"),v=/^['\/{}]/,A=tt(["'","/","{","}"],!1,!1),b={type:"any"},w=rt("numberSkeletonTokenOption"),E="/",x=et("/",!1),C=function(e){return e},k=rt("numberSkeletonToken"),D=function(e,t){return{stem:e,options:t}},F=function(e){return Rt({type:0,tokens:e},Ot())},P="::",T=et("::",!1),S=function(e){return e},Y=function(){return St.push("numberArgStyle"),!0},O=function(e){return St.pop(),e.replace(/\s*$/,"")},j=",",R=et(",",!1),B="number",Z=et("number",!1),z=function(e,t,r){return Rt({type:"number"===t?jt.TYPE.number:"date"===t?jt.TYPE.date:jt.TYPE.time,style:r&&r[2],value:e},Ot())},N="'",_=et("'",!1),M=/^[^']/,L=tt(["'"],!0,!1),$=/^[^a-zA-Z'{}]/,q=tt([["a","z"],["A","Z"],"'","{","}"],!0,!1),H=/^[a-zA-Z]/,I=tt([["a","z"],["A","Z"]],!1,!1),U=function(e){return Rt({type:1,pattern:e},Ot())},G=function(){return St.push("dateOrTimeArgStyle"),!0},K="date",Q=et("date",!1),V="time",W=et("time",!1),X="plural",J=et("plural",!1),ee="selectordinal",te=et("selectordinal",!1),re="offset:",ne=et("offset:",!1),ae=function(e,t,r,n){return Rt({type:jt.TYPE.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:r?r[2]:0,options:n.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Je('Duplicate option "'+r+'" in plural element: "'+We()+'"',Xe()),e[r]={value:n,location:a},e},{})},Ot())},ue="select",ie=et("select",!1),oe=function(e,t){return Rt({type:jt.TYPE.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Je('Duplicate option "'+r+'" in select element: "'+We()+'"',Xe()),e[r]={value:n,location:a},e},{})},Ot())},ce="=",se=et("=",!1),le=function(e){return St.push("select"),!0},fe=function(e,t){return St.pop(),Rt({id:e,value:t},Ot())},pe=function(e){return St.push("plural"),!0},he=function(e,t){return St.pop(),Rt({id:e,value:t},Ot())},ge=rt("whitespace pattern"),de=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,me=tt([["\t","\r"]," ","…","‎","‏","\u2028","\u2029"],!1,!1),ye=rt("syntax pattern"),ve=/^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,Ae=tt([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←","⑟"],["─","❵"],["➔","⯿"],["⸀","⹿"],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),be=rt("optional whitespace"),we=rt("number"),Ee="-",xe=et("-",!1),Ce=function(e,t){return t?e?-t:t:0},ke=rt("double apostrophes"),De="''",Fe=et("''",!1),Pe=function(){return"'"},Te=function(e,t){return e+t.replace("''","'")},Se=function(e){return!("{"===e||Yt()&&"#"===e||1<St.length&&"}"===e)},Ye="\n",Oe=et("\n",!1),je=function(e){return"{"===e||"}"===e||Yt()&&"#"===e},Re=rt("argNameOrNumber"),Be=rt("argNumber"),Ze="0",ze=et("0",!1),Ne=function(){return 0},_e=/^[1-9]/,Me=tt([["1","9"]],!1,!1),Le=/^[0-9]/,$e=tt([["0","9"]],!1,!1),qe=function(e){return parseInt(e.join(""),10)},He=rt("argName"),Ie=0,Ue=0,Ge=[{line:1,column:1}],Ke=0,Qe=[],Ve=0;if(void 0!==e.startRule){if(!(e.startRule in r))throw new Error("Can't start parsing from rule \""+e.startRule+'".');n=r[e.startRule]}function We(){return f.substring(Ue,Ie)}function Xe(){return at(Ue,Ie)}function Je(e,t){throw function(e,t){return new Bt(e,[],"",t)}(e,t=void 0!==t?t:at(Ue,Ie))}function et(e,t){return{type:"literal",text:e,ignoreCase:t}}function tt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function rt(e){return{type:"other",description:e}}function nt(e){var t,r=Ge[e];if(r)return r;for(t=e-1;!Ge[t];)t--;for(r={line:(r=Ge[t]).line,column:r.column};t<e;)10===f.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return Ge[e]=r}function at(e,t){var r=nt(e),n=nt(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function ut(e){Ie<Ke||(Ke<Ie&&(Ke=Ie,Qe=[]),Qe.push(e))}function it(){return ot()}function ot(){var e,t;for(e=[],t=ct();t!==p;)e.push(t),t=ct();return e}function ct(){var e;return(e=function(){var e,t;e=Ie,(t=st())!==p&&(Ue=e,t=u(t));return e=t}())===p&&(e=function(){var e,t,r,n,a;Ve++,e=Ie,123===f.charCodeAt(Ie)?(t=h,Ie++):(t=p,0===Ve&&ut(g));e=t!==p?(r=At(),r!==p?(n=Ct())!==p?At()!==p?(125===f.charCodeAt(Ie)?(a=d,Ie++):(a=p,0===Ve&&ut(m)),a!==p?(Ue=e,t=l(n)):(Ie=e,p)):(Ie=e,p):(Ie=e,p):(Ie=e,p)):(Ie=e,p);Ve--,e===p&&(t=p,0===Ve&&ut(s));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,a,u,i,o,c,s;e=Ie,123===f.charCodeAt(Ie)?(t=h,Ie++):(t=p,0===Ve&&ut(g));e=t!==p?(r=At(),r!==p?(n=Ct())!==p?At()!==p?(44===f.charCodeAt(Ie)?(a=j,Ie++):(a=p,0===Ve&&ut(R)),a!==p?At()!==p?(f.substr(Ie,6)===B?(u=B,Ie+=6):(u=p,0===Ve&&ut(Z)),u!==p?At()!==p?(i=Ie,44===f.charCodeAt(Ie)?(o=j,Ie++):(o=p,0===Ve&&ut(R)),(i=o!==p?(c=At())!==p?(s=function(){var e,t,r;e=Ie,f.substr(Ie,2)===P?(t=P,Ie+=2):(t=p,0===Ve&&ut(T));e=t!==p?(r=function(){var e,t,r;if(e=Ie,t=[],(r=pt())!==p)for(;r!==p;)t.push(r),r=pt();else t=p;t!==p&&(Ue=e,t=F(t));return e=t}(),r!==p?(Ue=e,t=S(r)):(Ie=e,p)):(Ie=e,p);e===p&&(Ue=e=Ie,t=Y(),e=(t=t?void 0:p)!==p?(r=st())!==p?(Ue=e,t=O(r)):(Ie=e,p):(Ie=e,p));return e}())!==p?o=[o,c,s]:(Ie=i,p):(Ie=i,p):(Ie=i,p))===p&&(i=null),i!==p?(o=At())!==p?(125===f.charCodeAt(Ie)?(c=d,Ie++):(c=p,0===Ve&&ut(m)),c!==p?(Ue=e,t=z(n,u,i)):(Ie=e,p)):(Ie=e,p):(Ie=e,p)):(Ie=e,p):(Ie=e,p)):(Ie=e,p):(Ie=e,p)):(Ie=e,p):(Ie=e,p):(Ie=e,p)):(Ie=e,p);return e}())===p&&(e=function(){var e,t,r,n,a,u,i,o,c,s;e=Ie,123===f.charCodeAt(Ie)?(t=h,Ie++):(t=p,0===Ve&&ut(g));e=t!==p?(r=At(),r!==p?(n=Ct())!==p?At()!==p?(44===f.charCodeAt(Ie)?(a=j,Ie++):(a=p,0===Ve&&ut(R)),a!==p?At()!==p?(f.substr(Ie,4)===K?(u=K,Ie+=4):(u=p,0===Ve&&ut(Q)),u===p&&(f.substr(Ie,4)===V?(u=V,Ie+=4):(u=p,0===Ve&&ut(W))),u!==p?At()!==p?(i=Ie,44===f.charCodeAt(Ie)?(o=j,Ie++):(o=p,0===Ve&&ut(R)),(i=o!==p?(c=At())!==p?(s=function(){var e,t,r;e=Ie,f.substr(Ie,2)===P?(t=P,Ie+=2):(t=p,0===Ve&&ut(T));e=t!==p?(r=function(){var e,t,r,n;t=e=Ie,r=[],(n=ht())===p&&(n=gt());if(n!==p)for(;n!==p;)r.push(n),(n=ht())===p&&(n=gt());else r=p;t=r!==p?f.substring(t,Ie):r;t!==p&&(Ue=e,t=U(t));return e=t}(),r!==p?(Ue=e,t=S(r)):(Ie=e,p)):(Ie=e,p);e===p&&(Ue=e=Ie,t=G(),e=(t=t?void 0:p)!==p?(r=st())!==p?(Ue=e,t=O(r)):(Ie=e,p):(Ie=e,p));return e}())!==p?o=[o,c,s]:(Ie=i,p):(Ie=i,p):(Ie=i,p))===p&&(i=null),i!==p?(o=At())!==p?(125===f.charCodeAt(Ie)?(c=d,Ie++):(c=p,0===Ve&&ut(m)),c!==p?(Ue=e,t=z(n,u,i)):(Ie=e,p)):(Ie=e,p):(Ie=e,p)):(Ie=e,p):(Ie=e,p)):(Ie=e,p):(Ie=e,p)):(Ie=e,p):(Ie=e,p):(Ie=e,p)):(Ie=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,a,u,i,o,c,s,l;e=Ie,123===f.charCodeAt(Ie)?(t=h,Ie++):(t=p,0===Ve&&ut(g));if(t!==p)if(At()!==p)if((r=Ct())!==p)if(At()!==p)if(44===f.charCodeAt(Ie)?(n=j,Ie++):(n=p,0===Ve&&ut(R)),n!==p)if(At()!==p)if(f.substr(Ie,6)===X?(a=X,Ie+=6):(a=p,0===Ve&&ut(J)),a===p&&(f.substr(Ie,13)===ee?(a=ee,Ie+=13):(a=p,0===Ve&&ut(te))),a!==p)if(At()!==p)if(44===f.charCodeAt(Ie)?(u=j,Ie++):(u=p,0===Ve&&ut(R)),u!==p)if(At()!==p)if(i=Ie,f.substr(Ie,7)===re?(o=re,Ie+=7):(o=p,0===Ve&&ut(ne)),(i=o!==p?(c=At())!==p?(s=bt())!==p?o=[o,c,s]:(Ie=i,p):(Ie=i,p):(Ie=i,p))===p&&(i=null),i!==p)if((o=At())!==p){if(c=[],(s=mt())!==p)for(;s!==p;)c.push(s),s=mt();else c=p;e=c!==p?(s=At())!==p?(125===f.charCodeAt(Ie)?(l=d,Ie++):(l=p,0===Ve&&ut(m)),l!==p?(Ue=e,t=ae(r,a,i,c)):(Ie=e,p)):(Ie=e,p):(Ie=e,p)}else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,a,u,i,o,c;e=Ie,123===f.charCodeAt(Ie)?(t=h,Ie++):(t=p,0===Ve&&ut(g));if(t!==p)if(At()!==p)if((r=Ct())!==p)if(At()!==p)if(44===f.charCodeAt(Ie)?(n=j,Ie++):(n=p,0===Ve&&ut(R)),n!==p)if(At()!==p)if(f.substr(Ie,6)===ue?(a=ue,Ie+=6):(a=p,0===Ve&&ut(ie)),a!==p)if(At()!==p)if(44===f.charCodeAt(Ie)?(u=j,Ie++):(u=p,0===Ve&&ut(R)),u!==p)if(At()!==p){if(i=[],(o=dt())!==p)for(;o!==p;)i.push(o),o=dt();else i=p;e=i!==p?(o=At())!==p?(125===f.charCodeAt(Ie)?(c=d,Ie++):(c=p,0===Ve&&ut(m)),c!==p?(Ue=e,t=oe(r,i)):(Ie=e,p)):(Ie=e,p):(Ie=e,p)}else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;else Ie=e,e=p;return e}())===p&&(e=function(){var e,t;e=Ie,35===f.charCodeAt(Ie)?(t=i,Ie++):(t=p,0===Ve&&ut(o));t!==p&&(Ue=e,t=c());return e=t}()),e}function st(){var e,t,r;if(e=Ie,t=[],(r=wt())===p&&(r=Et())===p&&(r=xt()),r!==p)for(;r!==p;)t.push(r),(r=wt())===p&&(r=Et())===p&&(r=xt());else t=p;return t!==p&&(Ue=e,t=a(t)),e=t}function lt(){var e,t,r,n,a;if(Ve++,t=[],n=r=e=Ie,Ve++,(a=yt())===p&&(v.test(f.charAt(Ie))?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut(A))),Ve--,(r=(n=a===p?void 0:(Ie=n,p))!==p?(f.length>Ie?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut(b)),a!==p?n=[n,a]:(Ie=r,p)):(Ie=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ie,Ve++,(a=yt())===p&&(v.test(f.charAt(Ie))?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut(A))),Ve--,r=(n=a===p?void 0:(Ie=n,p))!==p?(f.length>Ie?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut(b)),a!==p?n=[n,a]:(Ie=r,p)):(Ie=r,p);else t=p;return e=t!==p?f.substring(e,Ie):t,Ve--,e===p&&(t=p,0===Ve&&ut(y)),e}function ft(){var e,t,r;return Ve++,e=Ie,47===f.charCodeAt(Ie)?(t=E,Ie++):(t=p,0===Ve&&ut(x)),e=t!==p&&(r=lt())!==p?(Ue=e,t=C(r)):(Ie=e,p),Ve--,e===p&&(t=p,0===Ve&&ut(w)),e}function pt(){var e,t,r,n;if(Ve++,e=Ie,At()!==p)if((t=lt())!==p){for(r=[],n=ft();n!==p;)r.push(n),n=ft();e=r!==p?(Ue=e,D(t,r)):(Ie=e,p)}else Ie=e,e=p;else Ie=e,e=p;return Ve--,e===p&&(p,0===Ve&&ut(k)),e}function ht(){var e,t,r,n;if(e=Ie,39===f.charCodeAt(Ie)?(t=N,Ie++):(t=p,0===Ve&&ut(_)),t!==p){if(r=[],(n=wt())===p&&(M.test(f.charAt(Ie))?(n=f.charAt(Ie),Ie++):(n=p,0===Ve&&ut(L))),n!==p)for(;n!==p;)r.push(n),(n=wt())===p&&(M.test(f.charAt(Ie))?(n=f.charAt(Ie),Ie++):(n=p,0===Ve&&ut(L)));else r=p;e=r!==p?(39===f.charCodeAt(Ie)?(n=N,Ie++):(n=p,0===Ve&&ut(_)),n!==p?t=[t,r,n]:(Ie=e,p)):(Ie=e,p)}else Ie=e,e=p;if(e===p)if(e=[],(t=wt())===p&&($.test(f.charAt(Ie))?(t=f.charAt(Ie),Ie++):(t=p,0===Ve&&ut(q))),t!==p)for(;t!==p;)e.push(t),(t=wt())===p&&($.test(f.charAt(Ie))?(t=f.charAt(Ie),Ie++):(t=p,0===Ve&&ut(q)));else e=p;return e}function gt(){var e,t;if(e=[],H.test(f.charAt(Ie))?(t=f.charAt(Ie),Ie++):(t=p,0===Ve&&ut(I)),t!==p)for(;t!==p;)e.push(t),H.test(f.charAt(Ie))?(t=f.charAt(Ie),Ie++):(t=p,0===Ve&&ut(I));else e=p;return e}function dt(){var e,t,r,n,a;return e=Ie,e=At()!==p&&(t=Dt())!==p&&At()!==p?(123===f.charCodeAt(Ie)?(r=h,Ie++):(r=p,0===Ve&&ut(g)),r!==p?(Ue=Ie,(le()?void 0:p)!==p&&(n=ot())!==p?(125===f.charCodeAt(Ie)?(a=d,Ie++):(a=p,0===Ve&&ut(m)),a!==p?(Ue=e,fe(t,n)):(Ie=e,p)):(Ie=e,p)):(Ie=e,p)):(Ie=e,p)}function mt(){var e,t,r,n,a;return e=Ie,e=At()!==p&&(t=function(){var e,t,r,n;return t=e=Ie,61===f.charCodeAt(Ie)?(r=ce,Ie++):(r=p,0===Ve&&ut(se)),(e=(t=r!==p&&(n=bt())!==p?r=[r,n]:(Ie=t,p))!==p?f.substring(e,Ie):t)===p&&(e=Dt()),e}())!==p&&At()!==p?(123===f.charCodeAt(Ie)?(r=h,Ie++):(r=p,0===Ve&&ut(g)),r!==p?(Ue=Ie,(pe()?void 0:p)!==p&&(n=ot())!==p?(125===f.charCodeAt(Ie)?(a=d,Ie++):(a=p,0===Ve&&ut(m)),a!==p?(Ue=e,he(t,n)):(Ie=e,p)):(Ie=e,p)):(Ie=e,p)):(Ie=e,p)}function yt(){var e;return Ve++,de.test(f.charAt(Ie))?(e=f.charAt(Ie),Ie++):(e=p,0===Ve&&ut(me)),Ve--,e===p&&0===Ve&&ut(ge),e}function vt(){var e;return Ve++,ve.test(f.charAt(Ie))?(e=f.charAt(Ie),Ie++):(e=p,0===Ve&&ut(Ae)),Ve--,e===p&&0===Ve&&ut(ye),e}function At(){var e,t,r;for(Ve++,e=Ie,t=[],r=yt();r!==p;)t.push(r),r=yt();return e=t!==p?f.substring(e,Ie):t,Ve--,e===p&&(t=p,0===Ve&&ut(be)),e}function bt(){var e,t,r;return Ve++,e=Ie,45===f.charCodeAt(Ie)?(t=Ee,Ie++):(t=p,0===Ve&&ut(xe)),t===p&&(t=null),e=t!==p&&(r=kt())!==p?(Ue=e,t=Ce(t,r)):(Ie=e,p),Ve--,e===p&&(t=p,0===Ve&&ut(we)),e}function wt(){var e,t;return Ve++,e=Ie,f.substr(Ie,2)===De?(t=De,Ie+=2):(t=p,0===Ve&&ut(Fe)),t!==p&&(Ue=e,t=Pe()),Ve--,(e=t)===p&&(t=p,0===Ve&&ut(ke)),e}function Et(){var e,t,r,n,a,u;if(e=Ie,39===f.charCodeAt(Ie)?(t=N,Ie++):(t=p,0===Ve&&ut(_)),t!==p)if((r=function(){var e,t,r,n;t=e=Ie,f.length>Ie?(r=f.charAt(Ie),Ie++):(r=p,0===Ve&&ut(b));t=r!==p?(Ue=Ie,n=je(r),(n=n?void 0:p)!==p?r=[r,n]:(Ie=t,p)):(Ie=t,p);e=t!==p?f.substring(e,Ie):t;return e}())!==p){for(n=Ie,a=[],f.substr(Ie,2)===De?(u=De,Ie+=2):(u=p,0===Ve&&ut(Fe)),u===p&&(M.test(f.charAt(Ie))?(u=f.charAt(Ie),Ie++):(u=p,0===Ve&&ut(L)));u!==p;)a.push(u),f.substr(Ie,2)===De?(u=De,Ie+=2):(u=p,0===Ve&&ut(Fe)),u===p&&(M.test(f.charAt(Ie))?(u=f.charAt(Ie),Ie++):(u=p,0===Ve&&ut(L)));e=(n=a!==p?f.substring(n,Ie):a)!==p?(39===f.charCodeAt(Ie)?(a=N,Ie++):(a=p,0===Ve&&ut(_)),a===p&&(a=null),a!==p?(Ue=e,t=Te(r,n)):(Ie=e,p)):(Ie=e,p)}else Ie=e,e=p;else Ie=e,e=p;return e}function xt(){var e,t,r,n;return t=e=Ie,f.length>Ie?(r=f.charAt(Ie),Ie++):(r=p,0===Ve&&ut(b)),(t=r!==p?(Ue=Ie,(n=(n=Se(r))?void 0:p)!==p?r=[r,n]:(Ie=t,p)):(Ie=t,p))===p&&(10===f.charCodeAt(Ie)?(t=Ye,Ie++):(t=p,0===Ve&&ut(Oe))),e=t!==p?f.substring(e,Ie):t}function Ct(){var e,t;return Ve++,e=Ie,(t=kt())===p&&(t=Dt()),e=t!==p?f.substring(e,Ie):t,Ve--,e===p&&(t=p,0===Ve&&ut(Re)),e}function kt(){var e,t,r,n,a;if(Ve++,e=Ie,48===f.charCodeAt(Ie)?(t=Ze,Ie++):(t=p,0===Ve&&ut(ze)),t!==p&&(Ue=e,t=Ne()),(e=t)===p){if(t=e=Ie,_e.test(f.charAt(Ie))?(r=f.charAt(Ie),Ie++):(r=p,0===Ve&&ut(Me)),r!==p){for(n=[],Le.test(f.charAt(Ie))?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut($e));a!==p;)n.push(a),Le.test(f.charAt(Ie))?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut($e));t=n!==p?r=[r,n]:(Ie=t,p)}else Ie=t,t=p;t!==p&&(Ue=e,t=qe(t)),e=t}return Ve--,e===p&&(t=p,0===Ve&&ut(Be)),e}function Dt(){var e,t,r,n,a;if(Ve++,t=[],n=r=e=Ie,Ve++,(a=yt())===p&&(a=vt()),Ve--,(r=(n=a===p?void 0:(Ie=n,p))!==p?(f.length>Ie?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut(b)),a!==p?n=[n,a]:(Ie=r,p)):(Ie=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ie,Ve++,(a=yt())===p&&(a=vt()),Ve--,r=(n=a===p?void 0:(Ie=n,p))!==p?(f.length>Ie?(a=f.charAt(Ie),Ie++):(a=p,0===Ve&&ut(b)),a!==p?n=[n,a]:(Ie=r,p)):(Ie=r,p);else t=p;return e=t!==p?f.substring(e,Ie):t,Ve--,e===p&&(t=p,0===Ve&&ut(He)),e}var Ft,Pt,Tt,St=["root"];function Yt(){return"plural"===St[St.length-1]}function Ot(){return e&&e.captureLocation?{location:Xe()}:{}}if((t=n())!==p&&Ie===f.length)return t;throw t!==p&&Ie<f.length&&ut({type:"end"}),Ft=Qe,Pt=Ke<f.length?f.charAt(Ke):null,Tt=Ke<f.length?at(Ke,Ke+1):at(Ke,Ke),new Bt(Bt.buildMessage(Ft,Pt),Ft,Pt,Tt)},h=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var u=arguments[t],i=0,o=u.length;i<o;i++,a++)n[a]=u[i];return n},g=/(^|[^\\])#/g;var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},s=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;var l=/^\.(?:(0+)(\+|#+)?)?$/g,d=/^(@+)?(\+|#+)?$/g;function m(e){var n={};return e.replace(d,function(e,t,r){return"string"!=typeof r?(n.minimumSignificantDigits=t.length,n.maximumSignificantDigits=t.length):"+"===r?n.minimumSignificantDigits=t.length:"#"===t[0]?n.maximumSignificantDigits=t.length:(n.minimumSignificantDigits=t.length,n.maximumSignificantDigits=t.length+("string"==typeof r?r.length:0)),""}),n}function y(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":return{currencySign:"accounting"};case"sign-always":return{signDisplay:"always"};case"sign-accounting-always":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":return{signDisplay:"never"}}}function v(e){var t=y(e);return t||{}}jt.SyntaxError=Bt,jt.convertNumberSkeletonToNumberFormatOptions=function(e){for(var n={},t=0,r=e;t<r.length;t++){var a=r[t];switch(a.stem){case"percent":n.style="percent";continue;case"currency":n.style="currency",n.currency=a.options[0];continue;case"group-off":n.useGrouping=!1;continue;case"precision-integer":n.maximumFractionDigits=0;continue;case"measure-unit":n.style="unit",n.unit=a.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":n.notation="compact",n.compactDisplay="short";continue;case"compact-long":n.notation="compact",n.compactDisplay="long";continue;case"scientific":n=c(c(c({},n),{notation:"scientific"}),a.options.reduce(function(e,t){return c(c({},e),v(t))},{}));continue;case"engineering":n=c(c(c({},n),{notation:"engineering"}),a.options.reduce(function(e,t){return c(c({},e),v(t))},{}));continue;case"notation-simple":n.notation="standard";continue;case"unit-width-narrow":n.currencyDisplay="narrowSymbol",n.unitDisplay="narrow";continue;case"unit-width-short":n.currencyDisplay="code",n.unitDisplay="short";continue;case"unit-width-full-name":n.currencyDisplay="name",n.unitDisplay="long";continue;case"unit-width-iso-code":n.currencyDisplay="symbol";continue}if(l.test(a.stem)){if(1<a.options.length)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(l,function(e,t,r){return"."===e?n.maximumFractionDigits=0:"+"===r?n.minimumFractionDigits=r.length:"#"===t[0]?n.maximumFractionDigits=t.length:(n.minimumFractionDigits=t.length,n.maximumFractionDigits=t.length+("string"==typeof r?r.length:0)),""}),a.options.length&&(n=c(c({},n),m(a.options[0])))}else if(d.test(a.stem))n=c(c({},n),m(a.stem));else{var u=y(a.stem);u&&(n=c(c({},n),u))}}return n},jt.createLiteralElement=function(e){return{type:jt.TYPE.literal,value:e}},jt.createNumberElement=function(e,t){return{type:jt.TYPE.number,value:e,style:t}},jt.isArgumentElement=function(e){return e.type===jt.TYPE.argument},jt.isDateElement=function(e){return e.type===jt.TYPE.date},jt.isDateTimeSkeleton=function(e){return!(!e||"object"!=typeof e||1!==e.type)},jt.isLiteralElement=f,jt.isNumberElement=function(e){return e.type===jt.TYPE.number},jt.isNumberSkeleton=function(e){return!(!e||"object"!=typeof e||0!==e.type)},jt.isPluralElement=a,jt.isPoundElement=function(e){return e.type===jt.TYPE.pound},jt.isSelectElement=n,jt.isTimeElement=function(e){return e.type===jt.TYPE.time},jt.parse=function(e,t){var r=p(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(s){(a(s)||n(s))&&Object.keys(s.options).forEach(function(e){for(var t,r=s.options[e],n=-1,a=void 0,u=0;u<r.value.length;u++){var i=r.value[u];if(f(i)&&g.test(i.value)){n=u,a=i;break}}if(a){var o=a.value.replace(g,"$1{"+s.value+", number}"),c=p(o);(t=r.value).splice.apply(t,h([n,1],c))}l(r.value)})})}(r),r},jt.parseDateTimeSkeleton=function(e){var r={};return e.replace(s,function(e){var t=e.length;switch(e[0]){case"G":r.era=4===t?"long":5===t?"narrow":"short";break;case"y":r.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":r.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":r.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":r.weekday=4===t?"short":5===t?"narrow":"short";break;case"e":if(t<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");r.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");r.weekday=["short","long","narrow","short"][t-4];break;case"a":r.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":r.hourCycle="h12",r.hour=["numeric","2-digit"][t-1];break;case"H":r.hourCycle="h23",r.hour=["numeric","2-digit"][t-1];break;case"K":r.hourCycle="h11",r.hour=["numeric","2-digit"][t-1];break;case"k":r.hourCycle="h24",r.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":r.minute=["numeric","2-digit"][t-1];break;case"s":r.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw new RangeError("`S/A` (second) pattenrs are not supported, use `s` instead");case"z":r.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) pattenrs are not supported, use `z` instead")}return""}),r},jt.pegParse=p,Object.defineProperty(jt,"__esModule",{value:!0})});
//# sourceMappingURL=intl-messageformat-parser.min.js.map

@@ -98,2 +98,4 @@ import { UnifiedNumberFormatOptions } from '@formatjs/intl-unified-numberformat';

export declare function isPoundElement(el: MessageFormatElement): el is PoundElement;
export declare function isSelectElement(el: MessageFormatElement): el is SelectElement;

@@ -116,3 +118,3 @@

export declare type MessageFormatElement = LiteralElement | ArgumentElement | NumberElement | DateElement | TimeElement | SelectElement | PluralElement;
export declare type MessageFormatElement = LiteralElement | ArgumentElement | NumberElement | DateElement | TimeElement | SelectElement | PluralElement | PoundElement;

@@ -173,2 +175,7 @@ export declare type NumberElement = SimpleFormatElement<TYPE.number, NumberSkeleton>;

export declare interface PoundElement {
type: TYPE.pound;
location?: Location;
}
export declare interface SelectElement extends BaseElement<TYPE.select> {

@@ -235,3 +242,8 @@ options: Record<string, PluralOrSelectOption>;

*/
plural = 6
plural = 6,
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
pound = 7
}

@@ -238,0 +250,0 @@

import { MessageFormatElement, DateTimeSkeleton } from './types';
export declare function printAST(ast: MessageFormatElement[]): string;
export declare function doPrintAST(ast: MessageFormatElement[], isInPlural: boolean): string;
export declare function printDateTimeSkeleton(style: DateTimeSkeleton): string;

@@ -13,7 +13,10 @@ /*

};
import { isLiteralElement, isSelectElement, isArgumentElement, isDateElement, isTimeElement, isNumberElement, isPluralElement, TYPE, } from './types';
import { isLiteralElement, isSelectElement, isArgumentElement, isDateElement, isTimeElement, isNumberElement, isPluralElement, TYPE, isPoundElement, } from './types';
export function printAST(ast) {
return doPrintAST(ast, false);
}
export function doPrintAST(ast, isInPlural) {
var printedNodes = ast.map(function (el) {
if (isLiteralElement(el)) {
return printLiteralElement(el);
return printLiteralElement(el, isInPlural);
}

@@ -32,2 +35,5 @@ if (isArgumentElement(el)) {

}
if (isPoundElement(el)) {
return '#';
}
});

@@ -39,5 +45,6 @@ return printedNodes.join('');

}
function printLiteralElement(_a) {
function printLiteralElement(_a, isInPlural) {
var value = _a.value;
return printEscapedMessage(value);
var escaped = printEscapedMessage(value);
return isInPlural ? escaped.replace('#', "'#'") : escaped;
}

@@ -76,3 +83,3 @@ function printArgumentElement(_a) {

Object.keys(el.options)
.map(function (id) { return id + "{" + printAST(el.options[id].value) + "}"; })
.map(function (id) { return id + "{" + doPrintAST(el.options[id].value, false) + "}"; })
.join(' '),

@@ -89,3 +96,3 @@ ].join(',');

el.offset ? "offset:" + el.offset : ''
], Object.keys(el.options).map(function (id) { return id + "{" + printAST(el.options[id].value) + "}"; })).filter(Boolean)
], Object.keys(el.options).map(function (id) { return id + "{" + doPrintAST(el.options[id].value, true) + "}"; })).filter(Boolean)
.join(' '),

@@ -92,0 +99,0 @@ ].join(',');

@@ -29,3 +29,8 @@ export declare enum TYPE {

*/
plural = 6
plural = 6,
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
pound = 7
}

@@ -76,3 +81,7 @@ export declare const enum SKELETON_TYPE {

}
export declare type MessageFormatElement = LiteralElement | ArgumentElement | NumberElement | DateElement | TimeElement | SelectElement | PluralElement;
export interface PoundElement {
type: TYPE.pound;
location?: Location;
}
export declare type MessageFormatElement = LiteralElement | ArgumentElement | NumberElement | DateElement | TimeElement | SelectElement | PluralElement | PoundElement;
export interface NumberSkeletonToken {

@@ -103,2 +112,3 @@ stem: string;

export declare function isPluralElement(el: MessageFormatElement): el is PluralElement;
export declare function isPoundElement(el: MessageFormatElement): el is PoundElement;
export declare function isNumberSkeleton(el: NumberElement['style']): el is NumberSkeleton;

@@ -105,0 +115,0 @@ export declare function isDateTimeSkeleton(el?: DateElement['style'] | TimeElement['style']): el is DateTimeSkeleton;

@@ -31,2 +31,7 @@ export var TYPE;

TYPE[TYPE["plural"] = 6] = "plural";
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
TYPE[TYPE["pound"] = 7] = "pound";
})(TYPE || (TYPE = {}));

@@ -57,2 +62,5 @@ /**

}
export function isPoundElement(el) {
return el.type === TYPE.pound;
}
export function isNumberSkeleton(el) {

@@ -59,0 +67,0 @@ return !!(el && typeof el === 'object' && el.type === 0 /* number */);

{
"name": "intl-messageformat-parser",
"version": "3.5.3",
"version": "3.6.0",
"description": "Parses ICU Message strings into an AST via JavaScript.",

@@ -49,6 +49,6 @@ "main": "dist/index.js",

"dependencies": {
"@formatjs/intl-unified-numberformat": "^3.0.1"
"@formatjs/intl-unified-numberformat": "^3.0.2"
},
"homepage": "https://github.com/formatjs/formatjs",
"gitHead": "3f4ea0305b68d709d5a5bf9570a99ba6d103f545"
"gitHead": "4143ae3da624e6f117d177cee70e57dac5444bd0"
}

@@ -28,8 +28,16 @@ /*

DateTimeSkeleton,
isPoundElement,
} from './types';
export function printAST(ast: MessageFormatElement[]): string {
return doPrintAST(ast, false);
}
export function doPrintAST(
ast: MessageFormatElement[],
isInPlural: boolean
): string {
const printedNodes = ast.map(el => {
if (isLiteralElement(el)) {
return printLiteralElement(el);
return printLiteralElement(el, isInPlural);
}

@@ -51,2 +59,6 @@

}
if (isPoundElement(el)) {
return '#';
}
});

@@ -61,4 +73,5 @@

function printLiteralElement({value}: LiteralElement) {
return printEscapedMessage(value);
function printLiteralElement({value}: LiteralElement, isInPlural: boolean) {
const escaped = printEscapedMessage(value);
return isInPlural ? escaped.replace('#', "'#'") : escaped;
}

@@ -104,3 +117,3 @@

Object.keys(el.options)
.map(id => `${id}{${printAST(el.options[id].value)}}`)
.map(id => `${id}{${doPrintAST(el.options[id].value, false)}}`)
.join(' '),

@@ -119,3 +132,3 @@ ].join(',');

...Object.keys(el.options).map(
id => `${id}{${printAST(el.options[id].value)}}`
id => `${id}{${doPrintAST(el.options[id].value, true)}}`
),

@@ -122,0 +135,0 @@ ]

@@ -30,2 +30,7 @@ export enum TYPE {

plural,
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
pound,
}

@@ -96,2 +101,7 @@

export interface PoundElement {
type: TYPE.pound;
location?: Location;
}
export type MessageFormatElement =

@@ -104,3 +114,4 @@ | LiteralElement

| SelectElement
| PluralElement;
| PluralElement
| PoundElement;

@@ -154,2 +165,5 @@ export interface NumberSkeletonToken {

}
export function isPoundElement(el: MessageFormatElement): el is PoundElement {
return el.type === TYPE.pound;
}
export function isNumberSkeleton(

@@ -156,0 +170,0 @@ el: NumberElement['style']

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc