UNPKG

@smals-belgium-shared/vidis-diarynote

Version:

Diary notes web component

12 lines 1.19 MB
var K6=Object.defineProperty;var uf=e=>{throw TypeError(e)};var Z6=(e,t,n)=>t in e?K6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var s=(e,t,n)=>Z6(e,typeof t!="symbol"?t+"":t,n),hf=(e,t,n)=>t.has(e)||uf("Cannot "+n);var Ha=(e,t,n)=>(hf(e,t,"read from private field"),n?n.call(e):t.get(e)),pf=(e,t,n)=>t.has(e)?uf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),mf=(e,t,n,i)=>(hf(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);var X6=Object.create,Ic=Object.defineProperty,Q6=Object.defineProperties,J6=Object.getOwnPropertyDescriptor,e8=Object.getOwnPropertyDescriptors,t8=Object.getOwnPropertyNames,Bl=Object.getOwnPropertySymbols,i8=Object.getPrototypeOf,Kh=Object.prototype.hasOwnProperty,hy=Object.prototype.propertyIsEnumerable,ff=(e,t,n)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t)=>{for(var n in t||(t={}))Kh.call(t,n)&&ff(e,n,t[n]);if(Bl)for(var n of Bl(t))hy.call(t,n)&&ff(e,n,t[n]);return e},Qe=(e,t)=>Q6(e,e8(t)),a8=(e,t)=>{var n={};for(var i in e)Kh.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&Bl)for(var i of Bl(e))t.indexOf(i)<0&&hy.call(e,i)&&(n[i]=e[i]);return n},ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Se=(e,t)=>{for(var n in t)Ic(e,n,{get:t[n],enumerable:!0})},n8=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of t8(t))!Kh.call(e,a)&&a!==n&&Ic(e,a,{get:()=>t[a],enumerable:!(i=J6(t,a))||i.enumerable});return e},Zh=(e,t,n)=>(n=e!=null?X6(i8(e)):{},n8(t||!e||!e.__esModule?Ic(n,"default",{value:e,enumerable:!0}):n,e)),mi=(e,t,n)=>new Promise((i,a)=>{var r=c=>{try{l(n.next(c))}catch(d){a(d)}},o=c=>{try{l(n.throw(c))}catch(d){a(d)}},l=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,o);l((n=n.apply(e,t)).next())}),r8=ge((e,t)=>{(function(n,i){typeof e=="object"&&typeof t<"u"?t.exports=i():typeof define=="function"&&define.amd?define(i):(n=typeof globalThis<"u"?globalThis:n||self,n.MessageFormat=i())})(e,function(){var n=function(){return n=Object.assign||function(p){for(var f,y=1,b=arguments.length;y<b;y++){f=arguments[y];for(var _ in f)Object.prototype.hasOwnProperty.call(f,_)&&(p[_]=f[_])}return p},n.apply(this,arguments)};function i(p){var f=typeof Symbol=="function"&&Symbol.iterator,y=f&&p[f],b=0;if(y)return y.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&b>=p.length&&(p=void 0),{value:p&&p[b++],done:!p}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(p,f){var y=typeof Symbol=="function"&&p[Symbol.iterator];if(!y)return p;var b=y.call(p),_,S=[],C;try{for(;(f===void 0||f-- >0)&&!(_=b.next()).done;)S.push(_.value)}catch(I){C={error:I}}finally{try{_&&!_.done&&(y=b.return)&&y.call(b)}finally{if(C)throw C.error}}return S}function r(p,f,y){if(arguments.length===2)for(var b=0,_=f.length,S;b<_;b++)(S||!(b in f))&&(S||(S=Array.prototype.slice.call(f,0,b)),S[b]=f[b]);return p.concat(S||Array.prototype.slice.call(f))}typeof SuppressedError=="function"&&SuppressedError;class o extends Error{constructor(f,y,b){super(f),this.token=y,this.type=b||"error"}}let l=p=>p<4?"short":p===4?"long":"narrow",c=p=>p%2===0?"2-digit":"numeric";function d(p,f){switch(p.char){case"y":return{year:c(p.width)};case"r":return{calendar:"gregory",year:"numeric"};case"u":case"U":case"Y":default:return f(`${p.desc} is not supported; falling back to year:numeric`,o.WARNING),{year:"numeric"}}}function u(p,f){switch(p.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:f(`${p.desc} is not supported with width ${p.width}`);return}}function m(p,f){let{char:y,desc:b,width:_}=p;if(y==="d")return c(_);f(`${b} is not supported`)}function v(p,f){let{char:y,desc:b,width:_}=p;if((y==="c"||y==="e")&&_<3){let S=`Numeric value is not supported for ${b}; falling back to weekday:short`;f(S,o.WARNING)}return l(_)}function g(p){let f=c(p.width),y;switch(p.char){case"h":y="h12";break;case"H":y="h23";break;case"k":y="h24";break;case"K":y="h11";break}return y?{hour:f,hourCycle:y}:{hour:f}}function x(p,f){let{char:y,desc:b,width:_}=p;switch(y){case"v":case"z":return _===4?"long":"short";case"V":if(_===4)return"long";f(`${b} is not supported with width ${_}`);return;case"X":f(`${b} is not supported`);return}return"short"}function w(p,f){switch(p.field){case"era":return{era:l(p.width)};case"year":return d(p,f);case"month":return{month:u(p,f)};case"day":return{day:m(p,f)};case"weekday":return{weekday:v(p,f)};case"period":return;case"hour":return g(p);case"min":return{minute:c(p.width)};case"sec":return{second:c(p.width)};case"tz":return{timeZoneName:x(p,f)};case"quarter":case"week":case"sec-frac":case"ms":f(`${p.desc} is not supported`)}}function E(p,f){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S=>{throw S},b={timeZone:f},_=[];for(let S of p){let{error:C,field:I,str:R}=S;if(C){let he=new o(C.message,S);he.stack=C.stack,y(he)}if(R){let he=`Ignoring string part: ${R}`;y(new o(he,S,o.WARNING))}I&&(_.indexOf(I)===-1?_.push(I):y(new o(`Duplicate ${I} token`,S)));let H=w(S,(he,ke)=>y(new o(he,S,ke)));H&&Object.assign(b,H)}return b}let T={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},z=p=>p>="A"&&p<="Z"||p>="a"&&p<="z";function F(p,f){let y=p[f],b=1;for(;p[++f]===y;)++b;let _=T[y];if(!_){let S=`The letter ${y} is not a valid field identifier`;return{char:y,error:new Error(S),width:b}}return{char:y,field:_.field,desc:_.desc,width:b}}function qe(p,f){let y=p[++f],b=2;if(y==="'")return{char:"'",str:y,width:b};for(;;){let _=p[++f];if(++b,_===void 0){let S=`Unterminated quoted literal in pattern: ${y||p}`;return{char:"'",error:new Error(S),str:y,width:b}}else if(_==="'"){if(p[++f]!=="'")return{char:"'",str:y,width:b};++b}y+=_}}function dt(p,f){let y=p[f];if(!y)return null;if(z(y))return F(p,f);if(y==="'")return qe(p,f);let b=y,_=1;for(;;){let S=p[++f];if(!S||z(S)||S==="'")return{char:y,str:b,width:_};b+=S,_+=1}}function tt(p){let f=[],y=0;for(;;){let b=dt(p,y);if(!b)return f;f.push(b),y+=b.width}}function ei(p,f,y,b){typeof f=="string"&&(f=tt(f)),typeof y=="function"&&(b=y,y=void 0);let _=E(f,y,b),S=new Intl.DateTimeFormat(p,_);return C=>S.format(C)}function Kt(p,f,y,b){typeof f=="string"&&(f=tt(f)),typeof y=="function"&&(b=y,y=void 0);let _=E(f,y,b);return["(function() {",`var opt = ${JSON.stringify(_)};`,`var dtf = new Intl.DateTimeFormat(${JSON.stringify(p)}, opt);`,"return function(value) { return dtf.format(value); }"].join(` `)+` })()`}class At extends Error{constructor(f,y){super(y),this.code=f}}class Zt extends At{constructor(f,y){super("BAD_OPTION",`Unknown ${f} option: ${y}`),this.stem=f,this.option=y}}class ne extends At{constructor(f){super("BAD_STEM",`Unknown stem: ${f}`),this.stem=f}}class X extends At{constructor(f,y){super("MASKED_VALUE",`Value for ${f} is set multiple times`),this.type=f,this.prev=y}}class Re extends At{constructor(f){super("MISSING_OPTION",`Required option missing for ${f}`),this.stem=f}}class V extends At{constructor(f,y){super("BAD_PATTERN",y),this.char=f}}class $ extends At{constructor(f,y,b){let _=b>1?`${b} options`:"one option";super("TOO_MANY_OPTIONS",`Token ${f} only supports ${_} (got ${y.length})`),this.stem=f,this.options=y}}function te(p,f){let{numberingSystem:y}=f;return Array.isArray(p)||(p=[p]),y?p.map(b=>{let _=b.indexOf("-u-")===-1?"u-nu":"nu";return`${b}-${_}-${y}`}).concat(p):p}function je(p,f){let y=+p+f/2;return y-y%+f}function ut(p){let{scale:f,unit:y}=p,b=typeof f=="number"&&f>=0?f:1;return y&&y.style==="percent"&&(b*=.01),b}function ti(p){let f=ut(p),{precision:y}=p;return y&&y.style==="precision-increment"?b=>je(b,y.increment)*f:b=>b*f}function We(p){let f=ut(p),{precision:y}=p;if(y&&y.style==="precision-increment"){let b=`+n + ${y.increment/2}`,_=`x - (x % +${y.increment})`;return f!==1&&(_=`(${_}) * ${f}`),`function(n) { var x = ${b}; return ${_}; }`}return f!==1?`function(n) { return n * ${f}; }`:null}function et(p,f){let{decimal:y,group:b,integerWidth:_,notation:S,precision:C,roundingMode:I,sign:R,unit:H,unitPer:he,unitWidth:ke}=p,$e=(gt,Nt)=>{},ie={};if(H)switch(H.style){case"base-unit":ie.style="decimal";break;case"currency":ie.style="currency",ie.currency=H.currency;break;case"measure-unit":ie.style="unit",ie.unit=H.unit.replace(/.*-/,""),he&&(ie.unit+="-per-"+he.replace(/.*-/,""));break;case"percent":ie.style="percent";break}switch(ke){case"unit-width-full-name":ie.currencyDisplay="name",ie.unitDisplay="long";break;case"unit-width-hidden":break;case"unit-width-iso-code":ie.currencyDisplay="code";break;case"unit-width-narrow":ie.currencyDisplay="narrowSymbol",ie.unitDisplay="narrow";break;case"unit-width-short":ie.currencyDisplay="symbol",ie.unitDisplay="short";break}switch(b){case"group-off":ie.useGrouping=!1;break;case"group-auto":ie.useGrouping=!0;break;case"group-min2":case"group-on-aligned":case"group-thousands":ie.useGrouping=!0;break}if(C)switch(C.style){case"precision-fraction":{let{minFraction:gt,maxFraction:Nt,minSignificant:Ut,maxSignificant:hi,source:Qi}=C;typeof gt=="number"&&(ie.minimumFractionDigits=gt,typeof Ut=="number"&&$e()),typeof Nt=="number"&&(ie.maximumFractionDigits=Nt),typeof Ut=="number"&&(ie.minimumSignificantDigits=Ut),typeof hi=="number"&&(ie.maximumSignificantDigits=hi);break}case"precision-integer":ie.maximumFractionDigits=0;break;case"precision-unlimited":ie.maximumFractionDigits=20;break;case"precision-increment":break;case"precision-currency-standard":ie.trailingZeroDisplay=C.trailingZero;break;case"precision-currency-cash":$e(C.style);break}if(S)switch(S.style){case"compact-short":ie.notation="compact",ie.compactDisplay="short";break;case"compact-long":ie.notation="compact",ie.compactDisplay="long";break;case"notation-simple":ie.notation="standard";break;case"scientific":case"engineering":{let{expDigits:gt,expSign:Nt,source:Ut,style:hi}=S;ie.notation=hi;break}}if(_){let{min:gt,max:Nt,source:Ut}=_;if(gt>0&&(ie.minimumIntegerDigits=gt),Number(Nt)>0){let hi=ie.notation==="engineering"||ie.notation==="scientific";Nt===3&&hi?ie.notation="engineering":$e()}}switch(R){case"sign-auto":ie.signDisplay="auto";break;case"sign-always":ie.signDisplay="always";break;case"sign-except-zero":ie.signDisplay="exceptZero";break;case"sign-never":ie.signDisplay="never";break;case"sign-accounting":ie.currencySign="accounting";break;case"sign-accounting-always":ie.currencySign="accounting",ie.signDisplay="always";break;case"sign-accounting-except-zero":ie.currencySign="accounting",ie.signDisplay="exceptZero";break}return ie}function Dt(p,f,y){let b=p[f];switch(b){case"%":return{char:"%",style:"percent",width:1};case"‰":return{char:"%",style:"permille",width:1};case"¤":{let _=1;for(;p[++f]==="¤";)++_;switch(_){case 1:return{char:b,currency:"default",width:_};case 2:return{char:b,currency:"iso-code",width:_};case 3:return{char:b,currency:"full-name",width:_};case 5:return{char:b,currency:"narrow",width:_};default:{let S=`Invalid number (${_}) of ¤ chars in pattern`;return y(new V("¤",S)),null}}}case"*":{let _=p[f+1];if(_)return{char:b,pad:_,width:2};break}case"+":case"-":return{char:b,width:1};case"'":{let _=p[++f],S=2;if(_==="'")return{char:b,str:_,width:S};for(;;){let C=p[++f];if(++S,C===void 0){let I=`Unterminated quoted literal in pattern: ${_}`;return y(new V("'",I)),{char:b,str:_,width:S}}else if(C==="'"){if(p[++f]!=="'")return{char:b,str:_,width:S};++S}_+=C}}}return null}let Xi=p=>p>="0"&&p<="9";function ft(p,f){let y=p[f];if(Xi(y)){let b=y;for(;;){let _=p[++f];if(Xi(_))b+=_;else return{char:"0",digits:b,width:b.length}}}switch(y){case"#":{let b=1;for(;p[++f]==="#";)++b;return{char:y,width:b}}case"@":{let b=1;for(;p[++f]==="@";)++b;let _=b;for(f-=1;p[++f]==="#";)++_;return{char:y,min:b,width:_}}case"E":{let b=p[f+1]==="+";b&&++f;let _=0;for(;p[++f]==="0";)++_;let S=(b?2:1)+_;if(_)return{char:y,expDigits:_,plus:b,width:S};break}case".":case",":return{char:y,width:1}}return null}function ii(p,f,y){let b;(function(H){H[H.Prefix=0]="Prefix",H[H.Number=1]="Number",H[H.Suffix=2]="Suffix"})(b||(b={}));let _=[],S=[],C=[],I=b.Prefix,R="";for(;f<p.length;){let H=p[f];if(H===";"){f+=1;break}switch(I){case b.Prefix:{let he=Dt(p,f,y);if(he)R&&(_.push({char:"'",str:R,width:R.length}),R=""),_.push(he),f+=he.width;else{let ke=ft(p,f);ke?(R&&(_.push({char:"'",str:R,width:R.length}),R=""),I=b.Number,S.push(ke),f+=ke.width):(R+=H,f+=1)}break}case b.Number:{let he=ft(p,f);he?(S.push(he),f+=he.width):I=b.Suffix;break}case b.Suffix:{let he=Dt(p,f,y);he?(R&&(C.push({char:"'",str:R,width:R.length}),R=""),C.push(he),f+=he.width):(R+=H,f+=1);break}}}return R&&C.push({char:"'",str:R,width:R.length}),{pattern:{prefix:_,number:S,suffix:C},pos:f}}function $t(p,f){let{pattern:y,pos:b}=ii(p,0,f);if(b<p.length){let{pattern:_}=ii(p,b,f);return{tokens:y,negative:_}}return{tokens:y}}function ua(p,f){let y={},b=!1,_=!1,S=0,C="",I=-1,R="",H=0;for(let ke=0;ke<p.length;++ke){let $e=p[ke];switch($e.char){case"#":{if(I===-1){if(C){let ie="Pattern has # after integer digits";f(new V("#",ie))}S+=$e.width}else H+=$e.width;break}case"0":{if(I===-1)C+=$e.digits;else{if(H){let ie="Pattern has digits after # in fraction";f(new V("0",ie))}R+=$e.digits}break}case"@":{y.precision&&f(new X("precision",y.precision)),y.precision={style:"precision-fraction",minSignificant:$e.min,maxSignificant:$e.width};break}case",":b=!0;break;case".":if(I===1){let ie="Pattern has more than one decimal separator";f(new V(".",ie))}I=ke;break;case"E":{if(_&&f(new X("exponent",y.notation)),b){let ie="Exponential patterns may not contain grouping separators";f(new V("E",ie))}y.notation={style:"scientific"},$e.expDigits>1&&(y.notation.expDigits=$e.expDigits),$e.plus&&(y.notation.expSign="sign-always"),_=!0}}}b?y.group="group-auto":S+C.length>3&&(y.group="group-off");let he=+`${C||"0"}.${R}`;if(he&&(y.precision={style:"precision-increment",increment:he}),!_)C.length>1&&(y.integerWidth={min:C.length}),!y.precision&&(R.length||H)&&(y.precision={style:"precision-fraction",minFraction:R.length,maxFraction:R.length+H});else if((!y.precision||he)&&(y.integerWidth=S?{min:1,max:S+C.length}:{min:Math.max(1,C.length)}),y.precision)he||(y.integerWidth={min:1,max:1});else{let ke=C.length+R.length;I===-1?ke>0&&(y.precision={style:"precision-fraction",maxSignificant:ke}):(y.precision={style:"precision-fraction",maxSignificant:Math.max(1,ke)+H},ke>1&&(y.precision.minSignificant=ke))}return y}function on(p,f,y,b,_){let S=!1,C="";for(let I of p)switch(I.char){case"%":f.unit={style:I.style},_?S=!0:C="";break;case"¤":if(!y){let R="The ¤ pattern requires a currency";b(new V("¤",R));break}switch(f.unit={style:"currency",currency:y},I.currency){case"iso-code":f.unitWidth="unit-width-iso-code";break;case"full-name":f.unitWidth="unit-width-full-name";break;case"narrow":f.unitWidth="unit-width-narrow";break}_?S=!0:C="";break;case"*":break;case"+":S||(C+="+");break;case"'":S||(C+=I.str);break}return C}function zo(p,f){let y=!1,b="";for(let _ of p)switch(_.char){case"%":case"¤":f?y=!0:b="";break;case"-":y||(b+="-");break;case"'":y||(b+=_.str);break}return b}function jo(p,f){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R=>{throw R},{tokens:b,negative:_}=$t(p,y),S=ua(b.number,y),C=on(b.prefix,S,f,y,!0),I=on(b.suffix,S,f,y,!1);if(_){let R=zo(_.prefix,!0),H=zo(_.suffix,!1);S.affix={pos:[C,I],neg:[R,H]},S.sign="sign-never"}else(C||I)&&(S.affix={pos:[C,I]});return S}function o6(p){return["arab","arabext","bali","beng","deva","fullwide","gujr","guru","hanidec","khmr","knda","laoo","latn","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt"].indexOf(p)!==-1}function Qm(p){let f=["acceleration","angle","area","concentr","consumption","digital","duration","electric","energy","force","frequency","graphics","length","light","mass","power","pressure","speed","temperature","torque","volume"],[y]=p.split("-",1);return f.indexOf(y)!==-1}let Jm={"compact-short":0,"compact-long":0,"notation-simple":0,scientific:2,engineering:2,percent:0,permille:0,"base-unit":0,currency:1,"measure-unit":1,"per-measure-unit":1,"unit-width-narrow":0,"unit-width-short":0,"unit-width-full-name":0,"unit-width-iso-code":0,"unit-width-hidden":0,"precision-integer":0,"precision-unlimited":0,"precision-currency-standard":1,"precision-currency-cash":0,"precision-increment":1,"rounding-mode-ceiling":0,"rounding-mode-floor":0,"rounding-mode-down":0,"rounding-mode-up":0,"rounding-mode-half-even":0,"rounding-mode-half-down":0,"rounding-mode-half-up":0,"rounding-mode-unnecessary":0,"integer-width":1,scale:1,"group-off":0,"group-min2":0,"group-auto":0,"group-on-aligned":0,"group-thousands":0,latin:0,"numbering-system":1,"sign-auto":0,"sign-always":0,"sign-never":0,"sign-accounting":0,"sign-accounting-always":0,"sign-except-zero":0,"sign-accounting-except-zero":0,"decimal-auto":0,"decimal-always":0},ef={currency:1,"integer-width":1,"measure-unit":1,"numbering-system":1,"per-measure-unit":1,"precision-increment":1,scale:1};function l6(p){return p in Jm}function c6(p){return p in ef}function d6(p,f,y){if(l6(p)){let b=Jm[p];if(f.length>b){if(b===0)for(let _ of f)y(new Zt(p,_));else y(new $(p,f,b));return!1}else if(c6(p)&&f.length<ef[p])return y(new Re(p)),!1}return!0}function Cd(p,f){let y=f==="fraction"?/^\.(0*)(\+|#*)$/:/^(@+)(\+|#*)$/,b=p&&p.match(y);if(b){let _=b[1].length;switch(b[2].charAt(0)){case"":return{min:_,max:_};case"+":return{min:_,max:null};case"#":return{min:_,max:_+b[2].length}}}return null}function u6(p,f,y){let b=Cd(p,"fraction");if(b){f.length>1&&y(new $(p,f,1));let S={style:"precision-fraction",source:p,minFraction:b.min};b.max!=null&&(S.maxFraction=b.max);let C=f[0],I=Cd(C,"significant");return I?(S.source=`${p}/${C}`,S.minSignificant=I.min,I.max!=null&&(S.maxSignificant=I.max)):C&&y(new Zt(p,C)),S}let _=Cd(p,"significant");if(_){for(let C of f)y(new Zt(p,C));let S={style:"precision-fraction",source:p,minSignificant:_.min};return _.max!=null&&(S.maxSignificant=_.max),S}return null}class h6{constructor(f){this.skeleton={},this.onError=f}badOption(f,y){this.onError(new Zt(f,y))}assertEmpty(f){let y=this.skeleton[f];y&&this.onError(new X(f,y))}parseToken(f,y){if(!d6(f,y,this.onError))return;let b=y[0],_=this.skeleton;switch(f){case"compact-short":case"compact-long":case"notation-simple":this.assertEmpty("notation"),_.notation={style:f};break;case"scientific":case"engineering":{let S=null,C;for(let R of y)switch(R){case"sign-auto":case"sign-always":case"sign-never":case"sign-accounting":case"sign-accounting-always":case"sign-except-zero":case"sign-accounting-except-zero":C=R;break;default:/^\+e+$/.test(R)?S=R.length-1:this.badOption(f,R)}this.assertEmpty("notation");let I=y.join("/");_.notation=S&&C?{style:f,source:I,expDigits:S,expSign:C}:S?{style:f,source:I,expDigits:S}:C?{style:f,source:I,expSign:C}:{style:f,source:I};break}case"percent":case"permille":case"base-unit":this.assertEmpty("unit"),_.unit={style:f};break;case"currency":/^[A-Z]{3}$/.test(b)?(this.assertEmpty("unit"),_.unit={style:f,currency:b}):this.badOption(f,b);break;case"measure-unit":{Qm(b)?(this.assertEmpty("unit"),_.unit={style:f,unit:b}):this.badOption(f,b);break}case"per-measure-unit":{Qm(b)?(this.assertEmpty("unitPer"),_.unitPer=b):this.badOption(f,b);break}case"unit-width-narrow":case"unit-width-short":case"unit-width-full-name":case"unit-width-iso-code":case"unit-width-hidden":this.assertEmpty("unitWidth"),_.unitWidth=f;break;case"precision-integer":case"precision-unlimited":case"precision-currency-cash":this.assertEmpty("precision"),_.precision={style:f};break;case"precision-currency-standard":this.assertEmpty("precision"),b==="w"?_.precision={style:f,trailingZero:"stripIfInteger"}:_.precision={style:f};break;case"precision-increment":{let S=Number(b);S>0?(this.assertEmpty("precision"),_.precision={style:f,increment:S}):this.badOption(f,b);break}case"rounding-mode-ceiling":case"rounding-mode-floor":case"rounding-mode-down":case"rounding-mode-up":case"rounding-mode-half-even":case"rounding-mode-half-odd":case"rounding-mode-half-ceiling":case"rounding-mode-half-floor":case"rounding-mode-half-down":case"rounding-mode-half-up":case"rounding-mode-unnecessary":this.assertEmpty("roundingMode"),_.roundingMode=f;break;case"integer-width":{if(/^\+0*$/.test(b))this.assertEmpty("integerWidth"),_.integerWidth={source:b,min:b.length-1};else{let S=b.match(/^#*(0*)$/);S?(this.assertEmpty("integerWidth"),_.integerWidth={source:b,min:S[1].length,max:S[0].length}):this.badOption(f,b)}break}case"scale":{let S=Number(b);S>0?(this.assertEmpty("scale"),_.scale=S):this.badOption(f,b);break}case"group-off":case"group-min2":case"group-auto":case"group-on-aligned":case"group-thousands":this.assertEmpty("group"),_.group=f;break;case"latin":this.assertEmpty("numberingSystem"),_.numberingSystem="latn";break;case"numbering-system":{o6(b)?(this.assertEmpty("numberingSystem"),_.numberingSystem=b):this.badOption(f,b);break}case"sign-auto":case"sign-always":case"sign-never":case"sign-accounting":case"sign-accounting-always":case"sign-except-zero":case"sign-accounting-except-zero":this.assertEmpty("sign"),_.sign=f;break;case"decimal-auto":case"decimal-always":this.assertEmpty("decimal"),_.decimal=f;break;default:{let S=u6(f,y,this.onError);S?(this.assertEmpty("precision"),_.precision=S):this.onError(new ne(f))}}}}function tf(p){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_=>{throw _},y=[];for(let _ of p.split(" "))if(_){let S=_.split("/"),C=S.shift()||"";y.push({stem:C,options:S})}let b=new h6(f);for(let{stem:_,options:S}of y)b.parseToken(_,S);return b.skeleton}function p6(p,f,y,b){typeof f=="string"&&(f=f.indexOf("::")===0?tf(f.slice(2),b):jo(f,y,b));let _=te(p,f),S=et(f),C=ti(f),I=new Intl.NumberFormat(_,S);if(f.affix){let[R,H]=f.affix.pos,[he,ke]=f.affix.neg||["",""];return $e=>{let ie=I.format(C($e));return $e<0?`${he}${ie}${ke}`:`${R}${ie}${H}`}}return R=>I.format(C(R))}function m6(p,f,y,b){typeof f=="string"&&(f=f.indexOf("::")===0?tf(f.slice(2),b):jo(f,y,b));let _=te(p,f),S=et(f),C=We(f),I=["(function() {",`var opt = ${JSON.stringify(S)};`,`var nf = new Intl.NumberFormat(${JSON.stringify(_)}, opt);`],R="nf.format(value)";if(C&&(I.push(`var mod = ${C};`),R="nf.format(mod(value))"),f.affix){let[H,he]=f.affix.pos.map(ke=>JSON.stringify(ke));if(f.affix.neg){let[ke,$e]=f.affix.neg.map(ie=>JSON.stringify(ie));R=`value < 0 ? ${ke} + ${R} + ${$e} : ${H} + ${R} + ${he}`}else R=`${H} + ${R} + ${he}`}return I.push(`return function(value) { return ${R}; }`),I.join(` `)+` })()`}var Dd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f6(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var ss={},af={},nf={exports:{}};(function(p){(function(f,y){p.exports?p.exports=y():f.moo=y()})(Dd,function(){var f=Object.prototype.hasOwnProperty,y=Object.prototype.toString,b=typeof new RegExp().sticky=="boolean";function _(M){return M&&y.call(M)==="[object RegExp]"}function S(M){return M&&typeof M=="object"&&!_(M)&&!Array.isArray(M)}function C(M){return M.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function I(M){var K=new RegExp("|"+M);return K.exec("").length-1}function R(M){return"("+M+")"}function H(M){if(!M.length)return"(?!)";var K=M.map(function(oe){return"(?:"+oe+")"}).join("|");return"(?:"+K+")"}function he(M){if(typeof M=="string")return"(?:"+C(M)+")";if(_(M)){if(M.ignoreCase)throw new Error("RegExp /i flag not allowed");if(M.global)throw new Error("RegExp /g flag is implied");if(M.sticky)throw new Error("RegExp /y flag is implied");if(M.multiline)throw new Error("RegExp /m flag is implied");return M.source}else throw new Error("Not a pattern: "+M)}function ke(M,K){return M.length>K?M:Array(K-M.length+1).join(" ")+M}function $e(M,K){for(var oe=M.length,pe=0;;){var Ae=M.lastIndexOf(` `,oe-1);if(Ae===-1||(pe++,oe=Ae,pe===K)||oe===0)break}var we=pe<K?0:oe+1;return M.substring(we).split(` `)}function ie(M){for(var K=Object.getOwnPropertyNames(M),oe=[],pe=0;pe<K.length;pe++){var Ae=K[pe],we=M[Ae],Ye=[].concat(we);if(Ae==="include"){for(var kt=0;kt<Ye.length;kt++)oe.push({include:Ye[kt]});continue}var rt=[];Ye.forEach(function(Ce){S(Ce)?(rt.length&&oe.push(Nt(Ae,rt)),oe.push(Nt(Ae,Ce)),rt=[]):rt.push(Ce)}),rt.length&&oe.push(Nt(Ae,rt))}return oe}function gt(M){for(var K=[],oe=0;oe<M.length;oe++){var pe=M[oe];if(pe.include){for(var Ae=[].concat(pe.include),we=0;we<Ae.length;we++)K.push({include:Ae[we]});continue}if(!pe.type)throw new Error("Rule has no type: "+JSON.stringify(pe));K.push(Nt(pe.type,pe))}return K}function Nt(M,K){if(S(K)||(K={match:K}),K.include)throw new Error("Matching rules cannot also include states");var oe={defaultType:M,lineBreaks:!!K.error||!!K.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var pe in K)f.call(K,pe)&&(oe[pe]=K[pe]);if(typeof oe.type=="string"&&M!==oe.type)throw new Error("Type transform cannot be a string (type '"+oe.type+"' for token '"+M+"')");var Ae=oe.match;return oe.match=Array.isArray(Ae)?Ae:Ae?[Ae]:[],oe.match.sort(function(we,Ye){return _(we)&&_(Ye)?0:_(Ye)?-1:_(we)?1:Ye.length-we.length}),oe}function Ut(M){return Array.isArray(M)?gt(M):ie(M)}var hi=Nt("error",{lineBreaks:!0,shouldThrow:!0});function Qi(M,K){for(var oe=null,pe=Object.create(null),Ae=!0,we=null,Ye=[],kt=[],rt=0;rt<M.length;rt++)M[rt].fallback&&(Ae=!1);for(var rt=0;rt<M.length;rt++){var Ce=M[rt];if(Ce.include)throw new Error("Inheritance is not allowed in stateless lexers");if(Ce.error||Ce.fallback){if(oe)throw!Ce.fallback==!oe.fallback?new Error("Multiple "+(Ce.fallback?"fallback":"error")+" rules not allowed (for token '"+Ce.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+Ce.defaultType+"')");oe=Ce}var Lt=Ce.match.slice();if(Ae)for(;Lt.length&&typeof Lt[0]=="string"&&Lt[0].length===1;){var hr=Lt.shift();pe[hr.charCodeAt(0)]=Ce}if(Ce.pop||Ce.push||Ce.next){if(!K)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+Ce.defaultType+"')");if(Ce.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+Ce.defaultType+"')")}if(Lt.length!==0){Ae=!1,Ye.push(Ce);for(var ma=0;ma<Lt.length;ma++){var Rn=Lt[ma];if(_(Rn)){if(we===null)we=Rn.unicode;else if(we!==Rn.unicode&&Ce.fallback===!1)throw new Error("If one rule is /u then all must be")}}var pr=H(Lt.map(he)),Ji=new RegExp(pr);if(Ji.test(""))throw new Error("RegExp matches empty string: "+Ji);var ls=I(pr);if(ls>0)throw new Error("RegExp has capture groups: "+Ji+` Use (?: … ) instead`);if(!Ce.lineBreaks&&Ji.test(` `))throw new Error("Rule should declare lineBreaks: "+Ji);kt.push(R(pr))}}var mr=oe&&oe.fallback,cs=b&&!mr?"ym":"gm",Wo=b||mr?"":"|";we===!0&&(cs+="u");var Y6=new RegExp(H(kt)+Wo,cs);return{regexp:Y6,groups:Ye,fast:pe,error:oe||hi}}function cn(M){var K=Qi(Ut(M));return new Tt({start:K},"start")}function Va(M,K,oe){var pe=M&&(M.push||M.next);if(pe&&!oe[pe])throw new Error("Missing state '"+pe+"' (in token '"+M.defaultType+"' of state '"+K+"')");if(M&&M.pop&&+M.pop!=1)throw new Error("pop must be 1 (in token '"+M.defaultType+"' of state '"+K+"')")}function za(M,K){var oe=M.$all?Ut(M.$all):[];delete M.$all;var pe=Object.getOwnPropertyNames(M);K||(K=pe[0]);for(var Ae=Object.create(null),we=0;we<pe.length;we++){var Ye=pe[we];Ae[Ye]=Ut(M[Ye]).concat(oe)}for(var we=0;we<pe.length;we++)for(var Ye=pe[we],kt=Ae[Ye],rt=Object.create(null),Ce=0;Ce<kt.length;Ce++){var Lt=kt[Ce];if(Lt.include){var hr=[Ce,1];if(Lt.include!==Ye&&!rt[Lt.include]){rt[Lt.include]=!0;var ma=Ae[Lt.include];if(!ma)throw new Error("Cannot include nonexistent state '"+Lt.include+"' (in state '"+Ye+"')");for(var Rn=0;Rn<ma.length;Rn++){var pr=ma[Rn];kt.indexOf(pr)===-1&&hr.push(pr)}}kt.splice.apply(kt,hr),Ce--}}for(var Ji=Object.create(null),we=0;we<pe.length;we++){var Ye=pe[we];Ji[Ye]=Qi(Ae[Ye],!0)}for(var we=0;we<pe.length;we++){for(var ls=pe[we],mr=Ji[ls],cs=mr.groups,Ce=0;Ce<cs.length;Ce++)Va(cs[Ce],ls,Ji);for(var Wo=Object.getOwnPropertyNames(mr.fast),Ce=0;Ce<Wo.length;Ce++)Va(mr.fast[Wo[Ce]],ls,Ji)}return new Tt(Ji,K)}function ja(M){for(var K=typeof Map<"u",oe=K?new Map:Object.create(null),pe=Object.getOwnPropertyNames(M),Ae=0;Ae<pe.length;Ae++){var we=pe[Ae],Ye=M[we],kt=Array.isArray(Ye)?Ye:[Ye];kt.forEach(function(rt){if(typeof rt!="string")throw new Error("keyword must be string (in keyword '"+we+"')");K?oe.set(rt,we):oe[rt]=we})}return function(rt){return K?oe.get(rt):oe[rt]}}var Tt=function(M,K){this.startState=K,this.states=M,this.buffer="",this.stack=[],this.reset()};Tt.prototype.reset=function(M,K){return this.buffer=M||"",this.index=0,this.line=K?K.line:1,this.col=K?K.col:1,this.queuedToken=K?K.queuedToken:null,this.queuedText=K?K.queuedText:"",this.queuedThrow=K?K.queuedThrow:null,this.setState(K?K.state:this.startState),this.stack=K&&K.stack?K.stack.slice():[],this},Tt.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},Tt.prototype.setState=function(M){if(!(!M||this.state===M)){this.state=M;var K=this.states[M];this.groups=K.groups,this.error=K.error,this.re=K.regexp,this.fast=K.fast}},Tt.prototype.popState=function(){this.setState(this.stack.pop())},Tt.prototype.pushState=function(M){this.stack.push(this.state),this.setState(M)};var Go=b?function(M,K){return M.exec(K)}:function(M,K){var oe=M.exec(K);return oe[0].length===0?null:oe};Tt.prototype._getGroup=function(M){for(var K=this.groups.length,oe=0;oe<K;oe++)if(M[oe+1]!==void 0)return this.groups[oe];throw new Error("Cannot find token type for matched text")};function qo(){return this.value}if(Tt.prototype.next=function(){var M=this.index;if(this.queuedGroup){var K=this._token(this.queuedGroup,this.queuedText,M);return this.queuedGroup=null,this.queuedText="",K}var oe=this.buffer;if(M!==oe.length){var Ye=this.fast[oe.charCodeAt(M)];if(Ye)return this._token(Ye,oe.charAt(M),M);var pe=this.re;pe.lastIndex=M;var Ae=Go(pe,oe),we=this.error;if(Ae==null)return this._token(we,oe.slice(M,oe.length),M);var Ye=this._getGroup(Ae),kt=Ae[0];return we.fallback&&Ae.index!==M?(this.queuedGroup=Ye,this.queuedText=kt,this._token(we,oe.slice(M,Ae.index),M)):this._token(Ye,kt,M)}},Tt.prototype._token=function(M,K,oe){var pe=0;if(M.lineBreaks){var Ae=/\n/g,we=1;if(K===` `)pe=1;else for(;Ae.exec(K);)pe++,we=Ae.lastIndex}var Ye={type:typeof M.type=="function"&&M.type(K)||M.defaultType,value:typeof M.value=="function"?M.value(K):K,text:K,toString:qo,offset:oe,lineBreaks:pe,line:this.line,col:this.col},kt=K.length;if(this.index+=kt,this.line+=pe,pe!==0?this.col=kt-we+1:this.col+=kt,M.shouldThrow){var rt=new Error(this.formatError(Ye,"invalid syntax"));throw rt}return M.pop?this.popState():M.push?this.pushState(M.push):M.next&&this.setState(M.next),Ye},typeof Symbol<"u"&&Symbol.iterator){var Ba=function(M){this.lexer=M};Ba.prototype.next=function(){var M=this.lexer.next();return{value:M,done:!M}},Ba.prototype[Symbol.iterator]=function(){return this},Tt.prototype[Symbol.iterator]=function(){return new Ba(this)}}return Tt.prototype.formatError=function(pe,K){if(pe==null)var oe=this.buffer.slice(this.index),pe={text:oe,offset:this.index,lineBreaks:oe.indexOf(` `)===-1?0:1,line:this.line,col:this.col};var Ae=2,we=Math.max(pe.line-Ae,1),Ye=pe.line+Ae,kt=String(Ye).length,rt=$e(this.buffer,this.line-pe.line+Ae+1).slice(0,5),Ce=[];Ce.push(K+" at line "+pe.line+" col "+pe.col+":"),Ce.push("");for(var Lt=0;Lt<rt.length;Lt++){var hr=rt[Lt],ma=we+Lt;Ce.push(ke(String(ma),kt)+" "+hr),ma===pe.line&&Ce.push(ke("",kt+pe.col+1)+"^")}return Ce.join(` `)},Tt.prototype.clone=function(){return new Tt(this.states,this.state)},Tt.prototype.has=function(M){return!0},{compile:cn,states:za,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:ja}})})(nf);var g6=nf.exports;(function(p){var f=Dd&&Dd.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(p,"__esModule",{value:!0}),p.lexer=p.states=void 0;let y=f(g6);p.states={body:{doubleapos:{match:"''",value:()=>"'"},quoted:{lineBreaks:!0,match:/'[{}#](?:[^]*?[^'])?'(?!')/u,value:b=>b.slice(1,-1).replace(/''/g,"'")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:b=>b.substring(1).trim()},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:b=>b.split(",")[1].trim()},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:b=>b.split(",")[1].trim()},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:b=>b.substring(1).trim()},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:b=>b.split(":")[1].trim()},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:b=>b.substring(0,b.indexOf("{")).trim()},end:{match:/\s*\}/u,pop:1}}},p.lexer=y.default.states(p.states)})(af),Object.defineProperty(ss,"__esModule",{value:!0});var rf=ss.parse=ss.ParseError=void 0;let sf=af,Bo=p=>({offset:p.offset,line:p.line,col:p.col,text:p.text,lineBreaks:p.lineBreaks}),Id=p=>p==="plural"||p==="select"||p==="selectordinal";function v6(p,f){let y="",b="";for(let _ of f){let S=_.ctx.text;switch(b+=S,_.type){case"content":y+=_.value;break;case"argument":case"function":case"octothorpe":y+=S;break;default:throw new Wt(p,`Unsupported part in strict mode function arg style: ${S}`)}}return[{type:"content",value:y.trim(),ctx:Object.assign({},f[0].ctx,{text:b})}]}let y6=["number","date","time","spellout","ordinal","duration"],of=["zero","one","two","few","many","other"];class Wt extends Error{constructor(f,y){super(sf.lexer.formatError(f,y))}}ss.ParseError=Wt;class b6{constructor(f,y){var b,_,S,C;this.lexer=sf.lexer.reset(f),this.cardinalKeys=(b=y==null?void 0:y.cardinal)!==null&&b!==void 0?b:of,this.ordinalKeys=(_=y==null?void 0:y.ordinal)!==null&&_!==void 0?_:of,this.strict=(S=y==null?void 0:y.strict)!==null&&S!==void 0?S:!1,this.strictPluralKeys=(C=y==null?void 0:y.strictPluralKeys)!==null&&C!==void 0?C:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(f,y,b){if(b[0]==="="){if(y==="select")throw new Wt(f,`The case ${b} is not valid with select`)}else if(y!=="select"){let _=y==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&_.length>0&&!_.includes(b)){let S=`The ${y} case ${b} is not valid in this locale`;throw new Wt(f,S)}}}parseSelect(f,y,b,_){let{value:S}=f,C={type:_,arg:S,cases:[],ctx:b};_==="plural"||_==="selectordinal"?y=!0:this.strict&&(y=!1);for(let I of this.lexer)switch(I.type){case"offset":if(_==="select")throw new Wt(I,"Unexpected plural offset for select");if(C.cases.length>0)throw new Wt(I,"Plural offset must be set before cases");C.pluralOffset=Number(I.value),b.text+=I.text,b.lineBreaks+=I.lineBreaks;break;case"case":{this.checkSelectKey(I,_,I.value),C.cases.push({key:I.value,tokens:this.parseBody(y),ctx:Bo(I)});break}case"end":return C;default:throw new Wt(I,`Unexpected lexer token: ${I.type}`)}throw new Wt(null,"Unexpected message end")}parseArgToken(f,y){let b=Bo(f),_=this.lexer.next();if(!_)throw new Wt(null,"Unexpected message end");if(b.text+=_.text,b.lineBreaks+=_.lineBreaks,this.strict&&(_.type==="func-simple"||_.type==="func-args")&&!y6.includes(_.value)){let S=`Invalid strict mode function arg type: ${_.value}`;throw new Wt(f,S)}switch(_.type){case"end":return{type:"argument",arg:f.value,ctx:b};case"func-simple":{let S=this.lexer.next();if(!S)throw new Wt(null,"Unexpected message end");if(S.type!=="end")throw new Wt(S,`Unexpected lexer token: ${S.type}`);if(b.text+=S.text,Id(_.value.toLowerCase()))throw new Wt(_,`Invalid type identifier: ${_.value}`);return{type:"function",arg:f.value,key:_.value,ctx:b}}case"func-args":{if(Id(_.value.toLowerCase())){let C=`Invalid type identifier: ${_.value}`;throw new Wt(_,C)}let S=this.parseBody(this.strict?!1:y);return this.strict&&S.length>0&&(S=v6(f,S)),{type:"function",arg:f.value,key:_.value,param:S,ctx:b}}case"select":if(Id(_.value))return this.parseSelect(f,y,b,_.value);throw new Wt(_,`Unexpected select type ${_.value}`);default:throw new Wt(_,`Unexpected lexer token: ${_.type}`)}}parseBody(f,y){let b=[],_=null;for(let S of this.lexer)if(S.type==="argument")_&&(_=null),b.push(this.parseArgToken(S,f));else if(S.type==="octothorpe"&&f)_&&(_=null),b.push({type:"octothorpe",ctx:Bo(S)});else{if(S.type==="end"&&!y)return b;{let C=S.value;if(!f&&S.type==="quoted"&&C[0]==="#"){if(C.includes("{")){let I=`Unsupported escape pattern: ${C}`;throw new Wt(S,I)}C=S.text}_?(_.value+=C,_.ctx.text+=S.text,_.ctx.lineBreaks+=S.lineBreaks):(_={type:"content",value:C,ctx:Bo(S)},b.push(_))}}if(y)return b;throw new Wt(null,"Unexpected message end")}}function _6(p){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new b6(p,f).parse()}rf=ss.parse=_6;function os(p){return os[p]||(os[p]=new Intl.NumberFormat(p))}function x6(p,f,y){return os(p).format(f-y)}function w6(p,f,y,b){var _=f-y;if(isNaN(_))throw new Error("`"+b+"` or its offset is not a number");return os(p).format(_)}function k6(p,f,y,b,_){if({}.hasOwnProperty.call(b,p))return b[p];f&&(p-=f);var S=y(p,_);return S in b?b[S]:b.other}function S6(p,f){return{}.hasOwnProperty.call(f,p)?f[p]:f.other}function E6(p,f){for(var y=0;y<p.length;++y)if(!f||f[p[y]]===void 0)throw new Error("Message requires argument '".concat(p[y],"'"))}var C6=Object.freeze({__proto__:null,_nf:os,number:x6,plural:k6,reqArgs:E6,select:S6,strictNumber:w6});function D6(p,f,y){var b={day:"numeric",month:"short",year:"numeric"};switch(y){case"full":b.weekday="long";case"long":b.month="long";break;case"short":b.month="numeric"}return new Date(p).toLocaleDateString(f,b)}function I6(p){if(typeof p!="number"&&(p=Number(p)),!isFinite(p))return String(p);var f="";p<0?(f="-",p=Math.abs(p)):p=Number(p);var y=p%60,b=[Math.round(y)===y?y:y.toFixed(3)];p<60?b.unshift(0):(p=Math.round((p-Number(b[0]))/60),b.unshift(p%60),p>=60&&(p=Math.round((p-Number(b[0]))/60),b.unshift(p)));var _=b.shift();return f+_+":"+b.map(function(S){return Number(S)<10?"0"+String(S):String(S)}).join(":")}var Ad={};function Ho(p,f){var y=String(p)+JSON.stringify(f);return Ad[y]||(Ad[y]=new Intl.NumberFormat(p,f)),Ad[y]}function A6(p,f,y,b){var _=y&&y.split(":")||[],S=_[0],C=_[1],I={integer:{maximumFractionDigits:0},percent:{style:"percent"},currency:{style:"currency",currency:C&&C.trim()||b,minimumFractionDigits:2,maximumFractionDigits:2}};return Ho(f,I[S]||{}).format(p)}var T6=function(p,f,y){return Ho(f,{style:"currency",currency:y,minimumFractionDigits:2,maximumFractionDigits:2}).format(p)},O6=function(p,f){return Ho(f,{maximumFractionDigits:0}).format(p)},N6=function(p,f){return Ho(f,{style:"percent"}).format(p)};function R6(p,f,y){var b={second:"numeric",minute:"numeric",hour:"numeric"};switch(y){case"full":case"long":b.timeZoneName="short";break;case"short":delete b.second}return new Date(p).toLocaleTimeString(f,b)}var Td=Object.freeze({__proto__:null,date:D6,duration:I6,numberCurrency:T6,numberFmt:A6,numberInteger:O6,numberPercent:N6,time:R6}),M6={ES3:{break:!0,continue:!0,delete:!0,else:!0,for:!0,function:!0,if:!0,in:!0,new:!0,return:!0,this:!0,typeof:!0,var:!0,void:!0,while:!0,with:!0,case:!0,catch:!0,default:!0,do:!0,finally:!0,instanceof:!0,switch:!0,throw:!0,try:!0},ESnext:{await:!0,debugger:!0,class:!0,enum:!0,extends:!0,super:!0,const:!0,export:!0,import:!0,null:!0,true:!0,false:!0,implements:!0,let:!0,private:!0,public:!0,yield:!0,interface:!0,package:!0,protected:!0,static:!0}},Od=f6(M6);function P6(p){let f=0;for(let y=0;y<p.length;++y){let b=p.charCodeAt(y);f=(f<<5)-f+b,f|=0}return f}function ln(p,f){f&&(p+=" "+P6(p).toString(36));let y=p.trim().replace(/\W+/g,"_");return Od.ES3[y]||Od.ESnext[y]||/^\d/.test(y)?"_"+y:y}function Nd(p,f){if(/^[A-Z_$][0-9A-Z_$]*$/i.test(f)&&!Od.ES3[f])return p?p+"."+f:f;{let y=JSON.stringify(f);return p?p+"["+y+"]":y}}var F6=["ar","ckb","fa","he","ks($|[^bfh])","lrc","mzn","pa-Arab","ps","ug","ur","uz-Arab","yi"],L6=new RegExp("^"+F6.join("|^"));function V6(p,f){var y=L6.test(f),b=JSON.stringify(y?"‏":"‎");return"".concat(b," + ").concat(p," + ").concat(b)}var z6="@messageformat/runtime",j6="@messageformat/runtime/lib/cardinals",lf="@messageformat/runtime/lib/plurals",B6="@messageformat/runtime/lib/formatters",H6=function(){function p(f){this.arguments=[],this.runtime={},this.options=f}return p.prototype.compile=function(f,y,b){var _,S,C=this,I=this.options,R=I.localeCodeFromKey,H=I.requireAllArguments,he=I.strict,ke=I.strictPluralKeys;if(typeof f=="object"){var $e={};try{for(var ie=i(Object.keys(f)),gt=ie.next();!gt.done;gt=ie.next()){var Nt=gt.value,Ut=R?R(Nt):Nt,hi=b&&Ut&&b[Ut]||y;$e[Nt]=this.compile(f[Nt],hi,b)}}catch(Tt){_={error:Tt}}finally{try{gt&&!gt.done&&(S=ie.return)&&S.call(ie)}finally{if(_)throw _.error}}return $e}this.plural=y;var Qi={cardinal:y.cardinals,ordinal:y.ordinals,strict:he,strictPluralKeys:ke};this.arguments=[];var cn=rf(f,Qi).map(function(Tt){return C.token(Tt,null)}),Va=this.arguments.length>0,za=this.concatenate(cn,!0);if(H&&Va){this.setRuntimeFn("reqArgs");var ja=JSON.stringify(this.arguments);return"(d) => { reqArgs(".concat(ja,", d); return ").concat(za,"; }")}return"(".concat(Va?"d":"",") => ").concat(za)},p.prototype.cases=function(f,y){var b=this,_=!0,S=f.cases.map(function(he){var ke=he.key,$e=he.tokens;ke==="other"&&(_=!1);var ie=$e.map(function(gt){return b.token(gt,y)});return"".concat(Nd(null,ke.replace(/^=/,"")),": ").concat(b.concatenate(ie,!1))});if(_){var C=f.type,I=this.plural,R=I.cardinals,H=I.ordinals;if(C==="select"||C==="plural"&&R.includes("other")||C==="selectordinal"&&H.includes("other"))throw new Error("No 'other' form found in ".concat(JSON.stringify(f)))}return"{ ".concat(S.join(", ")," }")},p.prototype.concatenate=function(f,y){var b=this.options.returnType==="values";return b&&(y||f.length>1)?"["+f.join(", ")+"]":f.join(" + ")||'""'},p.prototype.token=function(f,y){if(f.type==="content")return JSON.stringify(f.value);var b=this.plural,_=b.id,S=b.lc,C,I;switch("arg"in f?(this.arguments.push(f.arg),C=[Nd("d",f.arg)]):C=[],f.type){case"argument":return this.options.biDiSupport?V6(String(C[0]),S):String(C[0]);case"select":I="select",y&&this.options.strict&&(y=null),C.push(this.cases(f,y)),this.setRuntimeFn("select");break;case"selectordinal":I="plural",C.push(f.pluralOffset||0,_,this.cases(f,f),1),this.setLocale(_,!0),this.setRuntimeFn("plural");break;case"plural":I="plural",C.push(f.pluralOffset||0,_,this.cases(f,f)),this.setLocale(_,!1),this.setRuntimeFn("plural");break;case"function":{var R=this.options.customFormatters[f.key],H=R&&"module"in R&&typeof R.module=="function";if(!R){if(f.key==="date"){I=this.setDateFormatter(f,C,y);break}else if(f.key==="number"){I=this.setNumberFormatter(f,C,y);break}}if(C.push(JSON.stringify(this.plural.locale)),f.param){y&&this.options.strict&&(y=null);var he=this.getFormatterArg(f,y);he&&C.push(he)}I=H?ln("".concat(f.key,"__").concat(this.plural.locale)):f.key,this.setFormatter(I,f.key);break}case"octothorpe":if(!y)return'"#"';C=[JSON.stringify(this.plural.locale),Nd("d",y.arg),y.pluralOffset||0],this.options.strict?(I="strictNumber",C.push(JSON.stringify(y.arg)),this.setRuntimeFn("strictNumber")):(I="number",this.setRuntimeFn("number"));break}if(!I)throw new Error("Parser error for token "+JSON.stringify(f));return"".concat(I,"(").concat(C.join(", "),")")},p.prototype.runtimeIncludes=function(f,y){if(ln(f)!==f)throw new SyntaxError("Reserved word used as ".concat(y," identifier: ").concat(f));var b=this.runtime[f];if(!b||b.type===y)return b;throw new TypeError("Cannot override ".concat(b.type," runtime function as ").concat(y,": ").concat(f))},p.prototype.setLocale=function(f,y){var b=this.runtimeIncludes(f,"locale"),_=this.plural,S=_.getCardinal,C=_.getPlural,I=_.isDefault,R,H,he;if(!y&&I&&S){if(b)return;R=function(ke){return S(ke)},H=j6,he=function(){return String(S)}}else{if(b&&(!I||b.module===lf))return;R=function(ke,$e){return C(ke,$e)},H=I?lf:C.module||null,he=function(){return String(C)}}this.runtime[f]=Object.assign(R,{id:f,module:H,toString:he,type:"locale"})},p.prototype.setRuntimeFn=function(f){this.runtimeIncludes(f,"runtime")||(this.runtime[f]=Object.assign(C6[f],{id:f,module:z6,type:"runtime"}))},p.prototype.getFormatterArg=function(f,y){var b,_,S,C,I=this,R=f.key,H=f.param,he=this.options.customFormatters[R]||cf(R)&&Td[R];if(!he||!H)return null;var ke="arg"in he&&he.arg||"string";if(ke==="options"){var $e="";try{for(var ie=i(H),gt=ie.next();!gt.done;gt=ie.next()){var Nt=gt.value;if(Nt.type==="content")$e+=Nt.value;else throw new SyntaxError("Expected literal options for ".concat(R," formatter"))}}catch(Ba){b={error:Ba}}finally{try{gt&&!gt.done&&(_=ie.return)&&_.call(ie)}finally{if(b)throw b.error}}var Ut={};try{for(var hi=i($e.split(",")),Qi=hi.next();!Qi.done;Qi=hi.next()){var cn=Qi.value,Va=cn.indexOf(":");if(Va===-1)Ut[cn.trim()]=null;else{var za=cn.substring(0,Va).trim(),ja=cn.substring(Va+1).trim();if(ja==="true")Ut[za]=!0;else if(ja==="false")Ut[za]=!1;else if(ja==="null")Ut[za]=null;else{var Tt=Number(ja);Ut[za]=Number.isFinite(Tt)?Tt:ja}}}}catch(Ba){S={error:Ba}}finally{try{Qi&&!Qi.done&&(C=hi.return)&&C.call(hi)}finally{if(S)throw S.error}}return JSON.stringify(Ut)}else{var Go=H.map(function(Ba){return I.token(Ba,y)});if(ke==="raw")return"[".concat(Go.join(", "),"]");var qo=Go.join(" + ");return qo?"(".concat(qo,").trim()"):'""'}},p.prototype.setFormatter=function(f,y){if(!this.runtimeIncludes(f,"formatter")){var b=this.options.customFormatters[y||f];if(b){var _=typeof b=="function"?{formatter:b}:b;this.runtime[f]=Object.assign(_.formatter.bind({}),n(n({},_.formatter.prototype),{toString:function(){return String(_.formatter)}}),{type:"formatter"},"module"in b&&b.module&&b.id?{id:ln(b.id),module:typeof b.module=="function"?b.module(this.plural.locale):b.module}:{id:null,module:null})}else if(cf(f))this.runtime[f]=Object.assign(Td[f],{type:"formatter"},{id:f,module:B6});else throw new Error("Formatting function not found: ".concat(f))}},p.prototype.setDateFormatter=function(f,y,b){var _=this,S=f.param,C=this.plural.locale,I=S&&S.length===1&&S[0];if(I&&I.type==="content"&&/^\s*::/.test(I.value)){var R=I.value.trim().substr(2),H=ln("date_".concat(C,"_").concat(R),!0);if(!this.runtimeIncludes(H,"formatter")){var he=ei(C,R,this.options.timeZone);this.runtime[H]=Object.assign(he,{id:H,module:null,toString:function(){return Kt(C,R,_.options.timeZone)},type:"formatter"})}return H}if(y.push(JSON.stringify(C)),S&&S.length>0){b&&this.options.strict&&(b=null);var ke=S.map(function($e){return _.token($e,b)});y.push("("+(ke.join(" + ")||'""')+").trim()")}return this.setFormatter("date"),"date"},p.prototype.setNumberFormatter=function(f,y,b){var _=this,S=f.param,C=this.plural.locale;if(!S||S.length===0)return y.unshift(JSON.stringify(C)),y.push("0"),this.setRuntimeFn("number"),"number";if(y.push(JSON.stringify(C)),S.length===1&&S[0].type==="content"){var I=S[0].value.trim();switch(I){case"currency":return y.push(JSON.stringify(this.options.currency)),this.setFormatter("numberCurrency"),"numberCurrency";case"integer":return this.setFormatter("numberInteger"),"numberInteger";case"percent":return this.setFormatter("numberPercent"),"numberPercent"}var R=I.match(/^currency:([A-Z]+)$/);if(R)return y.push(JSON.stringify(R[1])),this.setFormatter("numberCurrency"),"numberCurrency";var H=ln("number_".concat(C,"_").concat(I),!0);if(!this.runtimeIncludes(H,"formatter")){var he=this.options.currency,ke=p6(C,I,he);this.runtime[H]=Object.assign(ke,{id:null,module:null,toString:function(){return m6(C,I,he)},type:"formatter"})}return H}b&&this.options.strict&&(b=null);var $e=S.map(function(ie){return _.token(ie,b)});return y.push("("+($e.join(" + ")||'""')+").trim()"),y.push(JSON.stringify(this.options.currency)),this.setFormatter("numberFmt"),"numberFmt"},p}();function cf(p){return p in Td}let U=p=>p==1?"one":"other",Ra=p=>p==0||p==1?"one":"other",ha=p=>p>=0&&p<=1?"one":"other",Xt=p=>{let f=String(p).split("."),y=!f[1];return p==1&&y?"one":"other"},Xe=p=>"other",Ma=p=>p==1?"one":p==2?"two":"o