forked from andyearnshaw/Intl.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntl.min.js
12 lines (12 loc) · 36.4 KB
/
Intl.min.js
1
2
3
4
5
6
7
8
9
10
11
12
"undefined"!=typeof window&&(window.OldIntl=window.Intl);var Intl=function(Intl){/**
* @license Copyright 2013 Andy Earnshaw, MIT License
*
* Implements the ECMAScript Internationalization API in ES5-compatible environments,
* following the ECMA-402 specification as closely as possible
*
* ECMA-402: http://ecma-international.org/ecma-402/1.0/
*
* CLDR format locale data should be provided using Intl.__addLocaleData().
*/
"use strict";function IsStructurallyValidLanguageTag(locale){return expBCP47Syntax.test(locale)?expVariantDupes.test(locale)?!1:expSingletonDupes.test(locale)?!1:!0:!1}function CanonicalizeLanguageTag(locale){var match,parts;locale=locale.toLowerCase(),parts=locale.split("-");for(var i=1,max=parts.length;max>i;i++)if(2===parts[i].length)parts[i]=parts[i].toUpperCase();else if(4===parts[i].length)parts[i]=parts[i].charAt(0).toUpperCase()+parts[i].slice(1);else if(1===parts[i].length&&"x"!=parts[i])break;locale=arrJoin.call(parts,"-"),(match=locale.match(expExtSequences))&&match.length>1&&(match.sort(),locale=locale.replace(RegExp("(?:"+expExtSequences.source+")+","i"),arrJoin.call(match,""))),hop.call(redundantTags.tags,locale)&&(locale=redundantTags.tags[locale]),parts=locale.split("-");for(var i=1,max=parts.length;max>i;i++)hop.call(redundantTags.subtags,parts[i])?parts[i]=redundantTags.subtags[parts[i]]:hop.call(redundantTags.extLang,parts[i])&&(parts[i]=redundantTags.extLang[parts[i]][0],1===i&&redundantTags.extLang[parts[1]][1]===parts[0]&&(parts=arrSlice.call(parts,i++),max-=1));return arrJoin.call(parts,"-")}function DefaultLocale(){return defaultLocale}function IsWellFormedCurrencyCode(currency){var c=String(currency),normalized=toLatinUpperCase(c);return expCurrencyCode.test(normalized)===!1?!1:!0}function CanonicalizeLocaleList(locales){if(void 0===locales)return new List;for(var seen=new List,locales="string"==typeof locales?[locales]:locales,O=toObject(locales),len=O.length,k=0;len>k;){var Pk=String(k),kPresent=Pk in O;if(kPresent){var kValue=O[Pk];if(null==kValue||"string"!=typeof kValue&&"object"!=typeof kValue)throw new TypeError("String or Object type expected");var tag=String(kValue);if(!IsStructurallyValidLanguageTag(tag))throw new RangeError("'"+tag+"' is not a structurally valid language tag");tag=CanonicalizeLanguageTag(tag),-1===arrIndexOf.call(seen,tag)&&arrPush.call(seen,tag)}k++}return seen}function BestAvailableLocale(availableLocales,locale){for(var candidate=locale;;){if(arrIndexOf.call(availableLocales,candidate)>-1)return candidate;var pos=candidate.lastIndexOf("-");if(0>pos)return;pos>=2&&"-"==candidate.charAt(pos-2)&&(pos-=2),candidate=candidate.substring(0,pos)}}function LookupMatcher(availableLocales,requestedLocales){for(var availableLocale,i=0,len=requestedLocales.length;len>i&&!availableLocale;){var locale=requestedLocales[i],noExtensionsLocale=String(locale).replace(expUnicodeExSeq,""),availableLocale=BestAvailableLocale(availableLocales,noExtensionsLocale);i++}var result=new Record;if(void 0!==availableLocale){if(result["[[locale]]"]=availableLocale,String(locale)!==String(noExtensionsLocale)){var extension=locale.match(expUnicodeExSeq)[0],extensionIndex=locale.indexOf("-u-");result["[[extension]]"]=extension,result["[[extensionIndex]]"]=extensionIndex}}else result["[[locale]]"]=DefaultLocale();return result}function BestFitMatcher(availableLocales,requestedLocales){return LookupMatcher(availableLocales,requestedLocales)}function ResolveLocale(availableLocales,requestedLocales,options,relevantExtensionKeys,localeData){if(0===availableLocales.length)throw new ReferenceError("No locale data has been provided for this object yet.");var matcher=options["[[localeMatcher]]"];if("lookup"===matcher)var r=LookupMatcher(availableLocales,requestedLocales);else var r=BestFitMatcher(availableLocales,requestedLocales);var foundLocale=r["[[locale]]"];if(hop.call(r,"[[extension]]"))var extension=r["[[extension]]"],extensionIndex=r["[[extensionIndex]]"],split=String.prototype.split,extensionSubtags=split.call(extension,"-"),extensionSubtagsLength=extensionSubtags.length;var result=new Record;result["[[dataLocale]]"]=foundLocale;for(var supportedExtension="-u",i=0,len=relevantExtensionKeys.length;len>i;){var key=relevantExtensionKeys[i],foundLocaleData=localeData[foundLocale],keyLocaleData=foundLocaleData[key],value=keyLocaleData["0"],supportedExtensionAddition="",indexOf=arrIndexOf;if(void 0!==extensionSubtags){var keyPos=indexOf.call(extensionSubtags,key);if(-1!==keyPos)if(extensionSubtagsLength>keyPos+1&&extensionSubtags[keyPos+1].length>2){var requestedValue=extensionSubtags[keyPos+1],valuePos=indexOf.call(keyLocaleData,requestedValue);if(-1!==valuePos)var value=requestedValue,supportedExtensionAddition="-"+key+"-"+value}else{var valuePos=indexOf(keyLocaleData,"true");if(-1!==valuePos)var value="true"}}if(hop.call(options,"[["+key+"]]")){var optionsValue=options["[["+key+"]]"];-1!==indexOf.call(keyLocaleData,optionsValue)&&optionsValue!==value&&(value=optionsValue,supportedExtensionAddition="")}result["[["+key+"]]"]=value,supportedExtension+=supportedExtensionAddition,i++}if(supportedExtension.length>2)var preExtension=foundLocale.substring(0,extensionIndex),postExtension=foundLocale.substring(extensionIndex),foundLocale=preExtension+supportedExtension+postExtension;return result["[[locale]]"]=foundLocale,result}function LookupSupportedLocales(availableLocales,requestedLocales){for(var len=requestedLocales.length,subset=new List,k=0;len>k;){var locale=requestedLocales[k],noExtensionsLocale=String(locale).replace(expUnicodeExSeq,""),availableLocale=BestAvailableLocale(availableLocales,noExtensionsLocale);void 0!==availableLocale&&arrPush.call(subset,locale),k++}var subsetArray=arrSlice.call(subset);return subsetArray}function BestFitSupportedLocales(availableLocales,requestedLocales){return LookupSupportedLocales(availableLocales,requestedLocales)}function SupportedLocales(availableLocales,requestedLocales,options){if(void 0!==options){var options=new Record(toObject(options)),matcher=options.localeMatcher;if(void 0!==matcher&&(matcher=String(matcher),"lookup"!==matcher&&"best fit"!==matcher))throw new RangeError('matcher should be "lookup" or "best fit"')}if(void 0===matcher||"best fit"===matcher)var subset=BestFitSupportedLocales(availableLocales,requestedLocales);else var subset=LookupSupportedLocales(availableLocales,requestedLocales);for(var P in subset)hop.call(subset,P)&&defineProperty(subset,P,{writable:!1,configurable:!1,value:subset[P]});return defineProperty(subset,"length",{writable:!1}),subset}function GetOption(options,property,type,values,fallback){var value=options[property];if(void 0!==value){if(value="boolean"===type?Boolean(value):"string"===type?String(value):value,void 0!==values&&-1===arrIndexOf.call(values,value))throw new RangeError("'"+value+"' is not an allowed value for `"+property+"`");return value}return fallback}function GetNumberOption(options,property,minimum,maximum,fallback){var value=options[property];if(void 0!==value){if(value=Number(value),isNaN(value)||minimum>value||value>maximum)throw new RangeError("Value is not a number or outside accepted range");return Math.floor(value)}return fallback}function NumberFormatConstructor(){var locales=arguments[0],options=arguments[1];return this&&this!==Intl?InitializeNumberFormat(toObject(this),locales,options):new Intl.NumberFormat(locales,options)}function InitializeNumberFormat(numberFormat,locales,options){var internal=getInternalProperties(numberFormat),regexpState=createRegExpRestore();if(internal["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");defineProperty(numberFormat,"__getInternalProperties",{value:function(){return arguments[0]===secret?internal:void 0}}),internal["[[initializedIntlObject]]"]=!0;var requestedLocales=CanonicalizeLocaleList(locales);options=void 0===options?{}:toObject(options);var opt=new Record,matcher=GetOption(options,"localeMatcher","string",new List("lookup","best fit"),"best fit");opt["[[localeMatcher]]"]=matcher;var localeData=internals.NumberFormat["[[localeData]]"],r=ResolveLocale(internals.NumberFormat["[[availableLocales]]"],requestedLocales,opt,internals.NumberFormat["[[relevantExtensionKeys]]"],localeData);internal["[[locale]]"]=r["[[locale]]"],internal["[[numberingSystem]]"]=r["[[nu]]"],internal["[[dataLocale]]"]=r["[[dataLocale]]"];var dataLocale=r["[[dataLocale]]"],s=GetOption(options,"style","string",new List("decimal","percent","currency"),"decimal");internal["[[style]]"]=s;var c=GetOption(options,"currency","string");if(void 0!==c&&!IsWellFormedCurrencyCode(c))throw new RangeError("'"+c+"' is not a valid currency code");if("currency"===s&&void 0===c)throw new TypeError("Currency code is required when style is currency");if("currency"===s){c=c.toUpperCase(),internal["[[currency]]"]=c;var cDigits=CurrencyDigits(c)}var cd=GetOption(options,"currencyDisplay","string",new List("code","symbol","name"),"symbol");"currency"===s&&(internal["[[currencyDisplay]]"]=cd);var mnid=GetNumberOption(options,"minimumIntegerDigits",1,21,1);internal["[[minimumIntegerDigits]]"]=mnid;var mnfdDefault="currency"===s?cDigits:0,mnfd=GetNumberOption(options,"minimumFractionDigits",0,20,mnfdDefault);internal["[[minimumFractionDigits]]"]=mnfd;var mxfdDefault="currency"===s?Math.max(mnfd,cDigits):"percent"===s?Math.max(mnfd,0):Math.max(mnfd,3),mxfd=GetNumberOption(options,"maximumFractionDigits",mnfd,20,mxfdDefault);internal["[[maximumFractionDigits]]"]=mxfd;var mnsd=options.minimumSignificantDigits,mxsd=options.maximumSignificantDigits;(void 0!==mnsd||void 0!==mxsd)&&(mnsd=GetNumberOption(options,"minimumSignificantDigits",1,21,1),mxsd=GetNumberOption(options,"maximumSignificantDigits",mnsd,21,21),internal["[[minimumSignificantDigits]]"]=mnsd,internal["[[maximumSignificantDigits]]"]=mxsd);var g=GetOption(options,"useGrouping","boolean",void 0,!0);internal["[[useGrouping]]"]=g;var dataLocaleData=localeData[dataLocale],patterns=dataLocaleData.patterns,stylePatterns=patterns[s];return internal["[[positivePattern]]"]=stylePatterns.positivePattern,internal["[[negativePattern]]"]=stylePatterns.negativePattern,internal["[[boundFormat]]"]=void 0,internal["[[initializedNumberFormat]]"]=!0,regexpState.exp.test(regexpState.input),numberFormat}function CurrencyDigits(currency){return void 0!==currencyMinorUnits[currency]?currencyMinorUnits[currency]:2}function FormatNumber(numberFormat,x){var n,regexpState=createRegExpRestore(),internal=getInternalProperties(numberFormat),locale=internal["[[dataLocale]]"],nums=internal["[[numberingSystem]]"],data=internals.NumberFormat["[[localeData]]"][locale],ild=data.symbols[nums]||data.symbols.latn,negative=!1;if(isFinite(x)===!1)isNaN(x)?n=ild.nan:(n=ild.infinity,0>x&&(negative=!0));else{if(0>x&&(negative=!0,x=-x),"percent"===internal["[[style]]"]&&(x*=100),n=hop.call(internal,"[[minimumSignificantDigits]]")&&hop.call(internal,"[[maximumSignificantDigits]]")?ToRawPrecision(x,internal["[[minimumSignificantDigits]]"],internal["[[maximumSignificantDigits]]"]):ToRawFixed(x,internal["[[minimumIntegerDigits]]"],internal["[[minimumFractionDigits]]"],internal["[[maximumFractionDigits]]"]),numSys[nums]){var digits=numSys[internal["[[numberingSystem]]"]];n=String(n).replace(/\d/g,function(digit){return digits[digit]})}else n=String(n);if(n=n.replace(/\./g,ild.decimal),internal["[[useGrouping]]"]===!0){var parts=n.split(ild.decimal);parts[0]=parts[0].replace(expInsertGroups,ild.group),n=arrJoin.call(parts,ild.decimal)}}var result=internal[negative===!0?"[[negativePattern]]":"[[positivePattern]]"];if(result=result.replace("{number}",n),"currency"===internal["[[style]]"]){var cd,currency=internal["[[currency]]"],cData=data.currencies[currency];"code"===internal["[[currencyDisplay]]"]?cd=currency:"symbol"===internal["[[currencyDisplay]]"]?cd=cData||currency:"name"===internal["[[currencyDisplay]]"]&&(cd=cData?cData["displayName-count-one"]:currency),result=result.replace("{currency}",cd)}return regexpState.exp.test(regexpState.input),result}function ToRawPrecision(x,minPrecision,maxPrecision){var p=maxPrecision;if(0===x)var m=arrJoin.call(Array(p+1),"0"),e=0;else{var idx,isInt=x%1,pre=isInt?Math.pow(10,maxPrecision):1,m=Number.prototype.toPrecision.call(x*pre,maxPrecision),e=(idx=m.indexOf("e"))>-1?Number(m.slice(idx+1)):(idx=m.indexOf("."))>-1?idx-1:m.length-1;isInt&&(e-=maxPrecision),m=m.slice(0,m.indexOf("e")>-1?idx:m.length).replace(".","")}if(e>=p)return m+arrJoin.call(Array(e-p+1+1),"0");if(e===p-1)return m;if(e>=0?m=m.slice(0,e+1)+"."+m.slice(e+1):0>e&&(m="0."+arrJoin.call(Array(-(e+1)+1),"0")+m),m.indexOf(".")>=0&&maxPrecision>minPrecision){for(var cut=maxPrecision-minPrecision;cut>0&&"0"===m.charAt(m.length-1);)m=m.slice(0,-1),cut--;"."===m.charAt(m.length-1)&&(m=m.slice(0,-1))}return m}function ToRawFixed(x,minInteger,minFraction,maxFraction){var idx,m=Number.prototype.toFixed.call(x,maxFraction),igr=m.split(".")[0].length,cut=maxFraction-minFraction,exp=(idx=m.indexOf("e"))>-1?m.slice(idx+1):0;for(exp&&(m=m.slice(0,idx).replace(".",""),m+=arrJoin.call(Array(exp-(m.length-1)+1),"0")+"."+arrJoin.call(Array(maxFraction+1),"0"),igr=m.length);cut>0&&"0"===m.slice(-1);)m=m.slice(0,-1),cut--;if("."===m.slice(-1)&&(m=m.slice(0,-1)),minInteger>igr)var z=arrJoin.call(Array(minInteger-igr+1),"0");return(z?z:"")+m}function DateTimeFormatConstructor(){var locales=arguments[0],options=arguments[1];return this&&this!==Intl?InitializeDateTimeFormat(toObject(this),locales,options):new Intl.DateTimeFormat(locales,options)}function InitializeDateTimeFormat(dateTimeFormat,locales,options){var internal=getInternalProperties(dateTimeFormat),regexpState=createRegExpRestore();if(internal["[[initializedIntlObject]]"]===!0)throw new TypeError("`this` object has already been initialized as an Intl object");defineProperty(dateTimeFormat,"__getInternalProperties",{value:function(){return arguments[0]===secret?internal:void 0}}),internal["[[initializedIntlObject]]"]=!0;var requestedLocales=CanonicalizeLocaleList(locales),options=ToDateTimeOptions(options,"any","date"),opt=new Record;matcher=GetOption(options,"localeMatcher","string",new List("lookup","best fit"),"best fit"),opt["[[localeMatcher]]"]=matcher;var DateTimeFormat=internals.DateTimeFormat,localeData=DateTimeFormat["[[localeData]]"],r=ResolveLocale(DateTimeFormat["[[availableLocales]]"],requestedLocales,opt,DateTimeFormat["[[relevantExtensionKeys]]"],localeData);internal["[[locale]]"]=r["[[locale]]"],internal["[[calendar]]"]=r["[[ca]]"],internal["[[numberingSystem]]"]=r["[[nu]]"],internal["[[dataLocale]]"]=r["[[dataLocale]]"];var dataLocale=r["[[dataLocale]]"],tz=options.timeZone;if(void 0!==tz&&(tz=toLatinUpperCase(tz),"UTC"!==tz))throw new RangeError("timeZone is not supported.");internal["[[timeZone]]"]=tz,opt=new Record;for(var prop in dateTimeComponents)if(hop.call(dateTimeComponents,prop)){var value=GetOption(options,prop,"string",dateTimeComponents[prop]);opt["[["+prop+"]]"]=value}var bestFormat,dataLocaleData=localeData[dataLocale],formats=dataLocaleData.formats,matcher=GetOption(options,"formatMatcher","string",new List("basic","best fit"),"best fit");bestFormat="basic"===matcher?BasicFormatMatcher(opt,formats):BestFitFormatMatcher(opt,formats);for(var prop in dateTimeComponents)if(hop.call(dateTimeComponents,prop)&&hop.call(bestFormat,prop)){var p=bestFormat[prop];internal["[["+prop+"]]"]=p}var pattern,hr12=GetOption(options,"hour12","boolean");if(internal["[[hour]]"])if(hr12=void 0===hr12?dataLocaleData.hour12:hr12,internal["[[hour12]]"]=hr12,hr12===!0){var hourNo0=dataLocaleData.hourNo0;internal["[[hourNo0]]"]=hourNo0,pattern=bestFormat.pattern12}else pattern=bestFormat.pattern;else pattern=bestFormat.pattern;return internal["[[pattern]]"]=pattern,internal["[[boundFormat]]"]=void 0,internal["[[initializedDateTimeFormat]]"]=!0,regexpState.exp.test(regexpState.input),dateTimeFormat}function ToDateTimeOptions(options,required,defaults){options=void 0===options?null:new Record(toObject(options));var create=objCreate,options=create(options),needDefaults=!0;return("date"===required||"any"===required)&&(void 0!==options.weekday||void 0!==options.year||void 0!==options.month||void 0!==options.day)&&(needDefaults=!1),("time"===required||"any"===required)&&(void 0!==options.hour||void 0!==options.minute||void 0!==options.second)&&(needDefaults=!1),!needDefaults||"date"!==defaults&&"all"!==defaults||(options.year=options.month=options.day="numeric"),!needDefaults||"time"!==defaults&&"all"!==defaults||(options.hour=options.minute=options.second="numeric"),options}function BasicFormatMatcher(options,formats){for(var bestFormat,removalPenalty=120,additionPenalty=20,longLessPenalty=8,longMorePenalty=6,shortLessPenalty=6,shortMorePenalty=3,bestScore=-1/0,i=0,len=formats.length;len>i;){var format=formats[i],score=0;for(var property in dateTimeComponents)if(hop.call(dateTimeComponents,property)){var optionsProp=options["[["+property+"]]"],formatProp=hop.call(format,property)?format[property]:void 0;if(void 0===optionsProp&&void 0!==formatProp)score-=additionPenalty;else if(void 0!==optionsProp&&void 0===formatProp)score-=removalPenalty;else{var values=["2-digit","numeric","narrow","short","long"],optionsPropIndex=arrIndexOf.call(values,optionsProp),formatPropIndex=arrIndexOf.call(values,formatProp),delta=Math.max(Math.min(formatPropIndex-optionsPropIndex,2),-2);2===delta?score-=longMorePenalty:1===delta?score-=shortMorePenalty:-1===delta?score-=shortLessPenalty:-2===delta&&(score-=longLessPenalty)}}score>bestScore&&(bestScore=score,bestFormat=format),i++}return bestFormat}function BestFitFormatMatcher(options,formats){return BasicFormatMatcher(options,formats)}function FormatDateTime(dateTimeFormat,x){if(!isFinite(x))throw new RangeError("Invalid valid date passed to format");var internal=dateTimeFormat.__getInternalProperties(secret),regexpState=createRegExpRestore(),locale=internal["[[locale]]"],nf=new Intl.NumberFormat([locale],{useGrouping:!1}),nf2=new Intl.NumberFormat([locale],{minimumIntegerDigits:2,useGrouping:!1}),tm=ToLocalTime(x,internal["[[calendar]]"],internal["[[timeZone]]"]),result=internal["[[pattern]]"],dataLocale=internal["[[dataLocale]]"],localeData=internals.DateTimeFormat["[[localeData]]"][dataLocale].calendars,ca=internal["[[calendar]]"];for(var p in dateTimeComponents)if(hop.call(internal,"[["+p+"]]")){var pm,fv,f=internal["[["+p+"]]"],v=tm["[["+p+"]]"];if("year"===p&&0>=v?v=1-v:"month"===p?v++:"hour"===p&&internal["[[hour12]]"]===!0&&(v%=12,pm=v!==tm["[["+p+"]]"],0===v&&internal["[[hourNo0]]"]===!0&&(v=12)),"numeric"===f)fv=FormatNumber(nf,v);else if("2-digit"===f)fv=FormatNumber(nf2,v),fv.length>2&&(fv=fv.slice(-2));else if(f in dateWidths)switch(p){case"month":fv=resolveDateString(localeData,ca,"months",f,tm["[["+p+"]]"]);break;case"weekday":try{fv=resolveDateString(localeData,ca,"days",f,tm["[["+p+"]]"])}catch(e){throw new Error("Could not find weekday data for locale "+locale)}break;case"timeZoneName":fv="";break;default:fv=tm["[["+p+"]]"]}result=result.replace("{"+p+"}",fv)}return internal["[[hour12]]"]===!0&&(fv=resolveDateString(localeData,ca,"dayPeriods",pm?"pm":"am"),result=result.replace("{ampm}",fv)),regexpState.exp.test(regexpState.input),result}function ToLocalTime(date){var d=new Date(date);return new Record({"[[weekday]]":d.getDay(),"[[era]]":+(d.getFullYear>=0),"[[year]]":d.getFullYear(),"[[month]]":d.getMonth(),"[[day]]":d.getDate(),"[[hour]]":d.getHours(),"[[minute]]":d.getMinutes(),"[[second]]":d.getSeconds(),"[[inDST]]":!1})}function addLocaleData(data){if(!IsStructurallyValidLanguageTag(data.locale))throw new Error("Object passed doesn't identify itself with a valid language tag");if(!data.number)throw new Error("Object passed doesn't contain locale data for Intl.NumberFormat");var locale,locales=[data.locale],parts=data.locale.split("-");for(parts.length>2&&4==parts[1].length&&arrPush.call(locales,parts[0]+"-"+parts[2]);locale=arrShift.call(locales);)arrPush.call(internals.NumberFormat["[[availableLocales]]"],locale),internals.NumberFormat["[[localeData]]"][locale]=data.number,data.date&&(data.date.nu=data.number.nu,arrPush.call(internals.DateTimeFormat["[[availableLocales]]"],locale),internals.DateTimeFormat["[[localeData]]"][locale]=data.date);void 0===defaultLocale&&(defaultLocale=data.locale),numberFormatProtoInitialised||(InitializeNumberFormat(Intl.NumberFormat.prototype),numberFormatProtoInitialised=!0),data.date&&!dateTimeFormatProtoInitialised&&(InitializeDateTimeFormat(Intl.DateTimeFormat.prototype),dateTimeFormatProtoInitialised=!0)}function supportedLocalesOf(locales){if(!hop.call(this,"[[availableLocales]]"))throw new TypeError("supportedLocalesOf() is not a constructor");var regexpState=createRegExpRestore(),options=arguments[1],availableLocales=this["[[availableLocales]]"],requestedLocales=CanonicalizeLocaleList(locales);return regexpState.exp.test(regexpState.input),SupportedLocales(availableLocales,requestedLocales,options)}function resolveDateString(data,ca,component,width,key){var obj=data[ca]&&data[ca][component]?data[ca][component]:data.gregory[component],alts={narrow:["short","long"],"short":["long","narrow"],"long":["short","narrow"]},resolved=hop.call(obj,width)?obj[width]:hop.call(obj,alts[width][0])?obj[alts[width][0]]:obj[alts[width][1]];return null!=key?resolved[key]:resolved}function Record(obj){for(var k in obj)(obj instanceof Record||hop.call(obj,k))&&defineProperty(this,k,{value:obj[k],enumerable:!0,writable:!0,configurable:!0})}function List(){defineProperty(this,"length",{writable:!0,value:0}),arguments.length&&arrPush.apply(this,arrSlice.call(arguments))}function createRegExpRestore(){for(var lm=RegExp.lastMatch,ret={input:RegExp.input},esc=/[.?*+^$[\]\\(){}|-]/g,reg=new List,cap={},i=1;9>=i;i++)cap["$"+i]=RegExp["$"+i];for(var i=1;9>=i;i++){var m=cap["$"+i];lm=m?lm.replace(m,"("+m.replace(esc,"\\$0")+")"):"()"+lm,arrPush.call(reg,lm.slice(0,lm.indexOf("(")+1)),lm=lm.slice(lm.indexOf("(")+1)}return ret.exp=new RegExp(arrJoin.call(reg,"")+lm,RegExp.multiline?"m":""),ret}function toLatinUpperCase(str){for(var i=str.length;i--;){var ch=str.charAt(i);ch>="a"&&"z">=ch&&(str=str.slice(0,i)+ch.toUpperCase()+str.slice(i+1))}return str}function toObject(arg){if(null==arg)throw new TypeError("Cannot convert null or undefined to object");return Object(arg)}function getInternalProperties(obj){return hop.call(obj,"__getInternalProperties")?obj.__getInternalProperties(secret):objCreate(null)}var defaultLocale,expBCP47Syntax,expExtSequences,expVariantDupes,expSingletonDupes,hop=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,name,desc){desc.get&&obj.__defineGetter__?obj.__defineGetter(name,desc.get):(desc.value||desc.get)&&(obj[name]=desc.value||desc.get)},arrIndexOf=Array.prototype.indexOf||function(search){var t=this;if(!t.length)return-1;for(var i=arguments[1]||0,max=t.length;max>i;i++)if(t[i]===search)return i},objCreate=Object.create||function(proto,props){function F(){}var obj;F.prototype=proto,obj=new F;for(var k in props)hop.call(props,k)&&defineProperty(obj,k,props[k]);return obj},arrSlice=Array.prototype.slice,arrConcat=Array.prototype.concat,arrPush=Array.prototype.push,arrJoin=Array.prototype.join,arrShift=Array.prototype.shift,fnBind=Function.prototype.bind||function(thisObj){var fn=this,args=arrSlice.call(arguments,1);return function(){fn.apply(thisObj,arrConcat.call(args,arrSlice.call(arguments)))}},internals=objCreate(null),secret=Math.random(),dateWidths=objCreate(null,{narrow:{},"short":{},"long":{}}),numberFormatProtoInitialised=!1,dateTimeFormatProtoInitialised=!1,expInsertGroups=/(?=(?!^)(?:\d{3})+(?!\d))/g,expCurrencyCode=/^[A-Z]{3}$/,expUnicodeExSeq=/-u(?:-[0-9a-z]{2,8})+/gi,redundantTags={tags:{"art-lojban":"jbo","i-ami":"ami","i-bnn":"bnn","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","no-bok":"nb","no-nyn":"nn","sgn-BE-FR":"sfb","sgn-BE-NL":"vgt","sgn-CH-DE":"sgg","zh-guoyu":"cmn","zh-hakka":"hak","zh-min-nan":"nan","zh-xiang":"hsn","sgn-BR":"bzs","sgn-CO":"csn","sgn-DE":"gsg","sgn-DK":"dsl","sgn-ES":"ssp","sgn-FR":"fsl","sgn-GB":"bfi","sgn-GR":"gss","sgn-IE":"isg","sgn-IT":"ise","sgn-JP":"jsl","sgn-MX":"mfs","sgn-NI":"ncs","sgn-NL":"dse","sgn-NO":"nsl","sgn-PT":"psr","sgn-SE":"swl","sgn-US":"ase","sgn-ZA":"sfs","zh-cmn":"cmn","zh-cmn-Hans":"cmn-Hans","zh-cmn-Hant":"cmn-Hant","zh-gan":"gan","zh-wuu":"wuu","zh-yue":"yue"},subtags:{BU:"MM",DD:"DE",FX:"FR",TP:"TL",YD:"YE",ZR:"CD",heploc:"alalc97","in":"id",iw:"he",ji:"yi",jw:"jv",mo:"ro",ayx:"nun",bjd:"drl",ccq:"rki",cjr:"mom",cka:"cmr",cmk:"xch",drh:"khk",drw:"prs",gav:"dev",hrr:"jal",ibi:"opa",kgh:"kml",lcq:"ppr",mst:"mry",myt:"mry",sca:"hle",tie:"ras",tkk:"twm",tlw:"weo",tnf:"prs",ybd:"rki",yma:"lrr"},extLang:{aao:["aao","ar"],abh:["abh","ar"],abv:["abv","ar"],acm:["acm","ar"],acq:["acq","ar"],acw:["acw","ar"],acx:["acx","ar"],acy:["acy","ar"],adf:["adf","ar"],ads:["ads","sgn"],aeb:["aeb","ar"],aec:["aec","ar"],aed:["aed","sgn"],aen:["aen","sgn"],afb:["afb","ar"],afg:["afg","sgn"],ajp:["ajp","ar"],apc:["apc","ar"],apd:["apd","ar"],arb:["arb","ar"],arq:["arq","ar"],ars:["ars","ar"],ary:["ary","ar"],arz:["arz","ar"],ase:["ase","sgn"],asf:["asf","sgn"],asp:["asp","sgn"],asq:["asq","sgn"],asw:["asw","sgn"],auz:["auz","ar"],avl:["avl","ar"],ayh:["ayh","ar"],ayl:["ayl","ar"],ayn:["ayn","ar"],ayp:["ayp","ar"],bbz:["bbz","ar"],bfi:["bfi","sgn"],bfk:["bfk","sgn"],bjn:["bjn","ms"],bog:["bog","sgn"],bqn:["bqn","sgn"],bqy:["bqy","sgn"],btj:["btj","ms"],bve:["bve","ms"],bvl:["bvl","sgn"],bvu:["bvu","ms"],bzs:["bzs","sgn"],cdo:["cdo","zh"],cds:["cds","sgn"],cjy:["cjy","zh"],cmn:["cmn","zh"],coa:["coa","ms"],cpx:["cpx","zh"],csc:["csc","sgn"],csd:["csd","sgn"],cse:["cse","sgn"],csf:["csf","sgn"],csg:["csg","sgn"],csl:["csl","sgn"],csn:["csn","sgn"],csq:["csq","sgn"],csr:["csr","sgn"],czh:["czh","zh"],czo:["czo","zh"],doq:["doq","sgn"],dse:["dse","sgn"],dsl:["dsl","sgn"],dup:["dup","ms"],ecs:["ecs","sgn"],esl:["esl","sgn"],esn:["esn","sgn"],eso:["eso","sgn"],eth:["eth","sgn"],fcs:["fcs","sgn"],fse:["fse","sgn"],fsl:["fsl","sgn"],fss:["fss","sgn"],gan:["gan","zh"],gds:["gds","sgn"],gom:["gom","kok"],gse:["gse","sgn"],gsg:["gsg","sgn"],gsm:["gsm","sgn"],gss:["gss","sgn"],gus:["gus","sgn"],hab:["hab","sgn"],haf:["haf","sgn"],hak:["hak","zh"],hds:["hds","sgn"],hji:["hji","ms"],hks:["hks","sgn"],hos:["hos","sgn"],hps:["hps","sgn"],hsh:["hsh","sgn"],hsl:["hsl","sgn"],hsn:["hsn","zh"],icl:["icl","sgn"],ils:["ils","sgn"],inl:["inl","sgn"],ins:["ins","sgn"],ise:["ise","sgn"],isg:["isg","sgn"],isr:["isr","sgn"],jak:["jak","ms"],jax:["jax","ms"],jcs:["jcs","sgn"],jhs:["jhs","sgn"],jls:["jls","sgn"],jos:["jos","sgn"],jsl:["jsl","sgn"],jus:["jus","sgn"],kgi:["kgi","sgn"],knn:["knn","kok"],kvb:["kvb","ms"],kvk:["kvk","sgn"],kvr:["kvr","ms"],kxd:["kxd","ms"],lbs:["lbs","sgn"],lce:["lce","ms"],lcf:["lcf","ms"],liw:["liw","ms"],lls:["lls","sgn"],lsg:["lsg","sgn"],lsl:["lsl","sgn"],lso:["lso","sgn"],lsp:["lsp","sgn"],lst:["lst","sgn"],lsy:["lsy","sgn"],ltg:["ltg","lv"],lvs:["lvs","lv"],lzh:["lzh","zh"],max:["max","ms"],mdl:["mdl","sgn"],meo:["meo","ms"],mfa:["mfa","ms"],mfb:["mfb","ms"],mfs:["mfs","sgn"],min:["min","ms"],mnp:["mnp","zh"],mqg:["mqg","ms"],mre:["mre","sgn"],msd:["msd","sgn"],msi:["msi","ms"],msr:["msr","sgn"],mui:["mui","ms"],mzc:["mzc","sgn"],mzg:["mzg","sgn"],mzy:["mzy","sgn"],nan:["nan","zh"],nbs:["nbs","sgn"],ncs:["ncs","sgn"],nsi:["nsi","sgn"],nsl:["nsl","sgn"],nsp:["nsp","sgn"],nsr:["nsr","sgn"],nzs:["nzs","sgn"],okl:["okl","sgn"],orn:["orn","ms"],ors:["ors","ms"],pel:["pel","ms"],pga:["pga","ar"],pks:["pks","sgn"],prl:["prl","sgn"],prz:["prz","sgn"],psc:["psc","sgn"],psd:["psd","sgn"],pse:["pse","ms"],psg:["psg","sgn"],psl:["psl","sgn"],pso:["pso","sgn"],psp:["psp","sgn"],psr:["psr","sgn"],pys:["pys","sgn"],rms:["rms","sgn"],rsi:["rsi","sgn"],rsl:["rsl","sgn"],sdl:["sdl","sgn"],sfb:["sfb","sgn"],sfs:["sfs","sgn"],sgg:["sgg","sgn"],sgx:["sgx","sgn"],shu:["shu","ar"],slf:["slf","sgn"],sls:["sls","sgn"],sqk:["sqk","sgn"],sqs:["sqs","sgn"],ssh:["ssh","ar"],ssp:["ssp","sgn"],ssr:["ssr","sgn"],svk:["svk","sgn"],swc:["swc","sw"],swh:["swh","sw"],swl:["swl","sgn"],syy:["syy","sgn"],tmw:["tmw","ms"],tse:["tse","sgn"],tsm:["tsm","sgn"],tsq:["tsq","sgn"],tss:["tss","sgn"],tsy:["tsy","sgn"],tza:["tza","sgn"],ugn:["ugn","sgn"],ugy:["ugy","sgn"],ukl:["ukl","sgn"],uks:["uks","sgn"],urk:["urk","ms"],uzn:["uzn","uz"],uzs:["uzs","uz"],vgt:["vgt","sgn"],vkk:["vkk","ms"],vkt:["vkt","ms"],vsi:["vsi","sgn"],vsl:["vsl","sgn"],vsv:["vsv","sgn"],wuu:["wuu","zh"],xki:["xki","sgn"],xml:["xml","sgn"],xmm:["xmm","ms"],xms:["xms","sgn"],yds:["yds","sgn"],ysl:["ysl","sgn"],yue:["yue","zh"],zib:["zib","sgn"],zlm:["zlm","ms"],zmi:["zmi","ms"],zsl:["zsl","sgn"],zsm:["zsm","ms"]}},currencyMinorUnits={BHD:3,BYR:0,XOF:0,BIF:0,XAF:0,CLF:0,CLP:0,KMF:0,DJF:0,XPF:0,GNF:0,ISK:0,IQD:3,JPY:0,JOD:3,KRW:0,KWD:3,LYD:3,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,VUV:0,VND:0};!function(){var extlang="[a-z]{3}(?:-[a-z]{3}){0,2}",language="(?:[a-z]{2,3}(?:-"+extlang+")?|[a-z]{4}|[a-z]{5,8})",script="[a-z]{4}",region="(?:[a-z]{2}|\\d{3})",variant="(?:[a-z0-9]{5,8}|\\d[a-z0-9]{3})",singleton="[0-9a-wy-z]",extension=singleton+"(?:-[a-z0-9]{2,8})+",privateuse="x(?:-[a-z0-9]{1,8})+",irregular="(?:en-GB-oed|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)|sgn-(?:BE-FR|BE-NL|CH-DE))",regular="(?:art-lojban|cel-gaulish|no-bok|no-nyn|zh-(?:guoyu|hakka|min|min-nan|xiang))",grandfathered="(?:"+irregular+"|"+regular+")",langtag=language+"(?:-"+script+")?(?:-"+region+")?(?:-"+variant+")*(?:-"+extension+")*(?:-"+privateuse+")?";expBCP47Syntax=RegExp("^(?:"+langtag+"|"+privateuse+"|"+grandfathered+")$","i"),expVariantDupes=RegExp("^(?!x).*?-("+variant+")-(?:\\w{4,8}-(?!x-))*\\1\\b","i"),expSingletonDupes=RegExp("^(?!x).*?-("+singleton+")-(?:\\w+-(?!x-))*\\1\\b","i"),expExtSequences=RegExp("-"+extension,"ig")}(),defineProperty(Intl,"NumberFormat",{configurable:!0,writable:!0,value:NumberFormatConstructor}),defineProperty(Intl.NumberFormat,"prototype",{writable:!1}),internals.NumberFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["nu"],"[[localeData]]":{}},defineProperty(Intl.NumberFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:fnBind.call(supportedLocalesOf,internals.NumberFormat)}),defineProperty(Intl.NumberFormat.prototype,"format",{configurable:!0,get:function(){var internal=null!=this&&"object"==typeof this&&getInternalProperties(this);if(!internal||!internal["[[initializedNumberFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.NumberFormat object.");if(void 0===internal["[[boundFormat]]"]){var F=function(value){return FormatNumber(this,Number(value))},bf=fnBind.call(F,this);internal["[[boundFormat]]"]=bf}return internal["[[boundFormat]]"]}});var numSys={arab:["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],arabext:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],bali:["᭐","᭑","᭒","᭓","᭔","᭕","᭖","᭗","᭘","᭙"],beng:["০","১","২","৩","৪","৫","৬","৭","৮","৯"],deva:["०","१","२","३","४","५","६","७","८","९"],fullwide:["0","1","2","3","4","5","6","7","8","9"],gujr:["૦","૧","૨","૩","૪","૫","૬","૭","૮","૯"],guru:["੦","੧","੨","੩","੪","੫","੬","੭","੮","੯"],hanidec:["〇","一","二","三","四","五","六","七","八","九"],khmr:["០","១","២","៣","៤","៥","៦","៧","៨","៩"],knda:["೦","೧","೨","೩","೪","೫","೬","೭","೮","೯"],laoo:["໐","໑","໒","໓","໔","໕","໖","໗","໘","໙"],latn:["0","1","2","3","4","5","6","7","8","9"],limb:["᥆","᥇","᥈","᥉","᥊","᥋","᥌","᥍","᥎","᥏"],mlym:["൦","൧","൨","൩","൪","൫","൬","൭","൮","൯"],mong:["᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"],mymr:["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],orya:["୦","୧","୨","୩","୪","୫","୬","୭","୮","୯"],tamldec:["௦","௧","௨","௩","௪","௫","௬","௭","௮","௯"],telu:["౦","౧","౨","౩","౪","౫","౬","౭","౮","౯"],thai:["๐","๑","๒","๓","๔","๕","๖","๗","๘","๙"],tibt:["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"]};defineProperty(Intl.NumberFormat.prototype,"resolvedOptions",{configurable:!0,writable:!0,value:function(){var prop,descs=new Record,props=["locale","numberingSystem","style","currency","currencyDisplay","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","useGrouping"],internal=null!=this&&"object"==typeof this&&getInternalProperties(this);if(!internal||!internal["[[initializedNumberFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.");
for(var i=0,max=props.length;max>i;i++)hop.call(internal,prop="[["+props[i]+"]]")&&(descs[props[i]]={value:internal[prop],writable:!0,configurable:!0,enumerable:!0});return objCreate({},descs)}}),defineProperty(Intl,"DateTimeFormat",{configurable:!0,writable:!0,value:DateTimeFormatConstructor}),defineProperty(DateTimeFormatConstructor,"prototype",{writable:!1});var dateTimeComponents={weekday:["narrow","short","long"],era:["narrow","short","long"],year:["2-digit","numeric"],month:["2-digit","numeric","narrow","short","long"],day:["2-digit","numeric"],hour:["2-digit","numeric"],minute:["2-digit","numeric"],second:["2-digit","numeric"],timeZoneName:["short","long"]};return internals.DateTimeFormat={"[[availableLocales]]":[],"[[relevantExtensionKeys]]":["ca","nu"],"[[localeData]]":{}},defineProperty(Intl.DateTimeFormat,"supportedLocalesOf",{configurable:!0,writable:!0,value:fnBind.call(supportedLocalesOf,internals.DateTimeFormat)}),defineProperty(Intl.DateTimeFormat.prototype,"format",{configurable:!0,get:function(){var internal=null!=this&&"object"==typeof this&&getInternalProperties(this);if(!internal||!internal["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for format() is not an initialized Intl.DateTimeFormat object.");if(void 0===internal["[[boundFormat]]"]){var F=function(){var x=Number(0===arguments.length?Date.now():arguments[0]);return FormatDateTime(this,x)},bf=fnBind.call(F,this);internal["[[boundFormat]]"]=bf}return internal["[[boundFormat]]"]}}),defineProperty(Intl.DateTimeFormat.prototype,"resolvedOptions",{writable:!0,configurable:!0,value:function(){var prop,descs=new Record,props=["locale","calendar","numberingSystem","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","pattern"],internal=null!=this&&"object"==typeof this&&getInternalProperties(this);if(!internal||!internal["[[initializedDateTimeFormat]]"])throw new TypeError("`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.");for(var i=0,max=props.length;max>i;i++)hop.call(internal,prop="[["+props[i]+"]]")&&(descs[props[i]]={value:internal[prop],writable:!0,configurable:!0,enumerable:!0});return objCreate({},descs)}}),defineProperty(Number.prototype,"toLocaleString",{writable:!0,configurable:!0,value:function(){if("[object Number]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a number for Number.prototype.toLocaleString()");return FormatNumber(new NumberFormatConstructor(arguments[0],arguments[1]),this)}}),defineProperty(Date.prototype,"toLocaleString",{writable:!0,configurable:!0,value:function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleString()");var x=+this;if(isNaN(x))return"Invalid Date";var locales=arguments[0],options=arguments[1],options=ToDateTimeOptions(options,"any","all"),dateTimeFormat=new DateTimeFormatConstructor(locales,options);return FormatDateTime(dateTimeFormat,x)}}),defineProperty(Date.prototype,"toLocaleDateString",{writable:!0,configurable:!0,value:function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleDateString()");var x=+this;if(isNaN(x))return"Invalid Date";var locales=arguments[0],options=arguments[1],options=ToDateTimeOptions(options,"date","date"),dateTimeFormat=new DateTimeFormatConstructor(locales,options);return FormatDateTime(dateTimeFormat,x)}}),defineProperty(Date.prototype,"toLocaleTimeString",{writable:!0,configurable:!0,value:function(){if("[object Date]"!==Object.prototype.toString.call(this))throw new TypeError("`this` value must be a Date instance for Date.prototype.toLocaleTimeString()");var x=+this;if(isNaN(x))return"Invalid Date";var locales=arguments[0],options=arguments[1],options=ToDateTimeOptions(options,"time","time"),dateTimeFormat=new DateTimeFormatConstructor(locales,options);return FormatDateTime(dateTimeFormat,x)}}),defineProperty(Intl,"__addLocaleData",{value:addLocaleData}),"undefined"!=typeof window&&(window.IntlLocaleData=internals),Record.prototype=objCreate(null),List.prototype=objCreate(null),Intl}({});