-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path5d086492.a3271e79.js
1 lines (1 loc) · 65.1 KB
/
5d086492.a3271e79.js
1
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8103],{2054:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>f,contentTitle:()=>p,default:()=>b,frontMatter:()=>m,metadata:()=>n,toc:()=>g});const n=JSON.parse('{"id":"core-concepts/icu-syntax","title":"Message Syntax","description":"If you are translating text you\'ll need a way for your translators to express the subtleties of spelling, grammar, and conjugation inherent in each language. We use the ICU Message syntax which is also used in Java and PHP.","source":"@site/docs/core-concepts/icu-syntax.mdx","sourceDirName":"core-concepts","slug":"/core-concepts/icu-syntax","permalink":"/docs/core-concepts/icu-syntax","draft":false,"unlisted":false,"editUrl":"https://github.com/formatjs/formatjs/edit/main/website/docs/core-concepts/icu-syntax.mdx","tags":[],"version":"current","lastUpdatedBy":"renovate[bot]","lastUpdatedAt":1742906182000,"frontMatter":{"id":"icu-syntax","title":"Message Syntax"},"sidebar":"docs","previous":{"title":"Basic Internationalization Principles","permalink":"/docs/core-concepts/basic-internationalization-principles"}}');var r=s(6106),i=s(7389),o=s(7378),a=s(4079);const h="label_nUUl",l="textarea_ImEU",c="wFull_k1Tu",u="form_cu45",d=e=>{let{defaultMessage:t,defaultValues:s}=e;const n=(0,o.useRef)(null),[i,d]=(0,o.useState)(t||""),[m,p]=(0,o.useState)(s||"{}"),[f,g]=(0,o.useState)(!1),[E,b]=(0,o.useState)(""),x=(0,o.useId)(),y=(0,o.useId)(),T=(0,o.useId)();(0,o.useEffect)((()=>{try{let t={};try{t=JSON.parse(m)}catch(e){}const s=new a.Ay(i).format(t);g(!1),b(s)}catch(e){e instanceof Error&&(b(e.message),g(!0))}}),[m,i]);return(0,o.useEffect)((()=>{n?.current&&(n.current.style.height="auto",n.current.style.height=n.current.scrollHeight+"px")}),[i]),(0,r.jsxs)("form",{className:u,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:x,className:h,children:"ICU Message"}),(0,r.jsx)("pre",{children:(0,r.jsx)("textarea",{className:l,id:x,onChange:e=>d(e.target.value),value:i,ref:n})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:y,className:h,children:"Values as JSON"}),(0,r.jsx)("pre",{children:(0,r.jsx)("input",{className:c,id:y,type:"text",onChange:e=>p(e.target.value),value:m})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:T,className:h,children:"Result"}),(0,r.jsxs)("pre",{children:[(0,r.jsx)("input",{id:T,type:"text",value:E,readOnly:!0,disabled:!0,className:c}),f&&(0,r.jsx)("p",{children:f})]})]})]})},m={id:"icu-syntax",title:"Message Syntax"},p=void 0,f={},g=[{value:"Basic Principles",id:"basic-principles",level:2},{value:"Simple Argument",id:"simple-argument",level:2},{value:"Formatted Argument",id:"formatted-argument",level:2},{value:"<code>number</code> Type",id:"number-type",level:3},{value:"<code>date</code> Type",id:"date-type",level:3},{value:"<code>time</code> Type",id:"time-type",level:3},{value:"Supported DateTime Skeleton",id:"supported-datetime-skeleton",level:3},{value:"<code>{select}</code> Format",id:"select-format",level:3},{value:"<code>{plural}</code> Format",id:"plural-format",level:3},{value:"<code>{selectordinal}</code> Format",id:"selectordinal-format",level:3},{value:"Rich Text Formatting",id:"rich-text-formatting",level:2},{value:"Quoting / Escaping",id:"quoting--escaping",level:2}];function E(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["If you are translating text you'll need a way for your translators to express the subtleties of spelling, grammar, and conjugation inherent in each language. We use the ",(0,r.jsx)(t.a,{href:"https://unicode-org.github.io/icu/userguide/format_parse/messages",children:"ICU Message syntax"})," which is also used in Java and PHP."]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.a,{href:"/docs/intl-messageformat",children:(0,r.jsx)(t.code,{children:"intl-messageformat"})})," library takes the message and input data and creates an appropriately formatted string. This feature is included with all of the integrations we provide."]}),"\n",(0,r.jsx)(t.p,{children:"The following sections describe the ICU Message syntax and show how to use this features provided the FormatJS libraries:"}),"\n",(0,r.jsx)(t.h2,{id:"basic-principles",children:"Basic Principles"}),"\n",(0,r.jsx)(t.p,{children:"The simplest transform for the message is a literal string."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-html",children:"Hello everyone\n"})}),"\n",(0,r.jsxs)(t.p,{children:['All other transforms are done using replacements called "arguments". They are enclosed in curly braces (',(0,r.jsx)(t.code,{children:"{"})," and ",(0,r.jsx)(t.code,{children:"}"}),") and refer to a value in the input data."]}),"\n",(0,r.jsx)(t.h2,{id:"simple-argument",children:"Simple Argument"}),"\n",(0,r.jsxs)(t.p,{children:["You can use a ",(0,r.jsx)(t.code,{children:"{key}"})," argument for placing a value into the message. The key is looked up in the input data, and the string is interpolated with its value."]}),"\n",(0,r.jsx)(d,{defaultMessage:"Hello {who}",defaultValues:'{"who": "Minh"}'}),"\n",(0,r.jsx)(t.h2,{id:"formatted-argument",children:"Formatted Argument"}),"\n",(0,r.jsxs)(t.p,{children:["Values can also be formatted based on their type. You use a ",(0,r.jsx)(t.code,{children:"{key, type, format}"})," argument to do that."]}),"\n",(0,r.jsx)(t.p,{children:"The elements of the argument are:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"key"})," is where in the input data to find the data"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"type"})," is optional, and is how to interpret the value (see below)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"format"})," is optional, and is a further refinement on how to display that type of data"]}),"\n"]}),"\n",(0,r.jsx)(d,{defaultMessage:"I have {numCats, number} cats.",defaultValues:'{"numCats": 3}'}),"\n",(0,r.jsxs)(t.h3,{id:"number-type",children:[(0,r.jsx)(t.code,{children:"number"})," Type"]}),"\n",(0,r.jsxs)(t.p,{children:["This type is used to format numbers in a way that is sensitive to the locale. It understands the following values for the optional ",(0,r.jsx)(t.code,{children:"format"})," element of the argument:"]}),"\n",(0,r.jsx)(d,{defaultMessage:"I have {numCats, number} cats.",defaultValues:'{"numCats": 3}'}),"\n",(0,r.jsx)(d,{defaultMessage:"Almost {pctBlack, number, ::percent} of them are black.",defaultValues:'{"pctBlack": 0.33}'}),"\n",(0,r.jsxs)(t.p,{children:["Internally it uses the Intl.NumberFormat API. You can define custom values for the ",(0,r.jsx)(t.code,{children:"format"})," element, which are passed to the Intl.NumberFormat constructor."]}),"\n",(0,r.jsx)(t.p,{children:"Sometimes embedding how the number will be formatted provides great context to translators. We also support ICU Number Skeletons using the same syntax:"}),"\n",(0,r.jsx)(d,{defaultMessage:"The price of this bagel is {num, number, ::sign-always compact-short currency/GBP}",defaultValues:'{"num": 10}'}),"\n",(0,r.jsxs)(t.p,{children:["You can read more about this ",(0,r.jsx)(t.a,{href:"https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html",children:"here"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["For fine control over decimal precision, you can use the Fraction Precision ",(0,r.jsx)(t.code,{children:"#"})," and ",(0,r.jsx)(t.code,{children:"0"})," symbols, which specify the number of decimal places to display:"]}),"\n",(0,r.jsx)(d,{defaultMessage:"The duration is {num, number, ::.##} seconds",defaultValues:'{"num": 123.456789}'}),"\n",(0,r.jsxs)(t.p,{children:["Note that the ",(0,r.jsx)(t.code,{children:"#"})," symbol doesn't render trailing zeroes, as seen in this example:"]}),"\n",(0,r.jsx)(d,{defaultMessage:"The duration is {num, number, ::.##} seconds",defaultValues:'{"num": 123}'}),"\n",(0,r.jsxs)(t.p,{children:["To render trailing zeroes, use the ",(0,r.jsx)(t.code,{children:"0"})," symbol:"]}),"\n",(0,r.jsx)(d,{defaultMessage:"The very precise number is {num, number, ::.00}",defaultValues:'{"num": 123.4}'}),"\n",(0,r.jsxs)(t.p,{children:["For more details, see ",(0,r.jsx)(t.a,{href:"https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision",children:"Fraction Precision"}),"."]}),"\n",(0,r.jsxs)(t.h3,{id:"date-type",children:[(0,r.jsx)(t.code,{children:"date"})," Type"]}),"\n",(0,r.jsx)(t.p,{children:"This type is used to format dates in a way that is sensitive to the locale. It understands the following values for the optional format element of the argument:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"short"})," is used to format dates in the shortest possible way"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"medium"})," is used to format dates with short textual representation of the month"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"long"})," is used to format dates with long textual representation of the month"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"full"})," is used to format dates with the most detail"]}),"\n"]}),"\n",(0,r.jsx)(d,{defaultMessage:"Sale begins {start, date, medium}",defaultValues:'{"start": 1705024329653}'}),"\n",(0,r.jsxs)(t.p,{children:["Internally it uses the ",(0,r.jsx)(t.code,{children:"Intl.DateTimeFormat"})," API. You can define custom values for the format element, which are passed to the ",(0,r.jsx)(t.code,{children:"Intl.DateTimeFormat"})," constructor."]}),"\n",(0,r.jsxs)(t.h3,{id:"time-type",children:[(0,r.jsx)(t.code,{children:"time"})," Type"]}),"\n",(0,r.jsx)(t.p,{children:"This type is used to format times in a way that is sensitive to the locale. It understands the following values for the optional format element of the argument:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"short"})," is used to format times with hours and minutes"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"medium"})," is used to format times with hours, minutes, and seconds"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"long"})," is used to format times with hours, minutes, seconds, and timezone"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"full"})," is the same as long"]}),"\n"]}),"\n",(0,r.jsx)(d,{defaultMessage:"Coupon expires at {expire, time, short}",defaultValues:'{"expire": 1662684029921}'}),"\n",(0,r.jsxs)(t.p,{children:["Internally it uses the ",(0,r.jsx)(t.code,{children:"Intl.DateTimeFormat"})," API. You can define custom values for the format element, which are passed to the ",(0,r.jsx)(t.code,{children:"Intl.DateTimeFormat"})," constructor."]}),"\n",(0,r.jsx)(t.h3,{id:"supported-datetime-skeleton",children:"Supported DateTime Skeleton"}),"\n",(0,r.jsxs)(t.p,{children:["Similar to ",(0,r.jsx)(t.code,{children:"number"})," type, we also support ICU DateTime skeleton. ICU provides a ",(0,r.jsx)(t.a,{href:"https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table",children:"wide array of pattern"})," to customize date time format. However, not all of them are available via ECMA402's Intl API. Therefore, we only support the following patterns"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Symbol"}),(0,r.jsx)(t.th,{children:"Meaning"}),(0,r.jsx)(t.th,{children:"Notes"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"G"}),(0,r.jsx)(t.td,{children:"Era designator"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"y"}),(0,r.jsx)(t.td,{children:"year"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"M"}),(0,r.jsx)(t.td,{children:"month in year"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"L"}),(0,r.jsx)(t.td,{children:"stand-alone month in year"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"d"}),(0,r.jsx)(t.td,{children:"day in month"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"E"}),(0,r.jsx)(t.td,{children:"day of week"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"e"}),(0,r.jsx)(t.td,{children:"local day of week"}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"e..eee"})," is not supported"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"c"}),(0,r.jsx)(t.td,{children:"stand-alone local day of week"}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.code,{children:"c..ccc"})," is not supported"]})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"a"}),(0,r.jsx)(t.td,{children:"AM/PM marker"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"h"}),(0,r.jsx)(t.td,{children:"Hour [1-12]"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"H"}),(0,r.jsx)(t.td,{children:"Hour [0-23]"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"K"}),(0,r.jsx)(t.td,{children:"Hour [0-11]"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"k"}),(0,r.jsx)(t.td,{children:"Hour [1-24]"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"m"}),(0,r.jsx)(t.td,{children:"Minute"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"s"}),(0,r.jsx)(t.td,{children:"Second"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"z"}),(0,r.jsx)(t.td,{children:"Time Zone"}),(0,r.jsx)(t.td,{})]})]})]}),"\n",(0,r.jsxs)(t.h3,{id:"select-format",children:[(0,r.jsx)(t.code,{children:"{select}"})," Format"]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"{key, select, matches}"})," is used to choose output by matching a value to one of many choices. (It is similar to the ",(0,r.jsx)(t.code,{children:"switch"})," statement available in some programming languages.) The key is looked up in the input data. The corresponding value is matched to one of matches and the corresponding output is returned. The ",(0,r.jsx)(t.code,{children:"key"})," argument must follow ",(0,r.jsx)(t.a,{href:"https://www.unicode.org/reports/tr31/tr31-9.html#Pattern_Syntax",children:"Unicode Pattern_Syntax"}),". The ",(0,r.jsx)(t.code,{children:"matches"})," is a space-separated list of ",(0,r.jsx)(t.code,{children:"matches"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The format of a match is match ",(0,r.jsx)(t.code,{children:"{output}"}),". (A match is similar to the case statement of the switch found in some programming languages.) The ",(0,r.jsx)(t.code,{children:"match"})," is a literal value. If it is the same as the value for ",(0,r.jsx)(t.code,{children:"key"})," then the corresponding ",(0,r.jsx)(t.code,{children:"output"})," will be used."]}),"\n",(0,r.jsx)(t.p,{children:"output is itself a message, so it can be a literal string or also have more arguments nested inside of it."}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"other"})," match is special and is used if nothing else matches. (This is similar to the default case of the switch found in some programming languages.)"]}),"\n",(0,r.jsx)(t.admonition,{type:"danger",children:(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"other"})," is required as per ",(0,r.jsx)(t.code,{children:"icu4j"})," implementation. We will throw an error if ",(0,r.jsx)(t.code,{children:"select"})," is used without ",(0,r.jsx)(t.code,{children:"other"}),"."]})}),"\n",(0,r.jsx)(d,{defaultMessage:"{gender, select,\n male {He will respond shortly.}\n female {She will respond shortly.}\n other {They will respond shortly.}\n}",defaultValues:'{"gender": "male"}'}),"\n",(0,r.jsx)(t.p,{children:"Here's an example of nested arguments."}),"\n",(0,r.jsx)(d,{defaultMessage:"{isTaxed, select,\n yes {An additional {tax, number, percent} tax will be collected.}\n other {No taxes apply.}\n}",defaultValues:'{"isTaxed": "yes", "tax": 0.4}'}),"\n",(0,r.jsxs)(t.h3,{id:"plural-format",children:[(0,r.jsx)(t.code,{children:"{plural}"})," Format"]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"{key, plural, matches}"})," is used to choose output based on the pluralization rules of the current locale. It is very similar to the ",(0,r.jsx)(t.code,{children:"{select}"})," format above except that the value is expected to be a number and is mapped to a plural category."]}),"\n",(0,r.jsx)(t.p,{children:"The match is a literal value and is matched to one of these plural categories. Not all languages use all plural categories."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"zero"}),": This category is used for languages that have grammar specialized specifically for zero number of items. (Examples are Arabic and Latvian.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"one"}),": This category is used for languages that have grammar specialized specifically for one (singular) item. Many languages, but not all, use this plural category. (Many popular Asian languages, such as Chinese and Japanese, do not use this category.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"two"}),": This category is used for languages that have grammar specialized specifically for two (dual) items. (Examples are Arabic and Welsh.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"few"}),": This category is used for languages that have grammar specialized specifically for a small number (paucal) of items. For some languages this is used for 2-4 items, for some 3-10 items, and other languages have even more complex rules."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"many"}),": This category is used for languages that have grammar specialized specifically for a larger number of items. (Examples are Arabic, Polish, and Russian.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"other"}),': This category is used if the value doesn\'t match one of the other plural categories. Note that this is used for "plural" for languages (such as English) that have a simple "singular" versus "plural" dichotomy.']}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"=value"}),": This is used to match a specific value regardless of the plural categories of the current locale."]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["Don't use ",(0,r.jsx)(t.code,{children:"=1"})," in place of ",(0,r.jsx)(t.code,{children:"one"}),". ",(0,r.jsx)(t.code,{children:"one"})," doesn't always mean ",(0,r.jsx)(t.code,{children:"1"})," but rather means ",(0,r.jsx)(t.code,{children:"singular"}),", which can match to more than number ",(0,r.jsx)(t.code,{children:"1"})," in certain locales.\nSome locales considered all numbers ends with ",(0,r.jsx)(t.code,{children:"1"})," (like 1, 11, 111) to be ",(0,r.jsx)(t.code,{children:"singular"}),"."]})}),"\n",(0,r.jsx)(t.admonition,{type:"danger",children:(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"other"})," is required as per ",(0,r.jsx)(t.code,{children:"icu4j"})," implementation. We will throw an error if ",(0,r.jsx)(t.code,{children:"plural"})," is used without ",(0,r.jsx)(t.code,{children:"other"}),"."]})}),"\n",(0,r.jsx)(d,{defaultMessage:"{itemCount, plural,\n one {Cart: {itemCount, number} item}\n other {Cart: {itemCount, number} items}\n}",defaultValues:'{"itemCount": 123}'}),"\n",(0,r.jsx)(d,{defaultMessage:"{itemCount, plural,\n =0 {You have no items.}\n one {You have {itemCount, number} item.}\n other {You have {itemCount, number} items.}\n}",defaultValues:'{"itemCount": 123}'}),"\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.code,{children:"output"})," of the match, you can use the ",(0,r.jsx)(t.code,{children:"#"})," special token as a placeholder for the numeric value and it'll be formatted as if it were ",(0,r.jsx)(t.code,{children:"{key, number}"}),". This is the style we prefer to use."]}),"\n",(0,r.jsx)(d,{defaultMessage:"{itemCount, plural,\n =0 {You have no items.}\n one {You have # item.}\n other {You have # items.}\n}",defaultValues:'{"itemCount": 123}'}),"\n",(0,r.jsxs)(t.h3,{id:"selectordinal-format",children:[(0,r.jsx)(t.code,{children:"{selectordinal}"})," Format"]}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"{key, selectordinal, matches}"})," is used to choose output based on the ordinal pluralization rules (1st, 2nd, 3rd, etc.) of the current locale. It is very similar to the {plural} format above except that the value is mapped to an ordinal plural category."]}),"\n",(0,r.jsx)(t.p,{children:"The match is a literal value and is matched to one of these plural categories. Not all languages use all plural categories."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"zero"}),": This category is used for languages that have grammar specialized specifically for zero number of items. (Examples are Arabic and Latvian.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"one"}),": This category is used for languages that have grammar specialized specifically for one item. Many languages, but not all, use this plural category. (Many popular Asian languages, such as Chinese and Japanese, do not use this category.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"two"}),": This category is used for languages that have grammar specialized specifically for two items. (Examples are Arabic and Welsh.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"few"}),": This category is used for languages that have grammar specialized specifically for a small number of items. For some languages this is used for 2-4 items, for some 3-10 items, and other languages have even more complex rules."]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"many"}),": This category is used for languages that have grammar specialized specifically for a larger number of items. (Examples are Arabic, Polish, and Russian.)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"other"}),': This category is used if the value doesn\'t match one of the other plural categories. Note that this is used for "plural" for languages (such as English) that have a simple "singular" versus "plural" dichotomy.']}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"=value"}),": This is used to match a specific value regardless of the plural categories of the current locale."]}),"\n"]}),"\n",(0,r.jsx)(t.admonition,{type:"danger",children:(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"other"})," is required as per ",(0,r.jsx)(t.code,{children:"icu4j"})," implementation. We will throw an error if ",(0,r.jsx)(t.code,{children:"selectordinal"})," is used without ",(0,r.jsx)(t.code,{children:"other"}),"."]})}),"\n",(0,r.jsxs)(t.p,{children:["In the ",(0,r.jsx)(t.code,{children:"output"})," of the match, the ",(0,r.jsx)(t.code,{children:"#"})," special token can be used as a placeholder for the numeric value and will be formatted as if it were ",(0,r.jsx)(t.code,{children:"{key, number}"}),"."]}),"\n",(0,r.jsx)(d,{defaultMessage:"It's my cat's {year, selectordinal,\n one {#st}\n two {#nd}\n few {#rd}\n other {#th}\n} birthday!",defaultValues:'{"year": 2}'}),"\n",(0,r.jsx)(t.h2,{id:"rich-text-formatting",children:"Rich Text Formatting"}),"\n",(0,r.jsxs)(t.p,{children:["We also support embedded rich text formatting in our message using tags. This allows developers to embed as much text as possible so sentences don't have to be broken up into chunks\n",(0,r.jsx)(t.strong,{children:"NOTE: This is not XML/HTML tag"})]}),"\n",(0,r.jsx)(d,{defaultMessage:"Our price is <boldThis>{price, number, ::currency/USD precision-integer}</boldThis>\nwith <link>{pct, number, ::percent} discount</link>",defaultValues:'{"price": 2, "pct": 0.2}'}),"\n",(0,r.jsx)(t.admonition,{title:"Custom Behavior",type:"info",children:(0,r.jsxs)(t.p,{children:["It is expected that the system using embedded rich text formatting will have methods to handle these placeholders external to this library. The tags will be part of the generated output and can either be ",(0,r.jsx)(t.strong,{children:"post-processed"})," by your own tooling or use the ",(0,r.jsx)(t.a,{href:"/docs/intl/#defaultRichTextElements",children:"defaultRichTextElements"})," configuration."]})}),"\n",(0,r.jsx)(t.h2,{id:"quoting--escaping",children:"Quoting / Escaping"}),"\n",(0,r.jsxs)(t.p,{children:["The ASCII apostrophe ",(0,r.jsx)(t.code,{children:"'"})," (U+0027) can be used to escape syntax characters in the text portion of the message, which mimics the ",(0,r.jsx)(t.a,{href:"https://unicode-org.github.io/icu/userguide/format_parse/messages/#quotingescaping",children:"behavior of ICU's quoting/escaping"}),"."]}),"\n",(0,r.jsx)(d,{defaultMessage:"This is not an interpolation: '{word}"}),"\n",(0,r.jsx)(d,{defaultMessage:"These are not interpolations: '{word1} {word2}'"}),"\n",(0,r.jsx)(d,{defaultMessage:"'<notATag>"}),"\n",(0,r.jsx)(d,{defaultMessage:"'<notATag>hello</notATag>'"}),"\n",(0,r.jsxs)(t.p,{children:["Two consecutive ASCII apostrophes represents one ASCII apostrophe, similar to ",(0,r.jsx)(t.code,{children:"%%"})," in ",(0,r.jsx)(t.code,{children:"printf"})," represents one ",(0,r.jsx)(t.code,{children:"%"}),".\nHowever, we recommend using curly apostrophe ",(0,r.jsx)(t.code,{children:"\u2019"})," (U+2019) for human-readable strings and only use ASCII apostrophe ",(0,r.jsx)(t.code,{children:"'"}),"\n(U+0027) in ICU message syntax."]}),"\n",(0,r.jsx)(d,{defaultMessage:"This '{isn''t}' obvious."})]})}function b(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(E,{...e})}):E(e)}},8418:(e,t,s)=>{function n(e,t){const s=t&&t.cache?t.cache:c,n=t&&t.serializer?t.serializer:h;return(t&&t.strategy?t.strategy:a)(e,{cache:s,serializer:n})}function r(e,t,s,n){const r=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:s(n);var i;let o=t.get(r);return void 0===o&&(o=e.call(this,n),t.set(r,o)),o}function i(e,t,s){const n=Array.prototype.slice.call(arguments,3),r=s(n);let i=t.get(r);return void 0===i&&(i=e.apply(this,n),t.set(r,i)),i}function o(e,t,s,n,r){return s.bind(t,e,n,r)}function a(e,t){return o(e,this,1===e.length?r:i,t.cache.create(),t.serializer)}s.d(t,{B:()=>n,W:()=>u});const h=function(){return JSON.stringify(arguments)};class l{constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const c={create:function(){return new l}},u={variadic:function(e,t){return o(e,this,i,t.cache.create(),t.serializer)},monadic:function(e,t){return o(e,this,r,t.cache.create(),t.serializer)}}},6214:(e,t,s)=>{s.r(t),s.d(t,{SKELETON_TYPE:()=>i,TYPE:()=>r,_Parser:()=>ae,createLiteralElement:()=>E,createNumberElement:()=>b,isArgumentElement:()=>a,isDateElement:()=>l,isDateTimeSkeleton:()=>g,isLiteralElement:()=>o,isNumberElement:()=>h,isNumberSkeleton:()=>f,isPluralElement:()=>d,isPoundElement:()=>m,isSelectElement:()=>u,isStructurallySame:()=>re,isTagElement:()=>p,isTimeElement:()=>c,parse:()=>oe});let n=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({}),r=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),i=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function o(e){return e.type===r.literal}function a(e){return e.type===r.argument}function h(e){return e.type===r.number}function l(e){return e.type===r.date}function c(e){return e.type===r.time}function u(e){return e.type===r.select}function d(e){return e.type===r.plural}function m(e){return e.type===r.pound}function p(e){return e.type===r.tag}function f(e){return!(!e||"object"!=typeof e||e.type!==i.number)}function g(e){return!(!e||"object"!=typeof e||e.type!==i.dateTime)}function E(e){return{type:r.literal,value:e}}function b(e,t){return{type:r.number,value:e,style:t}}const x=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,y=/(?:[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 T(e){const t={};return e.replace(y,(e=>{const s=e.length;switch(e[0]){case"G":t.era=4===s?"long":5===s?"narrow":"short";break;case"y":t.year=2===s?"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":t.month=["numeric","2-digit","short","long","narrow"][s-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][s-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===s?"long":5===s?"narrow":"short";break;case"e":if(s<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][s-4];break;case"c":if(s<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][s-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][s-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][s-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][s-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][s-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":t.minute=["numeric","2-digit"][s-1];break;case"s":t.second=["numeric","2-digit"][s-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=s<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) patterns are not supported, use `z` instead")}return""})),t}const j=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;const H=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,B=/^(@+)?(\+|#+)?[rs]?$/g,A=/(\*)(0+)|(#+)(0+)|(0+)/g,v=/^(0+)$/;function _(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(B,(function(e,s,n){return"string"!=typeof n?(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length):"+"===n?t.minimumSignificantDigits=s.length:"#"===s[0]?t.maximumSignificantDigits=s.length:(t.minimumSignificantDigits=s.length,t.maximumSignificantDigits=s.length+("string"==typeof n?n.length:0)),""})),t}function S(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function I(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const s=e.slice(0,2);if("+!"===s?(t.signDisplay="always",e=e.slice(2)):"+?"===s&&(t.signDisplay="exceptZero",e=e.slice(2)),!v.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function P(e){const t=S(e);return t||{}}function N(e){let t={};for(const s of e){switch(s.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=s.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=s.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...s.options.reduce(((e,t)=>({...e,...P(t)})),{})};continue;case"engineering":t={...t,notation:"engineering",...s.options.reduce(((e,t)=>({...e,...P(t)})),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(s.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(s.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");s.options[0].replace(A,(function(e,s,n,r,i,o){if(s)t.minimumIntegerDigits=n.length;else{if(r&&i)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(v.test(s.stem)){t.minimumIntegerDigits=s.stem.length;continue}if(H.test(s.stem)){if(s.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");s.stem.replace(H,(function(e,s,n,r,i,o){return"*"===n?t.minimumFractionDigits=s.length:r&&"#"===r[0]?t.maximumFractionDigits=r.length:i&&o?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+o.length):(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length),""}));const e=s.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,..._(e)});continue}if(B.test(s.stem)){t={...t,..._(s.stem)};continue}const e=S(s.stem);e&&(t={...t,...e});const n=I(s.stem);n&&(t={...t,...n})}return t}const w={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function L(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const s=e.language;let n;"root"!==s&&(n=e.maximize().region);return(w[n||""]||w[s||""]||w[`${s}-001`]||w["001"])[0]}const C=new RegExp(`^${x.source}*`),M=new RegExp(`${x.source}*$`);function R(e,t){return{start:e,end:t}}const U=!!String.prototype.startsWith&&"_a".startsWith("a",1),O=!!String.fromCodePoint,G=!!Object.fromEntries,D=!!String.prototype.codePointAt,k=!!String.prototype.trimStart,F=!!String.prototype.trimEnd,V=!!Number.isSafeInteger?Number.isSafeInteger:e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991;let X=!0;try{const e=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");X="a"===e.exec("a")?.[0]}catch(he){X=!1}const Y=U?function(e,t,s){return e.startsWith(t,s)}:function(e,t,s){return e.slice(s,s+t.length)===t},z=O?String.fromCodePoint:function(){let e,t="",s=arguments.length,n=0;for(;s>n;){var r;if(e=(r=n++)<0||arguments.length<=r?void 0:arguments[r],e>1114111)throw RangeError(e+" is not a valid code point");t+=e<65536?String.fromCharCode(e):String.fromCharCode(55296+((e-=65536)>>10),e%1024+56320)}return t},K=G?Object.fromEntries:function(e){const t={};for(const[s,n]of e)t[s]=n;return t},W=D?function(e,t){return e.codePointAt(t)}:function(e,t){let s=e.length;if(t<0||t>=s)return;let n,r=e.charCodeAt(t);return r<55296||r>56319||t+1===s||(n=e.charCodeAt(t+1))<56320||n>57343?r:n-56320+(r-55296<<10)+65536},$=k?function(e){return e.trimStart()}:function(e){return e.replace(C,"")},Z=F?function(e){return e.trimEnd()}:function(e){return e.replace(M,"")};function J(e,t){return new RegExp(e,t)}let q;if(X){const e=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");q=function(t,s){e.lastIndex=s;return e.exec(t)[1]??""}}else q=function(e,t){let s=[];for(;;){const n=W(e,t);if(void 0===n||te(n)||se(n))break;s.push(n),t+=n>=65536?2:1}return z(...s)};class Q{constructor(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,s){let i=[];for(;!this.isEOF();){const o=this.char();if(123===o){const t=this.parseArgument(e,s);if(t.err)return t;i.push(t.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(s)break;return this.error(n.UNMATCHED_CLOSING_TAG,R(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&ee(this.peek()||0)){const s=this.parseTag(e,t);if(s.err)return s;i.push(s.val)}else{const s=this.parseLiteral(e,t);if(s.err)return s;i.push(s.val)}}else{const e=this.clonePosition();this.bump(),i.push({type:r.pound,location:R(e,this.clonePosition())})}}}return{val:i,err:null}}parseTag(e,t){const s=this.clonePosition();this.bump();const i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:r.literal,value:`<${i}/>`,location:R(s,this.clonePosition())},err:null};if(this.bumpIf(">")){const o=this.parseMessage(e+1,t,!0);if(o.err)return o;const a=o.val,h=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!ee(this.char()))return this.error(n.INVALID_TAG,R(h,this.clonePosition()));const e=this.clonePosition();return i!==this.parseTagName()?this.error(n.UNMATCHED_CLOSING_TAG,R(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:r.tag,value:i,children:a,location:R(s,this.clonePosition())},err:null}:this.error(n.INVALID_TAG,R(h,this.clonePosition())))}return this.error(n.UNCLOSED_TAG,R(s,this.clonePosition()))}return this.error(n.INVALID_TAG,R(s,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();var t;return this.message.slice(e,this.offset())}parseLiteral(e,t){const s=this.clonePosition();let n="";for(;;){const s=this.tryParseQuote(t);if(s){n+=s;continue}const r=this.tryParseUnquoted(e,t);if(r){n+=r;continue}const i=this.tryParseLeftAngleBracket();if(!i)break;n+=i}const i=R(s,this.clonePosition());return{val:{type:r.literal,value:n,location:i},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ee(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return z(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const s=this.char();return 60===s||123===s||35===s&&("plural"===t||"selectordinal"===t)||125===s&&e>0?null:(this.bump(),z(s))}parseArgument(e,t){const s=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,R(s,this.clonePosition()));if(125===this.char())return this.bump(),this.error(n.EMPTY_ARGUMENT,R(s,this.clonePosition()));let i=this.parseIdentifierIfPossible().value;if(!i)return this.error(n.MALFORMED_ARGUMENT,R(s,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,R(s,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:r.argument,value:i,location:R(s,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,R(s,this.clonePosition())):this.parseArgumentOptions(e,t,i,s);default:return this.error(n.MALFORMED_ARGUMENT,R(s,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),s=q(this.message,t),n=t+s.length;this.bumpTo(n);return{value:s,location:R(e,this.clonePosition())}}parseArgumentOptions(e,t,s,o){let a=this.clonePosition(),h=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(h){case"":return this.error(n.EXPECT_ARGUMENT_TYPE,R(a,l));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),s=this.parseSimpleArgStyleIfPossible();if(s.err)return s;const r=Z(s.val);if(0===r.length)return this.error(n.EXPECT_ARGUMENT_STYLE,R(this.clonePosition(),this.clonePosition()));e={style:r,styleLocation:R(t,this.clonePosition())}}const t=this.tryParseArgumentClose(o);if(t.err)return t;const a=R(o,this.clonePosition());if(e&&Y(e?.style,"::",0)){let t=$(e.style.slice(2));if("number"===h){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:r.number,value:s,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(n.EXPECT_DATE_TIME_SKELETON,a);let o=t;this.locale&&(o=function(e,t){let s="";for(let n=0;n<e.length;n++){const r=e.charAt(n);if("j"===r){let i=0;for(;n+1<e.length&&e.charAt(n+1)===r;)i++,n++;let o=1+(1&i),a=i<2?1:3+(i>>1),h="a",l=L(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)s+=h;for(;o-- >0;)s=l+s}else s+="J"===r?"H":r}return s}(t,this.locale));const l={type:i.dateTime,pattern:o,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?T(o):{}};return{val:{type:"date"===h?r.date:r.time,value:s,location:a,style:l},err:null}}}return{val:{type:"number"===h?r.number:"date"===h?r.date:r.time,value:s,location:a,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const i=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(n.EXPECT_SELECT_ARGUMENT_OPTIONS,R(i,{...i}));this.bumpSpace();let a=this.parseIdentifierIfPossible(),l=0;if("select"!==h&&"offset"===a.value){if(!this.bumpIf(":"))return this.error(n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,R(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,n.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),a=this.parseIdentifierIfPossible(),l=e.val}const c=this.tryParsePluralOrSelectOptions(e,h,t,a);if(c.err)return c;const u=this.tryParseArgumentClose(o);if(u.err)return u;const d=R(o,this.clonePosition());return"select"===h?{val:{type:r.select,value:s,options:K(c.val),location:d},err:null}:{val:{type:r.plural,value:s,options:K(c.val),offset:l,pluralType:"plural"===h?"cardinal":"ordinal",location:d},err:null}}default:return this.error(n.INVALID_ARGUMENT_TYPE,R(a,l))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(n.EXPECT_ARGUMENT_CLOSING_BRACE,R(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(n.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,R(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let s=[];try{s=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(j).filter((e=>e.length>0)),s=[];for(const n of t){let e=n.split("/");if(0===e.length)throw new Error("Invalid number skeleton");const[t,...r]=e;for(const s of r)if(0===s.length)throw new Error("Invalid number skeleton");s.push({stem:t,options:r})}return s}(e)}catch(r){return this.error(n.INVALID_NUMBER_SKELETON,t)}return{val:{type:i.number,tokens:s,location:t,parsedOptions:this.shouldParseSkeletons?N(s):{}},err:null}}tryParsePluralOrSelectOptions(e,t,s,r){let i=!1;const o=[],a=new Set;let{value:h,location:l}=r;for(;;){if(0===h.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(n.EXPECT_PLURAL_ARGUMENT_SELECTOR,n.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;l=R(e,this.clonePosition()),h=this.message.slice(e.offset,this.offset())}}if(a.has(h))return this.error("select"===t?n.DUPLICATE_SELECT_ARGUMENT_SELECTOR:n.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);"other"===h&&(i=!0),this.bumpSpace();const r=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?n.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:n.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,R(this.clonePosition(),this.clonePosition()));const c=this.parseMessage(e+1,t,s);if(c.err)return c;const u=this.tryParseArgumentClose(r);if(u.err)return u;o.push([h,{value:c.val,location:R(r,this.clonePosition())}]),a.add(h),this.bumpSpace(),({value:h,location:l}=this.parseIdentifierIfPossible())}return 0===o.length?this.error("select"===t?n.EXPECT_SELECT_ARGUMENT_SELECTOR:n.EXPECT_PLURAL_ARGUMENT_SELECTOR,R(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(n.MISSING_OTHER_CLAUSE,R(this.clonePosition(),this.clonePosition())):{val:o,err:null}}tryParseDecimalInteger(e,t){let s=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(s=-1);let r=!1,i=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;r=!0,i=10*i+(e-48),this.bump()}const o=R(n,this.clonePosition());return r?(i*=s,V(i)?{val:i,err:null}:this.error(t,o)):this.error(e,o)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=W(this.message,e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(Y(this.message,e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),s=this.message.indexOf(e,t);return s>=0?(this.bumpTo(s),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&te(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function ee(e){return e>=97&&e<=122||e>=65&&e<=90}function te(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function se(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function ne(e,t){void 0===t&&(t=new Map),e.forEach((e=>{if(a(e)||l(e)||c(e)||h(e)){if(e.value in t&&t.get(e.value)!==e.type)throw new Error(`Variable ${e.value} has conflicting types`);t.set(e.value,e.type)}(d(e)||u(e))&&(t.set(e.value,e.type),Object.keys(e.options).forEach((s=>{ne(e.options[s].value,t)}))),p(e)&&(t.set(e.value,e.type),ne(e.children,t))}))}function re(e,t){const s=new Map,n=new Map;return ne(e,s),ne(t,n),s.size!==n.size?{success:!1,error:new Error(`Different number of variables: [${Array.from(s.keys()).join(", ")}] vs [${Array.from(n.keys()).join(", ")}]`)}:Array.from(s.entries()).reduce(((e,t)=>{let[s,i]=t;if(!e.success)return e;const o=n.get(s);return null==o?{success:!1,error:new Error(`Missing variable ${s} in message`)}:o!==i?{success:!1,error:new Error(`Variable ${s} has conflicting types: ${r[i]} vs ${r[o]}`)}:e}),{success:!0})}function ie(e){e.forEach((e=>{if(delete e.location,u(e)||d(e))for(const t in e.options)delete e.options[t].location,ie(e.options[t].value);else h(e)&&f(e.style)||(l(e)||c(e))&&g(e.style)?delete e.style.location:p(e)&&ie(e.children)}))}function oe(e,t){void 0===t&&(t={}),t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const s=new Q(e,t).parse();if(s.err){const e=SyntaxError(n[s.err.kind]);throw e.location=s.err.location,e.originalMessage=s.err.message,e}return t?.captureLocation||ie(s.val),s.val}const ae=Q},4079:(e,t,s)=>{s.d(t,{Ay:()=>n});const n=s(9775).S},9775:(e,t,s)=>{s.d(t,{S:()=>h});var n=s(8418),r=s(6214),i=s(851);function o(e,t){return t?Object.keys(e).reduce(((s,n)=>{var r,i;return s[n]=(r=e[n],(i=t[n])?{...r||{},...i||{},...Object.keys(r).reduce(((e,t)=>(e[t]={...r[t],...i[t]||{}},e)),{})}:r),s}),{...e}):e}function a(e){return{create:()=>({get:t=>e[t],set(t,s){e[t]=s}})}}class h{formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t,s,r){if(void 0===t&&(t=h.defaultLocale),this.locales=t,this.resolvedLocale=h.resolveLocale(t),"string"==typeof e){if(this.message=e,!h.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{formatters:t,...s}=r||{};this.ast=h.__parse(e,{...s,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");var i;this.formats=o(h.formats,s),this.formatters=r&&r.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:(0,n.B)((function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return new Intl.NumberFormat(...t)}),{cache:a(i.number),strategy:n.W.variadic}),getDateTimeFormat:(0,n.B)((function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return new Intl.DateTimeFormat(...t)}),{cache:a(i.dateTime),strategy:n.W.variadic}),getPluralRules:(0,n.B)((function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return new Intl.PluralRules(...t)}),{cache:a(i.pluralRules),strategy:n.W.variadic})})}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const s=t.reduce(((e,t)=>(e.length&&t.type===i.TT.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e)),[]);return s.length<=1?s[0]||"":s};formatToParts=e=>(0,i.hN)(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return h.memoizedDefaultLocale||(h.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),h.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=(()=>r.parse)();static formats={number:{integer:{maximumFractionDigits:0},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"}}}}},3280:(e,t,s)=>{s.d(t,{$x:()=>i,Ei:()=>a,IF:()=>r,O4:()=>n,Zo:()=>o});let n=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class r extends Error{constructor(e,t,s){super(e),this.code=t,this.originalMessage=s}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class i extends r{constructor(e,t,s,r){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(s).join('", "')}"`,n.INVALID_VALUE,r)}}class o extends r{constructor(e,t,s){super(`Value for "${e}" must be of type ${t}`,n.INVALID_VALUE,s)}}class a extends r{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,n.MISSING_VALUE,t)}}},851:(e,t,s)=>{s.d(t,{RK:()=>o,TT:()=>i,hN:()=>a});var n=s(6214),r=s(3280);let i=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function o(e){return"function"==typeof e}function a(e,t,s,h,l,c,u){if(1===e.length&&(0,n.isLiteralElement)(e[0]))return[{type:i.literal,value:e[0].value}];const d=[];for(const p of e){if((0,n.isLiteralElement)(p)){d.push({type:i.literal,value:p.value});continue}if((0,n.isPoundElement)(p)){"number"==typeof c&&d.push({type:i.literal,value:s.getNumberFormat(t).format(c)});continue}const{value:e}=p;if(!l||!(e in l))throw new r.Ei(e,u);let m=l[e];if((0,n.isArgumentElement)(p))m&&"string"!=typeof m&&"number"!=typeof m||(m="string"==typeof m||"number"==typeof m?String(m):""),d.push({type:"string"==typeof m?i.literal:i.object,value:m});else if((0,n.isDateElement)(p)){const e="string"==typeof p.style?h.date[p.style]:(0,n.isDateTimeSkeleton)(p.style)?p.style.parsedOptions:void 0;d.push({type:i.literal,value:s.getDateTimeFormat(t,e).format(m)})}else if((0,n.isTimeElement)(p)){const e="string"==typeof p.style?h.time[p.style]:(0,n.isDateTimeSkeleton)(p.style)?p.style.parsedOptions:h.time.medium;d.push({type:i.literal,value:s.getDateTimeFormat(t,e).format(m)})}else if((0,n.isNumberElement)(p)){const e="string"==typeof p.style?h.number[p.style]:(0,n.isNumberSkeleton)(p.style)?p.style.parsedOptions:void 0;e&&e.scale&&(m*=e.scale||1),d.push({type:i.literal,value:s.getNumberFormat(t,e).format(m)})}else{if((0,n.isTagElement)(p)){const{children:e,value:n}=p,m=l[n];if(!o(m))throw new r.Zo(n,"function",u);let f=m(a(e,t,s,h,l,c).map((e=>e.value)));Array.isArray(f)||(f=[f]),d.push(...f.map((e=>({type:"string"==typeof e?i.literal:i.object,value:e}))))}if((0,n.isSelectElement)(p)){const e=p.options[m]||p.options.other;if(!e)throw new r.$x(p.value,m,Object.keys(p.options),u);d.push(...a(e.value,t,s,h,l))}else if((0,n.isPluralElement)(p)){let e=p.options[`=${m}`];if(!e){if(!Intl.PluralRules)throw new r.IF('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',r.O4.MISSING_INTL_API,u);const n=s.getPluralRules(t,{type:p.pluralType}).select(m-(p.offset||0));e=p.options[n]||p.options.other}if(!e)throw new r.$x(p.value,m,Object.keys(p.options),u);d.push(...a(e.value,t,s,h,l,m-(p.offset||0)))}else;}}return(m=d).length<2?m:m.reduce(((e,t)=>{const s=e[e.length-1];return s&&s.type===i.literal&&t.type===i.literal?s.value+=t.value:e.push(t),e}),[]);var m}},7389:(e,t,s)=>{s.d(t,{R:()=>o,x:()=>a});var n=s(7378);const r={},i=n.createContext(r);function o(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);