2022-09-17 19:36:06 +08:00
|
|
|
(()=>{var a={3:function(a){a.exports=function(){"use strict";var a,t,e=1e3,n=6e4,r=36e5,s=864e5,i=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,o=31536e6,l=2592e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:o,months:l,days:s,hours:r,minutes:n,seconds:e,milliseconds:1,weeks:6048e5},m=function(a){return a instanceof v},d=function(a,t,e){return new v(a,e,t.$l)},p=function(a){return t.p(a)+"s"},g=function(a){return a<0},f=function(a){return g(a)?Math.ceil(a):Math.floor(a)},h=function(a){return Math.abs(a)},k=function(a,t){return a?g(a)?{negative:!0,format:""+h(a)+t}:{negative:!1,format:""+a+t}:{negative:!1,format:""}},v=function(){function g(a,t,e){var n=this;if(this.$d={},this.$l=e,void 0===a&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(a*u[p(t)],this);if("number"==typeof a)return this.$ms=a,this.parseFromMilliseconds(),this;if("object"==typeof a)return Object.keys(a).forEach((function(t){n.$d[p(t)]=a[t]})),this.calMilliseconds(),this;if("string"==typeof a){var r=a.match(c);if(r){var s=r.slice(2).map((function(a){return null!=a?Number(a):0}));return this.$d.years=s[0],this.$d.months=s[1],this.$d.weeks=s[2],this.$d.days=s[3],this.$d.hours=s[4],this.$d.minutes=s[5],this.$d.seconds=s[6],this.calMilliseconds(),this}}return this}var h=g.prototype;return h.calMilliseconds=function(){var a=this;this.$ms=Object.keys(this.$d).reduce((function(t,e){return t+(a.$d[e]||0)*u[e]}),0)},h.parseFromMilliseconds=function(){var a=this.$ms;this.$d.years=f(a/o),a%=o,this.$d.months=f(a/l),a%=l,this.$d.days=f(a/s),a%=s,this.$d.hours=f(a/r),a%=r,this.$d.minutes=f(a/n),a%=n,this.$d.seconds=f(a/e),a%=e,this.$d.milliseconds=a},h.toISOString=function(){var a=k(this.$d.years,"Y"),t=k(this.$d.months,"M"),e=+this.$d.days||0;this.$d.weeks&&(e+=7*this.$d.weeks);var n=k(e,"D"),r=k(this.$d.hours,"H"),s=k(this.$d.minutes,"M"),i=this.$d.seconds||0;this.$d.milliseconds&&(i+=this.$d.milliseconds/1e3);var o=k(i,"S"),l=a.negative||t.negative||n.negative||r.negative||s.negative||o.negative,c=r.format||s.format||o.format?"T":"",u=(l?"-":"")+"P"+a.format+t.format+n.format+c+r.format+s.format+o.format;return"P"===u||"-P"===u?"P0D":u},h.toJSON=function(){return this.toISOString()},h.format=function(a){var e=a||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return e.replace(i,(function(a,t){return t||String(n[a])}))},h.as=function(a){return this.$ms/u[p(a)]},h.get=function(a){var t=this.$ms,e=p(a);return"milliseconds"===e?t%=1e3:t="weeks"===e?f(t/u[e]):this.$d[e],0===t?0:t},h.add=function(a,t,e){var n;return n=t?a*u[p(t)]:m(a)?a.$ms:d(a,this).$ms,d(this.$ms+n*(e?-1:1),this)},h.subtract=function(a,t){return this.add(a,t,!0)},h.locale=function(a){var t=this.clone();return t.$l=a,t},h.clone=function(){return d(this.$ms,this)},h.humanize=function(t){return a().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},h.milliseconds=function(){return this.get("milliseconds")},h.asMilliseconds=function(){return this.as("milliseconds")},h.seconds=function(){return this.get("seconds")},h.asSeconds=function(){return this.as("seconds")},h.minutes=function(){return this.get("minutes")},h.asMinutes=function(){return this.as("minutes")},h.hours=function(){return this.get("hours")},h.asHours=function(){return this.as("hours")},h.days=function(){return this.get("days")},h.asDays=function(){return this.as("days")},h.weeks=function(){return this.get("weeks")},h.asWeeks=function(){return this.as("weeks")},h.months=function(){return this.get("months")},h.asMonths=function(){return this.as("months")},h.years=function(){return this.get("years")},h.asYears=function(){return this.as("years")},g}();return functio
|