Files
Foundry-VTT-Docker/resources/app/node_modules/intl-messageformat/dist/intl-messageformat-with-locales.min.js

4 lines
85 KiB
JavaScript
Raw Normal View History

2025-01-04 00:34:03 +01:00
(function(){"use strict";function a(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(b=0,c=f.length;c>b;b+=1)if(d=f[b])for(e in d)h.call(d,e)&&(a[e]=d[e]);return a}function b(a,b,c){this.locales=a,this.formats=b,this.pluralFn=c}function c(a){this.id=a}function d(a,b,c,d,e){this.id=a,this.useOrdinal=b,this.offset=c,this.options=d,this.pluralFn=e}function e(a,b,c,d){this.id=a,this.offset=b,this.numberFormat=c,this.string=d}function f(a,b){this.id=a,this.options=b}function g(a,b,c){var d="string"==typeof a?g.__parse(a):a;if(!d||"messageFormatPattern"!==d.type)throw new TypeError("A message must be provided as a String or AST.");c=this._mergeFormats(g.formats,c),j(this,"_locale",{value:this._resolveLocale(b)});var e=this._findPluralRuleFunction(this._locale),f=this._compilePattern(d,b,c,e),h=this;this.format=function(a){return h._format(f,a)}}var h=Object.prototype.hasOwnProperty,i=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),j=(!i&&!Object.prototype.__defineGetter__,i?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!h.call(a,b)||"value"in c)&&(a[b]=c.value)}),k=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)h.call(b,e)&&j(d,e,b[e]);return d},l=b;b.prototype.compile=function(a){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(a)},b.prototype.compileMessage=function(a){if(!a||"messageFormatPattern"!==a.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var b,c,d,e=a.elements,f=[];for(b=0,c=e.length;c>b;b+=1)switch(d=e[b],d.type){case"messageTextElement":f.push(this.compileMessageText(d));break;case"argumentElement":f.push(this.compileArgument(d));break;default:throw new Error("Message element does not have a valid type")}return f},b.prototype.compileMessageText=function(a){return this.currentPlural&&/(^|[^\\])#/g.test(a.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new e(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,a.value)):a.value.replace(/\\#/g,"#")},b.prototype.compileArgument=function(a){var b=a.format;if(!b)return new c(a.id);var e,g=this.formats,h=this.locales,i=this.pluralFn;switch(b.type){case"numberFormat":return e=g.number[b.style],{id:a.id,format:new Intl.NumberFormat(h,e).format};case"dateFormat":return e=g.date[b.style],{id:a.id,format:new Intl.DateTimeFormat(h,e).format};case"timeFormat":return e=g.time[b.style],{id:a.id,format:new Intl.DateTimeFormat(h,e).format};case"pluralFormat":return e=this.compileOptions(a),new d(a.id,b.ordinal,b.offset,e,i);case"selectFormat":return e=this.compileOptions(a),new f(a.id,e);default:throw new Error("Message element does not have a valid format type")}},b.prototype.compileOptions=function(a){var b=a.format,c=b.options,d={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===b.type?a:null;var e,f,g;for(e=0,f=c.length;f>e;e+=1)g=c[e],d[g.selector]=this.compileMessage(g.value);return this.currentPlural=this.pluralStack.pop(),d},c.prototype.format=function(a){return a?"string"==typeof a?a:String(a):""},d.prototype.getOption=function(a){var b=this.options,c=b["="+a]||b[this.pluralFn(a-this.offset,this.useOrdinal)];return c||b.other},e.prototype.format=function(a){var b=this.numberFormat.format(a-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+b).replace(/\\#/g,"#")},f.prototype.getOption=function(a){var b=this.options;return b[a]||b.other};var m=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Ub!==b&&(Ub>b&&(Ub=0,Vb={line:1,column:1,seenCR:!1
}}),IntlMessageFormat.__addLocaleData({locale:"eo-001",parentLocale:"eo"}),IntlMessageFormat.__addLocaleData({locale:"es",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"es-419",parentLocale:"es"}),IntlMessageFormat.__addLocaleData({locale:"es-AR",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-BO",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-CL",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-CO",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-CR",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-CU",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-DO",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-EA",parentLocale:"es"}),IntlMessageFormat.__addLocaleData({locale:"es-EC",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-ES",parentLocale:"es"}),IntlMessageFormat.__addLocaleData({locale:"es-GQ",parentLocale:"es"}),IntlMessageFormat.__addLocaleData({locale:"es-GT",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-HN",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-IC",parentLocale:"es"}),IntlMessageFormat.__addLocaleData({locale:"es-MX",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-NI",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-PA",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-PE",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-PH",parentLocale:"es"}),IntlMessageFormat.__addLocaleData({locale:"es-PR",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-PY",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-SV",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-US",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-UY",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"es-VE",parentLocale:"es-419"}),IntlMessageFormat.__addLocaleData({locale:"et",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"et-EE",parentLocale:"et"}),IntlMessageFormat.__addLocaleData({locale:"eu",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"eu-ES",parentLocale:"eu"}),IntlMessageFormat.__addLocaleData({locale:"ewo",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"ewo-CM",parentLocale:"ewo"}),IntlMessageFormat.__addLocaleData({locale:"fa",pluralRuleFunction:function(a,b){return b?"other":a>=0&&1>=a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"fa-AF",parentLocale:"fa"}),IntlMessageFormat.__addLocaleData({locale:"fa-IR",parentLocale:"fa"}),IntlMessageFormat.__addLocaleData({locale:"ff",pluralRuleFunction:function(a,b){return b?"other":a>=0&&2>a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"ff-CM",parentLocale:"ff"}),IntlMessageFormat.__addLocaleData({locale:"ff-GN",parentLocale:"ff"}),IntlMessageFormat.__addLocaleData({locale:"ff-MR",parentLocale:"ff"}),IntlMessageFormat.__addLocaleData({locale:"ff-SN",parentLocale:"ff"}),IntlMessageFormat.__addLocaleData({locale:"fi",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"fi-FI",parentLocale:"fi"}),IntlMessageFormat.__addLocaleData({locale:"fil",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=e.slice(-1);return b?1==a?"one":"other":f&&(1==d||2==d||3==d)||f&&4!=g&&6!=g&&9!=g||!f&&4!=h&&6!=h&&9!=h?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"fil-PH",parentLocale:"fil"}),IntlMessageFormat.__addLocaleData({locale:"fo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"fo-FO",paren
return b?"other":1==a&&d?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"pt-BR",parentLocale:"pt"}),IntlMessageFormat.__addLocaleData({locale:"pt-CV",parentLocale:"pt-PT"}),IntlMessageFormat.__addLocaleData({locale:"pt-GW",parentLocale:"pt-PT"}),IntlMessageFormat.__addLocaleData({locale:"pt-MO",parentLocale:"pt-PT"}),IntlMessageFormat.__addLocaleData({locale:"pt-MZ",parentLocale:"pt-PT"}),IntlMessageFormat.__addLocaleData({locale:"pt-ST",parentLocale:"pt-PT"}),IntlMessageFormat.__addLocaleData({locale:"pt-TL",parentLocale:"pt-PT"}),IntlMessageFormat.__addLocaleData({locale:"qu",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"qu-BO",parentLocale:"qu"}),IntlMessageFormat.__addLocaleData({locale:"qu-EC",parentLocale:"qu"}),IntlMessageFormat.__addLocaleData({locale:"qu-PE",parentLocale:"qu"}),IntlMessageFormat.__addLocaleData({locale:"rm",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"rm-CH",parentLocale:"rm"}),IntlMessageFormat.__addLocaleData({locale:"rn",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"rn-BI",parentLocale:"rn"}),IntlMessageFormat.__addLocaleData({locale:"ro",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-2);return b?1==a?"one":"other":1==a&&d?"one":!d||0==a||1!=a&&f>=1&&19>=f?"few":"other"}}),IntlMessageFormat.__addLocaleData({locale:"ro-MD",parentLocale:"ro"}),IntlMessageFormat.__addLocaleData({locale:"ro-RO",parentLocale:"ro"}),IntlMessageFormat.__addLocaleData({locale:"rof",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"rof-TZ",parentLocale:"rof"}),IntlMessageFormat.__addLocaleData({locale:"ru",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=d.slice(-1),g=d.slice(-2);return b?"other":e&&1==f&&11!=g?"one":e&&f>=2&&4>=f&&(12>g||g>14)?"few":e&&0==f||e&&f>=5&&9>=f||e&&g>=11&&14>=g?"many":"other"}}),IntlMessageFormat.__addLocaleData({locale:"ru-BY",parentLocale:"ru"}),IntlMessageFormat.__addLocaleData({locale:"ru-KG",parentLocale:"ru"}),IntlMessageFormat.__addLocaleData({locale:"ru-KZ",parentLocale:"ru"}),IntlMessageFormat.__addLocaleData({locale:"ru-MD",parentLocale:"ru"}),IntlMessageFormat.__addLocaleData({locale:"ru-RU",parentLocale:"ru"}),IntlMessageFormat.__addLocaleData({locale:"ru-UA",parentLocale:"ru"}),IntlMessageFormat.__addLocaleData({locale:"rw",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"rw-RW",parentLocale:"rw"}),IntlMessageFormat.__addLocaleData({locale:"rwk",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"rwk-TZ",parentLocale:"rwk"}),IntlMessageFormat.__addLocaleData({locale:"sah",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"sah-RU",parentLocale:"sah"}),IntlMessageFormat.__addLocaleData({locale:"saq",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"saq-KE",parentLocale:"saq"}),IntlMessageFormat.__addLocaleData({locale:"sbp",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"sbp-TZ",parentLocale:"sbp"}),IntlMessageFormat.__addLocaleData({locale:"se",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"}}),IntlMessageFormat.__addLocaleData({locale:"se-FI",parentLocale:"se"}),IntlMessageFormat.__addLocaleData({locale:"se-NO",parentLocale:"se"}),IntlMessageFormat.__addLocaleData({locale:"se-SE",parentLocale:"se"}),IntlMessageFormat.__addLocaleData({locale:"seh",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"}}),IntlMessageFormat.__addLocaleData({locale:"seh-MZ",parentLocale:"seh"}),IntlMessageFormat.__addLocaleData({locale:"ses",pluralRuleFunction:function(a,b){return"other"}}),IntlMessageFormat.__addLocaleData({locale:"ses-ML",parentLocale:"ses"}),IntlMessageFormat
//# sourceMappingURL=intl-messageformat-with-locales.min.js.map