Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

any-date-parser

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any-date-parser - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

6

CHANGELOG.md
## Change Log
### v1.5.2 on 2022-01-31
- Fixes GitHub issue #12
- Avoid overflowing when month has too many days
- When year, month or day are missing, default to 2000, Jan, 1 respectively
### v1.5.1 on 2021-09-06

@@ -4,0 +10,0 @@

2

dist/browser-bundle.js

@@ -1,1 +0,1 @@

!function(){"use strict";var e,t,r,n=e={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],s=!1,c=-1;function f(){s&&u&&(s=!1,u.length?l=u.concat(l):c=-1,l.length&&y())}function y(){if(!s){var e=i(f);s=!0;for(var t=l.length;t;){for(u=l,l=[];++c<t;)u&&u[c].run();c=-1,t=l.length}u=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function T(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||s||i(y)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=T,n.addListener=T,n.once=T,n.off=T,n.removeListener=T,n.removeAllListeners=T,n.emit=T,n.prependListener=T,n.prependOnceListener=T,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};var h={};(function(e){(function(){var t;if("undefined"!=typeof navigator){var r=navigator;t=Array.isArray(r.languages)?r.languages[0]:r.language}else if(void 0!==e){var n=e.env;t=n.LC_ALL||n.LC_MESSAGES||n.LANG||n.LANGUAGE}t||(t="en-US"),h=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch(t){return"en-US"}}(t)}).call(this)}).call(this,e);for(var d={},p=1;p<100;p++)d[(p<9?"0":"")+p]=p+(p>51?1900:2e3);var v={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300,Z:0},g={zone:v,year:d,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}};function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){S(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?("+Object.keys(v).join("|")+")\\)?",MERIDIEM:"[ap]\\.?m?\\.?",ORDINAL:"st|nd|rd|th|\\.",YEAR:"[1-9]\\d{3}|\\d{2}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"[+-][01]?\\d?\\:?(?:[0-5]\\d)?",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",SPACE:"[\\s,-]"},C={latn:w,other:A(A({},w),{},{YEAR:"*{4}|*{2}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"[+-]*{1,2}\\:?*{0,2}",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"})};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},D={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"\uff10":0,"\uff11":1,"\uff12":2,"\uff13":3,"\uff14":4,"\uff15":5,"\uff16":6,"\uff17":7,"\uff18":8,"\uff19":9,"\u3007":0,"\u4e00":1,"\u4e8c":2,"\u4e09":3,"\u56db":4,"\u4e94":5,"\u516d":6,"\u4e03":7,"\u516b":8,"\u4e5d":9},j={},U="[\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\\d]",I=["year","month","day","hour","minute","second","millisecond"];function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){H(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function F(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var L=C.latn,Y=C.other,R=function(e){if(j[e])return j[e];if("fullwide"===e||"hanidec"===e)return{group:"[\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\\d]",lookup:_({},D)};var t=M[e];if(!t)return{group:"\\d",lookup:_({},D)};for(var r=String.fromCharCode(t),n=String.fromCharCode(t+9),o={},a=0;a<10;a++)o[String.fromCharCode(t+a)]=a;return j[e]={group:"[".concat(r,"-").concat(n,"]"),lookup:o},j[e]},$={},G=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.locale=t,this.lookups=k({},g),this.vars=k({},L);var r=new Intl.NumberFormat(this.locale);this.numberingSystem=r.resolvedOptions().numberingSystem,this.build()}var t,r,n;return t=e,n=[{key:"factory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return $[t.toLowerCase()]||($[t.toLowerCase()]=new e(t)),$[t.toLowerCase()]}}],(r=[{key:"toInt",value:function(e){if("number"==typeof e)return e;if("latn"===this.numberingSystem)return parseInt(e,10);for(var t="",r=0;r<e.length;r++)t+=String(this.lookups.digit[e[r]]);return parseInt(t,10)}},{key:"build",value:function(){"latn"!==this.numberingSystem&&this.buildNumbers(),/^en/i.test(this.locale)||(this.buildMonthNames(),this.buildDaynames(),this.buildMeridiems())}},{key:"buildNumbers",value:function(){var e=this.numberingSystem,t=R(e),r=t.group,n=t.lookup;for(var o in this.lookups.digit=n,Y)Y.hasOwnProperty(o)&&(this.vars[o]=Y[o].replace(/\*/g,r))}},{key:"buildMonthNames",value:function(){var e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((function(r,n){["","k","kuu","kuuta"].forEach((function(o,a){e[r+o+(a<2?"\\.?":"")]=!0,t[r+o]=n+1}))}));else{for(var r=[],n=function(e){return"month"===e.type},o=0;o<12;o++)r.push(new Date(2017,o,1));for(var a=0,i=["full","long","medium"];a<i.length;a++)for(var u=i[a],l=Intl.DateTimeFormat(this.locale,{dateStyle:u}),s=0;s<12;s++){var c=l.formatToParts(r[s]).find(n).value.toLowerCase();if(/^ko/i.test(this.locale)&&(c+="\uc6d4"),"medium"===u){if(/^ar|zh/i.test(this.locale))return;c=c.replace(/\.$/,""),e["".concat(c,"\\.?")]=!0}else e[c]=!0;t[c]=s+1}for(var f=Intl.DateTimeFormat(this.locale,{month:"short"}),y=0;y<12;y++){var m=f.formatToParts(r[y]).find(n).value.toLowerCase();m=m.replace(/\.$/,""),e["".concat(m,"\\.?")]=!0,t[m]=y+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}},{key:"buildDaynames",value:function(){for(var e=[],t=function(e){return"weekday"===e.type},r=0;r<7;r++)e.push(new Date(2017,0,r+1));for(var n=[],o={},a=0,i=["long","short"];a<i.length;a++)for(var u=i[a],l=Intl.DateTimeFormat(this.locale,{weekday:u}),s=0;s<7;s++){var c=l.formatToParts(e[s]).find(t).value.toLowerCase();"short"===u?(c=c.replace(/\.$/,""),n.push("".concat(c,"\\.?"))):n.push(c),o[c]=s}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=o}},{key:"buildMeridiems",value:function(){for(var e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=function(e){return"dayPeriod"===e.type},r=[],n={},o=Intl.DateTimeFormat(this.locale,{timeStyle:"long"}),a=0;a<2;a++){var i=o.formatToParts(e[a]).find(t);if(!i)return;var u=i.value.toLowerCase();r.push(u),n[u]=12*a}this.vars.MERIDIEM=r.join("|"),this.lookups.meridiem=n}},{key:"getObject",value:function(e,t){var r=this,n={};return e.forEach((function(e,o){if(e){var a=t[o+1];a=(a=a.toLowerCase()).replace(/\.$/,""),"offset"===e?n.offset=r.offsetToMinutes(a):r.lookups[e]?n[e]=r.lookups[e][a]||r.toInt(a):n[e]=r.toInt(a)}})),n}},{key:"castObject",value:function(e){var t=this,r={};return I.forEach((function(n){n in e&&(r[n]=t.toInt(e[n]))})),"string"==typeof e.offset?r.offset=this.offsetToMinutes(e.offset):"number"==typeof e.offset&&(r.offset=e.offset),r}},{key:"offsetToMinutes",value:function(e){var t=e.match(/^([+-])(..?):?(..)?$/);if(t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,4),n=r[1],o=r[2],a=r[3];return("-"===n?-1:1)*(60*this.toInt(o)+this.toInt(a||0))}return 0}},{key:"compile",value:function(e){var t=this,r=e.replace(/_([A-Z0-9]+)_/g,(function(e,r){if(!t.vars[r])throw new Error("Template string contains invalid variable _".concat(r,"_"));return t.vars[r]}));return new RegExp(r,"i")}}])&&F(t.prototype,r),n&&F(t,n),e}();function x(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var K=function(){function e(t){var r=t.template,n=void 0===r?null:r,o=t.matcher,a=void 0===o?null:o,i=t.units,u=void 0===i?null:i,l=t.handler,s=void 0===l?null:l,c=t.locales,f=void 0===c?null:c;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!Array.isArray(u)&&"function"!=typeof s)throw new Error('new Format must receive a "units" array or "handler" function');if("string"!=typeof n&&!(a instanceof RegExp))throw new Error('new Format must receive a "template" string or "matcher" RegExp');this.template=n,this.units=u,this.matcher=a,this.handler=s,this.locales=f,this.regexByLocale={}}var t,r;return t=e,(r=[{key:"getRegExp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return this.template?(this.regexByLocale[e]||(this.regexByLocale[e]=G.factory(e).compile(this.template)),this.regexByLocale[e]):this.matcher}},{key:"getMatches",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;return e.match(this.getRegExp(t))}},{key:"toDateTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,r=G.factory(t);if(this.units)return r.getObject(this.units,e);var n=this.handler(e,t);return!n||n.invalid?n:r.castObject(n)}},{key:"attempt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;e=String(e).trim();var r=this.getMatches(e,t);if(r){var n=this.toDateTime(r,t);if(n&&!n.invalid)return n}return null}},{key:"now",value:function(){return new Date}}])&&x(t.prototype,r),e}(),B=function(e){return function(t,r){return t instanceof Date?t:"number"==typeof t?new Date(t):e(t,r)}};function W(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return V(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var z=function(e,t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,o=e.attempt(r,n);if(o.invalid)return o;var a=new Date;return"number"==typeof o.year&&a.setUTCFullYear(o.year),"number"==typeof o.month&&a.setUTCMonth(o.month-1),"number"==typeof o.day&&a.setUTCDate(o.day),a.setUTCHours(o.hour||0),a.setUTCMinutes(o.minute||0),a.setUTCSeconds(o.second||0),a.setUTCMilliseconds(o.millisecond||0),"number"==typeof o.offset?new Date(a-60*o.offset*1e3):a}},J=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.formats=[]}var t,r;return t=e,(r=[{key:"addFormat",value:function(e){return this.formats.push(e),e.parser=this,this}},{key:"addFormats",value:function(e){var t=this;return e.forEach((function(e){return t.addFormat(e)})),this}},{key:"removeFormat",value:function(e){var t=this.formats.indexOf(e);if(t>-1){var r=this.formats[t];return this.formats.splice(t,1),r.parser=null,!0}return!1}},{key:"attempt",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,n=W(this.formats);try{for(n.s();!(t=n.n()).done;){var o=t.value;if(!(Array.isArray(o.locales)&&o.locales.length>0)||o.locales.includes(new Intl.Locale(r).baseName)){var a=o.attempt(e,r);if(a)return a}}}catch(u){n.e(u)}finally{n.f()}var i=String(e).slice(0,200);return""===i&&(i="empty string"),{invalid:"Unable to parse ".concat(i)}}},{key:"exportAsFunction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return z(this,e)}},{key:"exportAsFunctionAny",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return B(z(this,e))}}])&&Z(t.prototype,r),e}(),X=new K({template:"^@(\\d+)$",handler:function(e){var t=parseInt(e[1],10),r=new Date(1e3*t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds()}}}),q=new K({matcher:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){var t=parseInt(e[1],10),r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds(),offset:e[2]||0}}}),Q={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"};function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var te=new K({matcher:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ee(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ee(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,5),r=t[1],n=t[2],o=t[3],a=t[4];n=parseFloat(n),"week"===(o=o.length<=2?Q[o]:(o=o.replace(/s$/,"")).toLowerCase())&&(o="day",n*=7),("-"===r||a)&&(n*=-1);var i=this.now();return"millisecond"===o?i.setUTCMilliseconds(i.getUTCMilliseconds()+n):"second"===o?i.setUTCSeconds(i.getUTCSeconds()+n):"minute"===o?i.setUTCMinutes(i.getUTCMinutes()+n):"hour"===o?i.setUTCHours(i.getUTCHours()+n):"day"===o?i.setUTCDate(i.getUTCDate()+n):"month"===o?i.setUTCMonth(i.getUTCMonth()+n):"year"===o&&i.setUTCFullYear(i.getUTCFullYear()+n),{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}});function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne,oe=U,ae=new K({template:"^(".concat(oe,"{4}|").concat(oe,"{2})\\s*\u5e74\\s*(").concat(oe,"{1,2})\\s*\u6708\\s*(").concat(oe,"{1,2})\\s*\u65e5$"),handler:function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,4),r=t[1],n=t[2],o=t[3];return ne||((ne=new G("zh")).numberingSystem="hanidec",ne.buildNumbers()),ne.castObject({year:r,month:n,day:o})}}),ie=new K({template:"^(_DAY_)[\\/. ](_MONTH_)$",units:["day","month"]}),ue=new K({template:"^(_DAY_)(?:_ORDINAL_)?[ -](_MONTHNAME_)$",units:["day","month"]}),le=new K({template:"^(?:(?:_DAYNAME_),? )?(_DAY_)(?:_ORDINAL_)?([ -])(_MONTHNAME_)\\2(_YEAR_)$",units:["day",null,"month","year"]}),se=new K({template:"^(_DAY_)([\\/. -])(_MONTH_)\\2(_YEAR_)$",units:["day",null,"month","year"]}),ce=new K({template:"^(_MONTH_)(?:[\\/-])(_DAY_)$",units:["month","day"]}),fe=new K({template:"^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$",units:["month",null,"day","year"],locales:["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","sm-AS","sm-SM"]}),ye=new K({template:"^(?:(?:_DAYNAME_),? )?(_MONTHNAME_)? (_DAY_)(?:_ORDINAL_)?$",units:["month","day"]}),me=new K({template:"^(?:(?:_DAYNAME_),? )?(_MONTHNAME_)? (_DAY_)(?:_ORDINAL_)?,? (_YEAR_)$",units:["month","day","year"]});function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var he=new K({template:"^(.*?)_SPACE_*(?:at|on|T|)_SPACE_*(_H12_|_H24_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)?_SPACE_*(_MERIDIEM_)$",handler:function(e,t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Te(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,6),n=r[1],o=r[2],a=r[3],i=r[4],u=r[5],l={};if(n&&(l=this.parser.attempt(n,t)).invalid)return null;var s=G.factory(t);if(u){var c=s.lookups.meridiem[u.toLowerCase()]||0;12===(o=parseFloat(o))?o=c:o+=o>12&&12===c?0:c}return l.hour=o,a&&(l.minute=a),i&&(l.second=i),l}});function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pe=new K({template:"^(.*?)_SPACE_*(?:at|on|T|)_SPACE_*(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:[\\.,](_MS_))?)?_SPACE_*(?:GMT)?_SPACE_*(_OFFSET_)?_SPACE_*(_ZONE_)?$",handler:function(e,t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return de(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?de(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,8),n=r[1],o=r[2],a=r[3],i=r[4],u=r[5],l=r[6],s=r[7],c={};if(n&&(c=this.parser.attempt(n,t)).invalid)return c;if(c.hour=o,c.minute=a,i&&(c.second=i),u&&u.length>3?c.millisecond=u.slice(0,3):u&&(c.millisecond=u),s&&!l&&s in v)c.offset=v[s];else if(l){var f=G.factory(t);c.offset=f.offsetToMinutes(l)}return c}}),ve=new K({matcher:/^(now|today|tomorrow|yesterday)/i,handler:function(e){var t=this.now(),r=e[1].toLowerCase();switch(r){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}var n={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===r&&(n.hour=t.getUTCHours(),n.minute=t.getUTCMinutes(),n.second=t.getUTCSeconds(),n.millisecond=t.getUTCMilliseconds()),n}}),ge=new K({template:"^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) (_H24_):(_MIN_):(_SEC_) (_OFFSET_) (_YEAR_)$",units:["month","day","hour","minute","second","offset","year"]}),be=new K({template:"^(_YEAR_)(-?)(_MONTH_)\\2(_DAY_)$",units:["year",null,"month","day"]}),Ae=ce,Se=new J;Se.addFormats([pe,he,be,le,me,fe,se,ae,ge,ve,te,ye,ue,Ae,ie,X,q]),Se.Parser=J,Se.Format=K,Se.LocaleHelper=G,Se.fromString=Date.fromString=Se.exportAsFunction(),Se.fromAny=Date.fromAny=Se.exportAsFunctionAny(),"undefined"!=typeof window&&(window.anyDateParser=Se)}();
!function(){"use strict";var e,t,r,n=e={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],s=!1,c=-1;function f(){s&&u&&(s=!1,u.length?l=u.concat(l):c=-1,l.length&&y())}function y(){if(!s){var e=i(f);s=!0;for(var t=l.length;t;){for(u=l,l=[];++c<t;)u&&u[c].run();c=-1,t=l.length}u=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function T(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||s||i(y)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=T,n.addListener=T,n.once=T,n.off=T,n.removeListener=T,n.removeAllListeners=T,n.emit=T,n.prependListener=T,n.prependOnceListener=T,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};var h={};(function(e){(function(){var t;if("undefined"!=typeof navigator){var r=navigator;t=Array.isArray(r.languages)?r.languages[0]:r.language}else if(void 0!==e){var n=e.env;t=n.LC_ALL||n.LC_MESSAGES||n.LANG||n.LANGUAGE}t||(t="en-US"),h=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch(t){return"en-US"}}(t)}).call(this)}).call(this,e);for(var d={},p=1;p<100;p++)d[(p<9?"0":"")+p]=p+(p>51?1900:2e3);var v={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300,Z:0},g={zone:v,year:d,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}};function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){S(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?("+Object.keys(v).join("|")+")\\)?",MERIDIEM:"[ap]\\.?m?\\.?",ORDINAL:"st|nd|rd|th|\\.",YEAR:"[1-9]\\d{3}|\\d{2}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"[+-][01]?\\d?\\:?(?:[0-5]\\d)?",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",SPACE:"[\\s,-]"},C={latn:w,other:A(A({},w),{},{YEAR:"*{4}|*{2}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"[+-]*{1,2}\\:?*{0,2}",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"})};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},D={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"\uff10":0,"\uff11":1,"\uff12":2,"\uff13":3,"\uff14":4,"\uff15":5,"\uff16":6,"\uff17":7,"\uff18":8,"\uff19":9,"\u3007":0,"\u4e00":1,"\u4e8c":2,"\u4e09":3,"\u56db":4,"\u4e94":5,"\u516d":6,"\u4e03":7,"\u516b":8,"\u4e5d":9},j={},U="[\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\\d]",I=["year","month","day","hour","minute","second","millisecond"];function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){H(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var F=C.latn,Y=C.other,R=function(e){if(j[e])return j[e];if("fullwide"===e||"hanidec"===e)return{group:"[\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\\d]",lookup:_({},D)};var t=M[e];if(!t)return{group:"\\d",lookup:_({},D)};for(var r=String.fromCharCode(t),n=String.fromCharCode(t+9),o={},a=0;a<10;a++)o[String.fromCharCode(t+a)]=a;return j[e]={group:"[".concat(r,"-").concat(n,"]"),lookup:o},j[e]},$={},G=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.locale=t,this.lookups=k({},g),this.vars=k({},F);var r=new Intl.NumberFormat(this.locale);this.numberingSystem=r.resolvedOptions().numberingSystem,this.build()}var t,r,n;return t=e,n=[{key:"factory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return $[t.toLowerCase()]||($[t.toLowerCase()]=new e(t)),$[t.toLowerCase()]}}],(r=[{key:"toInt",value:function(e){if("number"==typeof e)return e;if("latn"===this.numberingSystem)return parseInt(e,10);for(var t="",r=0;r<e.length;r++)t+=String(this.lookups.digit[e[r]]);return parseInt(t,10)}},{key:"build",value:function(){"latn"!==this.numberingSystem&&this.buildNumbers(),/^en/i.test(this.locale)||(this.buildMonthNames(),this.buildDaynames(),this.buildMeridiems())}},{key:"buildNumbers",value:function(){var e=this.numberingSystem,t=R(e),r=t.group,n=t.lookup;for(var o in this.lookups.digit=n,Y)Y.hasOwnProperty(o)&&(this.vars[o]=Y[o].replace(/\*/g,r))}},{key:"buildMonthNames",value:function(){var e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((function(r,n){["","k","kuu","kuuta"].forEach((function(o,a){e[r+o+(a<2?"\\.?":"")]=!0,t[r+o]=n+1}))}));else{for(var r=[],n=function(e){return"month"===e.type},o=0;o<12;o++)r.push(new Date(2017,o,1));for(var a=0,i=["full","long","medium"];a<i.length;a++)for(var u=i[a],l=Intl.DateTimeFormat(this.locale,{dateStyle:u}),s=0;s<12;s++){var c=l.formatToParts(r[s]).find(n).value.toLowerCase();if(/^ko/i.test(this.locale)&&(c+="\uc6d4"),"medium"===u){if(/^ar|zh/i.test(this.locale))return;c=c.replace(/\.$/,""),e["".concat(c,"\\.?")]=!0}else e[c]=!0;t[c]=s+1}for(var f=Intl.DateTimeFormat(this.locale,{month:"short"}),y=0;y<12;y++){var m=f.formatToParts(r[y]).find(n).value.toLowerCase();m=m.replace(/\.$/,""),e["".concat(m,"\\.?")]=!0,t[m]=y+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}},{key:"buildDaynames",value:function(){for(var e=[],t=function(e){return"weekday"===e.type},r=0;r<7;r++)e.push(new Date(2017,0,r+1));for(var n=[],o={},a=0,i=["long","short"];a<i.length;a++)for(var u=i[a],l=Intl.DateTimeFormat(this.locale,{weekday:u}),s=0;s<7;s++){var c=l.formatToParts(e[s]).find(t).value.toLowerCase();"short"===u?(c=c.replace(/\.$/,""),n.push("".concat(c,"\\.?"))):n.push(c),o[c]=s}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=o}},{key:"buildMeridiems",value:function(){for(var e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=function(e){return"dayPeriod"===e.type},r=[],n={},o=Intl.DateTimeFormat(this.locale,{timeStyle:"long"}),a=0;a<2;a++){var i=o.formatToParts(e[a]).find(t);if(!i)return;var u=i.value.toLowerCase();r.push(u),n[u]=12*a}this.vars.MERIDIEM=r.join("|"),this.lookups.meridiem=n}},{key:"getObject",value:function(e,t){var r=this,n={};return e.forEach((function(e,o){if(e){var a=t[o+1];a=(a=a.toLowerCase()).replace(/\.$/,""),"offset"===e?n.offset=r.offsetToMinutes(a):r.lookups[e]?n[e]=r.lookups[e][a]||r.toInt(a):n[e]=r.toInt(a)}})),n}},{key:"castObject",value:function(e){var t=this,r={};return I.forEach((function(n){n in e&&(r[n]=t.toInt(e[n]))})),"string"==typeof e.offset?r.offset=this.offsetToMinutes(e.offset):"number"==typeof e.offset&&(r.offset=e.offset),r}},{key:"offsetToMinutes",value:function(e){var t=e.match(/^([+-])(..?):?(..)?$/);if(t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,4),n=r[1],o=r[2],a=r[3];return("-"===n?-1:1)*(60*this.toInt(o)+this.toInt(a||0))}return 0}},{key:"compile",value:function(e){var t=this,r=e.replace(/_([A-Z0-9]+)_/g,(function(e,r){if(!t.vars[r])throw new Error("Template string contains invalid variable _".concat(r,"_"));return t.vars[r]}));return new RegExp(r,"i")}}])&&L(t.prototype,r),n&&L(t,n),e}();function x(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var K=function(){function e(t){var r=t.template,n=void 0===r?null:r,o=t.matcher,a=void 0===o?null:o,i=t.units,u=void 0===i?null:i,l=t.handler,s=void 0===l?null:l,c=t.locales,f=void 0===c?null:c;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!Array.isArray(u)&&"function"!=typeof s)throw new Error('new Format must receive a "units" array or "handler" function');if("string"!=typeof n&&!(a instanceof RegExp))throw new Error('new Format must receive a "template" string or "matcher" RegExp');this.template=n,this.units=u,this.matcher=a,this.handler=s,this.locales=f,this.regexByLocale={}}var t,r;return t=e,(r=[{key:"getRegExp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return this.template?(this.regexByLocale[e]||(this.regexByLocale[e]=G.factory(e).compile(this.template)),this.regexByLocale[e]):this.matcher}},{key:"getMatches",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;return e.match(this.getRegExp(t))}},{key:"toDateTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,r=G.factory(t);if(this.units)return r.getObject(this.units,e);var n=this.handler(e,t);return!n||n.invalid?n:r.castObject(n)}},{key:"attempt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;e=String(e).trim();var r=this.getMatches(e,t);if(r){var n=this.toDateTime(r,t);if(n&&!n.invalid)return n}return null}},{key:"now",value:function(){return new Date}}])&&x(t.prototype,r),e}(),B=function(e){return function(t,r){return t instanceof Date?t:"number"==typeof t?new Date(t):e(t,r)}};function W(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return V(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var z=function(e,t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,o=e.attempt(r,n);if(o.invalid)return o;var a=new Date(2e3,0,1);return"number"==typeof o.day&&a.setUTCDate(o.day),"number"==typeof o.year&&a.setUTCFullYear(o.year),"number"==typeof o.month&&a.setUTCMonth(o.month-1),a.setUTCHours(o.hour||0),a.setUTCMinutes(o.minute||0),a.setUTCSeconds(o.second||0),a.setUTCMilliseconds(o.millisecond||0),"number"==typeof o.offset?new Date(a-60*o.offset*1e3):a}},J=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.formats=[]}var t,r;return t=e,(r=[{key:"addFormat",value:function(e){return this.formats.push(e),e.parser=this,this}},{key:"addFormats",value:function(e){var t=this;return e.forEach((function(e){return t.addFormat(e)})),this}},{key:"removeFormat",value:function(e){var t=this.formats.indexOf(e);if(t>-1){var r=this.formats[t];return this.formats.splice(t,1),r.parser=null,!0}return!1}},{key:"attempt",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,n=W(this.formats);try{for(n.s();!(t=n.n()).done;){var o=t.value;if(!(Array.isArray(o.locales)&&o.locales.length>0)||o.locales.includes(new Intl.Locale(r).baseName)){var a=o.attempt(e,r);if(a)return a}}}catch(u){n.e(u)}finally{n.f()}var i=String(e).slice(0,200);return""===i&&(i="empty string"),{invalid:"Unable to parse ".concat(i)}}},{key:"exportAsFunction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return z(this,e)}},{key:"exportAsFunctionAny",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return B(z(this,e))}}])&&Z(t.prototype,r),e}(),X=new K({template:"^@(\\d+)$",handler:function(e){var t=parseInt(e[1],10),r=new Date(1e3*t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds()}}}),q=new K({matcher:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){var t=parseInt(e[1],10),r=new Date(t);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds(),offset:e[2]||0}}}),Q={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"};function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var te=new K({matcher:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ee(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ee(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,5),r=t[1],n=t[2],o=t[3],a=t[4];n=parseFloat(n),"week"===(o=o.length<=2?Q[o]:(o=o.replace(/s$/,"")).toLowerCase())&&(o="day",n*=7),("-"===r||a)&&(n*=-1);var i=this.now();return"millisecond"===o?i.setUTCMilliseconds(i.getUTCMilliseconds()+n):"second"===o?i.setUTCSeconds(i.getUTCSeconds()+n):"minute"===o?i.setUTCMinutes(i.getUTCMinutes()+n):"hour"===o?i.setUTCHours(i.getUTCHours()+n):"day"===o?i.setUTCDate(i.getUTCDate()+n):"month"===o?i.setUTCMonth(i.getUTCMonth()+n):"year"===o&&i.setUTCFullYear(i.getUTCFullYear()+n),{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}});function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne,oe=U,ae=new K({template:"^(".concat(oe,"{4}|").concat(oe,"{2})\\s*\u5e74\\s*(").concat(oe,"{1,2})\\s*\u6708\\s*(").concat(oe,"{1,2})\\s*\u65e5$"),handler:function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,4),r=t[1],n=t[2],o=t[3];return ne||((ne=new G("zh")).numberingSystem="hanidec",ne.buildNumbers()),ne.castObject({year:r,month:n,day:o})}}),ie=new K({template:"^(_DAY_)[\\/. ](_MONTH_)$",units:["day","month"]}),ue=new K({template:"^(_DAY_)(?:_ORDINAL_)?[ -](_MONTHNAME_)$",units:["day","month"]}),le=new K({template:"^(?:(?:_DAYNAME_),? )?(_DAY_)(?:_ORDINAL_)?([ -])(_MONTHNAME_)\\2(_YEAR_)$",units:["day",null,"month","year"]}),se=new K({template:"^(_DAY_)([\\/. -])(_MONTH_)\\2(_YEAR_)$",units:["day",null,"month","year"]}),ce=new K({template:"^(_MONTH_)(?:[\\/-])(_DAY_)$",units:["month","day"]}),fe=new K({template:"^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$",units:["month",null,"day","year"],locales:["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","sm-AS","sm-SM"]}),ye=new K({template:"^(?:(?:_DAYNAME_),? )?(_MONTHNAME_)? (_DAY_)(?:_ORDINAL_)?$",units:["month","day"]}),me=new K({template:"^(?:(?:_DAYNAME_),? )?(_MONTHNAME_)? (_DAY_)(?:_ORDINAL_)?,? (_YEAR_)$",units:["month","day","year"]});function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var he=new K({template:"^(.*?)_SPACE_*(?:at|on|T|)_SPACE_*(_H12_|_H24_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)?_SPACE_*(_MERIDIEM_)$",handler:function(e,t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Te(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,6),n=r[1],o=r[2],a=r[3],i=r[4],u=r[5],l={};if(n&&(l=this.parser.attempt(n,t)).invalid)return null;var s=G.factory(t);if(u){var c=s.lookups.meridiem[u.toLowerCase()]||0;12===(o=parseFloat(o))?o=c:o+=o>12&&12===c?0:c}return l.hour=o,a&&(l.minute=a),i&&(l.second=i),l}});function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pe=new K({template:"^(.*?)_SPACE_*(?:at|on|T|)_SPACE_*(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:[\\.,](_MS_))?)?_SPACE_*(?:GMT)?_SPACE_*(_OFFSET_)?_SPACE_*(_ZONE_)?$",handler:function(e,t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return de(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?de(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,8),n=r[1],o=r[2],a=r[3],i=r[4],u=r[5],l=r[6],s=r[7],c={};if(n&&(c=this.parser.attempt(n,t)).invalid)return c;if(c.hour=o,c.minute=a,i&&(c.second=i),u&&u.length>3?c.millisecond=u.slice(0,3):u&&(c.millisecond=u),s&&!l&&s in v)c.offset=v[s];else if(l){var f=G.factory(t);c.offset=f.offsetToMinutes(l)}return c}}),ve=new K({matcher:/^(now|today|tomorrow|yesterday)/i,handler:function(e){var t=this.now(),r=e[1].toLowerCase();switch(r){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}var n={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===r&&(n.hour=t.getUTCHours(),n.minute=t.getUTCMinutes(),n.second=t.getUTCSeconds(),n.millisecond=t.getUTCMilliseconds()),n}}),ge=new K({template:"^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) (_H24_):(_MIN_):(_SEC_) (_OFFSET_) (_YEAR_)$",units:["month","day","hour","minute","second","offset","year"]}),be=new K({template:"^(_YEAR_)(-?)(_MONTH_)\\2(_DAY_)$",units:["year",null,"month","day"]}),Ae=new J;Ae.addFormats([pe,he,be,le,me,fe,se,ae,ge,ve,te,ye,ue,ce,ie,X,q]),Ae.Parser=J,Ae.Format=K,Ae.LocaleHelper=G,Ae.defaultLocale=h,Ae.fromString=Date.fromString=Ae.exportAsFunction(),Ae.fromAny=Date.fromAny=Ae.exportAsFunctionAny(),"undefined"!=typeof window&&(window.anyDateParser=Ae)}();

