UNPKG

ilib

Version:

iLib is a cross-engine library of internationalization (i18n) classes written in pure JS

125 lines (120 loc) 382 kB
/* Copyright © 2012-2015, JEDLSoft Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var ilib=ilib||{};ilib._ver=function $ilib$_ver$(){return"11.0.006"};ilib.getVersion=function $ilib$getVersion$(){return ilib._ver()||"11.0"};ilib.data={norm:{ccc:{},nfd:{},nfc:{},nfkd:{},nfkc:{}},zoneinfo:{"Etc/UTC":{o:"0:0",f:"UTC"},local:{f:"local"}},ctype:null,ctype_c:null,ctype_l:null,ctype_m:null,ctype_p:null,ctype_z:null,scriptToRange:null,dateformats:null,timezones:[]};"undefined"!==typeof module&&(module.exports.ilib=ilib); ilib.setAsPseudoLocale=function $ilib$setAsPseudoLocale$($localename$$){$localename$$&&ilib.pseudoLocales.push($localename$$)};ilib.clearPseudoLocales=function $ilib$clearPseudoLocales$(){ilib.pseudoLocales=["zxx-XX","zxx-Cyrl-XX","zxx-Hans-XX","zxx-Hebr-XX"]};ilib.clearPseudoLocales(); ilib._getPlatform=function $ilib$_getPlatform$(){if(!ilib._platform){try{if(typeof java.lang.Object!=="undefined"){ilib._platform=typeof process!=="undefined"?"trireme":"rhino";return ilib._platform}}catch($e$$){}ilib._platform=typeof process!=="undefined"&&typeof module!=="undefined"?"nodejs":typeof Qt!=="undefined"?"qt":typeof window!=="undefined"?typeof PalmSystem!=="undefined"?"webos":"browser":"unknown"}return ilib._platform}; ilib._getBrowser=function $ilib$_getBrowser$(){var $browser$$=void 0;if(ilib._getPlatform()==="browser"&&navigator&&navigator.userAgent){navigator.userAgent.indexOf("Firefox")>-1&&($browser$$="firefox");navigator.userAgent.indexOf("Opera")>-1&&($browser$$="opera");navigator.userAgent.indexOf("Chrome")>-1&&($browser$$="chrome");navigator.userAgent.indexOf(" .NET")>-1&&($browser$$="ie");navigator.userAgent.indexOf("Safari")>-1&&($browser$$="safari")}return $browser$$}; ilib._isGlobal=function $ilib$_isGlobal$($name$$){switch(ilib._getPlatform()){case "rhino":return typeof function(){return typeof global==="object"?global:this}()[$name$$]!=="undefined";case "nodejs":case "trireme":var $root$$=typeof global!=="undefined"?global:this;return $root$$&&typeof $root$$[$name$$]!=="undefined";case "qt":return false;default:try{return window&&typeof window[$name$$]!=="undefined"}catch($e$$){return false}}}; ilib.setLocale=function $ilib$setLocale$($spec$$){if(typeof $spec$$==="string"||!$spec$$)ilib.locale=$spec$$}; ilib.getLocale=function $ilib$getLocale$(){if(typeof ilib.locale!=="string"){switch(ilib._getPlatform()){case "browser":ilib.locale=navigator.language.substring(0,3)+navigator.language.substring(3,5).toUpperCase();if(!ilib.locale){var $lang_locobj$$=typeof navigator.browserLanguage!=="undefined"?navigator.browserLanguage:typeof navigator.userLanguage!=="undefined"?navigator.userLanguage:typeof navigator.systemLanguage!=="undefined"?navigator.systemLanguage:void 0;if(typeof $lang_locobj$$!=="undefined"&& $lang_locobj$$)ilib.locale=$lang_locobj$$.substring(0,3)+$lang_locobj$$.substring(3,5).toUpperCase()}break;case "webos":if(typeof PalmSystem.locales!=="undefined"&&typeof PalmSystem.locales.UI!="undefined"&&PalmSystem.locales.UI.length>0)ilib.locale=PalmSystem.locales.UI;else if(typeof PalmSystem.locale!=="undefined")ilib.locale=PalmSystem.locale;break;case "rhino":if(typeof environment!=="undefined"&&environment.user&&typeof environment.user.language==="string"&&environment.user.language.length> 0){ilib.locale=environment.user.language;if(typeof environment.user.country==="string"&&environment.user.country.length>0)ilib.locale=ilib.locale+("-"+environment.user.country)}break;case "trireme":if(($lang_locobj$$=process.env.LANG||process.env.LANGUAGE||process.env.LC_ALL)&&typeof $lang_locobj$$!=="undefined")ilib.locale=$lang_locobj$$.substring(0,2).toLowerCase()+"-"+$lang_locobj$$.substring(3,5).toUpperCase();break;case "nodejs":if(($lang_locobj$$=process.env.LANG||process.env.LC_ALL)&&typeof $lang_locobj$$!== "undefined")ilib.locale=$lang_locobj$$.substring(0,2).toLowerCase()+"-"+$lang_locobj$$.substring(3,5).toUpperCase();break;case "qt":$lang_locobj$$=Qt.locale();$lang_locobj$$.name&&$lang_locobj$$.name.replace("_","-")}ilib.locale=typeof ilib.locale==="string"?ilib.locale:"en-US"}return ilib.locale};ilib.setTimeZone=function $ilib$setTimeZone$($tz$$){ilib.tz=$tz$$||ilib.tz}; ilib.getTimeZone=function $ilib$getTimeZone$(){if(typeof ilib.tz==="undefined"){if(typeof navigator!=="undefined"&&typeof navigator.timezone!=="undefined"){if(navigator.timezone.length>0)ilib.tz=navigator.timezone}else if(typeof PalmSystem!=="undefined"&&typeof PalmSystem.timezone!=="undefined"){if(PalmSystem.timezone.length>0)ilib.tz=PalmSystem.timezone}else if(typeof environment!=="undefined"&&typeof environment.user!=="undefined"){if(typeof environment.user.timezone!=="undefined"&&environment.user.timezone.length> 0)ilib.tz=environment.user.timezone}else if(typeof process!=="undefined"&&typeof process.env!=="undefined"&&process.env.TZ&&typeof process.env.TZ!=="undefined")ilib.tz=process.env.TZ;ilib.tz=ilib.tz||"local"}return ilib.tz};ilib.Loader=function $ilib$Loader$(){};ilib.Loader.prototype.loadFiles=function $ilib$Loader$$loadFiles$(){};ilib.Loader.prototype.listAvailableFiles=function $ilib$Loader$$listAvailableFiles$(){};ilib.Loader.prototype.isAvailable=function $ilib$Loader$$isAvailable$(){}; ilib.setLoaderCallback=function $ilib$setLoaderCallback$($loader$$){if(typeof $loader$$==="object"&&typeof $loader$$.loadFiles==="function"||typeof $loader$$==="function"||typeof $loader$$==="undefined"){ilib._load=$loader$$;return true}return false};ilib.getLoader=function $ilib$getLoader$(){return ilib._load};ilib.isArray=function $ilib$isArray$($object$$){return typeof $object$$==="object"?Object.prototype.toString.call($object$$)==="[object Array]":false}; ilib.extend=function $ilib$extend$($object1$$,$object2$$){var $prop$$=void 0;if($object2$$)for($prop$$ in $object2$$)$prop$$&&(typeof $object2$$[$prop$$]!=="undefined"&&typeof $object2$$[$prop$$]!=="function")&&(ilib.isArray($object1$$[$prop$$])&&ilib.isArray($object2$$[$prop$$])?$object1$$[$prop$$]=$object1$$[$prop$$].concat($object2$$[$prop$$]):typeof $object1$$[$prop$$]==="object"&&typeof $object2$$[$prop$$]==="object"?$prop$$!=="ilib"&&($object1$$[$prop$$]=ilib.extend($object1$$[$prop$$],$object2$$[$prop$$])): $object1$$[$prop$$]=$object2$$[$prop$$]);return $object1$$}; ilib.extend2=function $ilib$extend2$($object1$$,$object2$$){var $prop$$=void 0;if($object2$$)for($prop$$ in $object2$$)$prop$$&&typeof $object2$$[$prop$$]!=="undefined"&&(ilib.isArray($object1$$[$prop$$])&&ilib.isArray($object2$$[$prop$$])?$object1$$[$prop$$]=$object1$$[$prop$$].concat($object2$$[$prop$$]):typeof $object1$$[$prop$$]==="object"&&typeof $object2$$[$prop$$]==="object"?$prop$$!=="ilib"&&($object1$$[$prop$$]=ilib.extend2($object1$$[$prop$$],$object2$$[$prop$$])):$object1$$[$prop$$]=$object2$$[$prop$$]); return $object1$$}; ilib.bind=function $ilib$bind$($scope$$,$method$$){function $cloneArray$$($inArrayLike$$,$inOffset$$){for(var $arr$$=[],$i$$=$inOffset$$||0,$l$$=$inArrayLike$$.length;$i$$<$l$$;$i$$++)$arr$$.push($inArrayLike$$[$i$$]);return $arr$$}if($scope$$&&$method$$&&typeof $method$$==="function"){var $args$$=$cloneArray$$(arguments,2);return typeof $method$$.bind==="function"?$method$$.bind.apply($method$$,[$scope$$].concat($args$$)):function(){var $nargs$$=$cloneArray$$(arguments);return $method$$.apply($scope$$,$args$$.concat($nargs$$))}}}; ilib._dyncode=!1;ilib.isDynCode=function $ilib$isDynCode$(){return ilib._dyncode};ilib._dyndata=!1;ilib.isDynData=function $ilib$isDynData$(){return ilib._dyndata};ilib._loadtime=(new Date).getTime(); var JSUtils={shallowCopy:function($source$$,$target$$){var $prop$$=void 0;if($source$$&&$target$$)for($prop$$ in $source$$)$prop$$!==void 0&&typeof $source$$[$prop$$]!=="undefined"&&($target$$[$prop$$]=$source$$[$prop$$])},deepCopy:function($from$$,$to$$){for(var $prop$$ in $from$$)if($prop$$)if(typeof $from$$[$prop$$]==="object"){$to$$[$prop$$]={};JSUtils.deepCopy($from$$[$prop$$],$to$$[$prop$$])}else $to$$[$prop$$]=$from$$[$prop$$];return $to$$},mapString:function($str$$,$map$$){var $mapped$$=""; if($map$$&&$str$$)for(var $i$$=0;$i$$<$str$$.length;$i$$++)var $c$$=$str$$.charAt($i$$),$mapped$$=$mapped$$+($map$$[$c$$]||$c$$);else $mapped$$=$str$$;return $mapped$$},indexOf:function($array$$,$obj$$){if(!$array$$||!$obj$$)return-1;if(typeof $array$$.indexOf==="function")return $array$$.indexOf($obj$$);for(var $i$$=0;$i$$<$array$$.length;$i$$++)if($array$$[$i$$]===$obj$$)return $i$$;return-1},toHexString:function($string$$,$limit$$){var $i$$,$result$$="",$lim$$=$limit$$&&$limit$$<9?$limit$$:4;if(!$string$$)return""; for($i$$=0;$i$$<$string$$.length;$i$$++)var $ch$$=$string$$.charCodeAt($i$$).toString(16),$result$$=$result$$+("00000000".substring(0,$lim$$-$ch$$.length)+$ch$$);return $result$$.toUpperCase()},isDate:function($object$$){return typeof $object$$==="object"?Object.prototype.toString.call($object$$)==="[object Date]":false},merge:function($object1$$,$object2$$,$replace$$,$name1$$,$name2$$){var $prop$$=void 0,$newObj$$={};for($prop$$ in $object1$$)$prop$$&&typeof $object1$$[$prop$$]!=="undefined"&&($newObj$$[$prop$$]= $object1$$[$prop$$]);for($prop$$ in $object2$$)if($prop$$&&typeof $object2$$[$prop$$]!=="undefined")if(ilib.isArray($object1$$[$prop$$])&&ilib.isArray($object2$$[$prop$$]))if(typeof $replace$$!=="boolean"||!$replace$$){$newObj$$[$prop$$]=[].concat($object1$$[$prop$$]);$newObj$$[$prop$$]=$newObj$$[$prop$$].concat($object2$$[$prop$$])}else $newObj$$[$prop$$]=$object2$$[$prop$$];else if(typeof $object1$$[$prop$$]==="object"&&typeof $object2$$[$prop$$]==="object")$newObj$$[$prop$$]=JSUtils.merge($object1$$[$prop$$], $object2$$[$prop$$],$replace$$);else{$name1$$&&($name2$$&&$newObj$$[$prop$$]==$object2$$[$prop$$])&&console.log("Property "+$prop$$+" in "+$name1$$+" is being overridden by the same value in "+$name2$$);$newObj$$[$prop$$]=$object2$$[$prop$$]}return $newObj$$},isEmpty:function($obj$$){var $prop$$=void 0;if(!$obj$$)return true;for($prop$$ in $obj$$)if($prop$$&&typeof $obj$$[$prop$$]!=="undefined")return false;return true},hashCode:function($obj$$){function $addHash$$($hash$$,$newValue$$){return($hash$$* 65543+$newValue$$)%2147483647}function $stringHash$$($str$$){for(var $hash$$=0,$i$$=0;$i$$<$str$$.length;$i$$++)$hash$$=$addHash$$($hash$$,$str$$.charCodeAt($i$$));return $hash$$}var $hash$$=0;switch(typeof $obj$$){case "undefined":$hash$$=0;break;case "string":$hash$$=$stringHash$$($obj$$);break;case "function":case "number":case "xml":$hash$$=$stringHash$$(""+$obj$$);break;case "boolean":$hash$$=$obj$$?1:0;break;case "object":var $props$$=[],$i$$0$$;for($i$$0$$ in $obj$$)$obj$$.hasOwnProperty($i$$0$$)&& $props$$.push($i$$0$$);$props$$.sort();for($i$$0$$=0;$i$$0$$<$props$$.length;$i$$0$$++){$hash$$=$addHash$$($hash$$,$stringHash$$($props$$[$i$$0$$]));$hash$$=$addHash$$($hash$$,JSUtils.hashCode($obj$$[$props$$[$i$$0$$]]))}}return $hash$$}},Locale=function $Locale$($language_parts_spec$$,$i$$,$variant$$,$script$$){if(typeof $i$$==="undefined"){$language_parts_spec$$=$language_parts_spec$$||ilib.getLocale();if(typeof $language_parts_spec$$==="string"){$language_parts_spec$$=$language_parts_spec$$.split("-"); for($i$$=0;$i$$<$language_parts_spec$$.length;$i$$++)Locale._isLanguageCode($language_parts_spec$$[$i$$])?this.language=$language_parts_spec$$[$i$$]:Locale._isRegionCode($language_parts_spec$$[$i$$])?this.region=$language_parts_spec$$[$i$$]:Locale._isScriptCode($language_parts_spec$$[$i$$])?this.script=$language_parts_spec$$[$i$$]:this.variant=$language_parts_spec$$[$i$$];this.language=this.language||void 0;this.region=this.region||void 0;this.script=this.script||void 0;this.variant=this.variant|| void 0}else if(typeof $language_parts_spec$$==="object"){this.language=$language_parts_spec$$.language||void 0;this.region=$language_parts_spec$$.region||void 0;this.script=$language_parts_spec$$.script||void 0;this.variant=$language_parts_spec$$.variant||void 0}}else{if($language_parts_spec$$){$language_parts_spec$$=$language_parts_spec$$.trim();this.language=$language_parts_spec$$.length>0?$language_parts_spec$$.toLowerCase():void 0}else this.language=void 0;if($i$$){$i$$=$i$$.trim();this.region= $i$$.length>0?$i$$.toUpperCase():void 0}else this.region=void 0;if($variant$$){$variant$$=$variant$$.trim();this.variant=$variant$$.length>0?$variant$$:void 0}else this.variant=void 0;if($script$$){$script$$=$script$$.trim();this.script=$script$$.length>0?$script$$:void 0}else this.script=void 0}this._genSpec()}; Locale.a2toa3regmap={AF:"AFG",AX:"ALA",AL:"ALB",DZ:"DZA",AS:"ASM",AD:"AND",AO:"AGO",AI:"AIA",AQ:"ATA",AG:"ATG",AR:"ARG",AM:"ARM",AW:"ABW",AU:"AUS",AT:"AUT",AZ:"AZE",BS:"BHS",BH:"BHR",BD:"BGD",BB:"BRB",BY:"BLR",BE:"BEL",BZ:"BLZ",BJ:"BEN",BM:"BMU",BT:"BTN",BO:"BOL",BQ:"BES",BA:"BIH",BW:"BWA",BV:"BVT",BR:"BRA",IO:"IOT",BN:"BRN",BG:"BGR",BF:"BFA",BI:"BDI",KH:"KHM",CM:"CMR",CA:"CAN",CV:"CPV",KY:"CYM",CF:"CAF",TD:"TCD",CL:"CHL",CN:"CHN",CX:"CXR",CC:"CCK",CO:"COL",KM:"COM",CG:"COG",CD:"COD",CK:"COK",CR:"CRI", CI:"CIV",HR:"HRV",CU:"CUB",CW:"CUW",CY:"CYP",CZ:"CZE",DK:"DNK",DJ:"DJI",DM:"DMA",DO:"DOM",EC:"ECU",EG:"EGY",SV:"SLV",GQ:"GNQ",ER:"ERI",EE:"EST",ET:"ETH",FK:"FLK",FO:"FRO",FJ:"FJI",FI:"FIN",FR:"FRA",GF:"GUF",PF:"PYF",TF:"ATF",GA:"GAB",GM:"GMB",GE:"GEO",DE:"DEU",GH:"GHA",GI:"GIB",GR:"GRC",GL:"GRL",GD:"GRD",GP:"GLP",GU:"GUM",GT:"GTM",GG:"GGY",GN:"GIN",GW:"GNB",GY:"GUY",HT:"HTI",HM:"HMD",VA:"VAT",HN:"HND",HK:"HKG",HU:"HUN",IS:"ISL",IN:"IND",ID:"IDN",IR:"IRN",IQ:"IRQ",IE:"IRL",IM:"IMN",IL:"ISR",IT:"ITA", JM:"JAM",JP:"JPN",JE:"JEY",JO:"JOR",KZ:"KAZ",KE:"KEN",KI:"KIR",KP:"PRK",KR:"KOR",KW:"KWT",KG:"KGZ",LA:"LAO",LV:"LVA",LB:"LBN",LS:"LSO",LR:"LBR",LY:"LBY",LI:"LIE",LT:"LTU",LU:"LUX",MO:"MAC",MK:"MKD",MG:"MDG",MW:"MWI",MY:"MYS",MV:"MDV",ML:"MLI",MT:"MLT",MH:"MHL",MQ:"MTQ",MR:"MRT",MU:"MUS",YT:"MYT",MX:"MEX",FM:"FSM",MD:"MDA",MC:"MCO",MN:"MNG",ME:"MNE",MS:"MSR",MA:"MAR",MZ:"MOZ",MM:"MMR",NA:"NAM",NR:"NRU",NP:"NPL",NL:"NLD",NC:"NCL",NZ:"NZL",NI:"NIC",NE:"NER",NG:"NGA",NU:"NIU",NF:"NFK",MP:"MNP",NO:"NOR", OM:"OMN",PK:"PAK",PW:"PLW",PS:"PSE",PA:"PAN",PG:"PNG",PY:"PRY",PE:"PER",PH:"PHL",PN:"PCN",PL:"POL",PT:"PRT",PR:"PRI",QA:"QAT",RE:"REU",RO:"ROU",RU:"RUS",RW:"RWA",BL:"BLM",SH:"SHN",KN:"KNA",LC:"LCA",MF:"MAF",PM:"SPM",VC:"VCT",WS:"WSM",SM:"SMR",ST:"STP",SA:"SAU",SN:"SEN",RS:"SRB",SC:"SYC",SL:"SLE",SG:"SGP",SX:"SXM",SK:"SVK",SI:"SVN",SB:"SLB",SO:"SOM",ZA:"ZAF",GS:"SGS",SS:"SSD",ES:"ESP",LK:"LKA",SD:"SDN",SR:"SUR",SJ:"SJM",SZ:"SWZ",SE:"SWE",CH:"CHE",SY:"SYR",TW:"TWN",TJ:"TJK",TZ:"TZA",TH:"THA",TL:"TLS", TG:"TGO",TK:"TKL",TO:"TON",TT:"TTO",TN:"TUN",TR:"TUR",TM:"TKM",TC:"TCA",TV:"TUV",UG:"UGA",UA:"UKR",AE:"ARE",GB:"GBR",US:"USA",UM:"UMI",UY:"URY",UZ:"UZB",VU:"VUT",VE:"VEN",VN:"VNM",VG:"VGB",VI:"VIR",WF:"WLF",EH:"ESH",YE:"YEM",ZM:"ZMB",ZW:"ZWE"}; Locale.a1toa3langmap={ab:"abk",aa:"aar",af:"afr",ak:"aka",sq:"sqi",am:"amh",ar:"ara",an:"arg",hy:"hye",as:"asm",av:"ava",ae:"ave",ay:"aym",az:"aze",bm:"bam",ba:"bak",eu:"eus",be:"bel",bn:"ben",bh:"bih",bi:"bis",bs:"bos",br:"bre",bg:"bul",my:"mya",ca:"cat",ch:"cha",ce:"che",ny:"nya",zh:"zho",cv:"chv",kw:"cor",co:"cos",cr:"cre",hr:"hrv",cs:"ces",da:"dan",dv:"div",nl:"nld",dz:"dzo",en:"eng",eo:"epo",et:"est",ee:"ewe",fo:"fao",fj:"fij",fi:"fin",fr:"fra",ff:"ful",gl:"glg",ka:"kat",de:"deu",el:"ell",gn:"grn", gu:"guj",ht:"hat",ha:"hau",he:"heb",hz:"her",hi:"hin",ho:"hmo",hu:"hun",ia:"ina",id:"ind",ie:"ile",ga:"gle",ig:"ibo",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",kl:"kal",kn:"kan",kr:"kau",ks:"kas",kk:"kaz",km:"khm",ki:"kik",rw:"kin",ky:"kir",kv:"kom",kg:"kon",ko:"kor",ku:"kur",kj:"kua",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",gv:"glv",mk:"mkd",mg:"mlg",ms:"msa",ml:"mal",mt:"mlt",mi:"mri",mr:"mar",mh:"mah",mn:"mon",na:"nau",nv:"nav",nb:"nob", nd:"nde",ne:"nep",ng:"ndo",nn:"nno",no:"nor",ii:"iii",nr:"nbl",oc:"oci",oj:"oji",cu:"chu",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",fa:"fas",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",sa:"san",sc:"srd",sd:"snd",se:"sme",sm:"smo",sg:"sag",sr:"srp",gd:"gla",sn:"sna",si:"sin",sk:"slk",sl:"slv",so:"som",st:"sot",az:"azb",es:"spa",su:"sun",sw:"swa",ss:"ssw",sv:"swe",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",bo:"bod",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso", tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",cy:"cym",wo:"wol",fy:"fry",xh:"xho",yi:"yid",yo:"yor",za:"zha",zu:"zul"};Locale._notLower=function $Locale$_notLower$($ch$$1_str$$){$ch$$1_str$$=$ch$$1_str$$.charCodeAt(0);return $ch$$1_str$$<97||$ch$$1_str$$>122};Locale._notUpper=function $Locale$_notUpper$($ch$$2_str$$){$ch$$2_str$$=$ch$$2_str$$.charCodeAt(0);return $ch$$2_str$$<65||$ch$$2_str$$>90}; Locale._notDigit=function $Locale$_notDigit$($ch$$3_str$$){$ch$$3_str$$=$ch$$3_str$$.charCodeAt(0);return $ch$$3_str$$<48||$ch$$3_str$$>57};Locale._isLanguageCode=function $Locale$_isLanguageCode$($str$$){if(typeof $str$$==="undefined"||$str$$.length<2||$str$$.length>3)return false;for(var $i$$=0;$i$$<$str$$.length;$i$$++)if(Locale._notLower($str$$.charAt($i$$)))return false;return true}; Locale._isRegionCode=function $Locale$_isRegionCode$($str$$){if(typeof $str$$==="undefined"||$str$$.length<2||$str$$.length>3)return false;if($str$$.length===2)for(var $i$$=0;$i$$<$str$$.length;$i$$++){if(Locale._notUpper($str$$.charAt($i$$)))return false}else for($i$$=0;$i$$<$str$$.length;$i$$++)if(Locale._notDigit($str$$.charAt($i$$)))return false;return true}; Locale._isScriptCode=function $Locale$_isScriptCode$($str$$){if(typeof $str$$==="undefined"||$str$$.length!==4||Locale._notUpper($str$$.charAt(0)))return false;for(var $i$$=1;$i$$<4;$i$$++)if(Locale._notLower($str$$.charAt($i$$)))return false;return true};Locale.regionAlpha2ToAlpha3=function $Locale$regionAlpha2ToAlpha3$($alpha2$$){return Locale.a2toa3regmap[$alpha2$$]||$alpha2$$}; Locale.languageAlpha1ToAlpha3=function $Locale$languageAlpha1ToAlpha3$($alpha1$$){return Locale.a1toa3langmap[$alpha1$$]||$alpha1$$}; Locale.prototype={_genSpec:function $Locale$$_genSpec$(){this.spec=this.language||"";if(this.script){if(this.spec.length>0)this.spec=this.spec+"-";this.spec=this.spec+this.script}if(this.region){if(this.spec.length>0)this.spec=this.spec+"-";this.spec=this.spec+this.region}if(this.variant){if(this.spec.length>0)this.spec=this.spec+"-";this.spec=this.spec+this.variant}},getLanguage:function $Locale$$getLanguage$(){return this.language},getLanguageAlpha3:function $Locale$$getLanguageAlpha3$(){return Locale.languageAlpha1ToAlpha3(this.language)}, getRegion:function $Locale$$getRegion$(){return this.region},getRegionAlpha3:function $Locale$$getRegionAlpha3$(){return Locale.regionAlpha2ToAlpha3(this.region)},getScript:function $Locale$$getScript$(){return this.script},getVariant:function $Locale$$getVariant$(){return this.variant},getSpec:function $Locale$$getSpec$(){return this.spec},toString:function $Locale$$toString$(){return this.getSpec()},equals:function $Locale$$equals$($other$$){return this.language===$other$$.language&&this.region=== $other$$.region&&this.script===$other$$.script&&this.variant===$other$$.variant},isPseudo:function $Locale$$isPseudo$(){return JSUtils.indexOf(ilib.pseudoLocales,this.spec)>-1}};Locale.locales=[]; Locale.getAvailableLocales=function $Locale$getAvailableLocales$($sync$$,$onLoad$$){var $locales$$=[];if(Locale.locales.length||typeof ilib._load.listAvailableFiles!=="function"){$locales$$=Locale.locales;$onLoad$$&&typeof $onLoad$$==="function"&&$onLoad$$($locales$$)}else{typeof $sync$$==="undefined"&&($sync$$=true);ilib._load.listAvailableFiles($sync$$,function($manifest$$){if($manifest$$)for(var $dir$$ in $manifest$$)for(var $filelist$$=$manifest$$[$dir$$],$i$$=0;$i$$<$filelist$$.length;$i$$++)$filelist$$[$i$$].length> 15&&$filelist$$[$i$$].substr(-15)==="localeinfo.json"&&$locales$$.push($filelist$$[$i$$].substring(0,$filelist$$[$i$$].length-16).replace(/\//g,"-"));$onLoad$$&&typeof $onLoad$$==="function"&&$onLoad$$($locales$$)})}return $locales$$}; var Utils={mergeLocData:function($prefix$$,$loc_locale$$,$replaceArrays$$,$returnOne$$){var $data$$=void 0,$loc_locale$$=$loc_locale$$||new Locale,$foundLocaleData$$=false,$property$$=$prefix$$,$mostSpecific$$;$mostSpecific$$=$data$$=ilib.data[$prefix$$]||{};if($loc_locale$$.getLanguage()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}if($loc_locale$$.getRegion()){$property$$= $prefix$$+"_"+$loc_locale$$.getRegion();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}if($loc_locale$$.getLanguage()){$loc_locale$$.getLanguage();if($loc_locale$$.getScript()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage()+"_"+$loc_locale$$.getScript();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$= ilib.data[$property$$]}}if($loc_locale$$.getRegion()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage()+"_"+$loc_locale$$.getRegion();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}}if($loc_locale$$.getRegion()&&$loc_locale$$.getVariant()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage()+"_"+$loc_locale$$.getVariant();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$= JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}if($loc_locale$$.getLanguage()&&$loc_locale$$.getScript()&&$loc_locale$$.getRegion()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage()+"_"+$loc_locale$$.getScript()+"_"+$loc_locale$$.getRegion();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}if($loc_locale$$.getLanguage()&&$loc_locale$$.getRegion()&& $loc_locale$$.getVariant()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage()+"_"+$loc_locale$$.getRegion()+"_"+$loc_locale$$.getVariant();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}if($loc_locale$$.getLanguage()&&$loc_locale$$.getScript()&&$loc_locale$$.getRegion()&&$loc_locale$$.getVariant()){$property$$=$prefix$$+"_"+$loc_locale$$.getLanguage()+"_"+$loc_locale$$.getScript()+ "_"+$loc_locale$$.getRegion()+"_"+$loc_locale$$.getVariant();if(ilib.data[$property$$]){$foundLocaleData$$=true;$data$$=JSUtils.merge($data$$,ilib.data[$property$$],$replaceArrays$$);$mostSpecific$$=ilib.data[$property$$]}}return $foundLocaleData$$?$returnOne$$?$mostSpecific$$:$data$$:void 0},getLocFiles:function($locale$$,$name$$){var $files$$=[],$filename$$=$name$$||"resources.json",$loc$$1_variant$$=$locale$$||new Locale,$language$$=$loc$$1_variant$$.getLanguage(),$region$$=$loc$$1_variant$$.getRegion(), $script$$=$loc$$1_variant$$.getScript(),$loc$$1_variant$$=$loc$$1_variant$$.getVariant();$files$$.push($filename$$);$language$$&&$files$$.push($language$$+"/"+$filename$$);$region$$&&$files$$.push("und/"+$region$$+"/"+$filename$$);if($language$$){$script$$&&$files$$.push($language$$+"/"+$script$$+"/"+$filename$$);$region$$&&$files$$.push($language$$+"/"+$region$$+"/"+$filename$$)}$region$$&&$loc$$1_variant$$&&$files$$.push("und/"+$region$$+"/"+$loc$$1_variant$$+"/"+$filename$$);$language$$&&($script$$&& $region$$)&&$files$$.push($language$$+"/"+$script$$+"/"+$region$$+"/"+$filename$$);$language$$&&($region$$&&$loc$$1_variant$$)&&$files$$.push($language$$+"/"+$region$$+"/"+$loc$$1_variant$$+"/"+$filename$$);$language$$&&($script$$&&$region$$&&$loc$$1_variant$$)&&$files$$.push($language$$+"/"+$script$$+"/"+$region$$+"/"+$loc$$1_variant$$+"/"+$filename$$);return $files$$},_callLoadData:function($files$$,$sync$$,$params$$,$callback$$){if(typeof ilib._load==="function")return ilib._load($files$$,$sync$$, $params$$,$callback$$);if(typeof ilib._load==="object"&&typeof ilib._load.loadFiles==="function")return ilib._load.loadFiles($files$$,$sync$$,$params$$,$callback$$)},loadData:function($dot_params$$2_returnOne$$){var $files$$2_name$$="resources.json",$object$$=void 0,$locale$$=new Locale(ilib.getLocale()),$sync$$=false,$type$$=void 0,$loadParams$$={},$callback$$=void 0,$nonlocale$$=false,$replace$$=false,$basename$$;if($dot_params$$2_returnOne$$&&typeof $dot_params$$2_returnOne$$.callback==="function"){if($dot_params$$2_returnOne$$.name)$files$$2_name$$= $dot_params$$2_returnOne$$.name;if($dot_params$$2_returnOne$$.object)$object$$=$dot_params$$2_returnOne$$.object;$dot_params$$2_returnOne$$.locale&&($locale$$=typeof $dot_params$$2_returnOne$$.locale==="string"?new Locale($dot_params$$2_returnOne$$.locale):$dot_params$$2_returnOne$$.locale);if($dot_params$$2_returnOne$$.type)$type$$=$dot_params$$2_returnOne$$.type;if($dot_params$$2_returnOne$$.loadParams)$loadParams$$=$dot_params$$2_returnOne$$.loadParams;if($dot_params$$2_returnOne$$.sync)$sync$$= $dot_params$$2_returnOne$$.sync;$dot_params$$2_returnOne$$.nonlocale&&($nonlocale$$=!!$dot_params$$2_returnOne$$.nonlocale);if(typeof $dot_params$$2_returnOne$$.replace==="boolean")$replace$$=$dot_params$$2_returnOne$$.replace;$callback$$=$dot_params$$2_returnOne$$.callback;if($object$$&&!$object$$.cache)$object$$.cache={};if(!$type$$){$dot_params$$2_returnOne$$=$files$$2_name$$.lastIndexOf(".");$type$$=$dot_params$$2_returnOne$$!==-1?$files$$2_name$$.substring($dot_params$$2_returnOne$$+1):"text"}var $spec$$= (!$nonlocale$$&&$locale$$.getSpec().replace(/-/g,"_")||"root")+","+$files$$2_name$$+","+(""+JSUtils.hashCode($loadParams$$));if(!$object$$||typeof $object$$.cache[$spec$$]==="undefined"){var $data$$,$dot_params$$2_returnOne$$=$loadParams$$&&$loadParams$$.returnOne;if($type$$==="json"){$basename$$=$files$$2_name$$.substring(0,$files$$2_name$$.lastIndexOf("."));if($nonlocale$$){$basename$$=$basename$$.replace(/\//g,".").replace(/[\\\+\-]/g,"_");$data$$=ilib.data[$basename$$]}else $data$$=Utils.mergeLocData($basename$$, $locale$$,$replace$$,$dot_params$$2_returnOne$$);if($data$$){$object$$&&($object$$.cache[$spec$$]=$data$$);$callback$$($data$$);return}}if(typeof ilib._load!=="undefined"){$files$$2_name$$=$nonlocale$$?[$files$$2_name$$||"resources.json"]:Utils.getLocFiles($locale$$,$files$$2_name$$);if($type$$!=="json")$loadParams$$.returnOne=true;Utils._callLoadData($files$$2_name$$,$sync$$,$loadParams$$,ilib.bind(this,function($arr$$){if($type$$==="json"){$data$$=ilib.data[$basename$$]||{};for(var $i$$=0;$i$$< $arr$$.length;$i$$++)typeof $arr$$[$i$$]!=="undefined"&&($data$$=$loadParams$$.returnOne?$arr$$[$i$$]:JSUtils.merge($data$$,$arr$$[$i$$],$replace$$));$object$$&&($object$$.cache[$spec$$]=$data$$);$callback$$($data$$)}else{for($i$$=$arr$$.length-1;$i$$>-1&&!$arr$$[$i$$];)$i$$--;if($i$$>-1){$object$$&&($object$$.cache[$spec$$]=$arr$$[$i$$]);$callback$$($arr$$[$i$$])}else $callback$$(void 0)}}))}else{$type$$==="json"&&($data$$=ilib.data[$basename$$]);$object$$&&$data$$&&($object$$.cache[$spec$$]=$data$$); $callback$$($data$$)}}else $callback$$($object$$.cache[$spec$$])}}},LocaleInfo=function $LocaleInfo$($locale$$,$options$$){var $sync$$=true,$loadParams$$=void 0;this.info=LocaleInfo.defaultInfo;switch(typeof $locale$$){case "string":this.locale=new Locale($locale$$);break;default:case "undefined":this.locale=new Locale;break;case "object":this.locale=$locale$$}if($options$$){typeof $options$$.sync!=="undefined"&&($sync$$=$options$$.sync==true);if(typeof $options$$.loadParams!=="undefined")$loadParams$$= $options$$.loadParams}if(!LocaleInfo.cache)LocaleInfo.cache={};Utils.loadData({object:LocaleInfo,locale:this.locale,name:"localeinfo.json",sync:$sync$$,loadParams:$loadParams$$,callback:ilib.bind(this,function($info$$){if(!$info$$){var $info$$=LocaleInfo.defaultInfo,$spec$$=this.locale.getSpec().replace(/-/g,"_");LocaleInfo.cache[$spec$$]=$info$$}this.info=$info$$;if($options$$&&typeof $options$$.onLoad==="function")$options$$.onLoad(this)})})};LocaleInfo.defaultInfo=ilib.data.localeinfo; LocaleInfo.defaultInfo=LocaleInfo.defaultInfo||{scripts:["Latn"],timezone:"Etc/UTC",units:"metric",calendar:"gregorian",clock:"24",currency:"USD",firstDayOfWeek:1,meridiems:"gregorian",numfmt:{currencyFormats:{common:"{s}{n}",commonNegative:"{s}-{n}",iso:"{s}{n}",isoNegative:"{s}-{n}"},script:"Latn",decimalChar:",",groupChar:".",prigroupSize:3,secgroupSize:0,pctFmt:"{n}%",negativepctFmt:"-{n}%",pctChar:"%",roundingMode:"halfdown",exponential:"e",digits:""}}; LocaleInfo.prototype={getLanguageName:function $LocaleInfo$$getLanguageName$(){return this.info["language.name"]},getRegionName:function $LocaleInfo$$getRegionName$(){return this.info["region.name"]},getClock:function $LocaleInfo$$getClock$(){return this.info.clock},getLocale:function $LocaleInfo$$getLocale$(){return this.locale},getUnits:function $LocaleInfo$$getUnits$(){return this.info.units},getUnitFormat:function $LocaleInfo$$getUnitFormat$(){return this.info.unitfmt},getCalendar:function $LocaleInfo$$getCalendar$(){return this.info.calendar}, getFirstDayOfWeek:function $LocaleInfo$$getFirstDayOfWeek$(){return this.info.firstDayOfWeek},getWeekEndStart:function $LocaleInfo$$getWeekEndStart$(){return this.info.weekendStart},getWeekEndEnd:function $LocaleInfo$$getWeekEndEnd$(){return this.info.weekendEnd},getTimeZone:function $LocaleInfo$$getTimeZone$(){return this.info.timezone},getDecimalSeparator:function $LocaleInfo$$getDecimalSeparator$(){return this.info.numfmt.decimalChar},getNativeDecimalSeparator:function $LocaleInfo$$getNativeDecimalSeparator$(){return this.info.native_numfmt&& this.info.native_numfmt.decimalChar||this.info.numfmt.decimalChar},getGroupingSeparator:function $LocaleInfo$$getGroupingSeparator$(){return this.info.numfmt.groupChar},getNativeGroupingSeparator:function $LocaleInfo$$getNativeGroupingSeparator$(){return this.info.native_numfmt&&this.info.native_numfmt.groupChar||this.info.numfmt.groupChar},getPrimaryGroupingDigits:function $LocaleInfo$$getPrimaryGroupingDigits$(){return typeof this.info.numfmt.prigroupSize!=="undefined"&&this.info.numfmt.prigroupSize|| 0},getSecondaryGroupingDigits:function $LocaleInfo$$getSecondaryGroupingDigits$(){return this.info.numfmt.secgroupSize||0},getPercentageFormat:function $LocaleInfo$$getPercentageFormat$(){return this.info.numfmt.pctFmt},getNegativePercentageFormat:function $LocaleInfo$$getNegativePercentageFormat$(){return this.info.numfmt.negativepctFmt},getPercentageSymbol:function $LocaleInfo$$getPercentageSymbol$(){return this.info.numfmt.pctChar||"%"},getExponential:function $LocaleInfo$$getExponential$(){return this.info.numfmt.exponential}, getNativeExponential:function $LocaleInfo$$getNativeExponential$(){return this.info.native_numfmt&&this.info.native_numfmt.exponential||this.info.numfmt.exponential},getNativePercentageSymbol:function $LocaleInfo$$getNativePercentageSymbol$(){return this.info.native_numfmt&&this.info.native_numfmt.pctChar||this.info.numfmt.pctChar||"%"},getNegativeNumberFormat:function $LocaleInfo$$getNegativeNumberFormat$(){return this.info.numfmt.negativenumFmt},getCurrencyFormats:function $LocaleInfo$$getCurrencyFormats$(){return this.info.numfmt.currencyFormats}, getCurrency:function $LocaleInfo$$getCurrency$(){return this.info.currency},getDigitsStyle:function $LocaleInfo$$getDigitsStyle$(){return this.info.numfmt.useNative?"native":typeof this.info.native_numfmt!=="undefined"?"optional":"western"},getDigits:function $LocaleInfo$$getDigits$(){return this.info.numfmt.digits},getNativeDigits:function $LocaleInfo$$getNativeDigits$(){return this.info.numfmt.useNative&&this.info.numfmt.digits||this.info.native_numfmt&&this.info.native_numfmt.digits},getRoundingMode:function $LocaleInfo$$getRoundingMode$(){return this.info.numfmt.roundingMode}, getDefaultScript:function $LocaleInfo$$getDefaultScript$(){return this.info.scripts?this.info.scripts[0]:"Latn"},getScript:function $LocaleInfo$$getScript$(){return this.locale.getScript()||this.getDefaultScript()},getAllScripts:function $LocaleInfo$$getAllScripts$(){return this.info.scripts||["Latn"]},getMeridiemsStyle:function $LocaleInfo$$getMeridiemsStyle$(){return this.info.meridiems||"gregorian"}};var IDate=function $IDate$(){};IDate._constructors={}; IDate.prototype={getType:function $IDate$$getType$(){return"date"},getTime:function $IDate$$getTime$(){return this.rd.getTime()},getTimeExtended:function $IDate$$getTimeExtended$(){return this.rd.getTimeExtended()},setTime:function $IDate$$setTime$($millis$$){this.rd=this.newRd({unixtime:$millis$$,cal:this.cal});this._calcDateComponents()},getDays:function $IDate$$getDays$(){return this.day},getMonths:function $IDate$$getMonths$(){return this.month},getYears:function $IDate$$getYears$(){return this.year}, getHours:function $IDate$$getHours$(){return this.hour},getMinutes:function $IDate$$getMinutes$(){return this.minute},getSeconds:function $IDate$$getSeconds$(){return this.second},getMilliseconds:function $IDate$$getMilliseconds$(){return this.millisecond},getEra:function $IDate$$getEra$(){return this.year<1?-1:1},setDays:function $IDate$$setDays$($day$$){this.day=parseInt($day$$,10)||1;this.rd._setDateComponents(this)},setMonths:function $IDate$$setMonths$($month$$){this.month=parseInt($month$$, 10)||1;this.rd._setDateComponents(this)},setYears:function $IDate$$setYears$($year$$){this.year=parseInt($year$$,10)||0;this.rd._setDateComponents(this)},setHours:function $IDate$$setHours$($hour$$){this.hour=parseInt($hour$$,10)||0;this.rd._setDateComponents(this)},setMinutes:function $IDate$$setMinutes$($minute$$){this.minute=parseInt($minute$$,10)||0;this.rd._setDateComponents(this)},setSeconds:function $IDate$$setSeconds$($second$$){this.second=parseInt($second$$,10)||0;this.rd._setDateComponents(this)}, setMilliseconds:function $IDate$$setMilliseconds$($milli$$){this.millisecond=parseInt($milli$$,10)||0;this.rd._setDateComponents(this)},before:function $IDate$$before$($dow$$){return new this.constructor({rd:this.rd.before($dow$$,this.offset),timezone:this.timezone})},after:function $IDate$$after$($dow$$){return new this.constructor({rd:this.rd.after($dow$$,this.offset),timezone:this.timezone})},onOrBefore:function $IDate$$onOrBefore$($dow$$){return new this.constructor({rd:this.rd.onOrBefore($dow$$, this.offset),timezone:this.timezone})},onOrAfter:function $IDate$$onOrAfter$($dow$$){return new this.constructor({rd:this.rd.onOrAfter($dow$$,this.offset),timezone:this.timezone})},getJSDate:function $IDate$$getJSDate$(){var $unix$$=this.rd.getTimeExtended();return isNaN($unix$$)?void 0:new Date($unix$$)},getRataDie:function $IDate$$getRataDie$(){return this.rd.getRataDie()},setRd:function $IDate$$setRd$($rd$$){this.rd=this.newRd({rd:$rd$$,cal:this.cal});this._calcDateComponents()},getJulianDay:function $IDate$$getJulianDay$(){return this.rd.getJulianDay()}, setJulianDay:function $IDate$$setJulianDay$($date$$){this.rd=this.newRd({julianday:typeof $date$$==="object"?$date$$.getDate():$date$$,cal:this.cal});this._calcDateComponents()},getTimeZone:function $IDate$$getTimeZone$(){return this.timezone||"local"},setTimeZone:function $IDate$$setTimeZone$($tzName$$){if(!$tzName$$||$tzName$$==="")this.tz=this.timezone=void 0;else if(typeof $tzName$$==="string"){this.timezone=$tzName$$;this.tz=void 0;this._calcDateComponents()}},firstSunday:function $IDate$$firstSunday$($year$$){return this.newRd({rd:this.newRd({year:$year$$, month:1,day:1,hour:0,minute:0,second:0,millisecond:0,cal:this.cal}).onOrAfter(4),cal:this.cal}).before(0)},getWeekOfYear:function $IDate$$getWeekOfYear$(){var $rd$$=Math.floor(this.rd.getRataDie()),$nextYear_year$$=this._calcYear($rd$$+this.offset),$yearStart$$=this.firstSunday($nextYear_year$$);if($rd$$<$yearStart$$)$yearStart$$=this.firstSunday($nextYear_year$$-1);else{$nextYear_year$$=this.firstSunday($nextYear_year$$+1);$rd$$>=$nextYear_year$$&&($yearStart$$=$nextYear_year$$)}return Math.floor(($rd$$- $yearStart$$)/7)+1},getWeekOfMonth:function $IDate$$getWeekOfMonth$($first$$1_locale$$){var $li_weekStart$$=new LocaleInfo($first$$1_locale$$),$first$$1_locale$$=this.newRd({year:this._calcYear(this.rd.getRataDie()+this.offset),month:this.getMonths(),day:1,hour:0,minute:0,second:0,millisecond:0,cal:this.cal}),$li_weekStart$$=$first$$1_locale$$.onOrAfter($li_weekStart$$.getFirstDayOfWeek());$li_weekStart$$-$first$$1_locale$$.getRataDie()>3&&($li_weekStart$$=$li_weekStart$$-7);return Math.floor((this.rd.getRataDie()- $li_weekStart$$)/7)+1}}; var MathUtils={signum:function($num$$){var $n$$=$num$$;if(typeof $num$$==="string")$n$$=parseInt($num$$,10);else if(typeof $num$$!=="number")return 1;return $n$$<0?-1:1},floor:function($num$$){return Math.floor($num$$)},ceiling:function($num$$){return Math.ceil($num$$)},down:function($num$$){return $num$$<0?Math.ceil($num$$):Math.floor($num$$)},up:function($num$$){return $num$$<0?Math.floor($num$$):Math.ceil($num$$)},halfup:function($num$$){return $num$$<0?Math.ceil($num$$-0.5):Math.floor($num$$+ 0.5)},halfdown:function($num$$){return $num$$<0?Math.floor($num$$+0.5):Math.ceil($num$$-0.5)},halfeven:function($num$$){return Math.floor($num$$)%2===0?Math.ceil($num$$-0.5):Math.floor($num$$+0.5)},halfodd:function($num$$){return Math.floor($num$$)%2!==0?Math.ceil($num$$-0.5):Math.floor($num$$+0.5)},mod:function($dividend$$,$modulus$$){if($modulus$$==0)return 0;var $x$$=$dividend$$%$modulus$$;return $x$$<0?$x$$+$modulus$$:$x$$},amod:function($dividend$$,$modulus$$){if($modulus$$==0)return 0;var $x$$= $dividend$$%$modulus$$;return $x$$<=0?$x$$+$modulus$$:$x$$}},IString=function $IString$($string$$){this.str=typeof $string$$==="object"?$string$$ instanceof IString?$string$$.str:$string$$.toString():typeof $string$$==="string"?new String($string$$):"";this.length=this.str.length;this.cpLength=-1;this.localeSpec=ilib.getLocale()}; IString._isSurrogate=function $IString$_isSurrogate$($ch$$4_n$$){$ch$$4_n$$=$ch$$4_n$$.charCodeAt(0);return $ch$$4_n$$>=56320&&$ch$$4_n$$<=57343||$ch$$4_n$$>=55296&&$ch$$4_n$$<=56319};IString.fromCodePoint=function $IString$fromCodePoint$($codepoint$$){if($codepoint$$<65536)return String.fromCharCode($codepoint$$);var $low$$=$codepoint$$&65535;return String.fromCharCode(55296|(Math.floor($codepoint$$/65536)-1&15)<<6|($low$$&64512)>>10)+String.fromCharCode(56320|$low$$&1023)}; IString.toCodePoint=function $IString$toCodePoint$($str$$,$index$$){if(!$str$$||$str$$.length===0)return-1;var $code$$=-1,$high$$=$str$$.charCodeAt($index$$);if($high$$>=55296&&$high$$<=56319){if($str$$.length>$index$$+1){var $low$$=$str$$.charCodeAt($index$$+1);$low$$>=56320&&$low$$<=57343&&($code$$=(($high$$&960)>>6)+1<<16|($high$$&63)<<10|$low$$&1023)}}else $code$$=$high$$;return $code$$}; IString.loadPlurals=function $IString$loadPlurals$($sync$$,$loc$$2_locale$$,$loadParams$$,$onLoad$$){var $loc$$2_locale$$=$loc$$2_locale$$?typeof $loc$$2_locale$$==="string"?new Locale($loc$$2_locale$$):$loc$$2_locale$$:new Locale(ilib.getLocale()),$spec$$=$loc$$2_locale$$.getLanguage();ilib.data["plurals_"+$spec$$]?$onLoad$$&&typeof $onLoad$$==="function"&&$onLoad$$(ilib.data["plurals_"+$spec$$]):Utils.loadData({name:"plurals.json",object:IString,locale:$loc$$2_locale$$,sync:$sync$$,loadParams:$loadParams$$, callback:ilib.bind(this,function($plurals$$){$plurals$$||(IString.cache[$spec$$]={});ilib.data["plurals_"+$spec$$]=$plurals$$||{};$onLoad$$&&typeof $onLoad$$==="function"&&$onLoad$$(ilib.data["plurals_"+$spec$$])})})}; IString._fncs={firstProp:function $IString$_fncs$firstProp$($obj$$){for(var $p$$ in $obj$$)if($p$$&&$obj$$[$p$$])return $p$$},getValue:function $IString$_fncs$getValue$($obj$$,$n$$){if(typeof $obj$$==="object"){var $subrule$$=IString._fncs.firstProp($obj$$);return IString._fncs[$subrule$$]($obj$$[$subrule$$],$n$$)}return typeof $obj$$==="string"?$n$$:$obj$$},matchRangeContinuous:function $IString$_fncs$matchRangeContinuous$($n$$,$range$$){for(var $num$$ in $range$$)if(typeof $num$$!=="undefined"&& typeof $range$$[$num$$]!=="undefined"){var $obj$$=$range$$[$num$$];if(typeof $obj$$==="number"){if($n$$===$range$$[$num$$])return true}else if(Object.prototype.toString.call($obj$$)==="[object Array]"&&$n$$>=$obj$$[0]&&$n$$<=$obj$$[1])return true}return false},matchRange:function $IString$_fncs$matchRange$($n$$,$range$$){return Math.floor($n$$)!==$n$$?false:IString._fncs.matchRangeContinuous($n$$,$range$$)},is:function $IString$_fncs$is$($rule$$,$n$$){var $left$$=IString._fncs.getValue($rule$$[0], $n$$),$right$$=IString._fncs.getValue($rule$$[1],$n$$);return $left$$==$right$$},isnot:function $IString$_fncs$isnot$($rule$$,$n$$){return IString._fncs.getValue($rule$$[0],$n$$)!=IString._fncs.getValue($rule$$[1],$n$$)},inrange:function $IString$_fncs$inrange$($rule$$,$n$$){return IString._fncs.matchRange(IString._fncs.getValue($rule$$[0],$n$$),$rule$$[1])},notin:function $IString$_fncs$notin$($rule$$,$n$$){return!IString._fncs.matchRange(IString._fncs.getValue($rule$$[0],$n$$),$rule$$[1])},within:function $IString$_fncs$within$($rule$$, $n$$){return IString._fncs.matchRangeContinuous(IString._fncs.getValue($rule$$[0],$n$$),$rule$$[1])},mod:function $IString$_fncs$mod$($rule$$,$n$$){return MathUtils.mod(IString._fncs.getValue($rule$$[0],$n$$),IString._fncs.getValue($rule$$[1],$n$$))},n:function $IString$_fncs$n$($rule$$,$n$$){return $n$$},or:function $IString$_fncs$or$($rule$$,$n$$){return IString._fncs.getValue($rule$$[0],$n$$)||IString._fncs.getValue($rule$$[1],$n$$)},and:function $IString$_fncs$and$($rule$$,$n$$){return IString._fncs.getValue($rule$$[0], $n$$)&&IString._fncs.getValue($rule$$[1],$n$$)}}; IString.prototype={_length:function $IString$$_length$(){return this.str.length},format:function $IString$$format$($params$$){var $formatted$$=this.str;if($params$$){var $regex$$,$p$$;for($p$$ in $params$$)if(typeof $params$$[$p$$]!=="undefined"){$regex$$=RegExp("{"+$p$$+"}","g");$formatted$$=$formatted$$.replace($regex$$,$params$$[$p$$])}}return $formatted$$.toString()},formatChoice:function $IString$$formatChoice$($argIndex$$,$params$$){var $arg$$=this.str.split("|"),$type$$=typeof $argIndex$$, $limits$$=[],$strings$$=[],$i$$,$limit$$1_parts$$1_ruleset_start$$,$result$$=void 0,$defaultCase$$="";if(this.str.length===0)return"";for($i$$=0;$i$$<$arg$$.length;$i$$++){$limit$$1_parts$$1_ruleset_start$$=$arg$$[$i$$].split("#");if($limit$$1_parts$$1_ruleset_start$$.length>2){$limits$$[$i$$]=$limit$$1_parts$$1_ruleset_start$$[0];$limit$$1_parts$$1_ruleset_start$$=$limit$$1_parts$$1_ruleset_start$$.shift();$strings$$[$i$$]=$limit$$1_parts$$1_ruleset_start$$.join("#")}else if($limit$$1_parts$$1_ruleset_start$$.length=== 2){$limits$$[$i$$]=$limit$$1_parts$$1_ruleset_start$$[0];$strings$$[$i$$]=$limit$$1_parts$$1_ruleset_start$$[1]}else throw"syntax error in choice format pattern: "+$arg$$[$i$$];}for($i$$=0;$i$$<$limits$$.length;$i$$++)if($limits$$[$i$$].length===0)$defaultCase$$=new IString($strings$$[$i$$]);else switch($type$$){case "number":$arg$$=parseInt($argIndex$$,10);if($limits$$[$i$$].substring(0,2)==="<="){$limit$$1_parts$$1_ruleset_start$$=parseFloat($limits$$[$i$$].substring(2));if($arg$$<=$limit$$1_parts$$1_ruleset_start$$){$result$$= new IString($strings$$[$i$$]);$i$$=$limits$$.length}}else if($limits$$[$i$$].substring(0,2)===">="){$limit$$1_parts$$1_ruleset_start$$=parseFloat($limits$$[$i$$].substring(2));if($arg$$>=$limit$$1_parts$$1_ruleset_start$$){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}}else if($limits$$[$i$$].charAt(0)==="<"){$limit$$1_parts$$1_ruleset_start$$=parseFloat($limits$$[$i$$].substring(1));if($arg$$<$limit$$1_parts$$1_ruleset_start$$){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}}else if($limits$$[$i$$].charAt(0)=== ">"){$limit$$1_parts$$1_ruleset_start$$=parseFloat($limits$$[$i$$].substring(1));if($arg$$>$limit$$1_parts$$1_ruleset_start$$){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}}else{this.locale=this.locale||new Locale(this.localeSpec);switch($limits$$[$i$$]){case "zero":case "one":case "two":case "few":case "many":if(($limit$$1_parts$$1_ruleset_start$$=ilib.data["plurals_"+this.locale.getLanguage()])&&IString._fncs.getValue($limit$$1_parts$$1_ruleset_start$$[$limits$$[$i$$]],$arg$$)){$result$$= new IString($strings$$[$i$$]);$i$$=$limits$$.length}break;default:var $dash_end$$=$limits$$[$i$$].indexOf("-");if($dash_end$$!==-1){$limit$$1_parts$$1_ruleset_start$$=$limits$$[$i$$].substring(0,$dash_end$$);$dash_end$$=$limits$$[$i$$].substring($dash_end$$+1);if($arg$$>=parseInt($limit$$1_parts$$1_ruleset_start$$,10)&&$arg$$<=parseInt($dash_end$$,10)){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}}else if($arg$$===parseInt($limits$$[$i$$],10)){$result$$=new IString($strings$$[$i$$]); $i$$=$limits$$.length}}}break;case "boolean":if($limits$$[$i$$]==="true"&&$argIndex$$===true){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}else if($limits$$[$i$$]==="false"&&$argIndex$$===false){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}break;case "string":if(RegExp($limits$$[$i$$],"i").test($argIndex$$)){$result$$=new IString($strings$$[$i$$]);$i$$=$limits$$.length}break;case "object":throw"syntax error: fmtChoice parameter for the argument index cannot be an object"; }$result$$||($result$$=$defaultCase$$||new IString(""));$result$$=$result$$.format($params$$);return $result$$.toString()},toString:function $IString$$toString$(){return this.str.toString()},valueOf:function $IString$$valueOf$(){return this.str.valueOf()},charAt:function $IString$$charAt$($index$$){return new IString(this.str.charAt($index$$))},charCodeAt:function $IString$$charCodeAt$($index$$){return this.str.charCodeAt($index$$)},concat:function $IString$$concat$($strings$$){return new IString(this.str.concat($strings$$))}, indexOf:function $IString$$indexOf$($searchValue$$,$start$$){return this.str.indexOf($searchValue$$,$start$$)},lastIndexOf:function $IString$$lastIndexOf$($searchValue$$,$start$$){return this.str.lastIndexOf($searchValue$$,$start$$)},match:function $IString$$match$($regexp$$){return this.str.match($regexp$$)},replace:function $IString$$replace$($searchValue$$,$newValue$$){return new IString(this.str.replace($searchValue$$,$newValue$$))},search:function $IString$$search$($regexp$$){return this.str.search($regexp$$)}, slice:function $IString$$slice$($start$$,$end$$){return new IString(this.str.slice($start$$,$end$$))},split:function $IString$$split$($separator$$,$limit$$){return this.str.split($separator$$,$limit$$)},substr:function $IString$$substr$($start$$,$length$$){var $plat$$=ilib._getPlatform();if($plat$$==="qt"||$plat$$==="rhino"||$plat$$==="trireme")typeof $length$$==="undefined"&&($length$$=this.str.length-$start$$);return new IString(this.str.substr($start$$,$length$$))},substring:function $IString$$substring$($from$$, $to$$){return this.str.substring($from$$,$to$$)},toLowerCase:function $IString$$toLowerCase$(){return this.str.toLowerCase()},toUpperCase:function $IString$$toUpperCase$(){return this.str.toUpperCase()},_toCodePoint:function $IString$$_toCodePoint$($index$$){return IString.toCodePoint(this.str,$index$$)},forEach:function $IString$$forEach$($callback$$){if(typeof $callback$$==="function")for(var $it$$=this.charIterator();$it$$.hasNext();)$callback$$($it$$.next())},forEachCodePoint:function $IString$$forEachCodePoint$($callback$$){if(typeof $callback$$=== "function")for(var $it$$=this.iterator();$it$$.hasNext();)$callback$$($it$$.next())},iterator:function $IString$$iterator$(){return new function _iterator($istring$$){this.index=0;this.hasNext=function $this$hasNext$(){return this.index<$istring$$.str.length};this.next=function $this$next$(){if(this.index<$istring$$.str.length){var $num$$=$istring$$._toCodePoint(this.index);this.index=this.index+($num$$>65535?2:1)}else $num$$=-1;return $num$$}}(this)},charIterator:function $IString$$charIterator$(){return new function _chiterator($istring$$){this.index= 0;this.hasNext=function $this$hasNext$(){return this.index<$istring$$.str.length};this.next=function $this$next$(){var $ch$$;if(this.index<$istring$$.str.length){$ch$$=$istring$$.str.charAt(this.index);if(IString._isSurrogate($ch$$)&&this.index+1<$istring$$.str.length&&IString._isSurrogate($istring$$.str.charAt(this.index+1))){this.index++;$ch$$=$ch$$+$istring$$.str.charAt(this.index)}this.index++}return $ch$$}}(this)},codePointAt:function $IString$$codePointAt$($count$$6_index$$){if($count$$6_index$$< 0)return-1;for(var $it$$=this.iterator(),$ch$$;$count$$6_index$$>=0&&$it$$.hasNext();$count$$6_index$$--)$ch$$=$it$$.next();return $count$$6_index$$<0?$ch$$:-1},setLocale:function $IString$$setLocale$($locale$$,$sync$$,$loadParams$$,$onLoad$$){if(typeof $locale$$==="object")this.locale=$locale$$;else{this.localeSpec=$locale$$;this.locale=new Locale($locale$$)}IString.loadPlurals(typeof $sync$$!=="undefined"?$sync$$:true,this.locale,$loadParams$$,$onLoad$$)},getLocale:function $IString$$getLocale$(){return(this.locale? this.locale.getSpec():this.localeSpec)||ilib.getLocale()},codePointLength:function $IString$$codePointLength$(){if(this.cpLength===-1){var $it$$=this.iterator();for(this.cpLength=0;$it$$.hasNext();){this.cpLength++;$it$$.next()}}return this.cpLength}};var Calendar=function $Calendar$(){};Calendar._constructors={}; Calendar.prototype={getType:function $Calendar$$getType$(){throw"Cannot call meth