intl-messageformat 7.8.0 → 7.8.4
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var Rt,t;function v(e){return e.type===Rt.literal}function b(e){return e.type===Rt.select}function w(e){return e.type===Rt.plural}(t=Rt||(Rt={}))[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound";var n,o,r=(n=function(e,t){return(n=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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Mt=function(){return(Mt=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)},Pt=(o=Error,r(u,o),u.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 o(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(o);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},u);function u(e,t,r,n){var a=o.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,u),a}var f=function(f,e){e=void 0!==e?e:{};var t,p={},r={start:ut},n=ut,a=function(e){return e.join("")},o=function(e){return Mt({type:Rt.literal,value:e},St())},u="#",i=et("#",!1),s=function(){return Mt({type:Rt.pound},St())},c=rt("argumentElement"),h="{",g=et("{",!1),m="}",d=et("}",!1),l=function(e){return Mt({type:Rt.argument,value:e},St())},y=rt("numberSkeletonId"),v=/^['\/{}]/,b=tt(["'","/","{","}"],!1,!1),w={type:"any"},A=rt("numberSkeletonTokenOption"),x="/",C=et("/",!1),D=function(e){return e},F=rt("numberSkeletonToken"),k=function(e,t){return{stem:e,options:t}},O=function(e){return Mt({type:0,tokens:e},St())},E="::",j=et("::",!1),_=function(e){return e},T=function(){return _t.push("numberArgStyle"),!0},S=function(e){return _t.pop(),e.replace(/\s*$/,"")},R=",",M=et(",",!1),P="number",I=et("number",!1),N=function(e,t,r){return Mt({type:"number"===t?Rt.number:"date"===t?Rt.date:Rt.time,style:r&&r[2],value:e},St())},Z="'",z=et("'",!1),B=/^[^']/,L=tt(["'"],!0,!1),H=/^[^a-zA-Z'{}]/,$=tt([["a","z"],["A","Z"],"'","{","}"],!0,!1),q=/^[a-zA-Z]/,U=tt([["a","z"],["A","Z"]],!1,!1),X=function(e){return Mt({type:1,pattern:e},St())},G=function(){return _t.push("dateOrTimeArgStyle"),!0},J="date",K=et("date",!1),Q="time",V=et("time",!1),W="plural",Y=et("plural",!1),ee="selectordinal",te=et("selectordinal",!1),re="offset:",ne=et("offset:",!1),ae=function(e,t,r,n){return Mt({type:Rt.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&&Ye('Duplicate option "'+r+'" in plural element: "'+Ve()+'"',We()),e[r]={value:n,location:a},e},{})},St())},oe="select",ue=et("select",!1),ie=function(e,t){return Mt({type:Rt.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Ye('Duplicate option "'+r+'" in select element: "'+Ve()+'"',We()),e[r]={value:n,location:a},e},{})},St())},se="=",ce=et("=",!1),le=function(e){return _t.push("select"),!0},fe=function(e,t){return _t.pop(),Mt({id:e,value:t},St())},pe=function(e){return _t.push("plural"),!0},he=function(e,t){return _t.pop(),Mt({id:e,value:t},St())},ge=rt("whitespace pattern"),me=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,de=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]/,be=tt([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←",""],["─","❵"],["➔","⯿"],["⸀",""],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),we=rt("optional whitespace"),Ae=rt("number"),xe="-",Ce=et("-",!1),De=function(e,t){return t?e?-t:t:0},Fe=rt("double apostrophes"),ke="''",Oe=et("''",!1),Ee=function(){return"'"},je=function(e,t){return e+t.replace("''","'")},_e=function(e){return!("{"===e||Tt()&&"#"===e||1<_t.length&&"}"===e)},Te="\n",Se=et("\n",!1),Re=function(e){return"{"===e||"}"===e||Tt()&&"#"===e},Me=rt("argNameOrNumber"),Pe=rt("argNumber"),Ie="0",Ne=et("0",!1),Ze=function(){return 0},ze=/^[1-9]/,Be=tt([["1","9"]],!1,!1),Le=/^[0-9]/,He=tt([["0","9"]],!1,!1),$e=function(e){return parseInt(e.join(""),10)},qe=rt("argName"),Ue=0,Xe=0,Ge=[{line:1,column:1}],Je=0,Ke=[],Qe=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 Ve(){return f.substring(Xe,Ue)}function We(){return at(Xe,Ue)}function Ye(e,t){throw function(e,t){return new Pt(e,[],"",t)}(e,t=void 0!==t?t:at(Xe,Ue))}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 ot(e){Ue<Je||(Je<Ue&&(Je=Ue,Ke=[]),Ke.push(e))}function ut(){return it()}function it(){var e,t;for(e=[],t=st();t!==p;)e.push(t),t=st();return e}function st(){var e;return(e=function(){var e,t;e=Ue,(t=ct())!==p&&(Xe=e,t=o(t));return e=t}())===p&&(e=function(){var e,t,r,n,a;Qe++,e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));e=t!==p?(r=bt(),r!==p?(n=Dt())!==p?bt()!==p?(125===f.charCodeAt(Ue)?(a=m,Ue++):(a=p,0===Qe&&ot(d)),a!==p?(Xe=e,t=l(n)):(Ue=e,p)):(Ue=e,p):(Ue=e,p):(Ue=e,p)):(Ue=e,p);Qe--,e===p&&(t=p,0===Qe&&ot(c));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,a,o,u,i,s,c;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));e=t!==p?(r=bt(),r!==p?(n=Dt())!==p?bt()!==p?(44===f.charCodeAt(Ue)?(a=R,Ue++):(a=p,0===Qe&&ot(M)),a!==p?bt()!==p?(f.substr(Ue,6)===P?(o=P,Ue+=6):(o=p,0===Qe&&ot(I)),o!==p?bt()!==p?(u=Ue,44===f.charCodeAt(Ue)?(i=R,Ue++):(i=p,0===Qe&&ot(M)),(u=i!==p?(s=bt())!==p?(c=function(){var e,t,r;e=Ue,f.substr(Ue,2)===E?(t=E,Ue+=2):(t=p,0===Qe&&ot(j));e=t!==p?(r=function(){var e,t,r;if(e=Ue,t=[],(r=pt())!==p)for(;r!==p;)t.push(r),r=pt();else t=p;t!==p&&(Xe=e,t=O(t));return e=t}(),r!==p?(Xe=e,t=_(r)):(Ue=e,p)):(Ue=e,p);e===p&&(Xe=e=Ue,t=T(),e=(t=t?void 0:p)!==p?(r=ct())!==p?(Xe=e,t=S(r)):(Ue=e,p):(Ue=e,p));return e}())!==p?i=[i,s,c]:(Ue=u,p):(Ue=u,p):(Ue=u,p))===p&&(u=null),u!==p?(i=bt())!==p?(125===f.charCodeAt(Ue)?(s=m,Ue++):(s=p,0===Qe&&ot(d)),s!==p?(Xe=e,t=N(n,o,u)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p):(Ue=e,p)):(Ue=e,p);return e}())===p&&(e=function(){var e,t,r,n,a,o,u,i,s,c;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));e=t!==p?(r=bt(),r!==p?(n=Dt())!==p?bt()!==p?(44===f.charCodeAt(Ue)?(a=R,Ue++):(a=p,0===Qe&&ot(M)),a!==p?bt()!==p?(f.substr(Ue,4)===J?(o=J,Ue+=4):(o=p,0===Qe&&ot(K)),o===p&&(f.substr(Ue,4)===Q?(o=Q,Ue+=4):(o=p,0===Qe&&ot(V))),o!==p?bt()!==p?(u=Ue,44===f.charCodeAt(Ue)?(i=R,Ue++):(i=p,0===Qe&&ot(M)),(u=i!==p?(s=bt())!==p?(c=function(){var e,t,r;e=Ue,f.substr(Ue,2)===E?(t=E,Ue+=2):(t=p,0===Qe&&ot(j));e=t!==p?(r=function(){var e,t,r,n;t=e=Ue,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,Ue):r;t!==p&&(Xe=e,t=X(t));return e=t}(),r!==p?(Xe=e,t=_(r)):(Ue=e,p)):(Ue=e,p);e===p&&(Xe=e=Ue,t=G(),e=(t=t?void 0:p)!==p?(r=ct())!==p?(Xe=e,t=S(r)):(Ue=e,p):(Ue=e,p));return e}())!==p?i=[i,s,c]:(Ue=u,p):(Ue=u,p):(Ue=u,p))===p&&(u=null),u!==p?(i=bt())!==p?(125===f.charCodeAt(Ue)?(s=m,Ue++):(s=p,0===Qe&&ot(d)),s!==p?(Xe=e,t=N(n,o,u)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p):(Ue=e,p)):(Ue=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,a,o,u,i,s,c,l;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));if(t!==p)if(bt()!==p)if((r=Dt())!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(n=R,Ue++):(n=p,0===Qe&&ot(M)),n!==p)if(bt()!==p)if(f.substr(Ue,6)===W?(a=W,Ue+=6):(a=p,0===Qe&&ot(Y)),a===p&&(f.substr(Ue,13)===ee?(a=ee,Ue+=13):(a=p,0===Qe&&ot(te))),a!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(o=R,Ue++):(o=p,0===Qe&&ot(M)),o!==p)if(bt()!==p)if(u=Ue,f.substr(Ue,7)===re?(i=re,Ue+=7):(i=p,0===Qe&&ot(ne)),(u=i!==p?(s=bt())!==p?(c=wt())!==p?i=[i,s,c]:(Ue=u,p):(Ue=u,p):(Ue=u,p))===p&&(u=null),u!==p)if((i=bt())!==p){if(s=[],(c=dt())!==p)for(;c!==p;)s.push(c),c=dt();else s=p;e=s!==p?(c=bt())!==p?(125===f.charCodeAt(Ue)?(l=m,Ue++):(l=p,0===Qe&&ot(d)),l!==p?(Xe=e,t=ae(r,a,u,s)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,a,o,u,i,s;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));if(t!==p)if(bt()!==p)if((r=Dt())!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(n=R,Ue++):(n=p,0===Qe&&ot(M)),n!==p)if(bt()!==p)if(f.substr(Ue,6)===oe?(a=oe,Ue+=6):(a=p,0===Qe&&ot(ue)),a!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(o=R,Ue++):(o=p,0===Qe&&ot(M)),o!==p)if(bt()!==p){if(u=[],(i=mt())!==p)for(;i!==p;)u.push(i),i=mt();else u=p;e=u!==p?(i=bt())!==p?(125===f.charCodeAt(Ue)?(s=m,Ue++):(s=p,0===Qe&&ot(d)),s!==p?(Xe=e,t=ie(r,u)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;return e}())===p&&(e=function(){var e,t;e=Ue,35===f.charCodeAt(Ue)?(t=u,Ue++):(t=p,0===Qe&&ot(i));t!==p&&(Xe=e,t=s());return e=t}()),e}function ct(){var e,t,r;if(e=Ue,t=[],(r=At())===p&&(r=xt())===p&&(r=Ct()),r!==p)for(;r!==p;)t.push(r),(r=At())===p&&(r=xt())===p&&(r=Ct());else t=p;return t!==p&&(Xe=e,t=a(t)),e=t}function lt(){var e,t,r,n,a;if(Qe++,t=[],n=r=e=Ue,Qe++,(a=yt())===p&&(v.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(b))),Qe--,(r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(w)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ue,Qe++,(a=yt())===p&&(v.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(b))),Qe--,r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(w)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p);else t=p;return e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(y)),e}function ft(){var e,t,r;return Qe++,e=Ue,47===f.charCodeAt(Ue)?(t=x,Ue++):(t=p,0===Qe&&ot(C)),e=t!==p&&(r=lt())!==p?(Xe=e,t=D(r)):(Ue=e,p),Qe--,e===p&&(t=p,0===Qe&&ot(A)),e}function pt(){var e,t,r,n;if(Qe++,e=Ue,bt()!==p)if((t=lt())!==p){for(r=[],n=ft();n!==p;)r.push(n),n=ft();e=r!==p?(Xe=e,k(t,r)):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;return Qe--,e===p&&(p,0===Qe&&ot(F)),e}function ht(){var e,t,r,n;if(e=Ue,39===f.charCodeAt(Ue)?(t=Z,Ue++):(t=p,0===Qe&&ot(z)),t!==p){if(r=[],(n=At())===p&&(B.test(f.charAt(Ue))?(n=f.charAt(Ue),Ue++):(n=p,0===Qe&&ot(L))),n!==p)for(;n!==p;)r.push(n),(n=At())===p&&(B.test(f.charAt(Ue))?(n=f.charAt(Ue),Ue++):(n=p,0===Qe&&ot(L)));else r=p;e=r!==p?(39===f.charCodeAt(Ue)?(n=Z,Ue++):(n=p,0===Qe&&ot(z)),n!==p?t=[t,r,n]:(Ue=e,p)):(Ue=e,p)}else Ue=e,e=p;if(e===p)if(e=[],(t=At())===p&&(H.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot($))),t!==p)for(;t!==p;)e.push(t),(t=At())===p&&(H.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot($)));else e=p;return e}function gt(){var e,t;if(e=[],q.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot(U)),t!==p)for(;t!==p;)e.push(t),q.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot(U));else e=p;return e}function mt(){var e,t,r,n,a;return e=Ue,e=bt()!==p&&(t=kt())!==p&&bt()!==p?(123===f.charCodeAt(Ue)?(r=h,Ue++):(r=p,0===Qe&&ot(g)),r!==p?(Xe=Ue,(le()?void 0:p)!==p&&(n=it())!==p?(125===f.charCodeAt(Ue)?(a=m,Ue++):(a=p,0===Qe&&ot(d)),a!==p?(Xe=e,fe(t,n)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)}function dt(){var e,t,r,n,a;return e=Ue,e=bt()!==p&&(t=function(){var e,t,r,n;return t=e=Ue,61===f.charCodeAt(Ue)?(r=se,Ue++):(r=p,0===Qe&&ot(ce)),(e=(t=r!==p&&(n=wt())!==p?r=[r,n]:(Ue=t,p))!==p?f.substring(e,Ue):t)===p&&(e=kt()),e}())!==p&&bt()!==p?(123===f.charCodeAt(Ue)?(r=h,Ue++):(r=p,0===Qe&&ot(g)),r!==p?(Xe=Ue,(pe()?void 0:p)!==p&&(n=it())!==p?(125===f.charCodeAt(Ue)?(a=m,Ue++):(a=p,0===Qe&&ot(d)),a!==p?(Xe=e,he(t,n)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)}function yt(){var e;return Qe++,me.test(f.charAt(Ue))?(e=f.charAt(Ue),Ue++):(e=p,0===Qe&&ot(de)),Qe--,e===p&&0===Qe&&ot(ge),e}function vt(){var e;return Qe++,ve.test(f.charAt(Ue))?(e=f.charAt(Ue),Ue++):(e=p,0===Qe&&ot(be)),Qe--,e===p&&0===Qe&&ot(ye),e}function bt(){var e,t,r;for(Qe++,e=Ue,t=[],r=yt();r!==p;)t.push(r),r=yt();return e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(we)),e}function wt(){var e,t,r;return Qe++,e=Ue,45===f.charCodeAt(Ue)?(t=xe,Ue++):(t=p,0===Qe&&ot(Ce)),t===p&&(t=null),e=t!==p&&(r=Ft())!==p?(Xe=e,t=De(t,r)):(Ue=e,p),Qe--,e===p&&(t=p,0===Qe&&ot(Ae)),e}function At(){var e,t;return Qe++,e=Ue,f.substr(Ue,2)===ke?(t=ke,Ue+=2):(t=p,0===Qe&&ot(Oe)),t!==p&&(Xe=e,t=Ee()),Qe--,(e=t)===p&&(t=p,0===Qe&&ot(Fe)),e}function xt(){var e,t,r,n,a,o;if(e=Ue,39===f.charCodeAt(Ue)?(t=Z,Ue++):(t=p,0===Qe&&ot(z)),t!==p)if((r=function(){var e,t,r,n;t=e=Ue,f.length>Ue?(r=f.charAt(Ue),Ue++):(r=p,0===Qe&&ot(w));t=r!==p?(Xe=Ue,n=Re(r),(n=n?void 0:p)!==p?r=[r,n]:(Ue=t,p)):(Ue=t,p);e=t!==p?f.substring(e,Ue):t;return e}())!==p){for(n=Ue,a=[],f.substr(Ue,2)===ke?(o=ke,Ue+=2):(o=p,0===Qe&&ot(Oe)),o===p&&(B.test(f.charAt(Ue))?(o=f.charAt(Ue),Ue++):(o=p,0===Qe&&ot(L)));o!==p;)a.push(o),f.substr(Ue,2)===ke?(o=ke,Ue+=2):(o=p,0===Qe&&ot(Oe)),o===p&&(B.test(f.charAt(Ue))?(o=f.charAt(Ue),Ue++):(o=p,0===Qe&&ot(L)));e=(n=a!==p?f.substring(n,Ue):a)!==p?(39===f.charCodeAt(Ue)?(a=Z,Ue++):(a=p,0===Qe&&ot(z)),a===p&&(a=null),a!==p?(Xe=e,t=je(r,n)):(Ue=e,p)):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;return e}function Ct(){var e,t,r,n;return t=e=Ue,f.length>Ue?(r=f.charAt(Ue),Ue++):(r=p,0===Qe&&ot(w)),(t=r!==p?(Xe=Ue,(n=(n=_e(r))?void 0:p)!==p?r=[r,n]:(Ue=t,p)):(Ue=t,p))===p&&(10===f.charCodeAt(Ue)?(t=Te,Ue++):(t=p,0===Qe&&ot(Se))),e=t!==p?f.substring(e,Ue):t}function Dt(){var e,t;return Qe++,e=Ue,(t=Ft())===p&&(t=kt()),e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(Me)),e}function Ft(){var e,t,r,n,a;if(Qe++,e=Ue,48===f.charCodeAt(Ue)?(t=Ie,Ue++):(t=p,0===Qe&&ot(Ne)),t!==p&&(Xe=e,t=Ze()),(e=t)===p){if(t=e=Ue,ze.test(f.charAt(Ue))?(r=f.charAt(Ue),Ue++):(r=p,0===Qe&&ot(Be)),r!==p){for(n=[],Le.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(He));a!==p;)n.push(a),Le.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(He));t=n!==p?r=[r,n]:(Ue=t,p)}else Ue=t,t=p;t!==p&&(Xe=e,t=$e(t)),e=t}return Qe--,e===p&&(t=p,0===Qe&&ot(Pe)),e}function kt(){var e,t,r,n,a;if(Qe++,t=[],n=r=e=Ue,Qe++,(a=yt())===p&&(a=vt()),Qe--,(r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(w)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ue,Qe++,(a=yt())===p&&(a=vt()),Qe--,r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(w)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p);else t=p;return e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(qe)),e}var Ot,Et,jt,_t=["root"];function Tt(){return"plural"===_t[_t.length-1]}function St(){return e&&e.captureLocation?{location:We()}:{}}if((t=n())!==p&&Ue===f.length)return t;throw t!==p&&Ue<f.length&&ot({type:"end"}),Ot=Ke,Et=Je<f.length?f.charAt(Je):null,jt=Je<f.length?at(Je,Je+1):at(Je,Je),new Pt(Pt.buildMessage(Ot,Et),Ot,Et,jt)},p=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 o=arguments[t],u=0,i=o.length;u<i;u++,a++)n[a]=o[u];return n},h=/(^|[^\\])#/g;var i=function(){return(i=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)},a=/(?:[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;function A(e){var r={};return e.replace(a,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}var s=/^\.(?:(0+)(\+|#+)?)?$/g,c=/^(@+)?(\+|#+)?$/g;function l(e){var n={};return e.replace(c,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 g(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 m(e){var t=g(e);return t||{}}function x(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=i(i(i({},n),{notation:"scientific"}),a.options.reduce(function(e,t){return i(i({},e),m(t))},{}));continue;case"engineering":n=i(i(i({},n),{notation:"engineering"}),a.options.reduce(function(e,t){return i(i({},e),m(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(s.test(a.stem)){if(1<a.options.length)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(s,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=i(i({},n),l(a.options[0])))}else if(c.test(a.stem))n=i(i({},n),l(a.stem));else{var o=g(a.stem);o&&(n=i(i({},n),o))}}return n}function d(e,t){var r=f(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(c){(w(c)||b(c))&&Object.keys(c.options).forEach(function(e){for(var t,r=c.options[e],n=-1,a=void 0,o=0;o<r.value.length;o++){var u=r.value[o];if(v(u)&&h.test(u.value)){n=o,a=u;break}}if(a){var i=a.value.replace(h,"$1{"+c.value+", number}"),s=f(i);(t=r.value).splice.apply(t,p([n,1],s))}l(r.value)})})}(r),r}var y=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 o=arguments[t],u=0,i=o.length;u<i;u++,a++)n[a]=o[u];return n};function C(e){return JSON.stringify(e.map(function(e){return e&&"object"==typeof e?function(r){return Object.keys(r).sort().map(function(e){var t;return(t={})[e]=r[e],t})}(e):e}))}var D,F,k,O=function(o,u){return void 0===u&&(u={}),function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=C(t),a=n&&u[n];return a||(a=new((e=o).bind.apply(e,y([void 0],t))),n&&(u[n]=a)),a}},E=(D=function(e,t){return(D=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}D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),j=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 o=arguments[t],u=0,i=o.length;u<i;u++,a++)n[a]=o[u];return n},_=(F=Error,E(T,F),T);function T(e,t){var r=F.call(this,e)||this;return r.variableId=t,r}function S(e,t,r,n,a,o,u){if(1===e.length&&v(e[0]))return[{type:0,value:e[0].value}];for(var i,s,c=[],l=0,f=e;l<f.length;l++){var p=f[l];if(v(p))c.push({type:0,value:p.value});else if(p.type!==Rt.pound){var h=p.value;if(!(a&&h in a))throw new _('The intl string context variable "'+h+'" was not provided to the string "'+u+'"');var g=a[h];if(p.type!==Rt.argument)if(p.type!==Rt.date)if(p.type!==Rt.time)if(p.type!==Rt.number)if(b(p)){if(!(m=p.options[g]||p.options.other))throw new RangeError('Invalid values for "'+p.value+'": "'+g+'". Options are "'+Object.keys(p.options).join('", "')+'"');c.push.apply(c,S(m.value,t,r,n,a))}else if(w(p)){var m;if(!(m=p.options["="+g])){if(!Intl.PluralRules)throw new _('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n');var d=r.getPluralRules(t,{type:p.pluralType}).select(g-(p.offset||0));m=p.options[d]||p.options.other}if(!m)throw new RangeError('Invalid values for "'+p.value+'": "'+g+'". Options are "'+Object.keys(p.options).join('", "')+'"');c.push.apply(c,S(m.value,t,r,n,a,g-(p.offset||0)))}else;else{y="string"==typeof p.style?n.number[p.style]:(i=p.style)&&"object"==typeof i&&0===i.type?x(p.style.tokens):void 0;c.push({type:0,value:r.getNumberFormat(t,y).format(g)})}else{var y="string"==typeof p.style?n.time[p.style]:(s=p.style)&&"object"==typeof s&&1===s.type?A(p.style.pattern):void 0;c.push({type:0,value:r.getDateTimeFormat(t,y).format(g)})}else{var y="string"==typeof p.style?n.date[p.style]:void 0;c.push({type:0,value:r.getDateTimeFormat(t,y).format(g)})}else g&&"string"!=typeof g&&"number"!=typeof g||(g="string"==typeof g||"number"==typeof g?String(g):""),c.push({type:1,value:g})}else"number"==typeof o&&c.push({type:0,value:r.getNumberFormat(t).format(o)})}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&0===r.type&&0===t.type?r.value+=t.value:e.push(t),e},[])}(c)}function R(e,t,r,n,a,o){var u=S(e,t,r,n,a,void 0,o);return 1===u.length?u[0].value:u.reduce(function(e,t){return e+t.value},"")}var M="@@",P=/@@(\d+_\d+)@@/g,I=0;function N(e,t){return e.split(P).filter(Boolean).map(function(e){return null!=t[e]?t[e]:e}).reduce(function(e,t){return e.length&&"string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e},[])}var Z=/(<([0-9a-zA-Z-_]*?)>(.*?)<\/([0-9a-zA-Z-_]*?)>)|(<[0-9a-zA-Z-_]*?\/>)/,z=Date.now()+"@@",B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];function L(e,t,r,n,a,o){var u=S(e,t,r,n,a,void 0,o),i={},s=u.reduce(function(e,t){if(0===t.type)return e+t.value;var r=Date.now()+"_"+ ++I;return i[r]=t.value,e+(M+r)+M},"");if(!Z.test(s))return N(s,i);if(!a)throw new _("Message has placeholders but no values was given");if("undefined"==typeof DOMParser)throw new _("Cannot format XML message without DOMParser");k||(k=new DOMParser);var c=k.parseFromString('<formatted-message id="'+z+'">'+s+"</formatted-message>","text/html").getElementById(z);if(!c)throw new _("Malformed HTML message "+s);var l=Object.keys(a).filter(function(e){return!!c.getElementsByTagName(e).length});if(!l.length)return N(s,i);var f=l.filter(function(e){return e!==e.toLowerCase()});if(f.length)throw new _("HTML tag must be lowercased but the following tags are not: "+f.join(", "));return Array.prototype.slice.call(c.childNodes).reduce(function(e,t){return e.concat(function r(e,n,a){var t=e.tagName,o=e.outerHTML,u=e.textContent,i=e.childNodes;if(!t)return N(u||"",n);t=t.toLowerCase();var s=~B.indexOf(t),c=a[t];if(c&&s)throw new _(t+" is a self-closing tag and can not be used, please use another tag name.");if(!i.length)return[o];var l=Array.prototype.slice.call(i).reduce(function(e,t){return e.concat(r(t,n,a))},[]);return c?"function"==typeof c?[c.apply(void 0,l)]:[c]:j(["<"+t+">"],l,["</"+t+">"])}(t,i,a))},[])}var H=function(){return(H=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)};function $(r,n){return n?Object.keys(r).reduce(function(e,t){return e[t]=function(r,n){return n?H(H(H({},r||{}),n||{}),Object.keys(r).reduce(function(e,t){return e[t]=H(H({},r[t]),n[t]||{}),e},{})):r}(r[t],n[t]),e},H({},r)):r}function q(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:O(Intl.NumberFormat,e.number),getDateTimeFormat:O(Intl.DateTimeFormat,e.dateTime),getPluralRules:O(Intl.PluralRules,e.pluralRules)}}var U=(X.defaultLocale=(new Intl.NumberFormat).resolvedOptions().locale,X.__parse=d,X.formats={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},X);function X(e,t,r,n){var a=this;if(void 0===t&&(t=X.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){return R(a.ast,a.locales,a.formatters,a.formats,e,a.message)},this.formatToParts=function(e){return S(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.formatHTMLMessage=function(e){return L(a.ast,a.locales,a.formatters,a.formats,e,a.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},"string"==typeof e){if(this.message=e,!X.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=X.__parse(e,{normalizeHashtagInPlural:!1})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=$(X.formats,r),this.locales=t,this.formatters=n&&n.formatters||q(this.formatterCache)}e.IntlMessageFormat=U,e.createDefaultFormatters=q,e.default=U,e.formatHTMLMessage=L,e.formatToParts=S,e.formatToString=R,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var Rt,t;function v(e){return e.type===Rt.literal}function b(e){return e.type===Rt.select}function A(e){return e.type===Rt.plural}(t=Rt||(Rt={}))[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound";var n,o,r=(n=function(e,t){return(n=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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Mt=function(){return(Mt=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)},Pt=(o=Error,r(u,o),u.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 o(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(o);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},u);function u(e,t,r,n){var a=o.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,u),a}var f=function(f,e){e=void 0!==e?e:{};var t,p={},r={start:ut},n=ut,a=function(e){return e.join("")},o=function(e){return Mt({type:Rt.literal,value:e},St())},u="#",i=et("#",!1),s=function(){return Mt({type:Rt.pound},St())},c=rt("argumentElement"),h="{",g=et("{",!1),m="}",d=et("}",!1),l=function(e){return Mt({type:Rt.argument,value:e},St())},y=rt("numberSkeletonId"),v=/^['\/{}]/,b=tt(["'","/","{","}"],!1,!1),A={type:"any"},w=rt("numberSkeletonTokenOption"),x="/",C=et("/",!1),F=function(e){return e},D=rt("numberSkeletonToken"),k=function(e,t){return{stem:e,options:t}},O=function(e){return Mt({type:0,tokens:e},St())},E="::",j=et("::",!1),_=function(e){return e},T=function(){return _t.push("numberArgStyle"),!0},S=function(e){return _t.pop(),e.replace(/\s*$/,"")},R=",",M=et(",",!1),P="number",I=et("number",!1),N=function(e,t,r){return Mt({type:"number"===t?Rt.number:"date"===t?Rt.date:Rt.time,style:r&&r[2],value:e},St())},Z="'",z=et("'",!1),B=/^[^']/,L=tt(["'"],!0,!1),H=/^[^a-zA-Z'{}]/,$=tt([["a","z"],["A","Z"],"'","{","}"],!0,!1),q=/^[a-zA-Z]/,U=tt([["a","z"],["A","Z"]],!1,!1),X=function(e){return Mt({type:1,pattern:e},St())},G=function(){return _t.push("dateOrTimeArgStyle"),!0},J="date",K=et("date",!1),Q="time",V=et("time",!1),W="plural",Y=et("plural",!1),ee="selectordinal",te=et("selectordinal",!1),re="offset:",ne=et("offset:",!1),ae=function(e,t,r,n){return Mt({type:Rt.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&&Ye('Duplicate option "'+r+'" in plural element: "'+Ve()+'"',We()),e[r]={value:n,location:a},e},{})},St())},oe="select",ue=et("select",!1),ie=function(e,t){return Mt({type:Rt.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Ye('Duplicate option "'+r+'" in select element: "'+Ve()+'"',We()),e[r]={value:n,location:a},e},{})},St())},se="=",ce=et("=",!1),le=function(e){return _t.push("select"),!0},fe=function(e,t){return _t.pop(),Mt({id:e,value:t},St())},pe=function(e){return _t.push("plural"),!0},he=function(e,t){return _t.pop(),Mt({id:e,value:t},St())},ge=rt("whitespace"),me=/^[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,de=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]/,be=tt([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←",""],["─","❵"],["➔","⯿"],["⸀",""],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),Ae=rt("optional whitespace"),we=rt("number"),xe="-",Ce=et("-",!1),Fe=function(e,t){return t?e?-t:t:0},De=rt("double apostrophes"),ke="''",Oe=et("''",!1),Ee=function(){return"'"},je=function(e,t){return e+t.replace("''","'")},_e=function(e){return!("{"===e||Tt()&&"#"===e||1<_t.length&&"}"===e)},Te="\n",Se=et("\n",!1),Re=function(e){return"{"===e||"}"===e||Tt()&&"#"===e},Me=rt("argNameOrNumber"),Pe=rt("argNumber"),Ie="0",Ne=et("0",!1),Ze=function(){return 0},ze=/^[1-9]/,Be=tt([["1","9"]],!1,!1),Le=/^[0-9]/,He=tt([["0","9"]],!1,!1),$e=function(e){return parseInt(e.join(""),10)},qe=rt("argName"),Ue=0,Xe=0,Ge=[{line:1,column:1}],Je=0,Ke=[],Qe=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 Ve(){return f.substring(Xe,Ue)}function We(){return at(Xe,Ue)}function Ye(e,t){throw function(e,t){return new Pt(e,[],"",t)}(e,t=void 0!==t?t:at(Xe,Ue))}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 ot(e){Ue<Je||(Je<Ue&&(Je=Ue,Ke=[]),Ke.push(e))}function ut(){return it()}function it(){var e,t;for(e=[],t=st();t!==p;)e.push(t),t=st();return e}function st(){var e;return(e=function(){var e,t;e=Ue,(t=ct())!==p&&(Xe=e,t=o(t));return e=t}())===p&&(e=function(){var e,t,r,n,a;Qe++,e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));e=t!==p?(r=bt(),r!==p?(n=Ft())!==p?bt()!==p?(125===f.charCodeAt(Ue)?(a=m,Ue++):(a=p,0===Qe&&ot(d)),a!==p?(Xe=e,t=l(n)):(Ue=e,p)):(Ue=e,p):(Ue=e,p):(Ue=e,p)):(Ue=e,p);Qe--,e===p&&(t=p,0===Qe&&ot(c));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,a,o,u,i,s,c;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));e=t!==p?(r=bt(),r!==p?(n=Ft())!==p?bt()!==p?(44===f.charCodeAt(Ue)?(a=R,Ue++):(a=p,0===Qe&&ot(M)),a!==p?bt()!==p?(f.substr(Ue,6)===P?(o=P,Ue+=6):(o=p,0===Qe&&ot(I)),o!==p?bt()!==p?(u=Ue,44===f.charCodeAt(Ue)?(i=R,Ue++):(i=p,0===Qe&&ot(M)),(u=i!==p?(s=bt())!==p?(c=function(){var e,t,r;e=Ue,f.substr(Ue,2)===E?(t=E,Ue+=2):(t=p,0===Qe&&ot(j));e=t!==p?(r=function(){var e,t,r;if(e=Ue,t=[],(r=pt())!==p)for(;r!==p;)t.push(r),r=pt();else t=p;t!==p&&(Xe=e,t=O(t));return e=t}(),r!==p?(Xe=e,t=_(r)):(Ue=e,p)):(Ue=e,p);e===p&&(Xe=e=Ue,t=T(),e=(t=t?void 0:p)!==p?(r=ct())!==p?(Xe=e,t=S(r)):(Ue=e,p):(Ue=e,p));return e}())!==p?i=[i,s,c]:(Ue=u,p):(Ue=u,p):(Ue=u,p))===p&&(u=null),u!==p?(i=bt())!==p?(125===f.charCodeAt(Ue)?(s=m,Ue++):(s=p,0===Qe&&ot(d)),s!==p?(Xe=e,t=N(n,o,u)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p):(Ue=e,p)):(Ue=e,p);return e}())===p&&(e=function(){var e,t,r,n,a,o,u,i,s,c;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));e=t!==p?(r=bt(),r!==p?(n=Ft())!==p?bt()!==p?(44===f.charCodeAt(Ue)?(a=R,Ue++):(a=p,0===Qe&&ot(M)),a!==p?bt()!==p?(f.substr(Ue,4)===J?(o=J,Ue+=4):(o=p,0===Qe&&ot(K)),o===p&&(f.substr(Ue,4)===Q?(o=Q,Ue+=4):(o=p,0===Qe&&ot(V))),o!==p?bt()!==p?(u=Ue,44===f.charCodeAt(Ue)?(i=R,Ue++):(i=p,0===Qe&&ot(M)),(u=i!==p?(s=bt())!==p?(c=function(){var e,t,r;e=Ue,f.substr(Ue,2)===E?(t=E,Ue+=2):(t=p,0===Qe&&ot(j));e=t!==p?(r=function(){var e,t,r,n;t=e=Ue,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,Ue):r;t!==p&&(Xe=e,t=X(t));return e=t}(),r!==p?(Xe=e,t=_(r)):(Ue=e,p)):(Ue=e,p);e===p&&(Xe=e=Ue,t=G(),e=(t=t?void 0:p)!==p?(r=ct())!==p?(Xe=e,t=S(r)):(Ue=e,p):(Ue=e,p));return e}())!==p?i=[i,s,c]:(Ue=u,p):(Ue=u,p):(Ue=u,p))===p&&(u=null),u!==p?(i=bt())!==p?(125===f.charCodeAt(Ue)?(s=m,Ue++):(s=p,0===Qe&&ot(d)),s!==p?(Xe=e,t=N(n,o,u)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p)):(Ue=e,p):(Ue=e,p):(Ue=e,p)):(Ue=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,a,o,u,i,s,c,l;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));if(t!==p)if(bt()!==p)if((r=Ft())!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(n=R,Ue++):(n=p,0===Qe&&ot(M)),n!==p)if(bt()!==p)if(f.substr(Ue,6)===W?(a=W,Ue+=6):(a=p,0===Qe&&ot(Y)),a===p&&(f.substr(Ue,13)===ee?(a=ee,Ue+=13):(a=p,0===Qe&&ot(te))),a!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(o=R,Ue++):(o=p,0===Qe&&ot(M)),o!==p)if(bt()!==p)if(u=Ue,f.substr(Ue,7)===re?(i=re,Ue+=7):(i=p,0===Qe&&ot(ne)),(u=i!==p?(s=bt())!==p?(c=At())!==p?i=[i,s,c]:(Ue=u,p):(Ue=u,p):(Ue=u,p))===p&&(u=null),u!==p)if((i=bt())!==p){if(s=[],(c=dt())!==p)for(;c!==p;)s.push(c),c=dt();else s=p;e=s!==p?(c=bt())!==p?(125===f.charCodeAt(Ue)?(l=m,Ue++):(l=p,0===Qe&&ot(d)),l!==p?(Xe=e,t=ae(r,a,u,s)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,a,o,u,i,s;e=Ue,123===f.charCodeAt(Ue)?(t=h,Ue++):(t=p,0===Qe&&ot(g));if(t!==p)if(bt()!==p)if((r=Ft())!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(n=R,Ue++):(n=p,0===Qe&&ot(M)),n!==p)if(bt()!==p)if(f.substr(Ue,6)===oe?(a=oe,Ue+=6):(a=p,0===Qe&&ot(ue)),a!==p)if(bt()!==p)if(44===f.charCodeAt(Ue)?(o=R,Ue++):(o=p,0===Qe&&ot(M)),o!==p)if(bt()!==p){if(u=[],(i=mt())!==p)for(;i!==p;)u.push(i),i=mt();else u=p;e=u!==p?(i=bt())!==p?(125===f.charCodeAt(Ue)?(s=m,Ue++):(s=p,0===Qe&&ot(d)),s!==p?(Xe=e,t=ie(r,u)):(Ue=e,p)):(Ue=e,p):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;else Ue=e,e=p;return e}())===p&&(e=function(){var e,t;e=Ue,35===f.charCodeAt(Ue)?(t=u,Ue++):(t=p,0===Qe&&ot(i));t!==p&&(Xe=e,t=s());return e=t}()),e}function ct(){var e,t,r;if(e=Ue,t=[],(r=wt())===p&&(r=xt())===p&&(r=Ct()),r!==p)for(;r!==p;)t.push(r),(r=wt())===p&&(r=xt())===p&&(r=Ct());else t=p;return t!==p&&(Xe=e,t=a(t)),e=t}function lt(){var e,t,r,n,a;if(Qe++,t=[],n=r=e=Ue,Qe++,(a=yt())===p&&(v.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(b))),Qe--,(r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(A)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ue,Qe++,(a=yt())===p&&(v.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(b))),Qe--,r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(A)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p);else t=p;return e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(y)),e}function ft(){var e,t,r;return Qe++,e=Ue,47===f.charCodeAt(Ue)?(t=x,Ue++):(t=p,0===Qe&&ot(C)),e=t!==p&&(r=lt())!==p?(Xe=e,t=F(r)):(Ue=e,p),Qe--,e===p&&(t=p,0===Qe&&ot(w)),e}function pt(){var e,t,r,n;if(Qe++,e=Ue,bt()!==p)if((t=lt())!==p){for(r=[],n=ft();n!==p;)r.push(n),n=ft();e=r!==p?(Xe=e,k(t,r)):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;return Qe--,e===p&&(p,0===Qe&&ot(D)),e}function ht(){var e,t,r,n;if(e=Ue,39===f.charCodeAt(Ue)?(t=Z,Ue++):(t=p,0===Qe&&ot(z)),t!==p){if(r=[],(n=wt())===p&&(B.test(f.charAt(Ue))?(n=f.charAt(Ue),Ue++):(n=p,0===Qe&&ot(L))),n!==p)for(;n!==p;)r.push(n),(n=wt())===p&&(B.test(f.charAt(Ue))?(n=f.charAt(Ue),Ue++):(n=p,0===Qe&&ot(L)));else r=p;e=r!==p?(39===f.charCodeAt(Ue)?(n=Z,Ue++):(n=p,0===Qe&&ot(z)),n!==p?t=[t,r,n]:(Ue=e,p)):(Ue=e,p)}else Ue=e,e=p;if(e===p)if(e=[],(t=wt())===p&&(H.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot($))),t!==p)for(;t!==p;)e.push(t),(t=wt())===p&&(H.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot($)));else e=p;return e}function gt(){var e,t;if(e=[],q.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot(U)),t!==p)for(;t!==p;)e.push(t),q.test(f.charAt(Ue))?(t=f.charAt(Ue),Ue++):(t=p,0===Qe&&ot(U));else e=p;return e}function mt(){var e,t,r,n,a;return e=Ue,e=bt()!==p&&(t=kt())!==p&&bt()!==p?(123===f.charCodeAt(Ue)?(r=h,Ue++):(r=p,0===Qe&&ot(g)),r!==p?(Xe=Ue,(le()?void 0:p)!==p&&(n=it())!==p?(125===f.charCodeAt(Ue)?(a=m,Ue++):(a=p,0===Qe&&ot(d)),a!==p?(Xe=e,fe(t,n)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)}function dt(){var e,t,r,n,a;return e=Ue,e=bt()!==p&&(t=function(){var e,t,r,n;return t=e=Ue,61===f.charCodeAt(Ue)?(r=se,Ue++):(r=p,0===Qe&&ot(ce)),(e=(t=r!==p&&(n=At())!==p?r=[r,n]:(Ue=t,p))!==p?f.substring(e,Ue):t)===p&&(e=kt()),e}())!==p&&bt()!==p?(123===f.charCodeAt(Ue)?(r=h,Ue++):(r=p,0===Qe&&ot(g)),r!==p?(Xe=Ue,(pe()?void 0:p)!==p&&(n=it())!==p?(125===f.charCodeAt(Ue)?(a=m,Ue++):(a=p,0===Qe&&ot(d)),a!==p?(Xe=e,he(t,n)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)):(Ue=e,p)}function yt(){var e;return Qe++,me.test(f.charAt(Ue))?(e=f.charAt(Ue),Ue++):(e=p,0===Qe&&ot(de)),Qe--,e===p&&0===Qe&&ot(ge),e}function vt(){var e;return Qe++,ve.test(f.charAt(Ue))?(e=f.charAt(Ue),Ue++):(e=p,0===Qe&&ot(be)),Qe--,e===p&&0===Qe&&ot(ye),e}function bt(){var e,t,r;for(Qe++,e=Ue,t=[],r=yt();r!==p;)t.push(r),r=yt();return e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(Ae)),e}function At(){var e,t,r;return Qe++,e=Ue,45===f.charCodeAt(Ue)?(t=xe,Ue++):(t=p,0===Qe&&ot(Ce)),t===p&&(t=null),e=t!==p&&(r=Dt())!==p?(Xe=e,t=Fe(t,r)):(Ue=e,p),Qe--,e===p&&(t=p,0===Qe&&ot(we)),e}function wt(){var e,t;return Qe++,e=Ue,f.substr(Ue,2)===ke?(t=ke,Ue+=2):(t=p,0===Qe&&ot(Oe)),t!==p&&(Xe=e,t=Ee()),Qe--,(e=t)===p&&(t=p,0===Qe&&ot(De)),e}function xt(){var e,t,r,n,a,o;if(e=Ue,39===f.charCodeAt(Ue)?(t=Z,Ue++):(t=p,0===Qe&&ot(z)),t!==p)if((r=function(){var e,t,r,n;t=e=Ue,f.length>Ue?(r=f.charAt(Ue),Ue++):(r=p,0===Qe&&ot(A));t=r!==p?(Xe=Ue,n=Re(r),(n=n?void 0:p)!==p?r=[r,n]:(Ue=t,p)):(Ue=t,p);e=t!==p?f.substring(e,Ue):t;return e}())!==p){for(n=Ue,a=[],f.substr(Ue,2)===ke?(o=ke,Ue+=2):(o=p,0===Qe&&ot(Oe)),o===p&&(B.test(f.charAt(Ue))?(o=f.charAt(Ue),Ue++):(o=p,0===Qe&&ot(L)));o!==p;)a.push(o),f.substr(Ue,2)===ke?(o=ke,Ue+=2):(o=p,0===Qe&&ot(Oe)),o===p&&(B.test(f.charAt(Ue))?(o=f.charAt(Ue),Ue++):(o=p,0===Qe&&ot(L)));e=(n=a!==p?f.substring(n,Ue):a)!==p?(39===f.charCodeAt(Ue)?(a=Z,Ue++):(a=p,0===Qe&&ot(z)),a===p&&(a=null),a!==p?(Xe=e,t=je(r,n)):(Ue=e,p)):(Ue=e,p)}else Ue=e,e=p;else Ue=e,e=p;return e}function Ct(){var e,t,r,n;return t=e=Ue,f.length>Ue?(r=f.charAt(Ue),Ue++):(r=p,0===Qe&&ot(A)),(t=r!==p?(Xe=Ue,(n=(n=_e(r))?void 0:p)!==p?r=[r,n]:(Ue=t,p)):(Ue=t,p))===p&&(10===f.charCodeAt(Ue)?(t=Te,Ue++):(t=p,0===Qe&&ot(Se))),e=t!==p?f.substring(e,Ue):t}function Ft(){var e,t;return Qe++,e=Ue,(t=Dt())===p&&(t=kt()),e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(Me)),e}function Dt(){var e,t,r,n,a;if(Qe++,e=Ue,48===f.charCodeAt(Ue)?(t=Ie,Ue++):(t=p,0===Qe&&ot(Ne)),t!==p&&(Xe=e,t=Ze()),(e=t)===p){if(t=e=Ue,ze.test(f.charAt(Ue))?(r=f.charAt(Ue),Ue++):(r=p,0===Qe&&ot(Be)),r!==p){for(n=[],Le.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(He));a!==p;)n.push(a),Le.test(f.charAt(Ue))?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(He));t=n!==p?r=[r,n]:(Ue=t,p)}else Ue=t,t=p;t!==p&&(Xe=e,t=$e(t)),e=t}return Qe--,e===p&&(t=p,0===Qe&&ot(Pe)),e}function kt(){var e,t,r,n,a;if(Qe++,t=[],n=r=e=Ue,Qe++,(a=yt())===p&&(a=vt()),Qe--,(r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(A)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ue,Qe++,(a=yt())===p&&(a=vt()),Qe--,r=(n=a===p?void 0:(Ue=n,p))!==p?(f.length>Ue?(a=f.charAt(Ue),Ue++):(a=p,0===Qe&&ot(A)),a!==p?n=[n,a]:(Ue=r,p)):(Ue=r,p);else t=p;return e=t!==p?f.substring(e,Ue):t,Qe--,e===p&&(t=p,0===Qe&&ot(qe)),e}var Ot,Et,jt,_t=["root"];function Tt(){return"plural"===_t[_t.length-1]}function St(){return e&&e.captureLocation?{location:We()}:{}}if((t=n())!==p&&Ue===f.length)return t;throw t!==p&&Ue<f.length&&ot({type:"end"}),Ot=Ke,Et=Je<f.length?f.charAt(Je):null,jt=Je<f.length?at(Je,Je+1):at(Je,Je),new Pt(Pt.buildMessage(Ot,Et),Ot,Et,jt)},p=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 o=arguments[t],u=0,i=o.length;u<i;u++,a++)n[a]=o[u];return n},h=/(^|[^\\])#/g;var i=function(){return(i=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)},a=/(?:[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;function w(e){var r={};return e.replace(a,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}var s=/^\.(?:(0+)(\+|#+)?)?$/g,c=/^(@+)?(\+|#+)?$/g;function l(e){var n={};return e.replace(c,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 g(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 m(e){var t=g(e);return t||{}}function x(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=i(i(i({},n),{notation:"scientific"}),a.options.reduce(function(e,t){return i(i({},e),m(t))},{}));continue;case"engineering":n=i(i(i({},n),{notation:"engineering"}),a.options.reduce(function(e,t){return i(i({},e),m(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(s.test(a.stem)){if(1<a.options.length)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(s,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=i(i({},n),l(a.options[0])))}else if(c.test(a.stem))n=i(i({},n),l(a.stem));else{var o=g(a.stem);o&&(n=i(i({},n),o))}}return n}function d(e,t){var r=f(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(c){(A(c)||b(c))&&Object.keys(c.options).forEach(function(e){for(var t,r=c.options[e],n=-1,a=void 0,o=0;o<r.value.length;o++){var u=r.value[o];if(v(u)&&h.test(u.value)){n=o,a=u;break}}if(a){var i=a.value.replace(h,"$1{"+c.value+", number}"),s=f(i);(t=r.value).splice.apply(t,p([n,1],s))}l(r.value)})})}(r),r}var y=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 o=arguments[t],u=0,i=o.length;u<i;u++,a++)n[a]=o[u];return n};function C(e){return JSON.stringify(e.map(function(e){return e&&"object"==typeof e?function(r){return Object.keys(r).sort().map(function(e){var t;return(t={})[e]=r[e],t})}(e):e}))}var F,D,k,O=function(o,u){return void 0===u&&(u={}),function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=C(t),a=n&&u[n];return a||(a=new((e=o).bind.apply(e,y([void 0],t))),n&&(u[n]=a)),a}},E=(F=function(e,t){return(F=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}F(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),j=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 o=arguments[t],u=0,i=o.length;u<i;u++,a++)n[a]=o[u];return n},_=(D=Error,E(T,D),T);function T(e,t){var r=D.call(this,e)||this;return r.variableId=t,r}function S(e,t,r,n,a,o,u){if(1===e.length&&v(e[0]))return[{type:0,value:e[0].value}];for(var i,s,c=[],l=0,f=e;l<f.length;l++){var p=f[l];if(v(p))c.push({type:0,value:p.value});else if(p.type!==Rt.pound){var h=p.value;if(!(a&&h in a))throw new _('The intl string context variable "'+h+'" was not provided to the string "'+u+'"');var g=a[h];if(p.type!==Rt.argument)if(p.type!==Rt.date)if(p.type!==Rt.time)if(p.type!==Rt.number)if(b(p)){if(!(m=p.options[g]||p.options.other))throw new RangeError('Invalid values for "'+p.value+'": "'+g+'". Options are "'+Object.keys(p.options).join('", "')+'"');c.push.apply(c,S(m.value,t,r,n,a))}else if(A(p)){var m;if(!(m=p.options["="+g])){if(!Intl.PluralRules)throw new _('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n');var d=r.getPluralRules(t,{type:p.pluralType}).select(g-(p.offset||0));m=p.options[d]||p.options.other}if(!m)throw new RangeError('Invalid values for "'+p.value+'": "'+g+'". Options are "'+Object.keys(p.options).join('", "')+'"');c.push.apply(c,S(m.value,t,r,n,a,g-(p.offset||0)))}else;else{y="string"==typeof p.style?n.number[p.style]:(i=p.style)&&"object"==typeof i&&0===i.type?x(p.style.tokens):void 0;c.push({type:0,value:r.getNumberFormat(t,y).format(g)})}else{var y="string"==typeof p.style?n.time[p.style]:(s=p.style)&&"object"==typeof s&&1===s.type?w(p.style.pattern):void 0;c.push({type:0,value:r.getDateTimeFormat(t,y).format(g)})}else{var y="string"==typeof p.style?n.date[p.style]:void 0;c.push({type:0,value:r.getDateTimeFormat(t,y).format(g)})}else g&&"string"!=typeof g&&"number"!=typeof g||(g="string"==typeof g||"number"==typeof g?String(g):""),c.push({type:1,value:g})}else"number"==typeof o&&c.push({type:0,value:r.getNumberFormat(t).format(o)})}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&0===r.type&&0===t.type?r.value+=t.value:e.push(t),e},[])}(c)}function R(e,t,r,n,a,o){var u=S(e,t,r,n,a,void 0,o);return 1===u.length?u[0].value:u.reduce(function(e,t){return e+t.value},"")}var M="@@",P=/@@(\d+_\d+)@@/g,I=0;function N(e,t){return e.split(P).filter(Boolean).map(function(e){return null!=t[e]?t[e]:e}).reduce(function(e,t){return e.length&&"string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e},[])}var Z=/(<([0-9a-zA-Z-_]*?)>(.*?)<\/([0-9a-zA-Z-_]*?)>)|(<[0-9a-zA-Z-_]*?\/>)/,z=Date.now()+"@@",B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];function L(e,t,r,n,a,o){var u=S(e,t,r,n,a,void 0,o),i={},s=u.reduce(function(e,t){if(0===t.type)return e+t.value;var r=Date.now()+"_"+ ++I;return i[r]=t.value,e+(M+r)+M},"");if(!Z.test(s))return N(s,i);if(!a)throw new _("Message has placeholders but no values was given");if("undefined"==typeof DOMParser)throw new _("Cannot format XML message without DOMParser");k||(k=new DOMParser);var c=k.parseFromString('<formatted-message id="'+z+'">'+s+"</formatted-message>","text/html").getElementById(z);if(!c)throw new _("Malformed HTML message "+s);var l=Object.keys(a).filter(function(e){return!!c.getElementsByTagName(e).length});if(!l.length)return N(s,i);var f=l.filter(function(e){return e!==e.toLowerCase()});if(f.length)throw new _("HTML tag must be lowercased but the following tags are not: "+f.join(", "));return Array.prototype.slice.call(c.childNodes).reduce(function(e,t){return e.concat(function r(e,n,a){var t=e.tagName,o=e.outerHTML,u=e.textContent,i=e.childNodes;if(!t)return N(u||"",n);t=t.toLowerCase();var s=~B.indexOf(t),c=a[t];if(c&&s)throw new _(t+" is a self-closing tag and can not be used, please use another tag name.");if(!i.length)return[o];var l=Array.prototype.slice.call(i).reduce(function(e,t){return e.concat(r(t,n,a))},[]);return c?"function"==typeof c?[c.apply(void 0,l)]:[c]:j(["<"+t+">"],l,["</"+t+">"])}(t,i,a))},[])}var H=function(){return(H=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)};function $(r,n){return n?Object.keys(r).reduce(function(e,t){return e[t]=function(r,n){return n?H(H(H({},r||{}),n||{}),Object.keys(r).reduce(function(e,t){return e[t]=H(H({},r[t]),n[t]||{}),e},{})):r}(r[t],n[t]),e},H({},r)):r}function q(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:O(Intl.NumberFormat,e.number),getDateTimeFormat:O(Intl.DateTimeFormat,e.dateTime),getPluralRules:O(Intl.PluralRules,e.pluralRules)}}var U=(X.defaultLocale=(new Intl.NumberFormat).resolvedOptions().locale,X.__parse=d,X.formats={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},X);function X(e,t,r,n){var a=this;if(void 0===t&&(t=X.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){return R(a.ast,a.locales,a.formatters,a.formats,e,a.message)},this.formatToParts=function(e){return S(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.formatHTMLMessage=function(e){return L(a.ast,a.locales,a.formatters,a.formats,e,a.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},"string"==typeof e){if(this.message=e,!X.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=X.__parse(e,{normalizeHashtagInPlural:!1})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=$(X.formats,r),this.locales=t,this.formatters=n&&n.formatters||q(this.formatterCache)}e.IntlMessageFormat=U,e.createDefaultFormatters=q,e.default=U,e.formatHTMLMessage=L,e.formatToParts=S,e.formatToString=R,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=intl-messageformat.min.js.map
|