text: !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).spacetime=n()}(this,(function(){"use strict";function e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],r=!0,a=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done)&&(t.push(i.value),!n||t.length!==n);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return t}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(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.")}()}function n(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var t=function(n,t,r){var a=e(n.split("/"),2),o=a[0],i=e(a[1].split(":"),2),u=i[0],s=i[1];return Date.UTC(r,o-1,u,s)-36e5*t},r=function(e,n,r,a,o){var i=new Date(e).getUTCFullYear(),u=t(n,o,i),s=t(r,a,i);return e>=u&&e<s},a=function(e){var n=e.timezones[e.tz];if(void 0===n)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===n.dst)return n.offset;var t=n.offset,a=n.offset+1;"n"===n.hem&&(a=t-1);var o=n.dst.split("->");return!0===r(e.epoch,o[0],o[1],t,a)?t:a},o=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];var i,u=(i=Object.freeze({__proto__:null,default:{"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,11/palau","9.5|s|04/05:03->10/04:02":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/08:01->10/04:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,4/west","8|n|03/25:03->09/29:23":"2/ulan_bator","8|n":"2/brunei,2/choibalsan,2/chongqing,2/chungking,2/harbin,2/hong_kong,2/irkutsk,2/kuching,2/macao,2/macau,2/manila,2/shanghai,2/taipei,2/ujung_pandang,2/ulaanbaatar","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/ho_chi_minh,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/saigon,2/tomsk,2/vientiane","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dacca,2/dhaka,2/kashgar,2/omsk,2/qyzylorda,2/qostanay,2/thimbu,2/thimphu,2/urumqi,9/chagos","6.5|n":"2/rangoon,2/yangon,9/cocos","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/ashkhabad,2/atyrau,2/baku,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives","5.75|n":"2/kathmandu,2/katmandu","5.5|n":"2/calcutta,2/colombo,2/kolkata","4|s":"9/reunion","4|n":"2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,2/volgograd,9/mahe,9/mauritius","4.5|n|03/21:00->09/20:24":"2/tehran","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|03/29:03->10/25:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kiev,8/mariehamn,8/nicosia,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye","3|n|03/29:02->10/25:03":"8/chisinau,8/tiraspol","3|n|03/29:00->10/24:24":"2/beirut","3|n|03/28:00->10/24:01":"2/gaza,2/hebron","3|n|03/27:02->10/25:02":"2/jerusalem,2/tel_aviv","3|n|03/27:00->10/30:01":"2/amman","3|n|03/27:00->10/29:24":"2/damascus","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/baghdad,2/bahrain,2/istanbul,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte","2|s|03/29:02->10/25:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/29:02->10/25:03":"0/ceuta,arctic/longyearbyen,3/jan_mayen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich","2|n":"0/blantyre,0/bujumbura,0/cairo,0/khartoum,0/kigali,0/tripoli,8/kaliningrad","1|s|04/02:01->09/03:03":"0/windhoek","1|s":"0/kinshasa,0/luanda","1|n|04/19:03->05/31:02":"0/casablanca,0/el_aaiun","1|n|03/29:01->10/25:02":"3/canary,3/faeroe,3/faroe,3/madeira,8/belfast,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london","1|n":"0/algiers,0/bangui,0/brazzaville,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s|04/05:04->09/27:03":"11/apia","13|s|01/15:02->11/05:03":"11/tongatapu","13|n":"11/enderbury,11/fakaofo","12|s|04/05:03->09/27:02":"12/mcmurdo,12/south_pole,11/auckland","12|s|01/12:03->12/20:02":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis","12.75|s|04/05:03->04/05:02":"11/chatham","11|s|04/05:03->10/04:02":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/05:03->10/04:02":"11/norfolk","10|s|04/05:03->10/04:02":"4/act,4/canberra,4/currie,4/hobart,4/melbourne,4/nsw,4/sydney,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,4/queensland","10|n":"2/ust-nera,2/vladivostok,2/yakutsk,11/chuuk,11/guam,11/port_moresby,11/saipan,11/truk,11/yap","10.5|s|04/05:01->10/04:02":"4/lhi,4/lord_howe","0|n|03/29:00->10/25:01":"1/scoresbysund,3/azores","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,0/timbuktu,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/gmt+0,13/gmt-0,13/gmt0,13/greenwich,13/utc,13/universal,13/zulu","-9|n|03/08:02->11/01:02":"1/adak,1/atka","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/08:02->11/01:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat","-8|n":"11/pitcairn","-7|n|03/08:02->11/01:02":"1/ensenada,1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,6/pacific,10/bajanorte","-7|n|03/08:02->11/01:01":"6/yukon","-7|n":"1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/phoenix,1/whitehorse","-6|s|04/04:22->09/05:22":"7/easterisland,11/easter","-6|n|04/05:02->10/25:02":"1/chihuahua,1/mazatlan,10/bajasur","-6|n|03/08:02->11/01:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/ojinaga,1/shiprock,1/yellowknife,6/mountain","-6|n":"1/belize,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/regina,1/swift_current,1/tegucigalpa,6/east-saskatchewan,6/saskatchewan,11/galapagos","-5|s":"1/lima,1/rio_branco,5/acre","-5|n|04/05:02->10/25:02":"1/bahia_banderas,1/merida,1/mexico_city,1/monterrey,10/general","-5|n|03/12:03->11/05:01":"1/north_dakota","-5|n|03/08:02->11/01:02":"1/chicago,1/knox_in,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,6/central","-5|n":"1/atikokan,1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/porto_acre","-4|s|05/13:23->08/13:01":"12/palmer","-4|s|04/04:24->09/06:00":"1/santiago,7/continental","-4|s|03/21:24->10/04:00":"1/asuncion","-4|s|02/16:24->11/03:00":"1/campo_grande,1/cuiaba","-4|s":"1/la_paz,1/manaus,5/west","-4|n|03/12:03->11/05:01":"1/indiana,1/kentucky","-4|n|03/08:02->11/01:02":"1/detroit,1/fort_wayne,1/grand_turk,1/indianapolis,1/iqaluit,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,6/eastern","-4|n|03/08:00->11/01:01":"1/havana","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/cordoba,1/fortaleza,1/montevideo,1/punta_arenas,1/sao_paulo,12/rothera,3/stanley,5/east","-3|n|03/28:22->10/24:23":"1/nuuk","-3|n|03/08:02->11/01:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/catamarca,1/cayenne,1/jujuy,1/maceio,1/mendoza,1/paramaribo,1/recife,1/rosario,1/santarem","-2|s":"5/denoronha","-2|n|03/28:22->10/24:23":"1/godthab","-2|n|03/08:02->11/01:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia","-2.5|n|03/08:02->11/01:02":"1/st_johns,6/newfoundland","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti"}}))&&i.default||i,s={};Object.keys(u).forEach((function(e){var n=e.split("|"),t={offset:Number(n[0]),hem:n[1]};n[2]&&(t.dst=n[2]),u[e].split(",").forEach((function(e){e=e.replace(/(^[0-9]+)\//,(function(e,n){return n=Number(n),o[n]+"/"})),s[e]=t}))})),s.utc={offset:0,hem:"n"};for(var c=-14;c<=14;c+=.5){var h=c;h>0&&(h="+"+h);var f="etc/gmt"+h;s[f]={offset:-1*c,hem:"n"},s[f="utc/gmt"+h]={offset:-1*c,hem:"n"}}var d=s,l=/(\-?[0-9]+)h(rs)?/i,m=/(\-?[0-9]+)/,p=/utc([\-+]?[0-9]+)/i,y=/gmt([\-+]?[0-9]+)/i,v=function(e){return(e=Number(e))>-13&&e<13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null},g=function(e){var n=e.match(l);if(null!==n)return v(n[1]);if(null!==(n=e.match(p)))return v(n[1]);if(null!==(n=e.match(y))){var t=-1*Number(n[1]);return v(t)}return null!==(n=e.match(m))?v(n[1]):null},b=function(){var e=function(){if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;var e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;var n=e.resolvedOptions().timeZone;return n?n.toLowerCase():null}();return null===e?"utc":e}(),k=Object.keys(d).reduce((function(e,n){var t=n.split("/")[1]||"";return e[t=t.replace(/_/g," ")]=n,e}),{}),w=function(e,n){if(!e)return b;var t=e.trim(),r=e.split("/");if(r.length>2&&!1===n.hasOwnProperty(t)&&(t=r[0]+"/"+r[1]),t=t.toLowerCase(),!0===n.hasOwnProperty(t))return t;if(t=function(e){return(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/\islands/g,"island")}(t),!0===n.hasOwnProperty(t))return t;if(!0===k.hasOwnProperty(t))return k[t];if(!0===/[0-9]/.test(t)){var a=g(t);if(a)return a}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")},z={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};z.date=z.day,z.month=25488e5,z.week=6048e5,z.year=3154e7,Object.keys(z).forEach((function(e){z[e+"s"]=z[e]}));var j=z,_=function(e,n,t,r,a){var o=e.d[t]();if(o!==n){var i=null===a?null:e.d[a](),u=e.epoch,s=n-o;e.epoch+=j[r]*s,"day"===r&&Math.abs(s)>28&&n<28&&(e.epoch+=j.hour),null!==a&&i!==e.d[a]()&&(e.epoch=u);for(var c=j[r]/2;e.d[t]()<n;)e.epoch+=c;for(;e.d[t]()>n;)e.epoch-=c;null!==a&&i!==e.d[a]()&&(e.epoch=u)}},O={year:{valid:function(e){return e>-4e3&&e<4e3},walkTo:function(e,n){return _(e,n,"getFullYear","year",null)}},month:{valid:function(e){return e>=0&&e<=11},walkTo:function(e,n){var t=e.d,r=t.getMonth(),a=e.epoch,o=t.getFullYear();if(r!==n){var i=n-r;for(e.epoch+=j.day*(28*i),o!==e.d.getFullYear()&&(e.epoch=a);e.d.getMonth()<n;)e.epoch+=j.day;for(;e.d.getMonth()>n;)e.epoch-=j.day}}},date:{valid:function(e){return e>0&&e<=31},walkTo:function(e,n){return _(e,n,"getDate","day","getMonth")}},hour:{valid:function(e){return e>=0&&e<24},walkTo:function(e,n){return _(e,n,"getHours","hour","getDate")}},minute:{valid:function(e){return e>=0&&e<60},walkTo:function(e,n){return _(e,n,"getMinutes","minute","getHours")}},second:{valid:function(e){return e>=0&&e<60},walkTo:function(e,n){e.epoch=e.seconds(n).epoch}},millisecond:{valid:function(e){return e>=0&&e<1e3},walkTo:function(e,n){e.epoch=e.milliseconds(n).epoch}}},D=function(e,n){for(var t=Object.keys(O),r=e.clone(),a=0;a<t.length;a++){var o=t[a],i=n[o];if(void 0===i&&(i=r[o]()),"string"==typeof i&&(i=parseInt(i,10)),!O[o].valid(i))return e.epoch=null,void(!1===e.silent&&console.warn("invalid "+o+": "+i));O[o].walkTo(e,i)}},S=["jan","feb","mar","apr","may","jun","jul","aug","sept","oct","nov","dec"],M=["january","february","march","april","may","june","july","august","september","october","november","december"];var q=function(){return S},P=function(){return M},C=function(){return function(){for(var e={sep:8},n=0;n<S.length;n++)e[S[n]]=n;for(var t=0;t<M.length;t++)e[M[t]]=t;return e}()},E=function(e){S=e.short||S,M=e.long||M},I=function(e,n){if(!n)return e;"Z"===n&&(n="+0000");var t=0;/^[\+-]?[0-9]{2}:[0-9]{2}$/.test(n)&&(!0===/:00/.test(n)&&(n=n.replace(/:00/,"")),!0===/:30/.test(n)&&(n=n.replace(/:30/,".5"))),/^[\+-]?[0-9]{4}$/.test(n)&&(n=n.replace(/30$/,".5")),t=parseFloat(n),Math.abs(t)>100&&(t/=100),(t*=-1)>=0&&(t="+"+t);var r="etc/gmt"+t;return e.timezones[r]&&(e.tz=r),e},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=(n=n.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:\.]?([0-9]{1,4})?/);if(null!==t){var r=Number(t[1]);if(r<0||r>24)return e.startOf("day");var a=Number(t[2]);if(t[2].length<2||a<0||a>59)return e.startOf("day");e=(e=(e=(e=e.hour(r)).minute(a)).seconds(t[3]||0)).millisecond(t[4]||0);var o=n.match(/[\b0-9](am|pm)\b/);return null!==o&&o[1]&&(e=e.ampm(o[1])),e}if(null!==(t=n.match(/([0-9]+) ?(am|pm)/))&&t[1]){var i=Number(t[1]);return i>12||i<1?e.startOf("day"):e=(e=(e=e.hour(t[1]||0)).ampm(t[2])).startOf("hour")}return e=e.startOf("day")},A=[31,28,31,30,31,30,31,31,30,31,30,31],N=function(e,n){return e(n={exports:{}},n.exports),n.exports}((function(e,n){n.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},n.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())},n.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n.zeroPad=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t="0";return(e+="").length>=n?e:new Array(n-e.length+1).join(t)+e},n.titleCase=function(e){return e?e[0].toUpperCase()+e.substr(1):""},n.ordinal=function(e){var n=e%10,t=e%100;return 1===n&&11!==t?e+"st":2===n&&12!==t?e+"nd":3===n&&13!==t?e+"rd":e+"th"},n.toCardinal=function(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)},n.normalize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e},n.getEpoch=function(e){return"number"==typeof e?e:n.isDate(e)?e.getTime():e.epoch?e.epoch:null},n.beADate=function(e,t){return!1===n.isObject(e)?t.clone().set(e):e},n.formatTimezone=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e>0?"+":"-",a=Math.abs(e),o=n.zeroPad(parseInt(""+a,10)),i=n.zeroPad(a%1*60);return"".concat(r).concat(o).concat(t).concat(i)}})),$=(N.isLeapYear,N.isDate,N.isArray,N.isObject,N.zeroPad,N.titleCase,N.ordinal,N.toCardinal,N.normalize,N.getEpoch,N.beADate,N.formatTimezone,N.isLeapYear),x=function(e){if(!0!==A.hasOwnProperty(e.month))return!1;if(1===e.month)return!!($(e.year)&&e.date<=29)||e.date<=28;var n=A[e.month]||0;return e.date<=n},Y=C(),L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,t=parseInt(e.trim(),10);return!t&&n&&(t=n.year),t=t||(new Date).getFullYear()},F=[{reg:/^(\-?0?0?[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9\-\+:]+)?$/,parse:function(e,n,t,r){var a=parseInt(n[2],10)-1,o={year:n[1],month:a,date:n[3]};return!1===x(o)?(e.epoch=null,e):(I(e,n[5]),D(e,o),e=T(e,n[4]))}},{reg:/^([0-9]{4})[\-\/]([0-9]{1,2})[\-\/]([0-9]{1,2}),?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:function(e,n){var t={year:n[1],month:parseInt(n[2],10)-1,date:parseInt(n[3],10)};return t.month>=12&&(t.date=parseInt(n[2],10),t.month=parseInt(n[3],10)-1),!1===x(t)?(e.epoch=null,e):(D(e,t),e=T(e,n[4]))}},{reg:/^([0-9]{1,2})[\-\/]([0-9]{1,2})[\-\/]?([0-9]{4})?,?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:function(e,n){var t=parseInt(n[1],10)-1,r=parseInt(n[2],10);(e.british||t>=12)&&(r=parseInt(n[1],10),t=parseInt(n[2],10)-1);var a={year:n[3]||(new Date).getFullYear(),month:t,date:r};return!1===x(a)?(e.epoch=null,e):(D(e,a),e=T(e,n[4]))}},{reg:/^([0-9]{1,2})[\-\/]([a-z]+)[\-\/]?([0-9]{4})?$/i,parse:function(e,n){var t=Y[n[2].toLowerCase()],r={year:L(n[3],e._today),month:t,date:N.toCardinal(n[1]||"")};return!1===x(r)?(e.epoch=null,e):(D(e,r),e=T(e,n[4]))}},{reg:/^([a-z]+) ([0-9]{1,2}(?:st|nd|rd|th)?),?( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:function(e,n){var t=Y[n[1].toLowerCase()],r={year:L(n[3],e._today),month:t,date:N.toCardinal(n[2]||"")};return!1===x(r)?(e.epoch=null,e):(D(e,r),e=T(e,n[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:function(e,n){var t=Y[n[1].toLowerCase()],r={year:L(n[2],e._today),month:t,date:e._today.date||1};return!1===x(r)?(e.epoch=null,e):(D(e,r),e=T(e,n[4]))}},{reg:/^([0-9]{1,2}(?:st|nd|rd|th)?) ([a-z]+),?( [0-9]{4})?,? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2}? ?(am|pm|gmt))?$/i,parse:function(e,n){var t=Y[n[2].toLowerCase()];if(!t)return null;var r={year:L(n[3],e._today),month:t,date:N.toCardinal(n[1])};return!1===x(r)?(e.epoch=null,e):(D(e,r),e=T(e,n[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:function(e,n){var t=n[1]||"";e=e.quarter(t);var r=n[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:function(e,n){var t=n[1]||"";e=e.season(t);var r=n[3]||"";return r&&(r=r.trim(),e=e.year(r)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:function(e,n){var t=n[0]||"";t=(t=t.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1")).replace(/,/g,"");var r=parseInt(t.trim(),10),a=new Date,o={year:r,month:a.getMonth(),date:a.getDate()};return!1===x(o)?(e.epoch=null,e):(D(e,o),e=T(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:function(e,n){var t=n[0]||"";t=t.replace(/,/g,"");var r=parseInt(t.trim(),10),a=new Date,o={year:r,month:a.getMonth(),date:a.getDate()};return!1===x(o)?(e.epoch=null,e):(D(e,o),e=T(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:function(e,n){var t=e._today,r=L(n[0],t),a=new Date;t.month&&!t.date&&(t.date=1);var o={year:r,month:t.month||a.getMonth(),date:t.date||a.getDate()};return!1===x(o)?(e.epoch=null,e):(D(e,o),e=T(e))}}],Z=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach((function(n){"function"==typeof e[n]&&(e=e[n](e._today[n]))})),e},H={now:function(e){return Z(e)},today:function(e){return Z(e)},tonight:function(e){return e=(e=Z(e)).hour(18)},tomorrow:function(e){return e=(e=(e=Z(e)).add(1,"day")).startOf("day")},yesterday:function(e){return e=(e=(e=Z(e)).subtract(1,"day")).startOf("day")},christmas:function(e){var n=Z(e).year();return e=e.set([n,11,25,18,0,0])},"new years":function(e){var n=Z(e).year();return e=e.set([n,11,31,18,0,0])}};H["new years eve"]=H["new years"];var B=H,Q={year:(new Date).getFullYear(),month:0,date:1},G=function(e,n,t){if(0===Object.keys(n).length)return e;n=Object.assign({},Q,t,n);for(var r=Object.keys(n),a=0;a<r.length;a++){var o=r[a];if(void 0!==e[o]&&"function"==typeof e[o]&&(null!==n[o]&&void 0!==n[o]&&""!==n[o])){var i=n[o]||t[o]||Q[o]||0;e=e[o](i)}}return e},U=function(e,n,t){var r=e._today||Q;if("number"==typeof n)return n>0&&n<25e8&&!1===e.silent&&(console.warn("  - Warning: You are setting the date to January 1970."),console.warn("       -   did input seconds instead of milliseconds?")),e.epoch=n,e;if(e.epoch=Date.now(),e._today&&N.isObject(e._today)&&Object.keys(e._today).length>0){var a=G(e,r,Q);a.isValid()&&(e.epoch=a.epoch)}if(null==n||""===n)return e;if(!0===N.isDate(n))return e.epoch=n.getTime(),e;if(!0===N.isArray(n))return e=function(e,n,t){if(0===n.length)return e;for(var r=["year","month","date","hour","minute","second","millisecond"],a=0;a<r.length;a++){var o=n[a]||t[r[a]]||Q[r[a]]||0;e=e[r[a]](o)}return e}(e,n,r);if(!0===N.isObject(n))return n.epoch?(e.epoch=n.epoch,e.tz=n.tz,e):e=G(e,n,r);if("string"!=typeof n)return e;if(n=(n=(n=n.replace(/\b(mon|tues|wed|wednes|thu|thurs|fri|sat|satur|sun)(day)?\b/i,"")).replace(/,/g,"")).replace(/ +/g," ").trim(),!0===B.hasOwnProperty(n))return e=B[n](e);for(var o=0;o<F.length;o++){var i=n.match(F[o].reg);if(i){var u=F[o].parse(e,i,t);if(null!==u&&u.isValid())return u}}return!1===e.silent&&console.warn("Warning: couldn't parse date-string: '"+n+"'"),e.epoch=null,e},V=["sun","mon","tue","wed","thu","fri","sat"],W=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],J=function(){return V},K=function(){return W},R=function(e){V=e.short||V,W=e.long||W},X=function(e){var n=e.timezone().current.offset;return n?N.formatTimezone(n,":"):"Z"},ee={day:function(e){return N.titleCase(e.dayName())},"day-short":function(e){return N.titleCase(J()[e.day()])},"day-number":function(e){return e.day()},"day-ordinal":function(e){return N.ordinal(e.day())},"day-pad":function(e){return N.zeroPad(e.day())},date:function(e){return e.date()},"date-ordinal":function(e){return N.ordinal(e.date())},"date-pad":function(e){return N.zeroPad(e.date())},month:function(e){return N.titleCase(e.monthName())},"month-short":function(e){return N.titleCase(q()[e.month()])},"month-number":function(e){return e.month()},"month-ordinal":function(e){return N.ordinal(e.month())},"month-pad":function(e){return N.zeroPad(e.month())},"iso-month":function(e){return N.zeroPad(e.month()+1)},year:function(e){var n=e.year();return n>0?n:(n=Math.abs(n),n+" BC")},"year-short":function(e){var n=e.year();return n>0?"'".concat(String(e.year()).substr(2,4)):(n=Math.abs(n))+" BC"},"iso-year":function(e){var n=e.year(),t=n<0,r=N.zeroPad(Math.abs(n),4);return t&&(r="-"+(r=N.zeroPad(r,6))),r},time:function(e){return e.time()},"time-24":function(e){return"".concat(e.hour24(),":").concat(N.zeroPad(e.minute()))},hour:function(e){return e.hour12()},"hour-pad":function(e){return N.zeroPad(e.hour12())},"hour-24":function(e){return e.hour24()},"hour-24-pad":function(e){return N.zeroPad(e.hour24())},minute:function(e){return e.minute()},"minute-pad":function(e){return N.zeroPad(e.minute())},second:function(e){return e.second()},"second-pad":function(e){return N.zeroPad(e.second())},ampm:function(e){return e.ampm()},quarter:function(e){return"Q"+e.quarter()},season:function(e){return e.season()},era:function(e){return e.era()},json:function(e){return e.json()},timezone:function(e){return e.timezone().name},offset:function(e){return X(e)},numeric:function(e){return"".concat(e.year(),"/").concat(N.zeroPad(e.month()+1),"/").concat(N.zeroPad(e.date()))},"numeric-us":function(e){return"".concat(N.zeroPad(e.month()+1),"/").concat(N.zeroPad(e.date()),"/").concat(e.year())},"numeric-uk":function(e){return"".concat(N.zeroPad(e.date()),"/").concat(N.zeroPad(e.month()+1),"/").concat(e.year())},"mm/dd":function(e){return"".concat(N.zeroPad(e.month()+1),"/").concat(N.zeroPad(e.date()))},iso:function(e){var n=e.format("iso-year"),t=N.zeroPad(e.month()+1),r=N.zeroPad(e.date()),a=N.zeroPad(e.h24()),o=N.zeroPad(e.minute()),i=N.zeroPad(e.second()),u=N.zeroPad(e.millisecond(),3),s=X(e);return"".concat(n,"-").concat(t,"-").concat(r,"T").concat(a,":").concat(o,":").concat(i,".").concat(u).concat(s)},"iso-short":function(e){var n=N.zeroPad(e.month()+1),t=N.zeroPad(e.date());return"".concat(e.year(),"-").concat(n,"-").concat(t)},"iso-utc":function(e){return new Date(e.epoch).toISOString()},nice:function(e){return"".concat(q()[e.month()]," ").concat(N.ordinal(e.date()),", ").concat(e.time())},"nice-year":function(e){return"".concat(q()[e.month()]," ").concat(N.ordinal(e.date()),", ").concat(e.year())},"nice-day":function(e){return"".concat(J()[e.day()]," ").concat(N.titleCase(q()[e.month()])," ").concat(N.ordinal(e.date()))},"nice-full":function(e){return"".concat(e.dayName()," ").concat(N.titleCase(e.monthName())," ").concat(N.ordinal(e.date()),", ").concat(e.time())}},ne={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(ne).forEach((function(e){return ee[e]=ee[ne[e]]}));var te=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!0!==e.isValid())return"";if(ee.hasOwnProperty(n)){var t=ee[n](e)||"";return"json"!==n&&(t=String(t),"ampm"!==n&&(t=N.titleCase(t))),t}if(-1!==n.indexOf("{")){var r=/\{(.+?)\}/g;return n=n.replace(r,(function(n,t){return t=t.toLowerCase().trim(),ee.hasOwnProperty(t)?String(ee[t](e)):""}))}return e.format("iso-short")},re=N.zeroPad,ae=N.formatTimezone,oe={G:function(e){return e.era()},GG:function(e){return e.era()},GGG:function(e){return e.era()},GGGG:function(e){return"AD"===e.era()?"Anno Domini":"Before Christ"},y:function(e){return e.year()},yy:function(e){return parseInt(String(e.year()).substr(2,4),10)},yyy:function(e){return e.year()},yyyy:function(e){return e.year()},yyyyy:function(e){return"0"+e.year()},Q:function(e){return e.quarter()},QQ:function(e){return e.quarter()},QQQ:function(e){return e.quarter()},QQQQ:function(e){return e.quarter()},M:function(e){return e.month()+1},MM:function(e){return re(e.month()+1)},MMM:function(e){return e.format("month-short")},MMMM:function(e){return e.format("month")},w:function(e){return e.week()},ww:function(e){return re(e.week())},d:function(e){return e.date()},dd:function(e){return re(e.date())},D:function(e){return e.dayOfYear()},DD:function(e){return re(e.dayOfYear())},DDD:function(e){return re(e.dayOfYear(),3)},E:function(e){return e.format("day-short")},EE:function(e){return e.format("day-short")},EEE:function(e){return e.format("day-short")},EEEE:function(e){return e.format("day")},EEEEE:function(e){return e.format("day")[0]},e:function(e){return e.day()},ee:function(e){return e.day()},eee:function(e){return e.format("day-short")},eeee:function(e){return e.format("day")},eeeee:function(e){return e.format("day")[0]},a:function(e){return e.ampm().toUpperCase()},aa:function(e){return e.ampm().toUpperCase()},aaa:function(e){return e.ampm().toUpperCase()},aaaa:function(e){return e.ampm().toUpperCase()},h:function(e){return e.h12()},hh:function(e){return re(e.h12())},H:function(e){return e.hour()},HH:function(e){return re(e.hour())},m:function(e){return e.minute()},mm:function(e){return re(e.minute())},s:function(e){return e.second()},ss:function(e){return re(e.second())},A:function(e){return e.epoch-e.startOf("day").epoch},z:function(e){return e.timezone().name},zz:function(e){return e.timezone().name},zzz:function(e){return e.timezone().name},zzzz:function(e){return e.timezone().name},Z:function(e){return ae(e.timezone().current.offset)},ZZ:function(e){return ae(e.timezone().current.offset)},ZZZ:function(e){return ae(e.timezone().current.offset)},ZZZZ:function(e){return ae(e.timezone().current.offset,":")}},ie=function(e,n,t){for(var r=e,a=n,o=0;o<t;o+=1)oe[r]=oe[a],r+=e,a+=n};ie("q","Q",4),ie("L","M",4),ie("Y","y",4),ie("c","e",4),ie("k","H",2),ie("K","h",2),ie("S","s",2),ie("v","z",4),ie("V","Z",4);var ue=function(e,n){for(var t=n.split(""),r=[t[0]],a=!1,o=1;o<t.length;o+=1){if("'"===t[o]){if(!0!==(a=!a)||!t[o+1]||"'"!==t[o+1])continue;a=!0}!0===a||t[o]===r[r.length-1][0]?r[r.length-1]+=t[o]:r.push(t[o])}return r.reduce((function(n,t){return void 0!==oe[t]?n+=oe[t](e)||"":n+=t,n}),"")},se=["year","season","quarter","month","week","day","quarterHour","hour","minute"],ce=function(e,n){var t=e.clone().startOf(n),r=e.clone().endOf(n).epoch-t.epoch,a=(e.epoch-t.epoch)/r;return parseFloat(a.toFixed(2))},he=function(e,n){if(n)return n=N.normalize(n),ce(e,n);var t={};return se.forEach((function(n){t[n]=ce(e,n)})),t},fe=function(e,n){var t=e.progress();return"quarterhour"===(n=N.normalize(n))&&(n="quarterHour"),void 0!==t[n]?(t[n]>.5&&(e=e.add(1,n)),e=e.startOf(n)):!1===e.silent&&console.warn("no known unit '"+n+"'"),e},de=function(e,n,t){var r=0;for(e=e.clone();e.isBefore(n);)e=e.add(1,t),r+=1;return e.isAfter(n,t)&&(r-=1),r},le=function(e,n,t){return e.isBefore(n)?de(e,n,t):-1*de(n,e,t)},me=function(e,n){var t=n.epoch-e.epoch,r={milliseconds:t,seconds:parseInt(t/1e3,10)};r.minutes=parseInt(r.seconds/60,10),r.hours=parseInt(r.minutes/60,10);var a=e.clone();return r.years=function(e,n){var t=n.year()-e.year();return(e=e.year(n.year())).isAfter(n)&&(t-=1),t}(a,n),a=e.add(r.years,"year"),r.months=12*r.years,a=e.add(r.months,"month"),r.months+=le(a,n,"month"),r.weeks=52*r.years,a=e.add(r.weeks,"week"),r.weeks+=le(a,n,"week"),r.days=7*r.weeks,a=e.add(r.days,"day"),r.days+=le(a,n,"day"),r},pe=function(e,n,t){n=N.beADate(n,e);var r=!1;if(e.isAfter(n)){var a=e;e=n,n=a,r=!0}var o=me(e,n);return r&&(o=function(e){return Object.keys(e).forEach((function(n){e[n]*=-1})),e}(o)),t?(t=N.normalize(t),!0!==/s$/.test(t)&&(t+="s"),"dates"===t&&(t="days"),o[t]):o},ye={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function ve(e,n){return 1===e&&(n=n.slice(0,-1)),e+" "+n}var ge=function(e,n){var t,r,a,o=function(e,n){var t=e.isBefore(n),r=t?n:e,a=t?e:n;a=a.clone();var o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(o).forEach((function(e){if(!a.isSame(r,e)){var n=a.diff(r,e);a=a.add(n,e),o[e]=n}})),t&&Object.keys(o).forEach((function(e){0!==o[e]&&(o[e]*=-1)})),o}(e,n=N.beADate(n,e));if(!0===Object.keys(o).every((function(e){return!o[e]})))return{diff:o,rounded:"now",qualified:"now",precise:"now"};var i=[];return Object.keys(o).forEach((function(e,n,a){var u=Math.abs(o[e]);if(0!==u){var s=ve(u,e);if(i.push(s),!t){if(t=r=s,n>4)return;var c=a[n+1],h=Math.abs(o[c]);h>ye[c].almost?(t=ve(u+1,e),r="almost "+t):h>ye[c].over&&(r="over "+s)}}})),a=i.splice(0,2).join(", "),!0===e.isAfter(n)?(t+=" ago",r+=" ago",a+=" ago"):(t="in "+t,r="in "+r,a="in "+a),{diff:o,rounded:t,qualified:r,precise:a}},be={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},ke=[null,[0,1],[3,1],[6,1],[9,1]],we={minute:function(e){return D(e,{second:0,millisecond:0}),e},quarterhour:function(e){var n=e.minutes();return e=n>=45?e.minutes(45):n>=30?e.minutes(30):n>=15?e.minutes(15):e.minutes(0),D(e,{second:0,millisecond:0}),e},hour:function(e){return D(e,{minute:0,second:0,millisecond:0}),e},day:function(e){return D(e,{hour:0,minute:0,second:0,millisecond:0}),e},week:function(e){var n=e.clone();return(e=e.day(e._weekStart)).isAfter(n)&&(e=e.subtract(1,"week")),D(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:function(e){return D(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e},quarter:function(e){var n=e.quarter();return ke[n]&&D(e,{month:ke[n][0],date:ke[n][1],hour:0,minute:0,second:0,millisecond:0}),e},season:function(e){var n=e.season(),t="north";"South"===e.hemisphere()&&(t="south");for(var r=0;r<be[t].length;r++)if(be[t][r][0]===n){var a=e.year();return"winter"===n&&e.month()<3&&(a-=1),D(e,{year:a,month:be[t][r][1],date:be[t][r][2],hour:0,minute:0,second:0,millisecond:0}),e}return e},year:function(e){return D(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e},decade:function(e){var n=(e=e.startOf("year")).year(),t=10*parseInt(n/10,10);return e=e.year(t)},century:function(e){var n=(e=e.startOf("year")).year(),t=100*parseInt(n/100,10);return e=e.year(t)}};we.date=we.day;var ze=function(e,n){var t=e.clone();return n=N.normalize(n),we[n]?we[n](t):"summer"===n||"winter"===n?(t=t.season(n),we.season(t)):t},je=function(e,n){var t=e.clone();return n=N.normalize(n),we[n]?t=(t=(t=we[n](t)).add(1,n)).subtract(1,"milliseconds"):t},_e=function(e){return!!J().find((function(n){return n===e}))||!!K().find((function(n){return n===e}))},Oe=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;if(!n||!t)return[];if(n=N.normalize(n),t=e.clone().set(t),e.isAfter(t)){var r=e;e=t,t=r}var a=e.clone();_e(n)?(a=a.next(n),n="week"):a=a.next(n);for(var o=[];a.isBefore(t);)o.push(a),a=a.add(1,n);return o},De=function(e){var n=e.timezones,t=e.tz;if(!1===n.hasOwnProperty(t)&&(t=w(e.tz,n)),null===t)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};var a,o,i=n[t],u={name:(a=t,a=(a=(a=a[0].toUpperCase()+a.substr(1)).replace(/\/gmt/,"/GMT")).replace(/[\/_]([a-z])/gi,(function(e){return e.toUpperCase()}))),hasDst:Boolean(i.dst),default_offset:i.offset,hemisphere:"s"===i.hem?"South":"North",current:{}};if(u.hasDst){var s=(o=i.dst)?o.split("->"):[];u.change={start:s[0],back:s[1]}}var c=i.offset,h=c;return!0===u.hasDst&&(h="North"===u.hemisphere?c-1:i.offset+1),!1===u.hasDst?(u.current.offset=c,u.current.isDST=!1):!0===r(e.epoch,u.change.start,u.change.back,c,h)?(u.current.offset=c,u.current.isDST="North"===u.hemisphere):(u.current.offset=h,u.current.isDST="South"===u.hemisphere),u},Se=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Me={set:function(e,n){var t=this.clone();return t=U(t,e,null),n&&(this.tz=w(n)),t},timezone:function(){return De(this)},isDST:function(){return De(this).current.isDST},hasDST:function(){return De(this).hasDst},offset:function(){return 60*De(this).current.offset},hemisphere:function(){return De(this).hemisphere},format:function(e){return te(this,e)},unixFmt:function(e){return ue(this,e)},startOf:function(e){return ze(this,e)},endOf:function(e){return je(this,e)},leapYear:function(){var e=this.year();return N.isLeapYear(e)},progress:function(e){return he(this,e)},nearest:function(e){return fe(this,e)},diff:function(e,n){return pe(this,e,n)},since:function(e){return e||(e=this.clone().set()),ge(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){var n=this.clone();return n.tz=w(e,n.timezones),n},every:function(e,n){return Oe(this,e,n)},isAwake:function(){var e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},log:function(){return console.log(""),console.log(te(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(te(this,"full-short")),this},json:function(){var e=this;return Se.reduce((function(n,t){return n[t]=e[t](),n}),{})},debug:function(){var e=this.timezone(),n=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return n+="\n     - "+this.format("time"),console.log("\n\n",n+"\n     - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();var n=J().indexOf(e);-1===n&&(n=K().indexOf(e)),-1===n&&(n=1),this._weekStart=n}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Me.inDST=Me.isDST,Me.round=Me.nearest,Me.each=Me.every;var qe=Me,Pe=N.isLeapYear,Ce=function(e){return"string"==typeof e&&(e=parseInt(e,10)),e},Ee=["year","month","date","hour","minute","second","millisecond"],Ie=function(e,n,t){for(var r=Ee.indexOf(t),a=Ee.slice(r,Ee.length),o=0;o<a.length;o++){var i=n[a[o]]();e[a[o]](i)}return e},Te=function(e,n){n=Ce(n);var t=e.millisecond()-n;return e.epoch-t},Ae=function(e,n){n=Ce(n);var t=(e.second()-n)*j.second;return e.epoch-t},Ne=function(e,n){n=Ce(n);var t=e.clone(),r=(e.minute()-n)*j.minute;return e.epoch-=r,Ie(e,t,"second"),e.epoch},$e=function(e,n){(n=Ce(n))>=24?n=24:n<0&&(n=0);var t=e.clone(),r=e.hour()-n,a=r*j.hour;return e.epoch-=a,e.date()!==t.date()&&(e=t.clone(),r>1&&(r-=1),r<1&&(r+=1),a=r*j.hour,e.epoch-=a),D(e,{hour:n}),Ie(e,t,"minute"),e.epoch},xe=function(e,n){var t=n.match(/([0-9]{1,2}):([0-9]{1,2}) ?(am|pm)?/);if(!t){if(!(t=n.match(/([0-9]{1,2}) ?(am|pm)/)))return e.epoch;t.splice(2,0,"0")}var r=!1,a=parseInt(t[1],10),o=parseInt(t[2],10);return a>12&&(r=!0),!1===r&&("am"===t[3]&&12===a&&(a=0),"pm"===t[3]&&a<12&&(a+=12)),(e=(e=(e=(e=e.hour(a)).minute(o)).second(0)).millisecond(0)).epoch},Ye=function(e,n){if((n=Ce(n))>28){var t=e.month(),r=A[t];1===t&&29===n&&Pe(e.year())&&(r=29),n>r&&(n=r)}return n<=0&&(n=1),D(e,{date:n}),e.epoch},Le=function(e,n){"string"==typeof n&&(n=C()[n.toLowerCase()]),(n=Ce(n))>=12&&(n=11),n<=0&&(n=0);var t=e.date();return t>A[n]&&(t=A[n]),D(e,{month:n,date:t}),e.epoch},Fe=function(e,n){return n=Ce(n),D(e,{year:n}),e.epoch},Ze=function(e,n){n=Ce(n);var t=e.clone();return(n-=1)<=0?n=0:n>=365&&(n=364),e=(e=e.startOf("year")).add(n,"day"),Ie(e,t,"hour"),e.epoch},He={millisecond:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Te(n,e),n}return this.d.getMilliseconds()},second:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Ae(n,e),n}return this.d.getSeconds()},minute:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Ne(n,e),n}return this.d.getMinutes()},hour:function(e){var n=this.d;if(void 0!==e){var t=this.clone();return t.epoch=$e(t,e),t}return n.getHours()},hourFloat:function(e){if(void 0!==e){var n=this.clone(),t=e%1;t*=60;var r=parseInt(e,10);return n.epoch=$e(n,r),n.epoch=Ne(n,t),n}var a=this.d,o=a.getHours(),i=a.getMinutes();return o+(i/=60)},hour12:function(e){var n=this.d;if(void 0!==e){var t=this.clone(),r=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(r){var a=parseInt(r[1],10);"pm"===r[2]&&(a+=12),t.epoch=$e(t,a)}return t}var o=n.getHours();return o>12&&(o-=12),0===o&&(o=12),o},time:function(e){if(void 0!==e){var n=this.clone();return n.epoch=xe(n,e),n}return"".concat(this.h12(),":").concat(N.zeroPad(this.minute())).concat(this.ampm())},ampm:function(e){var n="am",t=this.hour();if(t>=12&&(n="pm"),"string"!=typeof e)return n;var r=this.clone();return e=e.toLowerCase().trim(),t>=12&&"am"===e?(t-=12,r.hour(t)):t<12&&"pm"===e?(t+=12,r.hour(t)):r},dayTime:function(e){if(void 0!==e){var n={morning:"7:00am",breakfast:"7:00am",noon:"12:00am",lunch:"12:00pm",afternoon:"2:00pm",evening:"6:00pm",dinner:"6:00pm",night:"11:00pm",midnight:"23:59pm"},t=this.clone();return e=(e=e||"").toLowerCase(),!0===n.hasOwnProperty(e)&&(t=t.time(n[e])),t}var r=this.hour();return r<6?"night":r<12?"morning":r<17?"afternoon":r<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}},Be={date:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Ye(n,e),n}return this.d.getDate()},day:function(e){if(void 0===e)return this.d.getDay();var n=this.clone(),t=e;"string"==typeof e&&(e=e.toLowerCase(),-1===(t=J().indexOf(e))&&(t=K().indexOf(e)));var r=this.d.getDay(),a=r-t,o=this.subtract(a,"days");return D(o,{hour:n.hour(),minute:n.minute(),second:n.second()}),o},dayName:function(e){if(void 0===e)return K()[this.day()];var n=this.clone();return n=n.day(e)},month:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Le(n,e),n}return this.d.getMonth()}},Qe=function(e){return e=(e=(e=e.minute(0)).second(0)).millisecond(1)},Ge={dayOfYear:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Ze(n,e),n}for(var t,r=0,a=this.d.getMonth(),o=1;o<=a;o++)(t=new Date).setDate(1),t.setFullYear(this.d.getFullYear()),t.setHours(1),t.setMinutes(1),t.setMonth(o),t.setHours(-2),r+=t.getDate();return r+this.d.getDate()},week:function(e){if(void 0!==e){var n=this.clone();return n=(n=(n=n.month(0)).date(1)).day("monday"),"december"===(n=Qe(n)).monthName()&&(n=n.add(1,"week")),e-=1,n=n.add(e,"weeks")}var t=this.clone();t=(t=t.month(0)).date(1),"december"===(t=(t=Qe(t)).day("monday")).monthName()&&(t=t.add(1,"week"));var r=1;1===t.date()&&(r=0),t=t.minus(1,"second");var a=this.epoch;if(t.epoch>a)return 1;var o=0,i=4*this.month();for(t.epoch+=j.week*i,o+=i;o<52;o++){if(t.epoch>a)return o+r;t=t.add(1,"week")}return 52},monthName:function(e){if(void 0===e)return P()[this.month()];var n=this.clone();return n=n.month(e)},quarter:function(e){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),ke[e])){var n=this.clone(),t=ke[e][0];return n=(n=(n=n.month(t)).date(1)).startOf("day")}for(var r=this.d.getMonth(),a=1;a<ke.length;a++)if(r<ke[a][0])return a-1;return 4},season:function(e){var n="north";if("South"===this.hemisphere()&&(n="south"),void 0!==e){for(var t=this.clone(),r=0;r<be[n].length;r++)e===be[n][r][0]&&(t=(t=(t=t.month(be[n][r][1])).date(1)).startOf("day"));return t}for(var a=this.d.getMonth(),o=0;o<be[n].length-1;o++)if(a>=be[n][o][1]&&a<be[n][o+1][1])return be[n][o][0];return"winter"},year:function(e){if(void 0!==e){var n=this.clone();return n.epoch=Fe(n,e),n}return this.d.getFullYear()},era:function(e){if(void 0!==e){var n=this.clone();e=e.toLowerCase();var t=n.d.getFullYear();return"bc"===e&&t>0&&(n.epoch=Fe(n,-1*t)),"ad"===e&&t<0&&(n.epoch=Fe(n,-1*t)),n}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);var n=Number(e);return isNaN(n)?this:(n=10*Math.floor(n/10),this.year(n))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,(function(e,n,t){return t.match(/b\.?c\.?/i)&&(n="-"+n),n}))).replace(/c$/,""));var n=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===n&&(n=1),n=n>=0?100*(n-1):100*(n+1),this.year(n))}var t=this.startOf("century").year();return(t=Math.floor(t/100))<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);var n=1e3*e;return 0===n&&(n=1),this.year(n)}var t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}},Ue=Object.assign({},He,Be,Ge);Ue.milliseconds=Ue.millisecond,Ue.seconds=Ue.second,Ue.minutes=Ue.minute,Ue.hours=Ue.hour,Ue.hour24=Ue.hour,Ue.h12=Ue.hour12,Ue.h24=Ue.hour24,Ue.days=Ue.day;var Ve=function(e){Object.keys(Ue).forEach((function(n){e.prototype[n]=Ue[n]}))},We=N.isLeapYear,Je=function(e,n){return 1===e&&We(n)?29:A[e]},Ke=function(e,n){if(e.month>0){var t=parseInt(e.month/12,10);e.year=n.year()+t,e.month=e.month%12}else if(e.month<0){var r=Math.floor(Math.abs(e.month)/13,10);r=Math.abs(r)+1,e.year=n.year()-r,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},Re=function(e,n,t){for(var r=n.year(),a=n.month(),o=Je(a,r);t>o;)t-=o,(a+=1)>=12&&(a-=12,r+=1),o=Je(a,r);return e.month=a,e.date=t,e},Xe=function(e,n,t){e.year=n.year(),e.month=n.month();var r=n.date();for(e.date=r-Math.abs(t);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);var a=Je(e.month,e.year);e.date+=a}return e},en=["millisecond","second","minute","hour","date","month"],nn={second:en.slice(0,1),minute:en.slice(0,2),quarterhour:en.slice(0,2),hour:en.slice(0,3),date:en.slice(0,4),month:en.slice(0,4),quarter:en.slice(0,4),season:en.slice(0,4),year:en,decade:en,century:en};nn.week=nn.hour,nn.season=nn.date,nn.quarter=nn.date;var tn={year:!0,quarter:!0,season:!0,month:!0,week:!0,day:!0},rn={month:!0,quarter:!0,season:!0,year:!0},an=function(e){e.prototype.add=function(e,n){var t=this.clone();if(!n||0===e)return t;var r=this.clone();n=N.normalize(n),j[n]?t.epoch+=j[n]*e:"week"===n?t.epoch+=j.day*(7*e):"quarter"===n||"season"===n||"season"===n?t.epoch+=j.month*(4*e):"quarterhour"===n&&(t.epoch+=15*j.minute*e);var a={};if(nn[n]&&nn[n].forEach((function(e){a[e]=r[e]()})),tn[n]){var o=r.timezone().current.offset-t.timezone().current.offset;t.epoch+=3600*o*1e3}if("month"===n&&(a.month=r.month()+e,a=Ke(a,r)),"week"===n){var i=r.date()+7*e;i<=28&&i>1&&(a.date=i)}else if("date"===n){if(e<0)a=Xe(a,r,e);else{var u=r.date()+e;a=Re(a,r,u)}0!==e&&r.isSame(t,"day")&&(a.date=r.date()+e)}else if("year"===n){var s=r.year()+e,c=t.year();(c<s||c>s)&&(t.epoch+=j.day)}else"decade"===n?a.year=t.year()+10:"century"===n&&(a.year=t.year()+100);if(rn[n]){var h=A[a.month];a.date=r.date(),a.date>h&&(a.date=h)}return D(t,a),t},e.prototype.subtract=function(e,n){return this.clone().add(-1*e,n)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add},on={millisecond:function(e){return e.epoch},second:function(e){return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-")},minute:function(e){return[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-")},hour:function(e){return[e.year(),e.month(),e.date(),e.hour()].join("-")},day:function(e){return[e.year(),e.month(),e.date()].join("-")},week:function(e){return[e.year(),e.week()].join("-")},month:function(e){return[e.year(),e.month()].join("-")},quarter:function(e){return[e.year(),e.quarter()].join("-")},year:function(e){return e.year()}};on.date=on.day;var un=function(e){e.prototype.isSame=function(n,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this;return t?("string"!=typeof n&&"number"!=typeof n||(n=new e(n,this.timezone.name)),t=t.replace(/s$/,""),!0===r&&a.tz!==n.tz&&((n=n.clone()).tz=a.tz),on[t]?on[t](a)===on[t](n):null):null}},sn=function(e){var n={isAfter:function(e){e=N.beADate(e,this);var n=N.getEpoch(e);return null===n?null:this.epoch>n},isBefore:function(e){e=N.beADate(e,this);var n=N.getEpoch(e);return null===n?null:this.epoch<n},isEqual:function(e){e=N.beADate(e,this);var n=N.getEpoch(e);return null===n?null:this.epoch===n},isBetween:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=N.beADate(e,this),n=N.beADate(n,this);var r=N.getEpoch(e);if(null===r)return null;var a=N.getEpoch(n);return null===a?null:t?this.isBetween(e,n)||this.isEqual(e)||this.isEqual(n):r<this.epoch&&this.epoch<a}};Object.keys(n).forEach((function(t){e.prototype[t]=n[t]}))},cn=function(e){var n={i18n:function(e){N.isObject(e.days)&&R(e.days),N.isObject(e.months)&&E(e.months)}};Object.keys(n).forEach((function(t){e.prototype[t]=n[t]}))},hn=d,fn=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.epoch=null,this.tz=w(n,hn),this.silent=t.silent||!0,this.british=t.dmy||t.british,this._weekStart=1,void 0!==t.weekStart&&(this._weekStart=t.weekStart),this._today={},void 0!==t.today&&(this._today=t.today),Object.defineProperty(this,"d",{get:function(){var e=a(this),n=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;n=60*n*1e3;var t=this.epoch+n;return new Date(t)}}),Object.defineProperty(this,"timezones",{get:function(){return hn},set:function(e){return hn=e,e}});var r=U(this,e,n);this.epoch=r.epoch};Object.keys(qe).forEach((function(e){fn.prototype[e]=qe[e]})),fn.prototype.clone=function(){return new fn(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today})},fn.prototype.toLocalDate=function(){return new Date(this.epoch)},Ve(fn),an(fn),un(fn),sn(fn),cn(fn);var dn=fn,ln=function(e,n){var t=new dn(null),r=new dn(null);t=t.time(e),r=n?r.time(n):t.add(59,"minutes");var a=t.hour(),o=r.hour();return Object.keys(t.timezones).filter((function(e){if(-1===e.indexOf("/"))return!1;var n=new dn(null,e),i=n.hour();return i>=a&&i<=o&&(!(i===a&&n.minute()<t.minute())&&!(i===o&&n.minute()>r.minute()))}))},mn=function(e,n,t){return new dn(e,n,t)},pn=function(e){var n=e._today||{};return Object.keys(n).forEach((function(t){e=e[t](n[t])})),e};return mn.now=function(e,n){var t=new dn((new Date).getTime(),e,n);return t=pn(t)},mn.today=function(e,n){var t=new dn((new Date).getTime(),e,n);return(t=pn(t)).startOf("day")},mn.tomorrow=function(e,n){var t=new dn((new Date).getTime(),e,n);return(t=pn(t)).add(1,"day").startOf("day")},mn.yesterday=function(e,n){var t=new dn((new Date).getTime(),e,n);return(t=pn(t)).subtract(1,"day").startOf("day")},mn.extend=function(e){return Object.keys(e).forEach((function(n){dn.prototype[n]=e[n]})),this},mn.whereIts=ln,mn.version="6.10.0",mn.plugin=mn.extend,mn}));
  