@@ -54,2 +54,3 @@ // import our main modules

parser.LocaleHelper = LocaleHelper;
parser.defaultLocale = defaultLocale;

@@ -61,2 +62,3 @@ // create functions on Date

if (typeof window !== 'undefined') {
/* istanbul ignore next */
window.anyDateParser = parser;

@@ -63,0 +65,0 @@ }

{
"name": "any-date-parser",
"version": "1.5.1",
"version": "1.5.2",
"description": "Parse a wide range of date formats including human-input dates",

@@ -5,0 +5,0 @@ "tags": [

@@ -7,4 +7,9 @@ function fromString(parser, defaultLocale) {

}
const date = new Date();
// default to current year, month and day
// set to Jan 1 to prevent setting non-existent days
const date = new Date(2000, 0, 1);
// first setting day, then year, then month
// to handle months with fewer days and years without Feb 29
if (typeof parsed.day === 'number') {
date.setUTCDate(parsed.day);
}
if (typeof parsed.year === 'number') {

@@ -16,5 +21,2 @@ date.setUTCFullYear(parsed.year);

}
if (typeof parsed.day === 'number') {
date.setUTCDate(parsed.day);
}
// default to first unit for time components

@@ -21,0 +23,0 @@ date.setUTCHours(parsed.hour || 0);

const fromString = require('./fromString.js');
const now = new Date();
describe('fromString', () => {

@@ -11,16 +10,14 @@ it('should return invalid dates', () => {

});
it('should use current month and day', () => {
it('should default to Jan 1', () => {
const result = { year: 2020 };
const parser = { attempt: jest.fn(() => result) };
const fromFn = fromString(parser);
const jan1 = new Date(
Date.UTC(2020, now.getUTCMonth(), now.getUTCDate(), 0, 0, 0, 0)
);
const jan1 = new Date(Date.UTC(2020, 0, 1, 0, 0, 0, 0));
expect(fromFn()).toEqual(jan1);
});
it('should use current month', () => {
it('should default to 1st of month', () => {
const result = { year: 2020, month: 5 };
const parser = { attempt: jest.fn(() => result) };
const fromFn = fromString(parser);
const may1 = new Date(Date.UTC(2020, 4, now.getUTCDate(), 0, 0, 0, 0));
const may1 = new Date(Date.UTC(2020, 4, 1, 0, 0, 0, 0));
expect(fromFn()).toEqual(may1);

@@ -27,0 +24,0 @@ });

@@ -52,2 +52,9 @@ const Parser = require('./Parser.js');

});
it('should return invalid on empty string', () => {
const format = { attempt: jest.fn(() => null) };
const parser = new Parser();
parser.addFormat(format);
const result = parser.attempt('', 'locale');
expect(result).toEqual({ invalid: 'Unable to parse empty string' });
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc