1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-25 10:42:17 -05:00
kaiwa/clientapp/libraries/sugar-1.2.1-dates.js
2013-08-20 10:45:06 -07:00

68 lines
29 KiB
JavaScript

/*
* Sugar Library v1.2.1
*
* Freely distributable and licensed under the MIT-style license.
* Copyright (c) 2012 Andrew Plummer
* http://sugarjs.com/
*
* ---------------------------- */
(function(context){var i=true,j=false;function k(a){return function(){return a}}var l=Object,o=Array,r=RegExp,s=Date,t=String,u=Number,aa=l.defineProperty&&l.defineProperties;function v(a,b,c,d){var f=b?a.prototype:a;w(d,function(g,h){if(typeof c==="function")y(f,g,ba(f[g],h,c));else if(c===i||!f[g])y(f,g,h)})}function ba(a,b,c){return function(){return a&&(c===i||c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}}
function y(a,b,c){if(aa)l.defineProperty(a,b,{value:c,configurable:i,enumerable:j,writable:i});else a[b]=c}function w(a,b){var c=0,d;for(d in a)if(a.hasOwnProperty(d)){b.call(a,d,a[d],c);c++}}function z(a,b,c,d){return a===b?i:l.isRegExp(b)?r(b).test(a):l.isFunction(b)?b.apply(c,[a].concat(d)):l.equal(b,a)}function A(a,b,c,d){return B(b)?a:l.isFunction(b)?b.apply(c,d||[]):l.isFunction(a[b])?a[b].call(a):a[b]}function da(a,b,c,d){a=Array.prototype.slice.call(a,void 0);if(c!==j)a=C(a);D(a,b,d)}
function B(a){return a===void 0}function E(a){return a!==void 0}function F(a,b,c,d){typeof b=="object"&&w(b,function(f,g){var h=a[f],e=E(h),m=l.isArray(g);if(c===i&&(m||l.isObject(g))){h||(h=m?[]:{});F(h,g,c)}else if(e&&l.isFunction(d))h=d.call(b,f,a[f],b[f]);else if(!e||e&&d!==j)h=b[f];if(E(h))a[f]=h});return a}
v(l,j,j,{isObject:function(a){return a===null||B(a)?j:l.prototype.toString.call(a)==="[object Object]"&&a.constructor===l},each:function(a,b){b&&w(a,function(c,d){b.call(a,c,d,a)});return a},merge:function(a,b,c){return F(a,b,i,c)}});function D(a,b,c,d){var f;G(b);if(c<0)c=a.length+c;c=isNaN(c)?0:parseInt(c>>0);for(d=d===i?a.length+c:a.length;c<d;){f=c%a.length;if(b.call(a,a[f],f,a)===j)break;c++}}
function H(a,b,c,d,f){var g,h;D(a,function(e,m,q){if(z(e,b,q,[m,q])){g=e;h=m;return j}},c,d);return f?h:g}function C(a,b,c){b=b||Infinity;c=c||0;var d=[];D(a,function(f){if(l.isArray(f)&&c<b)d=d.concat(C(f,b,c+1));else d.push(f)});return d}function I(a,b,c,d){var f=a.length,g=d==-1,h=g?f-1:0;c=isNaN(c)?h:parseInt(c>>0);if(c<0)c=f+c;if(!g&&c<0||g&&c>=f)c=h;for(;g&&c>=0||!g&&c<f;){if(a[c]===b)return c;c+=d}return-1}function G(a){if(!a||!a.call)throw new TypeError("Callback is not callable");}
function J(a){if(a.length===0)throw new TypeError("First argument must be defined");}
v(o,i,function(){var a=arguments;return a.length===0||l.isFunction(a[0])},{every:function(a,b){var c=this.length,d=0;for(J(arguments);d<c;){if(d in this&&!z(this[d],a,b,[d,this]))return j;d++}return i},some:function(a,b){var c=this.length,d=0;for(J(arguments);d<c;){if(d in this&&z(this[d],a,b,[d,this]))return i;d++}return j},map:function(a,b){var c=this.length,d=0,f,g=Array(c);for(J(arguments);d<c;){if(d in this){f=this[d];g[d]=A(f,a,b,[f,d,this])}d++}return g},filter:function(a,b){var c=this.length,
d=0,f=[];for(J(arguments);d<c;){d in this&&z(this[d],a,b,[d,this])&&f.push(this[d]);d++}return f}});
v(o,i,j,{indexOf:function(a,b){if(l.isString(this))return this.indexOf(a,b);return I(this,a,b,1)},lastIndexOf:function(a,b){if(l.isString(this))return this.lastIndexOf(a,b);return I(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(G(a);d<c;){d in this&&a.call(b,this[d],d,this);d++}},reduce:function(a,b){return arrayReduce(this,a,b)},reduceRight:function(a,b){return arrayReduce(this,a,b,i)},groupBy:function(a,b){var c=this,d={},f;D(c,function(g,h){f=A(g,a,c,[g,h,c]);d[f]||(d[f]=[]);d[f].push(g)});
return l.each(d,b)},compact:function(a){var b=[];D(this,function(c){if(l.isArray(c))b.push(c.compact());else if(a&&c)b.push(c);else if(!a&&E(c)&&c!==null&&(!l.isNumber(c)||!isNaN(c)))b.push(c)});return b}});function K(a,b,c){c=Math[c||"round"];var d=Math.abs(Math.pow(10,b||0));if(b<0)d=1/d;return c(a*d)/d}function ea(a,b,c,d){var f=[];a=parseInt(a);for(var g=d>0;g&&a<=b||!g&&a>=b;){f.push(a);c&&c.call(this,a);a+=d}return f}
v(u,i,j,{toNumber:function(){return parseFloat(this,10)},ordinalize:function(){var a;if(this>=11&&this<=13)a="th";else switch(this%10){case 1:a="st";break;case 2:a="nd";break;case 3:a="rd";break;default:a="th"}return this.toString()+a},pad:function(a,b,c){c=c||10;var d=this.toNumber()===0?"":this.toString(c).replace(/^-/,"");c=d;a=a-d.replace(/\.\d+$/,"").length;d=0;var f=String("0");if(f!="0")f="";l.isNumber(a)||(a=1);l.isNumber(d)||(d=1);d=f.repeat(a)+c+f.repeat(d);if(b||this<0)d=(this<0?"-":"+")+
d;return d}});function fa(a,b){function c(){return K(this*b)}function d(){return L(arguments)[g](this)}function f(){return L(arguments)[g](-this)}var g="add"+a.capitalize()+"s";y(u.prototype,a,c);y(u.prototype,a+"s",c);y(u.prototype,a+"Before",f);y(u.prototype,a+"sBefore",f);y(u.prototype,a+"Ago",f);y(u.prototype,a+"sAgo",f);y(u.prototype,a+"After",d);y(u.prototype,a+"sAfter",d);y(u.prototype,a+"FromNow",d);y(u.prototype,a+"sFromNow",d)}
function M(){return"\t\n\u000b\u000c\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff"}
v(t,i,j,{capitalize:function(a){return this.toLowerCase().replace(a?/\b[a-z]/g:/^[a-z]/,function(b){return b.toUpperCase()})},repeat:function(a){var b="",c=0;if(l.isNumber(a)&&a>0)for(;c<a;){b+=this;c++}return b},toNumber:function(a){var b=this.replace(/,/g,"");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},first:function(a){a=B(a)?1:a;return this.substr(0,a)},last:function(a){a=B(a)?1:a;return this.substr(this.length-a<0?0:this.length-a)},to:function(a){if(B(a))a=this.length;return this.slice(0,
a)},toDate:function(a){return L([this.toString(),a])},assign:function(){var a={};da(arguments,function(b,c){if(l.isObject(b))l.merge(a,b);else a[c+1]=b});return this.replace(/\{(.+?)\}/g,function(b,c){return a.hasOwnProperty(c)?a[c]:b})}});
var N=["hour","minute","second","millisecond","meridian","utc","offset_sign","offset_hours","offset_minutes"],O="(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(?:\\.(\\d{1,6}))?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?",P="\\s*(?:(?:t|at |\\s+)"+O+")?",Q="\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",R="\u5341\u767e\u5343\u4e07",ga=r("["+Q+R+"]","g"),S=[],T,U,ha=[{src:"(\\d{4})",to:["year"]},{src:"([+-])?(\\d{4})[-.]?({month})[-.]?(\\d{1,2})?",to:["year_sign","year","month","date"]},{src:"(\\d{1,2})[-.\\/]({month})[-.\\/]?(\\d{2,4})?",
to:["month","date","year"],h:i},{src:"\\/Date\\((\\d+(?:\\+\\d{4})?)\\)\\/",to:["timestamp"],r:j}],ia=[{b:"f{1,4}|ms|milliseconds",format:function(a){return a.getMilliseconds()}},{b:"ss?|seconds",format:function(a){return a.getSeconds()}},{b:"mm?|minutes",format:function(a){return a.getMinutes()}},{b:"hh?|hours|12hr",format:function(a){a=a.getHours(void 0);return a===0?12:a-(a/13|0)*12}},{b:"HH?|24hr",format:function(a){return a.getHours()}},{b:"dd?|date|day",format:function(a){return a.getDate()}},
{b:"dow|weekday",i:i,format:function(a,b,c){return b.weekdays[a.getDay()+(c-1)*7]}},{b:"MM?",format:function(a){return a.getMonth()+1}},{b:"mon|month",i:i,format:function(a,b,c){return b.months[a.getMonth()+(c-1)*12]}},{b:"y{2,4}|year",format:function(a){return a.getFullYear()}},{b:"[Tt]{1,2}",format:function(a,b,c,d){a=a.getHours(void 0)<12?"am":"pm";if(d.length===1)a=a.first();if(d.first()==="T")a=a.toUpperCase();return a}},{b:"z{1,4}|tz|timezone",text:i,format:function(a,b,c,d){a=a.getUTCOffset();
if(d=="z"||d=="zz")a=a.replace(/(\d{2})(\d{2})/,function(f,g){return g.toNumber().pad(d.length)});return a}},{b:"iso(tz|timezone)",format:function(a){return a.getUTCOffset(i)}},{b:"ord",format:function(a){return a.getDate().ordinalize()}}],V=[{a:"year",method:"FullYear",c:function(a){return(365+(a?a.isLeapYear()?1:0:0.25))*24*60*60*1E3}},{a:"month",method:"Month",c:function(a,b){var c=30.4375,d;if(a){d=a.daysInMonth();if(b<=d.days())c=d}return c*24*60*60*1E3}},{a:"week",method:"Week",c:k(6048E5)},
{a:"day",method:"Date",c:k(864E5)},{a:"hour",method:"Hours",c:k(36E5)},{a:"minute",method:"Minutes",c:k(6E4)},{a:"second",method:"Seconds",c:k(1E3)},{a:"millisecond",method:"Milliseconds",c:k(1)}],W={},ja={en:"2;;January,February,March,April,May,June,July,August,September,October,November,December;Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday;millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s;one,two,three,four,five,six,seven,eight,nine,ten;a,an,the;the,st|nd|rd|th,of;{num} {unit} {sign},{num} {unit=4-5} {sign} {day},{weekday?} {month} {date}{2} {year?} {time?},{date} {month} {year},{month} {year},{shift?} {weekday} {time?},{shift} week {weekday} {time?},{shift} {unit=5-7},{1} {edge} of {shift?} {unit=4-7?}{month?}{year?},{weekday} {3} {shift} week,{1} {date}{2} of {month},{1}{month?} {date?}{2} of {shift} {unit=6-7},{day} at {time?},{time} {day};{Month} {d}, {yyyy};,yesterday,today,tomorrow;,ago|before,,from now|after|from;,last,the|this,next;last day,end,,first day|beginning",
ja:"1;\u6708;;\u65e5\u66dc\u65e5,\u6708\u66dc\u65e5,\u706b\u66dc\u65e5,\u6c34\u66dc\u65e5,\u6728\u66dc\u65e5,\u91d1\u66dc\u65e5,\u571f\u66dc\u65e5;\u30df\u30ea\u79d2,\u79d2,\u5206,\u6642\u9593,\u65e5,\u9031\u9593|\u9031,\u30f6\u6708|\u30f5\u6708|\u6708,\u5e74;;;;{num}{unit}{sign},{shift}{unit=5-7}{weekday?},{year}\u5e74{month?}\u6708?{date?}\u65e5?,{month}\u6708{date?}\u65e5?,{date}\u65e5;{yyyy}\u5e74{M}\u6708{d}\u65e5;\u4e00\u6628\u65e5,\u6628\u65e5,\u4eca\u65e5,\u660e\u65e5,\u660e\u5f8c\u65e5;,\u524d,,\u5f8c;,\u53bb|\u5148,,\u6765",
ko:"1;\uc6d4;;\uc77c\uc694\uc77c,\uc6d4\uc694\uc77c,\ud654\uc694\uc77c,\uc218\uc694\uc77c,\ubaa9\uc694\uc77c,\uae08\uc694\uc77c,\ud1a0\uc694\uc77c;\ubc00\ub9ac\ucd08,\ucd08,\ubd84,\uc2dc\uac04,\uc77c,\uc8fc,\uac1c\uc6d4|\ub2ec,\ub144;\uc77c|\ud55c,\uc774,\uc0bc,\uc0ac,\uc624,\uc721,\uce60,\ud314,\uad6c,\uc2ed;;;{num}{unit} {sign},{shift} {unit=5-7},{shift} {unit=5?} {weekday},{year}\ub144{month?}\uc6d4?{date?}\uc77c?,{month}\uc6d4{date?}\uc77c?,{date}\uc77c;{yyyy}\ub144{M}\uc6d4{d}\uc77c;\uadf8\uc800\uaed8,\uc5b4\uc81c,\uc624\ub298,\ub0b4\uc77c,\ubaa8\ub808;,\uc804,,\ud6c4;,\uc9c0\ub09c|\uc791,\uc774\ubc88,\ub2e4\uc74c|\ub0b4",
ru:"4;;\u042f\u043d\u0432\u0430\u0440:\u044f|\u044c,\u0424\u0435\u0432\u0440\u0430\u043b:\u044f|\u044c,\u041c\u0430\u0440\u0442:\u0430|,\u0410\u043f\u0440\u0435\u043b:\u044f|\u044c,\u041c\u0430:\u044f|\u0439,\u0418\u044e\u043d:\u044f|\u044c,\u0418\u044e\u043b:\u044f|\u044c,\u0410\u0432\u0433\u0443\u0441\u0442:\u0430|,\u0421\u0435\u043d\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041e\u043a\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041d\u043e\u044f\u0431\u0440:\u044f|\u044c,\u0414\u0435\u043a\u0430\u0431\u0440:\u044f|\u044c;\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435,\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a,\u0412\u0442\u043e\u0440\u043d\u0438\u043a,\u0421\u0440\u0435\u0434\u0430,\u0427\u0435\u0442\u0432\u0435\u0440\u0433,\u041f\u044f\u0442\u043d\u0438\u0446\u0430,\u0421\u0443\u0431\u0431\u043e\u0442\u0430;\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u043c\u0438\u043d\u0443\u0442:\u0430|\u0443|\u044b|,\u0447\u0430\u0441:||\u0430|\u043e\u0432,\u0434\u0435\u043d\u044c|\u0434\u0435\u043d\u044c|\u0434\u043d\u044f|\u0434\u043d\u0435\u0439,\u043d\u0435\u0434\u0435\u043b:\u044f|\u044e|\u0438|\u044c|\u0435,\u043c\u0435\u0441\u044f\u0446:||\u0430|\u0435\u0432|\u0435,\u0433\u043e\u0434|\u0433\u043e\u0434|\u0433\u043e\u0434\u0430|\u043b\u0435\u0442|\u0433\u043e\u0434\u0443;\u043e\u0434:\u0438\u043d|\u043d\u0443,\u0434\u0432:\u0430|\u0435,\u0442\u0440\u0438,\u0447\u0435\u0442\u044b\u0440\u0435,\u043f\u044f\u0442\u044c,\u0448\u0435\u0441\u0442\u044c,\u0441\u0435\u043c\u044c,\u0432\u043e\u0441\u0435\u043c\u044c,\u0434\u0435\u0432\u044f\u0442\u044c,\u0434\u0435\u0441\u044f\u0442\u044c;;\u0432|\u043d\u0430,\u0433\u043e\u0434\u0430;{num} {unit} {sign},{sign} {num} {unit},{date} {month} {year?} {2},{month} {year},{1} {shift} {unit=5-7};{d} {month} {yyyy} \u0433\u043e\u0434\u0430;\u043f\u043e\u0437\u0430\u0432\u0447\u0435\u0440\u0430,\u0432\u0447\u0435\u0440\u0430,\u0441\u0435\u0433\u043e\u0434\u043d\u044f,\u0437\u0430\u0432\u0442\u0440\u0430,\u043f\u043e\u0441\u043b\u0435\u0437\u0430\u0432\u0442\u0440\u0430;,\u043d\u0430\u0437\u0430\u0434,,\u0447\u0435\u0440\u0435\u0437;,\u043f\u0440\u043e\u0448\u043b\u043e:\u0439|\u043c,,\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435:\u0439|\u043c",
es:"6;;enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre;domingo,lunes,martes,mi\u00e9rcoles|miercoles,jueves,viernes,s\u00e1bado|sabado;milisegundo:|s,segundo:|s,minuto:|s,hora:|s,d\u00eda|d\u00edas|dia|dias,semana:|s,mes:|es,a\u00f1o|a\u00f1os|ano|anos;uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve,diez;;el,de;{sign} {num} {unit},{num} {unit} {sign},{date?} {2} {month} {2} {year?},{1} {unit=5-7} {shift},{1} {shift} {unit=5-7};{d} de {month} de {yyyy};anteayer,ayer,hoy,ma\u00f1ana|manana;,hace,,de ahora;,pasad:o|a,,pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
pt:"6;;janeiro,fevereiro,mar\u00e7o,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro;domingo,segunda-feira,ter\u00e7a-feira,quarta-feira,quinta-feira,sexta-feira,s\u00e1bado|sabado;milisegundo:|s,segundo:|s,minuto:|s,hora:|s,dia:|s,semana:|s,m\u00eas|m\u00eases|mes|meses,ano:|s;um,dois,tr\u00eas|tres,quatro,cinco,seis,sete,oito,nove,dez,uma,duas;;a,de;{num} {unit} {sign},{sign} {num} {unit},{date?} {2} {month} {2} {year?},{1} {unit=5-7} {shift},{1} {shift} {unit=5-7};{d} de {month} de {yyyy};anteontem,ontem,hoje,amanh:\u00e3|a;,atr\u00e1s|atras|h\u00e1|ha,,daqui a;,passad:o|a,,pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
fr:"2;;janvier,f\u00e9vrier|fevrier,mars,avril,mai,juin,juillet,ao\u00fbt,septembre,octobre,novembre,d\u00e9cembre|decembre;dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi;milliseconde:|s,seconde:|s,minute:|s,heure:|s,jour:|s,semaine:|s,mois,an:|s|n\u00e9e|nee;un:|e,deux,trois,quatre,cinq,six,sept,huit,neuf,dix;;l'|la|le;{sign} {num} {unit},{sign} {num} {unit},{1} {date?} {month} {year?},{1} {unit=5-7} {shift};{d} {month} {yyyy};,hier,aujourd'hui,demain;,il y a,,dans|d'ici;,derni:er|\u00e8re|ere,,prochain:|e",
it:"2;;Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre;Domenica,Luned:\u00ec|i,Marted:\u00ec|i,Mercoled:\u00ec|i,Gioved:\u00ec|i,Venerd:\u00ec|i,Sabato;millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i;un:|'|a|o,due,tre,quattro,cinque,sei,sette,otto,nove,dieci;;l'|la|il;{num} {unit} {sign},{weekday?} {date?} {month} {year?},{1} {unit=5-7} {shift},{1} {shift} {unit=5-7};{d} {month} {yyyy};,ieri,oggi,domani,dopodomani;,fa,,da adesso;,scors:o|a,,prossim:o|a",
de:"2;;Januar,Februar,M\u00e4rz|Marz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember;Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag;Millisekunde:|n,Sekunde:|n,Minute:|n,Stunde:|n,Tag:|en,Woche:|n,Monat:|en,Jahr:|en;ein:|e|er|em|en,zwei,drei,vier,fuenf,sechs,sieben,acht,neun,zehn;;der;{sign} {num} {unit},{num} {unit} {sign},{num} {unit} {sign},{sign} {num} {unit},{weekday?} {date?} {month} {year?},{shift} {unit=5-7};{d}. {Month} {yyyy};vorgestern,gestern,heute,morgen,\u00fcbermorgen|ubermorgen|uebermorgen;,vor:|her,,in;,letzte:|r|n|s,,n\u00e4chste:|r|n|s+naechste:|r|n|s",
"zh-TW":"1;\u6708;;\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d;\u6beb\u79d2,\u79d2\u9418,\u5206\u9418,\u5c0f\u6642,\u5929,\u500b\u661f\u671f|\u9031,\u500b\u6708,\u5e74;;;\u65e5|\u865f;{num}{unit}{sign},\u661f\u671f{weekday},{shift}{unit=5-7},{shift}{unit=5}{weekday},{year}\u5e74{month?}\u6708?{date?}{1},{month}\u6708{date?}{1},{date}{1};{yyyy}\u5e74{M}\u6708{d}\u65e5;\u524d\u5929,\u6628\u5929,\u4eca\u5929,\u660e\u5929,\u5f8c\u5929;,\u524d,,\u5f8c;,\u4e0a|\u53bb,\u9019,\u4e0b|\u660e","zh-CN":"1;\u6708;;\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d;\u6beb\u79d2,\u79d2\u949f,\u5206\u949f,\u5c0f\u65f6,\u5929,\u4e2a\u661f\u671f|\u5468,\u4e2a\u6708,\u5e74;;;\u65e5|\u53f7;{num}{unit}{sign},\u661f\u671f{weekday},{shift}{unit=5-7},{shift}{unit=5}{weekday},{year}\u5e74{month?}\u6708?{date?}{1},{month}\u6708{date?}{1},{date}{1};{yyyy}\u5e74{M}\u6708{d}\u65e5;\u524d\u5929,\u6628\u5929,\u4eca\u5929,\u660e\u5929,\u540e\u5929;,\u524d,,\u540e;,\u4e0a|\u53bb,\u8fd9,\u4e0b|\u660e"};
function ka(a){var b=s.addFormat,c=a.code;if(!a.l){b("("+a.months.compact().join("|")+")",["month"],c);b("("+a.weekdays.compact().join("|")+")",["weekday"],c);b("("+a.modifiers.filter(function(d){return d.name==="day"}).map("text").join("|")+")",["day"],c);D(a.formats,function(d){var f=[];d=d.replace(/\s+/g,"[-,. ]*");d=d.replace(/\{(.+?)\}/g,function(g,h){var e=h.match(/\?$/),m=h.match(/(\d)(?:-(\d))?/),q=h.match(/^\d+$/),n=h.replace(/[^a-z]+$/,""),p,x;if(n==="time"){f=f.concat(N);return e?P:O}if(q)p=
a.optionals[q[0]-1];else if(a[n])p=a[n];else if(a[n+"s"]){p=a[n+"s"];if(m){x=[];D(p,function(pa,qa){var ca=qa%(a.units?8:p.length);if(ca>=m[1]&&ca<=(m[2]||m[1]))x.push(pa)});p=x}p=p.compact().join("|")}if(q)return"(?:"+p+")?";else{f.push(n);return"("+p+")"+(e?"?":"")}});b(d,f,c)});a.l=i}}function X(a,b,c){if(b&&(!l.isString(a)||!a))a=Date.currentLocale;a&&!W[a]&&la(a,c);return W[a]}
function la(a,b){function c(g,h){g=g.split("+").map(function(e){return e.replace(/(.+):(.+)$/,function(m,q,n){return n.split("|").map(function(p){return q+p}).join("|")})}).join("|");return D(g.split("|"),h)}function d(g,h,e){var m=[];if(b[g]){D(b[g],function(q,n){c(q,function(p,x){m[x*e+n]=p.toLowerCase()})});if(h)m=m.concat(b[g].map(function(q){return q.slice(0,3).toLowerCase()}));return b[g]=m}}function f(g,h){var e="[0-9\uff10-\uff19]"+(g?"{"+g+","+h+"}":"+");if(b.digits)e+="|["+b.digits+"]+";
return e}b=b||ma(a);if(!b)throw Error("Invalid locale.");d("months",i,12);d("weekdays",i,7);d("units",j,8);d("numbers",j,10);b.code=a;b.date=f(1,2);b.year=f(4,4);b.num=function(){var g=[f()].concat(b.articles);b.digits||(g=g.concat(b.numbers));return g.compact().join("|")}();(function(){var g=[];b.f={};D(b.modifiers,function(h){c(h.text,function(e){b.f[e]=h;g.push({name:h.name,text:e,value:h.value})})});g.groupBy("name",function(h,e){e=e.map("text");if(h==="day")e=e.concat(b.weekdays);b[h]=e.join("|")});
b.modifiers=g})();if(b.monthSuffix){b.month=f(1,2);b.months=ea(1,12,null,1).map(function(g){return g+b.monthSuffix})}W[a]=new na(b)}
function ma(a){function b(f){return!!(d[0]&Math.pow(2,f-1))}if(a.slice(0,3)=="en-")a="en";if(!ja[a])return null;var c={modifiers:[]},d=ja[a].split(";");D(["months","weekdays","units","numbers","articles","optionals","formats"],function(f,g){c[f]=d[g+2]?d[g+2].split(","):[]});c.outputFormat=d[9];D(["day","sign","shift","edge"],function(f,g){d[g+10]&&D(d[g+10].split(","),function(h,e){h&&c.modifiers.push({name:f,text:h,value:e-2})})});if(b(1)){c.digits=Q+R;if(c.numbers.length>0)c.digits+=c.numbers.join("");
else c.numbers=Q.split("");c.monthSuffix=d[1]}c.capitalizeUnit=a=="de";c.hasPlural=b(2);c.pastRelativeFormat=c.formats[0];c.futureRelativeFormat=c.formats[b(3)?1:0];return c}function oa(a){a||(a=Date.currentLocale);return a!="en"&&a!="en-US"}function na(a){l.merge(this,a)}
v(na,i,j,{getMonth:function(a){return l.isNumber(a)?a-1:H(this.months,r(a,"i"),0,j,i)%12},k:function(a){return H(this.weekdays,r(a,"i"),0,j,i)%7},j:function(a){var b;return l.isNumber(a)?a:a&&(b=this.numbers.indexOf(a))!==-1?(b+1)%10:1},n:function(a){var b=this;return a.replace(this.numbers[9],"").replace(/./g,function(c){return b.j(c)})},m:function(a){return English.units[this.units.indexOf(a)%8]},q:function(a,b,c){var d,f;d=c>0?this.futureRelativeFormat:this.pastRelativeFormat;if(this.code=="ru"){f=
a.toString().slice(-1);switch(i){case f==1:f=1;break;case f>=2&&f<=4:f=2;break;default:f=3}}else f=this.hasPlural&&a>1?1:0;f=this.units[f*8+b]||this.units[b];if(this.capitalizeUnit)f=f.capitalize();b=H(this.modifiers,function(g){return g.name=="sign"&&g.value==(c>0?1:-1)});return d.assign({num:a,unit:f,sign:b.text})}});function Y(a){var b;if(typeof a[0]=="object")return a;else if(a.length==1&&l.isNumber(a[0]))return[a[0]];b={};D(T,function(c,d){b[c.a]=a[d]});return[b]}
function ra(a,b){a=a.replace(/[\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19\uff10]/g,function(c){return String.fromCharCode(c.charCodeAt(0)-65248)});if(b!="date"&&b!="month"&&b!="year")return a;return a.replace(ga,function(c){return Q.indexOf(c)+1||""})}function sa(a,b){var c={},d,f;D(b,function(g,h){d=a[h+1];if(!(B(d)||d==="")){d=ra(d,g);if(g==="year")c.s=d;if(g==="millisecond")d*=Math.pow(10,3-d.length);f=parseFloat(d);c[g]=!isNaN(f)?f:d.toLowerCase()}});return c}
function ta(a,b){var c=new s,d=j,f,g,h,e,m,q,n;if(l.isDate(a))c=a;else if(l.isNumber(a))c=new s(a);else if(l.isObject(a)){c=(new s).set(a,i);e=a}else if(l.isString(a)){ka(X(b,i));g=oa(b);a=a.trim().replace(/\.+$/,"").replace(/^now$/,"");D(S,function(p){var x=a.match(p.p);if(x){h=p;e=sa(x,h.to);f=X(h.o,i);if(e.timestamp){c.setTime(0);e={milliseconds:e.timestamp};return j}if(h.h&&!l.isString(e.month)&&(l.isString(e.date)||g)){n=e.month;e.month=e.date;e.date=n}if(e.year&&e.s.length===2)e.year=K((new s).getFullYear()/
100)*100-K(e.year/100)*100+e.year;if(e.month){e.month=f.getMonth(e.month);if(e.shift&&!e.unit)e.unit="year"}if(e.weekday&&e.date)delete e.weekday;else if(e.weekday){e.weekday=f.k(e.weekday);if(e.shift&&!e.unit)e.unit="week"}if(e.day&&(n=f.f[e.day])){e.day=n.value;c.resetTime();d=i}else if(e.day&&(n=f.k(e.day))>-1){delete e.day;e.weekday=n}if(e.date&&!l.isNumber(e.date))e.date=f.n(e.date);if(e.meridian)if(e.meridian==="pm"&&e.hour<12)e.hour+=12;if(e.offset_hours||e.offset_minutes){e.utc=i;e.offset_minutes=
e.offset_minutes||0;e.offset_minutes+=e.offset_hours*60;if(e.offset_sign==="-")e.offset_minutes*=-1;e.minute-=e.offset_minutes}if(e.unit){d=i;q=f.j(e.num);m=f.m(e.unit);if(e.shift||e.edge){q*=(n=f.f[e.shift])?n.value:0;if(m==="month"&&E(e.date)){c.set({day:e.date},i);delete e.date}if(m==="year"&&E(e.month)){c.set({month:e.month,day:e.date},i);delete e.month;delete e.date}}if(e.sign&&(n=f.f[e.sign]))q*=n.value;if(E(e.weekday)){c.set({weekday:e.weekday},i);delete e.weekday}e[m]=(e[m]||0)+q}if(e.year_sign===
"-")e.year*=-1;return j}});if(h)if(d)c.advance(e);else e.utc?c.setUTC(e,i):c.set(e,i);else c=a?new s(a):new s;if(e&&e.edge){n=f.f[e.edge];D(U.slice(4),function(p){if(E(e[p.a])){m=p.a;return j}});if(m==="year")e.d="month";else if(m==="month"||m==="week")e.d="day";c[(n.value<0?"endOf":"beginningOf")+m.capitalize()]();n.value===-2&&c.resetTime()}}return{e:c,set:e}}
function Z(a,b,c,d){var f,g=X(d,i),h=r(/^[A-Z]/);if(a.isValid())if(Date[b])b=Date[b];else{if(l.isFunction(b)){f=ua(a);b=b.apply(a,f.concat(g))}}else return"Invalid Date";if(!b&&!c)b=g.outputFormat;else if(!b&&c){f=f||ua(a);if(f[1]===0){f[1]=1;f[0]=1}return g.q(f[0],f[1],f[2])}D(ia,function(e){b=b.replace(r("\\{("+e.b+")(\\d)?\\}",e.i?"i":""),function(m,q,n){m=e.format(a,g,n||1,q);n=q.length;var p=q.match(/^(.)\1+$/);if(e.i){if(n===3)m=m.slice(0,3);if(p||q.match(h))m=m.capitalize()}else if(p&&!e.text)m=
(l.isNumber(m)?m.pad(n):m.toString()).last(n);return m})});return b}function va(a,b,c){var d=ta(b),f=0,g=b=0,h;if(c>0){b=g=c;h=i}if(!d.e.isValid())return j;if(d.set&&d.set.d){D(V,function(m){if(m.a===d.set.d)f=m.c(d.e,a-d.e)-1});if(d.set.edge||d.set.shift)d.e["beginningOf"+d.set.d.capitalize()]();if(!h&&d.set.sign&&d.set.d!="millisecond"){b=50;g=-50}}c=a.getTime();h=d.e.getTime();var e=h+f;if(d.set&&d.set.d=="week"&&(new Date(e+1)).getHours()!=0)e-=s.DSTOffset;return c>=h-b&&c<=e+g}
function $(a,b,c,d,f){if(l.isNumber(b)&&f)b={milliseconds:b};else if(l.isNumber(b)){a.setTime(b);return a}if(b.date)b.day=b.date;if(!f&&B(b.day)&&E(b.weekday)){a["set"+(d?"UTC":"")+"Weekday"](b.weekday);b.day=a["get"+(d?"UTC":"")+"Date"](void 0);delete b.weekday}D(U,function(g){if(E(b[g.a])||E(b[g.a+"s"])){b.d=g.a;return j}else if(c&&g.a!=="week"&&g.a!=="year")a["set"+(d?"UTC":"")+g.method](g.a==="day"?1:0)});D(V,function(g){var h=g.a;g=g.method;var e=E(b[h])?b[h]:b[h+"s"];if(!B(e)){if(f){if(h===
"week"){e=(b.day||0)+e*7;g="Date"}e=e*f+a["get"+g](void 0)}a["set"+(d?"UTC":"")+g](e);if(h==="month"){h=e;if(h<0)h+=12;h%12!=a.getMonth()&&a.setDate(0)}}});return a}function wa(a){a.addDays(4-(a.getDay()||7)).resetTime();return 1+(a.daysSince(a.clone().beginningOfYear())/7|0)}function ua(a){var b;a=a.millisecondsFromNow();var c=Math.abs(a),d=c,f=0;D(U.slice(1),function(g,h){b=K(c/g.c(),1)|0;if(b>=1){d=b;f=h+1}});return[d,f,a]}
function L(a){var b;b=l.isNumber(a[1])?Y(a)[0]:a[0];return ta(b,a[1]).e}v(s,j,j,{create:function(){return L(arguments)},now:function(){return(new s).getTime()},setLocale:function(a,b){var c=X(a,j,b);if(c){Date.currentLocale=a;ka(c);return c}},getLocale:function(a){return X(a,i)},addFormat:function(a,b,c,d){S.push({h:d,o:c,p:r("^"+a+"$","i"),to:b})}});
v(s,i,j,{set:function(){var a=Y(arguments);return $(this,a[0],a[1])},setUTC:function(){var a=Y(arguments);return $(this,a[0],a[1],i)},setWeekday:function(a){B(a)||this.setDate(this.getDate()+a-this.getDay())},setUTCWeekday:function(a){B(a)||this.setDate(this.getUTCDate()+a-this.getDay())},setWeek:function(a){if(!B(a)){this.setMonth(0);this.setDate(a*7+1)}},setUTCWeek:function(a){if(!B(a)){this.setMonth(0);this.setUTCDate(a*7+1)}},getWeek:function(){return wa(this)},getUTCWeek:function(){return wa(this.toUTC())},
getUTCOffset:function(a){var b=this.g?0:this.getTimezoneOffset(),c=a===i?":":"";if(!b&&a)return"Z";return K(-b/60).pad(2,i)+c+(b%60).pad(2)},toUTC:function(){if(this.g)return this;var a=this.clone().addMinutes(this.getTimezoneOffset());a.g=i;return a},isUTC:function(){return this.g||this.getTimezoneOffset()===0},advance:function(){var a=Y(arguments);return $(this,a[0],j,j,1,i)},rewind:function(){var a=Y(arguments);return $(this,a[0],j,j,-1)},isValid:function(){return!isNaN(this.getTime())},isAfter:function(a,
b){return this.getTime()>s.create(a).getTime()-(b||0)},isBefore:function(a,b){return this.getTime()<s.create(a).getTime()+(b||0)},isBetween:function(a,b,c){var d=this.getTime();a=s.create(a).getTime();var f=s.create(b).getTime();b=Math.min(a,f);a=Math.max(a,f);c=c||0;return b-c<d&&a+c>d},isLeapYear:function(){var a=this.getFullYear();return a%4===0&&a%100!==0||a%400===0},daysInMonth:function(){return 32-(new s(this.getFullYear(),this.getMonth(),32)).getDate()},format:function(a,b){return Z(this,a,
j,b)},relative:function(a,b){if(l.isString(a)){b=a;a=null}return Z(this,a,i,b)},is:function(a,b){var c;if(l.isString(a)){a=a.trim().toLowerCase();switch(i){case a==="future":return this.getTime()>(new s).getTime();case a==="past":return this.getTime()<(new s).getTime();case a==="weekday":return this.getDay()>0&&this.getDay()<6;case a==="weekend":return this.getDay()===0||this.getDay()===6;case (c=English.weekdays.indexOf(a)%7)>-1:return this.getDay()===c;case (c=English.months.indexOf(a)%12)>-1:return this.getMonth()===
c}}return va(this,a,b)},resetTime:function(){return this.set({hour:0,minute:0,second:0,millisecond:0})},clone:function(){return new s(this.getTime())},compare:function(){return this-L(arguments)}});v(s,i,j,{getWeekday:s.prototype.getDay,getUTCWeekday:s.prototype.getUTCDay});(function(){var a={};D(["Array","Boolean","Date","Function","Number","String","RegExp"],function(b){a["is"+b]=function(c){return l.prototype.toString.call(c)==="[object "+b+"]"}});v(Object,j,j,a)})();
(function(){var a=M().match(/^\s+$/);try{t.prototype.trim.call([1])}catch(b){a=j}var c=r("^["+M()+"]+"),d=r("["+M()+"]+$");v(t,i,!a,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(c,"")},trimRight:function(){return this.replace(d,"")}})})();English=s.setLocale("en");
D(V,function(a,b){var c=a.a,d=c.capitalize(),f=a.c();y(s.prototype,c+"sSince",function(g,h){return K((this.getTime()-s.create(g,h).getTime())/f)});y(s.prototype,c+"sUntil",function(g,h){return K((s.create(g,h).getTime()-this.getTime())/f)});y(s.prototype,c+"sAgo",s.prototype[c+"sUntil"]);y(s.prototype,c+"sFromNow",s.prototype[c+"sSince"]);y(s.prototype,"add"+d+"s",function(g){var h={};h[c]=g;return this.advance(h)});fa(c,f);b<3&&D(["Last","This","Next"],function(g){y(s.prototype,"is"+g+d,function(){return this.is(g+
" "+c)})});if(b<4){y(s.prototype,"beginningOf"+d,function(){var g={};switch(c){case "year":g.year=this.getFullYear();break;case "month":g.month=this.getMonth();break;case "day":g.day=this.getDate();break;case "week":g.weekday=0}return this.set(g,i)});y(s.prototype,"endOf"+d,function(){var g={hours:23,minutes:59,seconds:59,milliseconds:999};switch(c){case "year":g.month=11;g.day=31;break;case "month":g.day=this.daysInMonth();break;case "week":g.weekday=6}return this.set(g,i)})}});
(function(){T=V.concat();T.splice(2,1);U=V.concat().reverse();var a="\\d{1,2}|"+English.months.join("|");D(ha,function(b){s.addFormat(b.src.replace(/\{month\}/,a)+(b.r===j?"":P),b.to.concat(N),"en",b.h)});s.addFormat(O,N)})();(function(){var a=English.weekdays.slice(0,7),b=English.months.slice(0,12);D(["today","yesterday","tomorrow","weekday","weekend","future","past"].concat(a).concat(b),function(c){y(s.prototype,"is"+c.capitalize(),function(){return this.is(c)})})})();
v(s,j,i,{DSTOffset:((new s(2E3,6,1)).getTimezoneOffset()-(new s(2E3,0,1)).getTimezoneOffset())*60*1E3,INTERNATIONAL_TIME:"{h}:{mm}:{ss}",RFC1123:"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}",ISO8601_DATE:"{yyyy}-{MM}-{dd}",ISO8601_DATETIME:"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}"});
(function(){var a=new s(s.UTC(1999,11,31));if(!a.toISOString||a.toISOString()!=="1999-12-31T00:00:00.000Z")v(s,i,i,{toISOString:function(){return Z(this.toUTC(),s.ISO8601_DATETIME)}});if(!a.toJSON||a.toJSON()!=="1999-12-31T00:00:00.000Z")v(s,i,i,{toJSON:s.prototype.toISOString});v(s,i,j,{iso:s.prototype.toISOString})})();})(this);