lila/public/javascripts/vendor/flatpickr.min.js

2 lines
44 KiB
JavaScript

/* flatpickr v4.4.6,, @license MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.flatpickr=t()}(this,function(){"use strict";var Z=function(e){return("0"+e).slice(-2)},Q=function(e){return!0===e?1:0};function X(n,a,i){var o;return void 0===i&&(i=!1),function(){var e=this,t=arguments;null!==o&&clearTimeout(o),o=window.setTimeout(function(){o=null,i||n.apply(e,t)},a),i&&!o&&n.apply(e,t)}}var ee=function(e){return e instanceof Array?e:[e]},e=function(){},te=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},D={D:e,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*Q(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t){var n=parseInt(t);return new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0)},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:e,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},w:e,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},ne={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},c={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[c.w(e,t,n)]},F:function(e,t,n){return te(c.n(e,t,n)-1,!1,t)},G:function(e,t,n){return Z(c.h(e,t,n))},H:function(e){return Z(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[Q(11<e.getHours())]},M:function(e,t){return te(e.getMonth(),!0,t)},S:function(e){return Z(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return Z(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Z(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return Z(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},ae={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(3<t&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},ie=function(e){var t=e.config,o=void 0===t?w:t,n=e.l10n,r=void 0===n?ae:n;return function(a,e,t){if(void 0!==o.formatDate)return o.formatDate(a,e);var i=t||r;return e.split("").map(function(e,t,n){return c[e]&&"\\"!==n[t-1]?c[e](a,i,o):"\\"!==e?e:""}).join("")}},oe=function(e){var t=e.config,h=void 0===t?w:t,n=e.l10n,v=void 0===n?ae:n;return function(e,t,n){if(0===e||e){var a,i=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var o=t||(h||w).dateFormat,r=String(e).trim();if("today"===r)a=new Date,n=!0;else if(/Z$/.test(r)||/GMT$/.test(r))a=new Date(e);else if(h&&h.parseDate)a=h.parseDate(e,o);else{a=h&&h.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var c,l=[],d=0,s=0,u="";d<o.length;d++){var f=o[d],m="\\"===f,g="\\"===o[d-1]||m;if(ne[f]&&!g){u+=ne[f];var p=new RegExp(u).exec(e);p&&(c=!0)&&l["Y"!==f?"push":"unshift"]({fn:D[f],val:p[++s]})}else m||(u+=".");l.forEach(function(e){var t=e.fn,n=e.val;return a=t(a,n,v)||a})}a=c?a:void 0}}if(a instanceof Date)return!0===n&&a.setHours(0,0,0,0),a;h.errorHandler(new Error("Invalid date provided: "+i))}}};function re(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var ce=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},le={DAY:864e5},w={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function de(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function se(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function ue(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function fe(e,t){var n=se("div","numInputWrapper"),a=se("input","numInput "+e),i=se("span","arrowUp"),o=se("span","arrowDown");if(a.type="text",a.pattern="\\d*",void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}if("function"!=typeof Object.assign&&(Object.assign=function(n){if(!n)throw TypeError("Cannot convert undefined or null to object");for(var e=arguments.length,a=new Array(1<e?e-1:0),t=1;t<e;t++)a[t-1]=arguments[t];for(var i=function(){var t=a[o];t&&Object.keys(t).forEach(function(e){return n[e]=t[e]})},o=0;o<a.length;o++)i();return n}),"function"!=typeof window.requestAnimationFrame){for(var t=["ms","moz","webkit","o"],n=0,a=t.length;n<a&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"];"function"!=typeof window.requestAnimationFrame&&(window.requestAnimationFrame=function(e){return setTimeout(e,16)})}var me=300;function r(u,f){var p={config:Object.assign({},ge.defaultConfig),l10n:ae};function m(e){return e.bind(p)}function t(){var t=p.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame(function(){if(p.calendarContainer.style.visibility="hidden",p.calendarContainer.style.display="block",void 0!==p.daysContainer){var e=(p.days.offsetWidth+1)*t.showMonths;p.daysContainer.style.width=e+"px",p.calendarContainer.style.width=e+(void 0!==p.weekWrapper?p.weekWrapper.offsetWidth:0)+"px",p.calendarContainer.style.removeProperty("visibility"),p.calendarContainer.style.removeProperty("display")}})}function d(e){0!==p.selectedDates.length&&(!function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==p.amPM&&e.target===p.amPM&&(p.amPM.textContent=p.l10n.amPM[Q(p.amPM.textContent===p.l10n.amPM[0])]);var a=parseFloat(n.getAttribute("data-min")),i=parseFloat(n.getAttribute("data-max")),o=parseFloat(n.getAttribute("data-step")),r=parseInt(n.value,10),c=e.delta||(t?38===e.which?1:-1:0),l=r+o*c;if(void 0!==n.value&&2===n.value.length){var d=n===p.hourElement,s=n===p.minuteElement;l<a?(l=i+l+Q(!d)+(Q(d)&&Q(!p.amPM)),s&&v(void 0,-1,p.hourElement)):i<l&&(l=n===p.hourElement?l-i-Q(!p.amPM):a,s&&v(void 0,1,p.hourElement)),p.amPM&&d&&(1===o?l+r===23:Math.abs(l-r)>o)&&(p.amPM.textContent=p.l10n.amPM[Q(p.amPM.textContent===p.l10n.amPM[0])]),n.value=Z(l)}}(e),"input"!==e.type?(s(),G()):setTimeout(function(){s(),G()},me))}function s(){if(void 0!==p.hourElement&&void 0!==p.minuteElement){var e,t,n=(parseInt(p.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(p.minuteElement.value,10)||0)%60,i=void 0!==p.secondElement?(parseInt(p.secondElement.value,10)||0)%60:0;void 0!==p.amPM&&(e=n,t=p.amPM.textContent,n=e%12+12*Q(t===p.l10n.amPM[1]));var o=void 0!==p.config.minTime||p.config.minDate&&p.minDateHasTime&&p.latestSelectedDateObj&&0===re(p.latestSelectedDateObj,p.config.minDate,!0);if(void 0!==p.config.maxTime||p.config.maxDate&&p.maxDateHasTime&&p.latestSelectedDateObj&&0===re(p.latestSelectedDateObj,p.config.maxDate,!0)){var r=void 0!==p.config.maxTime?p.config.maxTime:p.config.maxDate;(n=Math.min(n,r.getHours()))===r.getHours()&&(a=Math.min(a,r.getMinutes())),a===r.getMinutes()&&(i=Math.min(i,r.getSeconds()))}if(o){var c=void 0!==p.config.minTime?p.config.minTime:p.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(i=Math.max(i,c.getSeconds()))}l(n,a,i)}}function g(e){var t=e||p.latestSelectedDateObj;t&&l(t.getHours(),t.getMinutes(),t.getSeconds())}function l(e,t,n){void 0!==p.latestSelectedDateObj&&p.latestSelectedDateObj.setHours(e%24,t,n||0,0),p.hourElement&&p.minuteElement&&!p.isMobile&&(p.hourElement.value=Z(p.config.time_24hr?e:(12+e)%12+12*Q(e%12==0)),p.minuteElement.value=Z(t),void 0!==p.amPM&&(p.amPM.textContent=p.l10n.amPM[Q(12<=e)]),void 0!==p.secondElement&&(p.secondElement.value=Z(n)))}function n(e){var t=parseInt(e.target.value)+(e.delta||0);(1<t/1e3||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&S(t)}function o(t,n,a,i){return n instanceof Array?n.forEach(function(e){return o(t,e,a,i)}):t instanceof Array?t.forEach(function(e){return o(e,n,a,i)}):(t.addEventListener(n,a,i),void p._handlers.push({element:t,event:n,handler:a,options:i}))}function a(t){return function(e){1===e.which&&t(e)}}function h(){B("onChange")}function i(e){var t=void 0!==e?p.parseDate(e):p.latestSelectedDateObj||(p.config.minDate&&p.config.minDate>p.now?p.config.minDate:p.config.maxDate&&p.config.maxDate<p.now?p.config.maxDate:p.now);try{void 0!==t&&(p.currentYear=t.getFullYear(),p.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,p.config.errorHandler(e)}p.redraw()}function r(e){~e.target.className.indexOf("arrow")&&v(e,e.target.classList.contains("arrowUp")?1:-1)}function v(e,t,n){var a=e&&e.target,i=n||a&&a.parentNode&&a.parentNode.firstChild,o=U("increment");o.delta=t,i&&i.dispatchEvent(o)}function D(e,t,n,a){var i,o=F(t,!0),r=se("span","flatpickr-day "+e,t.getDate().toString());return r.dateObj=t,r.$i=a,r.setAttribute("aria-label",p.formatDate(t,p.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===re(t,p.now)&&((p.todayDateElem=r).classList.add("today"),r.setAttribute("aria-current","date")),o?(r.tabIndex=-1,z(t)&&(r.classList.add("selected"),p.selectedDateElem=r,"range"===p.config.mode&&(de(r,"startRange",p.selectedDates[0]&&0===re(t,p.selectedDates[0],!0)),de(r,"endRange",p.selectedDates[1]&&0===re(t,p.selectedDates[1],!0)),"nextMonthDay"===e&&r.classList.add("inRange")))):r.classList.add("disabled"),"range"===p.config.mode&&(i=t,!("range"!==p.config.mode||p.selectedDates.length<2)&&0<=re(i,p.selectedDates[0])&&re(i,p.selectedDates[1])<=0&&!z(t)&&r.classList.add("inRange")),p.weekNumbers&&1===p.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&p.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+p.config.getWeek(t)+"</span>"),B("onDayCreate",r),r}function w(e){e.focus(),"range"===p.config.mode&&P(e)}function b(e){for(var t=0<e?0:p.config.showMonths-1,n=0<e?p.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=p.daysContainer.children[a],o=0<e?0:i.children.length-1,r=0<e?i.children.length:-1,c=o;c!=r;c+=e){var l=i.children[c];if(-1===l.className.indexOf("hidden")&&F(l.dateObj))return l}}function M(e,t){var n=A(document.activeElement),a=void 0!==e?e:n?document.activeElement:void 0!==p.selectedDateElem&&A(p.selectedDateElem)?p.selectedDateElem:void 0!==p.todayDateElem&&A(p.todayDateElem)?p.todayDateElem:b(0<t?1:-1);return void 0===a?p._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():p.currentMonth,a=0<t?p.config.showMonths:-1,i=0<t?1:-1,o=n-p.currentMonth;o!=a;o+=i)for(var r=p.daysContainer.children[o],c=n-p.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,l=r.children.length,d=c;0<=d&&d<l&&d!=(0<t?l:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&F(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return w(s)}p.changeMonth(i),M(b(i),0)}(a,t):w(a)}function c(e,t){for(var n=(new Date(e,t,1).getDay()-p.l10n.firstDayOfWeek+7)%7,a=p.utils.getDaysInMonth((t-1+12)%12),i=p.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=1<p.config.showMonths,c=r?"prevMonthDay hidden":"prevMonthDay",l=r?"nextMonthDay hidden":"nextMonthDay",d=a+1-n,s=0;d<=a;d++,s++)o.appendChild(D(c,new Date(e,t-1,d),d,s));for(d=1;d<=i;d++,s++)o.appendChild(D("",new Date(e,t,d),d,s));for(var u=i+1;u<=42-n&&(1===p.config.showMonths||s%7!=0);u++,s++)o.appendChild(D(l,new Date(e,t+1,u%i),u,s));var f=se("div","dayContainer");return f.appendChild(o),f}function y(){if(void 0!==p.daysContainer){ue(p.daysContainer),p.weekNumbers&&ue(p.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<p.config.showMonths;t++){var n=new Date(p.currentYear,p.currentMonth,1);n.setMonth(p.currentMonth+t),e.appendChild(c(n.getFullYear(),n.getMonth()))}p.daysContainer.appendChild(e),p.days=p.daysContainer.firstChild}}function C(){var e=se("div","flatpickr-month"),t=window.document.createDocumentFragment(),n=se("span","cur-month");n.title=p.l10n.scrollTitle;var a=fe("cur-year",{tabindex:"-1"}),i=a.childNodes[0];i.title=p.l10n.scrollTitle,i.setAttribute("aria-label",p.l10n.yearAriaLabel),p.config.minDate&&i.setAttribute("data-min",p.config.minDate.getFullYear().toString()),p.config.maxDate&&(i.setAttribute("data-max",p.config.maxDate.getFullYear().toString()),i.disabled=!!p.config.minDate&&p.config.minDate.getFullYear()===p.config.maxDate.getFullYear());var o=se("div","flatpickr-current-month");return o.appendChild(n),o.appendChild(a),t.appendChild(o),e.appendChild(t),{container:e,yearElement:i,monthElement:n}}function x(){ue(p.monthNav),p.monthNav.appendChild(p.prevMonthNav);for(var e=p.config.showMonths;e--;){var t=C();p.yearElements.push(t.yearElement),p.monthElements.push(t.monthElement),p.monthNav.appendChild(t.container)}p.monthNav.appendChild(p.nextMonthNav)}function E(){p.weekdayContainer?ue(p.weekdayContainer):p.weekdayContainer=se("div","flatpickr-weekdays");for(var e=p.config.showMonths;e--;){var t=se("div","flatpickr-weekdaycontainer");p.weekdayContainer.appendChild(t)}return T(),p.weekdayContainer}function T(){var e=p.l10n.firstDayOfWeek,t=p.l10n.weekdays.shorthand.concat();0<e&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e)));for(var n=p.config.showMonths;n--;)p.weekdayContainer.children[n].innerHTML="\n <span class=flatpickr-weekday>\n "+t.join("</span><span class=flatpickr-weekday>")+"\n </span>\n "}function k(e,t){void 0===t&&(t=!0);var n=t?e:e-p.currentMonth;n<0&&!0===p._hidePrevMonthArrow||0<n&&!0===p._hideNextMonthArrow||(p.currentMonth+=n,(p.currentMonth<0||11<p.currentMonth)&&(p.currentYear+=11<p.currentMonth?1:-1,p.currentMonth=(p.currentMonth+12)%12,B("onYearChange")),y(),B("onMonthChange"),$())}function I(e){return!(!p.config.appendTo||!p.config.appendTo.contains(e))||p.calendarContainer.contains(e)}function O(t){if(p.isOpen&&!p.config.inline){var e=I(t.target),n=t.target===p.input||t.target===p.altInput||p.element.contains(t.target)||t.path&&t.path.indexOf&&(~t.path.indexOf(p.input)||~t.path.indexOf(p.altInput)),a="blur"===t.type?n&&t.relatedTarget&&!I(t.relatedTarget):!n&&!e,i=!p.config.ignoredFocusElements.some(function(e){return e.contains(t.target)});a&&i&&(p.close(),"range"===p.config.mode&&1===p.selectedDates.length&&(p.clear(!1),p.redraw()))}}function S(e){if(!(!e||p.config.minDate&&e<p.config.minDate.getFullYear()||p.config.maxDate&&e>p.config.maxDate.getFullYear())){var t=e,n=p.currentYear!==t;p.currentYear=t||p.currentYear,p.config.maxDate&&p.currentYear===p.config.maxDate.getFullYear()?p.currentMonth=Math.min(p.config.maxDate.getMonth(),p.currentMonth):p.config.minDate&&p.currentYear===p.config.minDate.getFullYear()&&(p.currentMonth=Math.max(p.config.minDate.getMonth(),p.currentMonth)),n&&(p.redraw(),B("onYearChange"))}}function F(e,t){void 0===t&&(t=!0);var n=p.parseDate(e,void 0,t);if(p.config.minDate&&n&&re(n,p.config.minDate,void 0!==t?t:!p.minDateHasTime)<0||p.config.maxDate&&n&&0<re(n,p.config.maxDate,void 0!==t?t:!p.maxDateHasTime))return!1;if(0===p.config.enable.length&&0===p.config.disable.length)return!0;if(void 0===n)return!1;for(var a,i=0<p.config.enable.length,o=i?p.config.enable:p.config.disable,r=0;r<o.length;r++){if("function"==typeof(a=o[r])&&a(n))return i;if(a instanceof Date&&void 0!==n&&a.getTime()===n.getTime())return i;if("string"==typeof a&&void 0!==n){var c=p.parseDate(a,void 0,!0);return c&&c.getTime()===n.getTime()?i:!i}if("object"==typeof a&&void 0!==n&&a.from&&a.to&&n.getTime()>=a.from.getTime()&&n.getTime()<=a.to.getTime())return i}return!i}function A(e){return void 0!==p.daysContainer&&(-1===e.className.indexOf("hidden")&&p.daysContainer.contains(e))}function _(e){var t=e.target===p._input,n=I(e.target),a=p.config.allowInput,i=p.isOpen&&(!a||!t),o=p.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return p.setDate(p._input.value,!0,e.target===p.altInput?p.config.altFormat:p.config.dateFormat),e.target.blur();p.open()}else if(n||i||o){var r=!!p.timeContainer&&p.timeContainer.contains(e.target);switch(e.keyCode){case 13:r?G():R(e);break;case 27:e.preventDefault(),W();break;case 8:case 46:t&&!p.config.allowInput&&(e.preventDefault(),p.clear());break;case 37:case 39:if(r)p.hourElement&&p.hourElement.focus();else if(e.preventDefault(),void 0!==p.daysContainer&&(!1===a||A(document.activeElement))){var c=39===e.keyCode?1:-1;e.ctrlKey?(k(c),M(b(1),0)):M(void 0,c)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;p.daysContainer?e.ctrlKey?(S(p.currentYear-l),M(b(1),0)):r||M(void 0,7*l):p.config.enableTime&&(!r&&p.hourElement&&p.hourElement.focus(),d(e),p._debouncedChange());break;case 9:if(!r)break;e.target===p.hourElement?(e.preventDefault(),p.minuteElement.select()):e.target===p.minuteElement&&(p.secondElement||p.amPM)?(e.preventDefault(),void 0!==p.secondElement?p.secondElement.focus():void 0!==p.amPM&&(e.preventDefault(),p.amPM.focus())):e.target===p.secondElement&&p.amPM&&(e.preventDefault(),p.amPM.focus())}}if(void 0!==p.amPM&&e.target===p.amPM)switch(e.key){case p.l10n.amPM[0].charAt(0):case p.l10n.amPM[0].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[0],s(),G();break;case p.l10n.amPM[1].charAt(0):case p.l10n.amPM[1].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[1],s(),G()}B("onKeyDown",e)}function P(o){if(1===p.selectedDates.length&&o.classList.contains("flatpickr-day")&&!o.classList.contains("disabled")){for(var r=o.dateObj.getTime(),c=p.parseDate(p.selectedDates[0],void 0,!0).getTime(),e=Math.min(r,p.selectedDates[0].getTime()),t=Math.max(r,p.selectedDates[0].getTime()),l=!1,d=0,s=0,n=e;n<t;n+=le.DAY)F(new Date(n),!0)||(l=l||e<n&&n<t,n<c&&(!d||d<n)?d=n:c<n&&(!s||n<s)&&(s=n));for(var u=0;u<p.config.showMonths;u++)for(var f=p.daysContainer.children[u],m=p.daysContainer.children[u-1],a=function(e,t){var n=f.children[e],a=n.dateObj.getTime(),i=0<d&&a<d||0<s&&s<a;return i?(n.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){n.classList.remove(e)}),"continue"):l&&!i?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){n.classList.remove(e)}),o.classList.add(r<p.selectedDates[0].getTime()?"startRange":"endRange"),void(!f.contains(o)&&0<u&&m&&m.lastChild.dateObj.getTime()>=a||(c<r&&a===c?n.classList.add("startRange"):r<c&&a===c&&n.classList.add("endRange"),d<=a&&(0===s||a<=s)&&ce(a,c,r)&&n.classList.add("inRange"))))},i=0,g=f.children.length;i<g;i++)a(i)}}function N(){!p.isOpen||p.config.static||p.config.inline||H()}function Y(a){return function(e){var t=p.config["_"+a+"Date"]=p.parseDate(e,p.config.dateFormat),n=p.config["_"+("min"===a?"max":"min")+"Date"];void 0!==t&&(p["min"===a?"minDateHasTime":"maxDateHasTime"]=0<t.getHours()||0<t.getMinutes()||0<t.getSeconds()),p.selectedDates&&(p.selectedDates=p.selectedDates.filter(function(e){return F(e)}),p.selectedDates.length||"min"!==a||g(t),G()),p.daysContainer&&(L(),void 0!==t?p.currentYearElement[a]=t.getFullYear().toString():p.currentYearElement.removeAttribute(a),p.currentYearElement.disabled=!!n&&void 0!==t&&n.getFullYear()===t.getFullYear())}}function j(){"object"!=typeof p.config.locale&&void 0===ge.l10ns[p.config.locale]&&p.config.errorHandler(new Error("flatpickr: invalid locale "+p.config.locale)),p.l10n=Object.assign({},ge.l10ns.default,"object"==typeof p.config.locale?p.config.locale:"default"!==p.config.locale?ge.l10ns[p.config.locale]:void 0),ne.K="("+p.l10n.amPM[0]+"|"+p.l10n.amPM[1]+"|"+p.l10n.amPM[0].toLowerCase()+"|"+p.l10n.amPM[1].toLowerCase()+")",p.formatDate=ie(p)}function H(e){if(void 0!==p.calendarContainer){B("onPreCalendarPosition");var t=e||p._positionElement,n=Array.prototype.reduce.call(p.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=p.calendarContainer.offsetWidth,i=p.config.position.split(" "),o=i[0],r=1<i.length?i[1]:null,c=t.getBoundingClientRect(),l=window.innerHeight-c.bottom,d="above"===o||"below"!==o&&l<n&&c.top>n,s=window.pageYOffset+c.top+(d?-n-2:t.offsetHeight+2);if(de(p.calendarContainer,"arrowTop",!d),de(p.calendarContainer,"arrowBottom",d),!p.config.inline){var u=window.pageXOffset+c.left-(null!=r&&"center"===r?(a-c.width)/2:0),f=window.document.body.offsetWidth-c.right,m=u+a>window.document.body.offsetWidth;de(p.calendarContainer,"rightMost",m),p.config.static||(p.calendarContainer.style.top=s+"px",m?(p.calendarContainer.style.left="auto",p.calendarContainer.style.right=f+"px"):(p.calendarContainer.style.left=u+"px",p.calendarContainer.style.right="auto"))}}}function L(){p.config.noCalendar||p.isMobile||($(),y())}function W(){p._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(p.close,0):p.close()}function R(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=p.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()<p.currentMonth||a.getMonth()>p.currentMonth+p.config.showMonths-1)&&"range"!==p.config.mode;if(p.selectedDateElem=n,"single"===p.config.mode)p.selectedDates=[a];else if("multiple"===p.config.mode){var o=z(a);o?p.selectedDates.splice(parseInt(o),1):p.selectedDates.push(a)}else"range"===p.config.mode&&(2===p.selectedDates.length&&p.clear(!1),p.selectedDates.push(a),0!==re(a,p.selectedDates[0],!0)&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(s(),i){var r=p.currentYear!==a.getFullYear();p.currentYear=a.getFullYear(),p.currentMonth=a.getMonth(),r&&B("onYearChange"),B("onMonthChange")}if($(),y(),p.config.minDate&&p.minDateHasTime&&p.config.enableTime&&0===re(a,p.config.minDate)&&g(p.config.minDate),G(),p.config.enableTime&&setTimeout(function(){return p.showTimeInput=!0},50),"range"===p.config.mode&&(1===p.selectedDates.length?P(n):$()),i||"range"===p.config.mode||1!==p.config.showMonths?p.selectedDateElem&&p.selectedDateElem.focus():w(n),void 0!==p.hourElement&&setTimeout(function(){return void 0!==p.hourElement&&p.hourElement.select()},451),p.config.closeOnSelect){var c="single"===p.config.mode&&!p.config.enableTime,l="range"===p.config.mode&&2===p.selectedDates.length&&!p.config.enableTime;(c||l)&&W()}h()}}p.parseDate=oe({config:p.config,l10n:p.l10n}),p._handlers=[],p._bind=o,p._setHoursFromDate=g,p.changeMonth=k,p.changeYear=S,p.clear=function(e){void 0===e&&(e=!0);p.input.value="",void 0!==p.altInput&&(p.altInput.value="");void 0!==p.mobileInput&&(p.mobileInput.value="");p.selectedDates=[],p.latestSelectedDateObj=void 0,!(p.showTimeInput=!1)===p.config.enableTime&&(void 0!==p.config.minDate?g(p.config.minDate):l(p.config.defaultHour,p.config.defaultMinute,p.config.defaultSeconds));p.redraw(),e&&B("onChange")},p.close=function(){p.isOpen=!1,p.isMobile||(p.calendarContainer.classList.remove("open"),p._input.classList.remove("active"));B("onClose")},p._createElement=se,p.destroy=function(){void 0!==p.config&&B("onDestroy");for(var e=p._handlers.length;e--;){var t=p._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}p._handlers=[],p.mobileInput?(p.mobileInput.parentNode&&p.mobileInput.parentNode.removeChild(p.mobileInput),p.mobileInput=void 0):p.calendarContainer&&p.calendarContainer.parentNode&&p.calendarContainer.parentNode.removeChild(p.calendarContainer);p.altInput&&(p.input.type="text",p.altInput.parentNode&&p.altInput.parentNode.removeChild(p.altInput),delete p.altInput);p.input&&(p.input.type=p.input._type,p.input.classList.remove("flatpickr-input"),p.input.removeAttribute("readonly"),p.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete p[e]}catch(e){}})},p.isEnabled=F,p.jumpToDate=i,p.open=function(e,t){void 0===t&&(t=p._input);if(!0===p.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),setTimeout(function(){void 0!==p.mobileInput&&p.mobileInput.focus()},0),void B("onOpen");if(p._input.disabled||p.config.inline)return;var n=p.isOpen;p.isOpen=!0,n||(p.calendarContainer.classList.add("open"),p._input.classList.add("active"),B("onOpen"),H(t));!0===p.config.enableTime&&!0===p.config.noCalendar&&(0===p.selectedDates.length&&(p.setDate(void 0!==p.config.minDate?new Date(p.config.minDate.getTime()):(new Date).setHours(p.config.defaultHour,p.config.defaultMinute,p.config.defaultSeconds,0),!1),s(),G()),!1!==p.config.allowInput||void 0!==e&&p.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return p.hourElement.select()},50))},p.redraw=L,p.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(p.config,e):(p.config[e]=t,void 0!==q[e]&&q[e].forEach(function(e){return e()}));p.redraw(),i()},p.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=p.config.dateFormat);if(0!==e&&!e)return p.clear(t);J(e,n),p.showTimeInput=0<p.selectedDates.length,p.latestSelectedDateObj=p.selectedDates[0],p.redraw(),i(),g(),G(t),t&&B("onChange")},p.toggle=function(e){if(!0===p.isOpen)return p.close();p.open(e)};var q={locale:[j,T],showMonths:[x,t,E]};function J(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return p.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[p.parseDate(e,t)];else if("string"==typeof e)switch(p.config.mode){case"single":case"time":n=[p.parseDate(e,t)];break;case"multiple":n=e.split(p.config.conjunction).map(function(e){return p.parseDate(e,t)});break;case"range":n=e.split(p.l10n.rangeSeparator).map(function(e){return p.parseDate(e,t)})}else p.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));p.selectedDates=n.filter(function(e){return e instanceof Date&&F(e,!1)}),"range"===p.config.mode&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function K(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?p.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:p.parseDate(e.from,void 0),to:p.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function B(e,t){var n=p.config[e];if(void 0!==n&&0<n.length)for(var a=0;n[a]&&a<n.length;a++)n[a](p.selectedDates,p.input.value,p,t);"onChange"===e&&(p.input.dispatchEvent(U("change")),p.input.dispatchEvent(U("input")))}function U(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function z(e){for(var t=0;t<p.selectedDates.length;t++)if(0===re(p.selectedDates[t],e))return""+t;return!1}function $(){p.config.noCalendar||p.isMobile||!p.monthNav||(p.yearElements.forEach(function(e,t){var n=new Date(p.currentYear,p.currentMonth,1);n.setMonth(p.currentMonth+t),p.monthElements[t].textContent=te(n.getMonth(),p.config.shorthandCurrentMonth,p.l10n)+" ",e.value=n.getFullYear().toString()}),p._hidePrevMonthArrow=void 0!==p.config.minDate&&(p.currentYear===p.config.minDate.getFullYear()?p.currentMonth<=p.config.minDate.getMonth():p.currentYear<p.config.minDate.getFullYear()),p._hideNextMonthArrow=void 0!==p.config.maxDate&&(p.currentYear===p.config.maxDate.getFullYear()?p.currentMonth+1>p.config.maxDate.getMonth():p.currentYear>p.config.maxDate.getFullYear()))}function G(e){if(void 0===e&&(e=!0),0===p.selectedDates.length)return p.clear(e);void 0!==p.mobileInput&&p.mobileFormatStr&&(p.mobileInput.value=void 0!==p.latestSelectedDateObj?p.formatDate(p.latestSelectedDateObj,p.mobileFormatStr):"");var t="range"!==p.config.mode?p.config.conjunction:p.l10n.rangeSeparator;p.input.value=p.selectedDates.map(function(e){return p.formatDate(e,p.config.dateFormat)}).join(t),void 0!==p.altInput&&(p.altInput.value=p.selectedDates.map(function(e){return p.formatDate(e,p.config.altFormat)}).join(t)),!1!==e&&B("onValueUpdate")}function V(e){e.preventDefault();var t=p.prevMonthNav.contains(e.target),n=p.nextMonthNav.contains(e.target);t||n?k(t?-1:1):0<=p.yearElements.indexOf(e.target)?e.target.select():e.target.classList.contains("arrowUp")?p.changeYear(p.currentYear+1):e.target.classList.contains("arrowDown")&&p.changeYear(p.currentYear-1)}return function(){p.element=p.input=u,p.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n=Object.assign({},f,JSON.parse(JSON.stringify(u.dataset||{}))),a={};p.config.parseDate=n.parseDate,p.config.formatDate=n.formatDate,Object.defineProperty(p.config,"enable",{get:function(){return p.config._enable},set:function(e){p.config._enable=K(e)}}),Object.defineProperty(p.config,"disable",{get:function(){return p.config._disable},set:function(e){p.config._disable=K(e)}});var i="time"===n.mode;n.dateFormat||!n.enableTime&&!i||(a.dateFormat=n.noCalendar||i?"H:i"+(n.enableSeconds?":S":""):ge.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&(n.enableTime||i)&&!n.altFormat&&(a.altFormat=n.noCalendar||i?"h:i"+(n.enableSeconds?":S K":" K"):ge.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(p.config,"minDate",{get:function(){return p.config._minDate},set:Y("min")}),Object.defineProperty(p.config,"maxDate",{get:function(){return p.config._maxDate},set:Y("max")});var o=function(t){return function(e){p.config["min"===t?"_minTime":"_maxTime"]=p.parseDate(e,"H:i")}};Object.defineProperty(p.config,"minTime",{get:function(){return p.config._minTime},set:o("min")}),Object.defineProperty(p.config,"maxTime",{get:function(){return p.config._maxTime},set:o("max")}),"time"===n.mode&&(p.config.noCalendar=!0,p.config.enableTime=!0),Object.assign(p.config,a,n);for(var r=0;r<e.length;r++)p.config[e[r]]=!0===p.config[e[r]]||"true"===p.config[e[r]];for(var c=t.length;c--;)void 0!==p.config[t[c]]&&(p.config[t[c]]=ee(p.config[t[c]]||[]).map(m));p.isMobile=!p.config.disableMobile&&!p.config.inline&&"single"===p.config.mode&&!p.config.disable.length&&!p.config.enable.length&&!p.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var l=0;l<p.config.plugins.length;l++){var d=p.config.plugins[l](p)||{};for(var s in d)~t.indexOf(s)?p.config[s]=ee(d[s]).map(m).concat(p.config[s]):void 0===n[s]&&(p.config[s]=d[s])}B("onParseConfig")}(),j(),function(){if(p.input=p.config.wrap?u.querySelector("[data-input]"):u,!p.input)return p.config.errorHandler(new Error("Invalid input element specified"));p.input._type=p.input.type,p.input.type="text",p.input.classList.add("flatpickr-input"),p._input=p.input,p.config.altInput&&(p.altInput=se(p.input.nodeName,p.input.className+" "+p.config.altInputClass),p._input=p.altInput,p.altInput.placeholder=p.input.placeholder,p.altInput.disabled=p.input.disabled,p.altInput.required=p.input.required,p.altInput.tabIndex=p.input.tabIndex,p.altInput.type="text",p.input.type="hidden",!p.config.static&&p.input.parentNode&&p.input.parentNode.insertBefore(p.altInput,p.input.nextSibling)),p.config.allowInput||p._input.setAttribute("readonly","readonly"),p._positionElement=p.config.positionElement||p._input}(),function(){p.selectedDates=[],p.now=p.parseDate(p.config.now)||new Date;var e=p.config.defaultDate||p.input.value;e&&J(e,p.config.dateFormat);var t=0<p.selectedDates.length?p.selectedDates[0]:p.config.minDate&&p.config.minDate.getTime()>p.now.getTime()?p.config.minDate:p.config.maxDate&&p.config.maxDate.getTime()<p.now.getTime()?p.config.maxDate:p.now;p.currentYear=t.getFullYear(),p.currentMonth=t.getMonth(),0<p.selectedDates.length&&(p.latestSelectedDateObj=p.selectedDates[0]),void 0!==p.config.minTime&&(p.config.minTime=p.parseDate(p.config.minTime,"H:i")),void 0!==p.config.maxTime&&(p.config.maxTime=p.parseDate(p.config.maxTime,"H:i")),p.minDateHasTime=!!p.config.minDate&&(0<p.config.minDate.getHours()||0<p.config.minDate.getMinutes()||0<p.config.minDate.getSeconds()),p.maxDateHasTime=!!p.config.maxDate&&(0<p.config.maxDate.getHours()||0<p.config.maxDate.getMinutes()||0<p.config.maxDate.getSeconds()),Object.defineProperty(p,"showTimeInput",{get:function(){return p._showTimeInput},set:function(e){p._showTimeInput=e,p.calendarContainer&&de(p.calendarContainer,"showTimeInput",e),p.isOpen&&H()}})}(),p.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=p.currentMonth),void 0===t&&(t=p.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:p.l10n.daysInMonth[e]}},p.isMobile||function(){var e=window.document.createDocumentFragment();if(p.calendarContainer=se("div","flatpickr-calendar"),p.calendarContainer.tabIndex=-1,!p.config.noCalendar){if(e.appendChild((p.monthNav=se("div","flatpickr-months"),p.yearElements=[],p.monthElements=[],p.prevMonthNav=se("span","flatpickr-prev-month"),p.prevMonthNav.innerHTML=p.config.prevArrow,p.nextMonthNav=se("span","flatpickr-next-month"),p.nextMonthNav.innerHTML=p.config.nextArrow,x(),Object.defineProperty(p,"_hidePrevMonthArrow",{get:function(){return p.__hidePrevMonthArrow},set:function(e){p.__hidePrevMonthArrow!==e&&(de(p.prevMonthNav,"disabled",e),p.__hidePrevMonthArrow=e)}}),Object.defineProperty(p,"_hideNextMonthArrow",{get:function(){return p.__hideNextMonthArrow},set:function(e){p.__hideNextMonthArrow!==e&&(de(p.nextMonthNav,"disabled",e),p.__hideNextMonthArrow=e)}}),p.currentYearElement=p.yearElements[0],$(),p.monthNav)),p.innerContainer=se("div","flatpickr-innerContainer"),p.config.weekNumbers){var t=function(){p.calendarContainer.classList.add("hasWeeks");var e=se("div","flatpickr-weekwrapper");e.appendChild(se("span","flatpickr-weekday",p.l10n.weekAbbreviation));var t=se("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;p.innerContainer.appendChild(n),p.weekNumbers=a,p.weekWrapper=n}p.rContainer=se("div","flatpickr-rContainer"),p.rContainer.appendChild(E()),p.daysContainer||(p.daysContainer=se("div","flatpickr-days"),p.daysContainer.tabIndex=-1),y(),p.rContainer.appendChild(p.daysContainer),p.innerContainer.appendChild(p.rContainer),e.appendChild(p.innerContainer)}p.config.enableTime&&e.appendChild(function(){p.calendarContainer.classList.add("hasTime"),p.config.noCalendar&&p.calendarContainer.classList.add("noCalendar"),p.timeContainer=se("div","flatpickr-time"),p.timeContainer.tabIndex=-1;var e=se("span","flatpickr-time-separator",":"),t=fe("flatpickr-hour");p.hourElement=t.childNodes[0];var n=fe("flatpickr-minute");if(p.minuteElement=n.childNodes[0],p.hourElement.tabIndex=p.minuteElement.tabIndex=-1,p.hourElement.value=Z(p.latestSelectedDateObj?p.latestSelectedDateObj.getHours():p.config.time_24hr?p.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(p.config.defaultHour)),p.minuteElement.value=Z(p.latestSelectedDateObj?p.latestSelectedDateObj.getMinutes():p.config.defaultMinute),p.hourElement.setAttribute("data-step",p.config.hourIncrement.toString()),p.minuteElement.setAttribute("data-step",p.config.minuteIncrement.toString()),p.hourElement.setAttribute("data-min",p.config.time_24hr?"0":"1"),p.hourElement.setAttribute("data-max",p.config.time_24hr?"23":"12"),p.minuteElement.setAttribute("data-min","0"),p.minuteElement.setAttribute("data-max","59"),p.timeContainer.appendChild(t),p.timeContainer.appendChild(e),p.timeContainer.appendChild(n),p.config.time_24hr&&p.timeContainer.classList.add("time24hr"),p.config.enableSeconds){p.timeContainer.classList.add("hasSeconds");var a=fe("flatpickr-second");p.secondElement=a.childNodes[0],p.secondElement.value=Z(p.latestSelectedDateObj?p.latestSelectedDateObj.getSeconds():p.config.defaultSeconds),p.secondElement.setAttribute("data-step",p.minuteElement.getAttribute("data-step")),p.secondElement.setAttribute("data-min",p.minuteElement.getAttribute("data-min")),p.secondElement.setAttribute("data-max",p.minuteElement.getAttribute("data-max")),p.timeContainer.appendChild(se("span","flatpickr-time-separator",":")),p.timeContainer.appendChild(a)}return p.config.time_24hr||(p.amPM=se("span","flatpickr-am-pm",p.l10n.amPM[Q(11<(p.latestSelectedDateObj?p.hourElement.value:p.config.defaultHour))]),p.amPM.title=p.l10n.toggleTitle,p.amPM.tabIndex=-1,p.timeContainer.appendChild(p.amPM)),p.timeContainer}()),de(p.calendarContainer,"rangeMode","range"===p.config.mode),de(p.calendarContainer,"animate",!0===p.config.animate),de(p.calendarContainer,"multiMonth",1<p.config.showMonths),p.calendarContainer.appendChild(e);var i=void 0!==p.config.appendTo&&void 0!==p.config.appendTo.nodeType;if((p.config.inline||p.config.static)&&(p.calendarContainer.classList.add(p.config.inline?"inline":"static"),p.config.inline&&(!i&&p.element.parentNode?p.element.parentNode.insertBefore(p.calendarContainer,p._input.nextSibling):void 0!==p.config.appendTo&&p.config.appendTo.appendChild(p.calendarContainer)),p.config.static)){var o=se("div","flatpickr-wrapper");p.element.parentNode&&p.element.parentNode.insertBefore(o,p.element),o.appendChild(p.element),p.altInput&&o.appendChild(p.altInput),o.appendChild(p.calendarContainer)}p.config.static||p.config.inline||(void 0!==p.config.appendTo?p.config.appendTo:window.document.body).appendChild(p.calendarContainer)}(),function(){if(p.config.wrap&&["open","close","toggle","clear"].forEach(function(t){Array.prototype.forEach.call(p.element.querySelectorAll("[data-"+t+"]"),function(e){return o(e,"click",p[t])})}),p.isMobile)return function(){var e=p.config.enableTime?p.config.noCalendar?"time":"datetime-local":"date";p.mobileInput=se("input",p.input.className+" flatpickr-mobile"),p.mobileInput.step=p.input.getAttribute("step")||"any",p.mobileInput.tabIndex=1,p.mobileInput.type=e,p.mobileInput.disabled=p.input.disabled,p.mobileInput.required=p.input.required,p.mobileInput.placeholder=p.input.placeholder,p.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",0<p.selectedDates.length&&(p.mobileInput.defaultValue=p.mobileInput.value=p.formatDate(p.selectedDates[0],p.mobileFormatStr)),p.config.minDate&&(p.mobileInput.min=p.formatDate(p.config.minDate,"Y-m-d")),p.config.maxDate&&(p.mobileInput.max=p.formatDate(p.config.maxDate,"Y-m-d")),p.input.type="hidden",void 0!==p.altInput&&(p.altInput.type="hidden");try{p.input.parentNode&&p.input.parentNode.insertBefore(p.mobileInput,p.input.nextSibling)}catch(e){}o(p.mobileInput,"change",function(e){p.setDate(e.target.value,!1,p.mobileFormatStr),B("onChange"),B("onClose")})}();var e=X(N,50);p._debouncedChange=X(h,me),p.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&o(p.daysContainer,"mouseover",function(e){"range"===p.config.mode&&P(e.target)}),o(window.document.body,"keydown",_),p.config.static||o(p._input,"keydown",_),p.config.inline||p.config.static||o(window,"resize",e),void 0!==window.ontouchstart?o(window.document,"click",O):o(window.document,"mousedown",a(O)),o(window.document,"focus",O,{capture:!0}),!0===p.config.clickOpens&&(o(p._input,"focus",p.open),o(p._input,"mousedown",a(p.open))),void 0!==p.daysContainer&&(o(p.monthNav,"mousedown",a(V)),o(p.monthNav,["keyup","increment"],n),o(p.daysContainer,"mousedown",a(R))),void 0!==p.timeContainer&&void 0!==p.minuteElement&&void 0!==p.hourElement&&(o(p.timeContainer,["input","increment"],d),o(p.timeContainer,"mousedown",a(r)),o(p.timeContainer,["input","increment"],p._debouncedChange,{passive:!0}),o([p.hourElement,p.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==p.secondElement&&o(p.secondElement,"focus",function(){return p.secondElement&&p.secondElement.select()}),void 0!==p.amPM&&o(p.amPM,"mousedown",a(function(e){d(e),h()})))}(),(p.selectedDates.length||p.config.noCalendar)&&(p.config.enableTime&&g(p.config.noCalendar?p.latestSelectedDateObj||p.config.minDate:void 0),G(!1)),t(),p.showTimeInput=0<p.selectedDates.length||p.config.noCalendar;var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!p.isMobile&&e&&H(),B("onReady")}(),p}function i(e,t){for(var n=Array.prototype.slice.call(e),a=[],i=0;i<n.length;i++){var o=n[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=r(o,t||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return i(this,e)},HTMLElement.prototype.flatpickr=function(e){return i([this],e)});var ge=function(e,t){return e instanceof NodeList?i(e,t):i("string"==typeof e?window.document.querySelectorAll(e):[e],t)};return ge.defaultConfig=w,ge.l10ns={en:Object.assign({},ae),default:Object.assign({},ae)},ge.localize=function(e){ge.l10ns.default=Object.assign({},ge.l10ns.default,e)},ge.setDefaults=function(e){ge.defaultConfig=Object.assign({},ge.defaultConfig,e)},ge.parseDate=oe({}),ge.formatDate=ie({}),ge.compareDates=re,"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(e){return i(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=ge),ge});