!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.flatpickr=t()}(this,function(){"use strict";function k(n,t,i){var r;return void 0===i&&(i=!1),function(){var u=this,f=arguments;null!==r&&clearTimeout(r);r=window.setTimeout(function(){r=null;i||n.apply(u,f)},t);i&&!r&&n.apply(u,f)}}function u(n,t,i){return void 0===i&&(i=!0),!1!==i?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}function f(n,t,i){if(!0===i)return n.classList.add(t);n.classList.remove(t)}function n(n,t,i){var r=window.document.createElement(n);return t=t||"",i=i||"",r.className=t,void 0!==i&&(r.textContent=i),r}function c(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function l(t,i){var r=n("div","numInputWrapper"),u=n("input","numInput "+t),e=n("span","arrowUp"),o=n("span","arrowDown"),f;if(u.type="text",u.pattern="\\d*",void 0!==i)for(f in i)u.setAttribute(f,i[f]);return r.appendChild(u),r.appendChild(e),r.appendChild(o),r}function rt(e,s){function si(n){return n.bind(h)}function hi(){var n=h.config;!1===n.weekNumbers&&1===n.showMonths||!0!==n.noCalendar&&window.requestAnimationFrame(function(){if(h.calendarContainer.style.visibility="hidden",h.calendarContainer.style.display="block",void 0!==h.daysContainer){var t=(h.days.offsetWidth+1)*n.showMonths;h.daysContainer.style.width=t+"px";h.calendarContainer.style.width=t+(void 0!==h.weekWrapper?h.weekWrapper.offsetWidth:0)+"px";h.calendarContainer.style.removeProperty("visibility");h.calendarContainer.style.removeProperty("display")}})}function et(n){if(0!==h.selectedDates.length){void 0!==n&&"blur"!==n.type&&function(n){var l,t,f,c;n.preventDefault();l="keydown"===n.type;t=n.target;void 0!==h.amPM&&n.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[r(h.amPM.textContent===h.l10n.amPM[0])]);var a=parseFloat(t.getAttribute("data-min")),e=parseFloat(t.getAttribute("data-max")),o=parseFloat(t.getAttribute("data-step")),s=parseInt(t.value,10),v=n.delta||(l?38===n.which?1:-1:0),u=s+o*v;void 0!==t.value&&2===t.value.length&&(f=t===h.hourElement,c=t===h.minuteElement,u<a?(u=e+u+r(!f)+(r(f)&&r(!h.amPM)),c&&kt(void 0,-1,h.hourElement)):e<u&&(u=t===h.hourElement?u-e-r(!h.amPM):a,c&&kt(void 0,1,h.hourElement)),h.amPM&&f&&(1===o?u+s===23:Math.abs(u-s)>o)&&(h.amPM.textContent=h.l10n.amPM[r(h.amPM.textContent===h.l10n.amPM[0])]),t.value=i(u))}(n);var t=h._input.value;ht();rt();h._input.value!==t&&h._debouncedChange()}}function ht(){var c,i,f;if(void 0!==h.hourElement&&void 0!==h.minuteElement){var o,s,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,t=(parseInt(h.minuteElement.value,10)||0)%60,e=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(o=n,s=h.amPM.textContent,n=o%12+12*r(s===h.l10n.amPM[1]));c=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===u(h.latestSelectedDateObj,h.config.minDate,!0);(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===u(h.latestSelectedDateObj,h.config.maxDate,!0))&&(i=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate,(n=Math.min(n,i.getHours()))===i.getHours()&&(t=Math.min(t,i.getMinutes())),t===i.getMinutes()&&(e=Math.min(e,i.getSeconds())));c&&(f=void 0!==h.config.minTime?h.config.minTime:h.config.minDate,(n=Math.max(n,f.getHours()))===f.getHours()&&(t=Math.max(t,f.getMinutes())),t===f.getMinutes()&&(e=Math.max(e,f.getSeconds())));pt(n,t,e)}}function ct(n){var t=n||h.latestSelectedDateObj;t&&pt(t.getHours(),t.getMinutes(),t.getSeconds())}function ci(){var n=h.config.defaultHour,t=h.config.defaultMinute,u=h.config.defaultSeconds,i,f,r,e;void 0!==h.config.minDate&&(i=h.config.minDate.getHours(),f=h.config.minDate.getMinutes(),(n=Math.max(n,i))===i&&(t=Math.max(f,t)),n===i&&t===f&&(u=h.config.minDate.getSeconds()));void 0!==h.config.maxDate&&(r=h.config.maxDate.getHours(),e=h.config.maxDate.getMinutes(),(n=Math.min(n,r))===r&&(t=Math.min(e,t)),n===r&&t===e&&(u=h.config.maxDate.getSeconds()));pt(n,t,u)}function pt(n,t,u){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(n%24,t,u||0,0);h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=i(h.config.time_24hr?n:(12+n)%12+12*r(n%12==0)),h.minuteElement.value=i(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[r(12<=n)]),void 0!==h.secondElement&&(h.secondElement.value=i(u)))}function ir(n){var t=parseInt(n.target.value)+(n.delta||0);(1<t/1e3||"Enter"===n.key&&!/[^\d]/.test(t.toString()))&&ri(t)}function v(n,t,i,r){return t instanceof Array?t.forEach(function(t){return v(n,t,i,r)}):n instanceof Array?n.forEach(function(n){return v(n,t,i,r)}):(n.addEventListener(t,i,r),void h._handlers.push({element:n,event:t,handler:i,options:r}))}function ft(n){return function(t){1===t.which&&n(t)}}function wt(){nt("onChange")}function bt(n){var t=void 0!==n?h.parseDate(n):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate<h.now?h.config.maxDate:h.now);try{void 0!==t&&(h.currentYear=t.getFullYear(),h.currentMonth=t.getMonth())}catch(n){n.message="Invalid date supplied: "+t;h.config.errorHandler(n)}h.redraw()}function rr(n){~n.target.className.indexOf("arrow")&&kt(n,n.target.classList.contains("arrowUp")?1:-1)}function kt(n,t,i){var r=n&&n.target,u=i||r&&r.parentNode&&r.parentNode.firstChild,f=ei("increment");f.delta=t;u&&u.dispatchEvent(f)}function dt(t,i,r,e){var s,c=ut(i,!0),o=n("span","flatpickr-day "+t,i.getDate().toString());return o.dateObj=i,o.$i=e,o.setAttribute("aria-label",h.formatDate(i,h.config.ariaDateFormat)),-1===t.indexOf("hidden")&&0===u(i,h.now)&&((h.todayDateElem=o).classList.add("today"),o.setAttribute("aria-current","date")),c?(o.tabIndex=-1,oi(i)&&(o.classList.add("selected"),h.selectedDateElem=o,"range"===h.config.mode&&(f(o,"startRange",h.selectedDates[0]&&0===u(i,h.selectedDates[0],!0)),f(o,"endRange",h.selectedDates[1]&&0===u(i,h.selectedDates[1],!0)),"nextMonthDay"===t&&o.classList.add("inRange")))):o.classList.add("disabled"),"range"===h.config.mode&&(s=i,!("range"!==h.config.mode||h.selectedDates.length<2)&&0<=u(s,h.selectedDates[0])&&u(s,h.selectedDates[1])<=0&&!oi(i)&&o.classList.add("inRange")),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==t&&r%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+h.config.getWeek(i)+"<\/span>"),nt("onDayCreate",o),o}function gt(n){n.focus();"range"===h.config.mode&&ui(n)}function lt(n){for(var t,f=0<n?0:h.config.showMonths-1,e=0<n?h.config.showMonths:-1,i=f;i!=e;i+=n)for(var r=h.daysContainer.children[i],o=0<n?0:r.children.length-1,s=0<n?r.children.length:-1,u=o;u!=s;u+=n)if(t=r.children[u],-1===t.className.indexOf("hidden")&&ut(t.dateObj))return t}function ot(n,t){var r=vt(document.activeElement||document.body),i=void 0!==n?n:r?document.activeElement:void 0!==h.selectedDateElem&&vt(h.selectedDateElem)?h.selectedDateElem:void 0!==h.todayDateElem&&vt(h.todayDateElem)?h.todayDateElem:lt(0<t?1:-1);return void 0===i?h._input.focus():r?void function(n,t){for(var f,o=-1===n.className.indexOf("Month")?n.dateObj.getMonth():h.currentMonth,c=0<t?h.config.showMonths:-1,r=0<t?1:-1,u=o-h.currentMonth;u!=c;u+=r)for(var e=h.daysContainer.children[u],l=o-h.currentMonth===u?n.$i+t:t<0?e.children.length-1:0,s=e.children.length,i=l;0<=i&&i<s&&i!=(0<t?s:-1);i+=r)if(f=e.children[i],-1===f.className.indexOf("hidden")&&ut(f.dateObj)&&Math.abs(n.$i-i)>=Math.abs(t))return gt(f);h.changeMonth(r);ot(lt(r),0)}(i,t):gt(i)}function ur(t,i){for(var f,s,c=(new Date(t,i,1).getDay()-h.l10n.firstDayOfWeek+7)%7,l=h.utils.getDaysInMonth((i- -11)%12),o=h.utils.getDaysInMonth(i),e=window.document.createDocumentFragment(),a=1<h.config.showMonths,v=a?"prevMonthDay hidden":"prevMonthDay",y=a?"nextMonthDay hidden":"nextMonthDay",r=l+1-c,u=0;r<=l;r++,u++)e.appendChild(dt(v,new Date(t,i-1,r),r,u));for(r=1;r<=o;r++,u++)e.appendChild(dt("",new Date(t,i,r),r,u));for(f=o+1;f<=42-c&&(1===h.config.showMonths||u%7!=0);f++,u++)e.appendChild(dt(y,new Date(t,i+1,f%o),f,u));return s=n("div","dayContainer"),s.appendChild(e),s}function at(){var i,n,t;if(void 0!==h.daysContainer){for(c(h.daysContainer),h.weekNumbers&&c(h.weekNumbers),i=document.createDocumentFragment(),n=0;n<h.config.showMonths;n++)t=new Date(h.currentYear,h.currentMonth,1),t.setMonth(h.currentMonth+n),i.appendChild(ur(t.getFullYear(),t.getMonth()));h.daysContainer.appendChild(i);h.days=h.daysContainer.firstChild;"range"===h.config.mode&&1===h.selectedDates.length&&ui()}}function fr(){var r=n("div","flatpickr-month"),u=window.document.createDocumentFragment(),f=n("span","cur-month"),e=l("cur-year",{tabindex:"-1"}),t=e.getElementsByTagName("input")[0],i;return t.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&t.setAttribute("data-min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(t.setAttribute("data-max",h.config.maxDate.getFullYear().toString()),t.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear()),i=n("div","flatpickr-current-month"),i.appendChild(f),i.appendChild(e),u.appendChild(i),r.appendChild(u),{container:r,yearElement:t,monthElement:f}}function li(){var t,n;for(c(h.monthNav),h.monthNav.appendChild(h.prevMonthNav),t=h.config.showMonths;t--;)n=fr(),h.yearElements.push(n.yearElement),h.monthElements.push(n.monthElement),h.monthNav.appendChild(n.container);h.monthNav.appendChild(h.nextMonthNav)}function ai(){var t,i;for(h.weekdayContainer?c(h.weekdayContainer):h.weekdayContainer=n("div","flatpickr-weekdays"),t=h.config.showMonths;t--;)i=n("div","flatpickr-weekdaycontainer"),h.weekdayContainer.appendChild(i);return vi(),h.weekdayContainer}function vi(){var t=h.l10n.firstDayOfWeek,n=h.l10n.weekdays.shorthand.concat(),i;for(0<t&&t<n.length&&(n=n.splice(t,n.length).concat(n.splice(0,t))),i=h.config.showMonths;i--;)h.weekdayContainer.children[i].innerHTML="\n      <span class=flatpickr-weekday>\n        "+n.join("<\/span><span class=flatpickr-weekday>")+"\n      <\/span>\n      "}function ni(n,t){void 0===t&&(t=!0);var i=t?n:n-h.currentMonth;i<0&&!0===h._hidePrevMonthArrow||0<i&&!0===h._hideNextMonthArrow||(h.currentMonth+=i,(h.currentMonth<0||11<h.currentMonth)&&(h.currentYear+=11<h.currentMonth?1:-1,h.currentMonth=(h.currentMonth+12)%12,nt("onYearChange")),at(),nt("onMonthChange"),yt())}function ti(n){return!(!h.config.appendTo||!h.config.appendTo.contains(n))||h.calendarContainer.contains(n)}function ii(n){if(h.isOpen&&!h.config.inline){var i=ti(n.target),t=n.target===h.input||n.target===h.altInput||h.element.contains(n.target)||n.path&&n.path.indexOf&&(~n.path.indexOf(h.input)||~n.path.indexOf(h.altInput)),r="blur"===n.type?t&&n.relatedTarget&&!ti(n.relatedTarget):!t&&!i,u=!h.config.ignoredFocusElements.some(function(t){return t.contains(n.target)});r&&u&&(h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}}function ri(n){if(!(!n||h.config.minDate&&n<h.config.minDate.getFullYear()||h.config.maxDate&&n>h.config.maxDate.getFullYear())){var t=n,i=h.currentYear!==t;h.currentYear=t||h.currentYear;h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth));i&&(h.redraw(),nt("onYearChange"))}}function ut(n,t){var i,o;if(void 0===t&&(t=!0),i=h.parseDate(n,void 0,t),h.config.minDate&&i&&u(i,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&i&&0<u(i,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime))return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===i)return!1;for(var r,f=0<h.config.enable.length,s=f?h.config.enable:h.config.disable,e=0;e<s.length;e++){if("function"==typeof(r=s[e])&&r(i)||r instanceof Date&&void 0!==i&&r.getTime()===i.getTime())return f;if("string"==typeof r&&void 0!==i)return o=h.parseDate(r,void 0,!0),o&&o.getTime()===i.getTime()?f:!f;if("object"==typeof r&&void 0!==i&&r.from&&r.to&&i.getTime()>=r.from.getTime()&&i.getTime()<=r.to.getTime())return f}return!f}function vt(n){return void 0!==h.daysContainer&&-1===n.className.indexOf("hidden")&&h.daysContainer.contains(n)}function yi(n){var i=n.target===h._input,r=h.config.allowInput,c=h.isOpen&&(!r||!i),l=h.config.inline&&i&&!r,t,u,f,e,o,s;if(13===n.keyCode&&i){if(r)return h.setDate(h._input.value,!0,n.target===h.altInput?h.config.altFormat:h.config.dateFormat),n.target.blur();h.open()}else if(ti(n.target)||c||l){t=!!h.timeContainer&&h.timeContainer.contains(n.target);switch(n.keyCode){case 13:t?et():di(n);break;case 27:n.preventDefault();ki();break;case 8:case 46:i&&!h.config.allowInput&&(n.preventDefault(),h.clear());break;case 37:case 39:t?h.hourElement&&h.hourElement.focus():(n.preventDefault(),void 0!==h.daysContainer&&(!1===r||vt(document.activeElement)))&&(u=39===n.keyCode?1:-1,n.ctrlKey?(ni(u),ot(lt(1),0)):ot(void 0,u));break;case 38:case 40:n.preventDefault();f=40===n.keyCode?1:-1;h.daysContainer&&void 0!==n.target.$i?n.ctrlKey?(ri(h.currentYear-f),ot(lt(1),0)):t||ot(void 0,7*f):h.config.enableTime&&(!t&&h.hourElement&&h.hourElement.focus(),et(n),h._debouncedChange());break;case 9:if(!t){h.element.focus();break}e=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].filter(function(n){return n});o=e.indexOf(n.target);-1!==o&&(s=e[o+(n.shiftKey?-1:1)],void 0!==s?(n.preventDefault(),s.focus()):h.element.focus())}}if(void 0!==h.amPM&&n.target===h.amPM)switch(n.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0];ht();rt();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1];ht();rt()}nt("onKeyDown",n)}function ui(n){var e;if(1===h.selectedDates.length&&(!n||n.classList.contains("flatpickr-day")&&!n.classList.contains("disabled"))){for(var u=n?n.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),i=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),l=Math.min(u,h.selectedDates[0].getTime()),v=Math.max(u,h.selectedDates[0].getTime()),y=h.daysContainer.lastChild.lastChild.dateObj.getTime(),o=!1,f=0,r=0,t=l;t<y;t+=it.DAY)ut(new Date(t),!0)||(o=o||l<t&&t<v,t<i&&(!f||f<t)?f=t:i<t&&(!r||t<r)&&(r=t));for(e=0;e<h.config.showMonths;e++)for(var s=h.daysContainer.children[e],a=h.daysContainer.children[e-1],p=function(t){var l=s.children[t],c=l.dateObj.getTime(),v=0<f&&c<f||0<r&&r<c;return v?(l.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(n){l.classList.remove(n)}),"continue"):o&&!v?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(n){l.classList.remove(n)}),void(void 0!==n&&(n.classList.add(u<h.selectedDates[0].getTime()?"startRange":"endRange"),!s.contains(n)&&0<e&&a&&a.lastChild.dateObj.getTime()>=c||(i<u&&c===i?l.classList.add("startRange"):u<i&&c===i&&l.classList.add("endRange"),f<=c&&(0===r||c<=r)&&tt(c,i,u)&&l.classList.add("inRange")))))},c=0,w=s.children.length;c<w;c++)p(c)}}function er(){!h.isOpen||h.config.static||h.config.inline||st()}function pi(n){return function(t){var i=h.config["_"+n+"Date"]=h.parseDate(t,h.config.dateFormat),r=h.config["_"+("min"===n?"max":"min")+"Date"];void 0!==i&&(h["min"===n?"minDateHasTime":"maxDateHasTime"]=0<i.getHours()||0<i.getMinutes()||0<i.getSeconds());h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(n){return ut(n)}),h.selectedDates.length||"min"!==n||ct(i),rt());h.daysContainer&&(bi(),void 0!==i?h.currentYearElement[n]=i.getFullYear().toString():h.currentYearElement.removeAttribute(n),h.currentYearElement.disabled=!!r&&void 0!==i&&r.getFullYear()===i.getFullYear())}}function wi(){"object"!=typeof h.config.locale&&void 0===t.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale));h.l10n=Object.assign({},t.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?t.l10ns[h.config.locale]:void 0);p.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")";h.formatDate=d(h);h.parseDate=w({config:h.config,l10n:h.l10n})}function st(n){if(void 0!==h.calendarContainer){nt("onPreCalendarPosition");var e=n||h._positionElement,i=Array.prototype.reduce.call(h.calendarContainer.children,function(n,t){return n+t.offsetHeight},0),o=h.calendarContainer.offsetWidth,r=h.config.position.split(" "),s=r[0],c=1<r.length?r[1]:null,t=e.getBoundingClientRect(),v=window.innerHeight-t.bottom,u="above"===s||"below"!==s&&v<i&&t.top>i,y=window.pageYOffset+t.top+(u?-i-2:e.offsetHeight+2);if(f(h.calendarContainer,"arrowTop",!u),f(h.calendarContainer,"arrowBottom",u),!h.config.inline){var l=window.pageXOffset+t.left-(null!=c&&"center"===c?(o-t.width)/2:0),p=window.document.body.offsetWidth-t.right,a=l+o>window.document.body.offsetWidth;f(h.calendarContainer,"rightMost",a);h.config.static||(h.calendarContainer.style.top=y+"px",a?(h.calendarContainer.style.left="auto",h.calendarContainer.style.right=p+"px"):(h.calendarContainer.style.left=l+"px",h.calendarContainer.style.right="auto"))}}}function bi(){h.config.noCalendar||h.isMobile||(yt(),at())}function ki(){h._input.focus();-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function di(n){var i,f,o,s,c;if(n.preventDefault(),n.stopPropagation(),i=function n(t,i){return i(t)?t:t.parentNode?n(t.parentNode,i):void 0}(n.target,function(n){return n.classList&&n.classList.contains("flatpickr-day")&&!n.classList.contains("disabled")&&!n.classList.contains("notAllowed")}),void 0!==i){var r=i,t=h.latestSelectedDateObj=new Date(r.dateObj.getTime()),e=(t.getMonth()<h.currentMonth||t.getMonth()>h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;(h.selectedDateElem=r,"single"===h.config.mode)?h.selectedDates=[t]:"multiple"===h.config.mode?(f=oi(t),f?h.selectedDates.splice(parseInt(f),1):h.selectedDates.push(t)):"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1),h.selectedDates.push(t),0!==u(t,h.selectedDates[0],!0)&&h.selectedDates.sort(function(n,t){return n.getTime()-t.getTime()}));(ht(),e)&&(o=h.currentYear!==t.getFullYear(),h.currentYear=t.getFullYear(),h.currentMonth=t.getMonth(),o&&nt("onYearChange"),nt("onMonthChange"));(yt(),at(),rt(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),e||"range"===h.config.mode||1!==h.config.showMonths?h.selectedDateElem&&h.selectedDateElem.focus():gt(r),void 0!==h.hourElement&&setTimeout(function(){return void 0!==h.hourElement&&h.hourElement.select()},451),h.config.closeOnSelect)&&(s="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime,(s||c)&&ki());wt()}}function gi(n,t){var i=[];if(n instanceof Array)i=n.map(function(n){return h.parseDate(n,t)});else if(n instanceof Date||"number"==typeof n)i=[h.parseDate(n,t)];else if("string"==typeof n)switch(h.config.mode){case"single":case"time":i=[h.parseDate(n,t)];break;case"multiple":i=n.split(h.config.conjunction).map(function(n){return h.parseDate(n,t)});break;case"range":i=n.split(h.l10n.rangeSeparator).map(function(n){return h.parseDate(n,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));h.selectedDates=i.filter(function(n){return n instanceof Date&&ut(n,!1)});"range"===h.config.mode&&h.selectedDates.sort(function(n,t){return n.getTime()-t.getTime()})}function nr(n){return n.slice().map(function(n){return"string"==typeof n||"number"==typeof n||n instanceof Date?h.parseDate(n,void 0,!0):n&&"object"==typeof n&&n.from&&n.to?{from:h.parseDate(n.from,void 0),to:h.parseDate(n.to,void 0)}:n}).filter(function(n){return n})}function nt(n,t){var i,r;if(void 0!==h.config){if(i=h.config[n],void 0!==i&&0<i.length)for(r=0;i[r]&&r<i.length;r++)i[r](h.selectedDates,h.input.value,h,t);"onChange"===n&&(h.input.dispatchEvent(ei("change")),h.input.dispatchEvent(ei("input")))}}function ei(n){var t=document.createEvent("Event");return t.initEvent(n,!0,!0),t}function oi(n){for(var t=0;t<h.selectedDates.length;t++)if(0===u(h.selectedDates[t],n))return""+t;return!1}function yt(){h.config.noCalendar||h.isMobile||!h.monthNav||(h.yearElements.forEach(function(n,t){var i=new Date(h.currentYear,h.currentMonth,1);i.setMonth(h.currentMonth+t);h.monthElements[t].textContent=y(i.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ";n.value=i.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYear<h.config.minDate.getFullYear()),h._hideNextMonthArrow=void 0!==h.config.maxDate&&(h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth+1>h.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function tr(n){return h.selectedDates.map(function(t){return h.formatDate(t,n)}).filter(function(n,t,i){return"range"!==h.config.mode||h.config.enableTime||i.indexOf(n)===t}).join("range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator)}function rt(n){if(void 0===n&&(n=!0),0===h.selectedDates.length)return h.clear(n);void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):"");h.input.value=tr(h.config.dateFormat);void 0!==h.altInput&&(h.altInput.value=tr(h.config.altFormat));!1!==n&&nt("onValueUpdate")}function or(n){n.preventDefault();var t=h.prevMonthNav.contains(n.target),i=h.nextMonthNav.contains(n.target);t||i?ni(t?-1:1):0<=h.yearElements.indexOf(n.target)?n.target.select():n.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):n.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}var h={config:Object.assign({},t.defaultConfig),l10n:o},fi;return h.parseDate=w({config:h.config,l10n:h.l10n}),h._handlers=[],h._bind=v,h._setHoursFromDate=ct,h._positionCalendar=st,h.changeMonth=ni,h.changeYear=ri,h.clear=function(n){void 0===n&&(n=!0);h.input.value="";void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[];h.latestSelectedDateObj=void 0;!(h.showTimeInput=!1)===h.config.enableTime&&ci();h.redraw();n&&nt("onChange")},h.close=function(){h.isOpen=!1;h.isMobile||(h.calendarContainer.classList.remove("open"),h._input.classList.remove("active"));nt("onClose")},h._createElement=n,h.destroy=function(){var i,t,n;for(void 0!==h.config&&nt("onDestroy"),i=h._handlers.length;i--;)t=h._handlers[i],t.element.removeEventListener(t.event,t.handler,t.options);if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config.static&&h.calendarContainer.parentNode){if(n=h.calendarContainer.parentNode,n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.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(n){try{delete h[n]}catch(n){}})},h.isEnabled=ut,h.jumpToDate=bt,h.open=function(n,t){if(void 0===t&&(t=h._positionElement),!0===h.isMobile)return n&&(n.preventDefault(),n.target&&n.target.blur()),void 0!==h.mobileInput&&(h.mobileInput.focus(),h.mobileInput.click()),void nt("onOpen");if(!h._input.disabled&&!h.config.inline){var i=h.isOpen;h.isOpen=!0;i||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),nt("onOpen"),st(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&(h.setDate(void 0!==h.config.minDate?new Date(h.config.minDate.getTime()):new Date,!1),ci(),rt()),!1!==h.config.allowInput||void 0!==n&&h.timeContainer.contains(n.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))}},h.redraw=bi,h.set=function(n,t){null!==n&&"object"==typeof n?Object.assign(h.config,n):(h.config[n]=t,void 0!==fi[n]?fi[n].forEach(function(n){return n()}):-1<b.indexOf(n)&&(h.config[n]=a(t)));h.redraw();bt();rt(!1)},h.setDate=function(n,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=h.config.dateFormat),0!==n&&!n||n instanceof Array&&0===n.length)return h.clear(t);gi(n,i);h.showTimeInput=0<h.selectedDates.length;h.latestSelectedDateObj=h.selectedDates[0];h.redraw();bt();ct();rt(t);t&&nt("onChange")},h.toggle=function(n){if(!0===h.isOpen)return h.close();h.open(n)},fi={locale:[wi,vi],showMonths:[li,hi,ai]},function(){h.element=h.input=e;h.isOpen=!1,function(){var f=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],n=Object.assign({},s,JSON.parse(JSON.stringify(e.dataset||{}))),l={},u,v,r,o,c,i;for(h.config.parseDate=n.parseDate,h.config.formatDate=n.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(n){h.config._enable=nr(n)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(n){h.config._disable=nr(n)}}),u="time"===n.mode,!n.dateFormat&&(n.enableTime||u)&&(l.dateFormat=n.noCalendar||u?"H:i"+(n.enableSeconds?":S":""):t.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&(n.enableTime||u)&&!n.altFormat&&(l.altFormat=n.noCalendar||u?"h:i"+(n.enableSeconds?":S K":" K"):t.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:pi("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:pi("max")}),v=function(n){return function(t){h.config["min"===n?"_minTime":"_maxTime"]=h.parseDate(t,"H:i")}},Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:v("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:v("max")}),"time"===n.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),Object.assign(h.config,l,n),r=0;r<f.length;r++)h.config[f[r]]=!0===h.config[f[r]]||"true"===h.config[f[r]];for(b.filter(function(n){return void 0!==h.config[n]}).forEach(function(n){h.config[n]=a(h.config[n]||[]).map(si)}),h.isMobile=!h.config.disableMobile&&!h.config.inline&&"single"===h.config.mode&&!h.config.disable.length&&!h.config.enable.length&&!h.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),o=0;o<h.config.plugins.length;o++){c=h.config.plugins[o](h)||{};for(i in c)-1<b.indexOf(i)?h.config[i]=a(c[i]).map(si).concat(h.config[i]):void 0===n[i]&&(h.config[i]=c[i])}nt("onParseConfig")}();wi(),function(){if(h.input=h.config.wrap?e.querySelector("[data-input]"):e,!h.input)return h.config.errorHandler(new Error("Invalid input element specified"));h.input._type=h.input.type;h.input.type="text";h.input.classList.add("flatpickr-input");h._input=h.input;h.config.altInput&&(h.altInput=n(h.input.nodeName,h.input.className+" "+h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling));h.config.allowInput||h._input.setAttribute("readonly","readonly");h._positionElement=h.config.positionElement||h._input}(),function(){var n,t;h.selectedDates=[];h.now=h.parseDate(h.config.now)||new Date;n=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);n&&gi(n,h.config.dateFormat);t=0<h.selectedDates.length?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()<h.now.getTime()?h.config.maxDate:h.now;h.currentYear=t.getFullYear();h.currentMonth=t.getMonth();0<h.selectedDates.length&&(h.latestSelectedDateObj=h.selectedDates[0]);void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i"));void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i"));h.minDateHasTime=!!h.config.minDate&&(0<h.config.minDate.getHours()||0<h.config.minDate.getMinutes()||0<h.config.minDate.getSeconds());h.maxDateHasTime=!!h.config.maxDate&&(0<h.config.maxDate.getHours()||0<h.config.maxDate.getMinutes()||0<h.config.maxDate.getSeconds());Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(n){h._showTimeInput=n;h.calendarContainer&&f(h.calendarContainer,"showTimeInput",n);h.isOpen&&st()}})}();h.utils={getDaysInMonth:function(n,t){return void 0===n&&(n=h.currentMonth),void 0===t&&(t=h.currentYear),1===n&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[n]}};h.isMobile||function(){var u=window.document.createDocumentFragment(),s,t;if(h.calendarContainer=n("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(u.appendChild((h.monthNav=n("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=n("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=n("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,li(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(n){h.__hidePrevMonthArrow!==n&&(f(h.prevMonthNav,"disabled",n),h.__hidePrevMonthArrow=n)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(n){h.__hideNextMonthArrow!==n&&(f(h.nextMonthNav,"disabled",n),h.__hideNextMonthArrow=n)}}),h.currentYearElement=h.yearElements[0],yt(),h.monthNav)),h.innerContainer=n("div","flatpickr-innerContainer"),h.config.weekNumbers){var e=function(){var t,i;return h.calendarContainer.classList.add("hasWeeks"),t=n("div","flatpickr-weekwrapper"),t.appendChild(n("span","flatpickr-weekday",h.l10n.weekAbbreviation)),i=n("div","flatpickr-weeks"),t.appendChild(i),{weekWrapper:t,weekNumbers:i}}(),o=e.weekWrapper,c=e.weekNumbers;h.innerContainer.appendChild(o);h.weekNumbers=c;h.weekWrapper=o}h.rContainer=n("div","flatpickr-rContainer");h.rContainer.appendChild(ai());h.daysContainer||(h.daysContainer=n("div","flatpickr-days"),h.daysContainer.tabIndex=-1);at();h.rContainer.appendChild(h.daysContainer);h.innerContainer.appendChild(h.rContainer);u.appendChild(h.innerContainer)}h.config.enableTime&&u.appendChild(function(){var e,t,u,f;return h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=n("div","flatpickr-time"),h.timeContainer.tabIndex=-1,e=n("span","flatpickr-time-separator",":"),t=l("flatpickr-hour"),h.hourElement=t.getElementsByTagName("input")[0],u=l("flatpickr-minute"),(h.minuteElement=u.getElementsByTagName("input")[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(n){switch(n%24){case 0:case 12:return 12;default:return n%12}}(h.config.defaultHour)),h.minuteElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("data-step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("data-step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("data-min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("data-max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("data-min","0"),h.minuteElement.setAttribute("data-max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(u),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds)&&(h.timeContainer.classList.add("hasSeconds"),f=l("flatpickr-second"),h.secondElement=f.getElementsByTagName("input")[0],h.secondElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("data-step",h.minuteElement.getAttribute("data-step")),h.secondElement.setAttribute("data-min",h.minuteElement.getAttribute("data-min")),h.secondElement.setAttribute("data-max",h.minuteElement.getAttribute("data-max")),h.timeContainer.appendChild(n("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(f)),h.config.time_24hr||(h.amPM=n("span","flatpickr-am-pm",h.l10n.amPM[r(11<(h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour))]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}());f(h.calendarContainer,"rangeMode","range"===h.config.mode);f(h.calendarContainer,"animate",!0===h.config.animate);f(h.calendarContainer,"multiMonth",1<h.config.showMonths);h.calendarContainer.appendChild(u);s=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;(h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!s&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)&&(t=n("div","flatpickr-wrapper"),h.element.parentNode&&h.element.parentNode.insertBefore(t,h.element),t.appendChild(h.element),h.altInput&&t.appendChild(h.altInput),t.appendChild(h.calendarContainer));h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(n){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+n+"]"),function(t){return v(t,"click",h[n])})}),h.isMobile)return function(){var t=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=n("input",h.input.className+" flatpickr-mobile");h.mobileInput.step=h.input.getAttribute("step")||"any";h.mobileInput.tabIndex=1;h.mobileInput.type=t;h.mobileInput.disabled=h.input.disabled;h.mobileInput.required=h.input.required;h.mobileInput.placeholder=h.input.placeholder;h.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S";0<h.selectedDates.length&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr));h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d"));h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d"));h.input.type="hidden";void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(t){}v(h.mobileInput,"change",function(n){h.setDate(n.target.value,!1,h.mobileFormatStr);nt("onChange");nt("onClose")})}();var t=k(er,50);h._debouncedChange=k(wt,g);h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(h.daysContainer,"mouseover",function(n){"range"===h.config.mode&&ui(n.target)});v(window.document.body,"keydown",yi);h.config.static||v(h._input,"keydown",yi);h.config.inline||h.config.static||v(window,"resize",t);void 0!==window.ontouchstart?v(window.document,"click",ii):v(window.document,"mousedown",ft(ii));v(window.document,"focus",ii,{capture:!0});!0===h.config.clickOpens&&(v(h._input,"focus",h.open),v(h._input,"mousedown",ft(h.open)));void 0!==h.daysContainer&&(v(h.monthNav,"mousedown",ft(or)),v(h.monthNav,["keyup","increment"],ir),v(h.daysContainer,"mousedown",ft(di)));void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(v(h.timeContainer,["increment"],et),v(h.timeContainer,"blur",et,{capture:!0}),v(h.timeContainer,"mousedown",ft(rr)),v([h.hourElement,h.minuteElement],["focus","click"],function(n){return n.target.select()}),void 0!==h.secondElement&&v(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&v(h.amPM,"mousedown",ft(function(n){et(n);wt()})))}();(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&ct(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),rt(!1));hi();h.showTimeInput=0<h.selectedDates.length||h.config.noCalendar;var u=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&u&&st();nt("onReady")}(),h}function s(n,t){for(var i,f=Array.prototype.slice.call(n),r=[],u=0;u<f.length;u++){i=f[u];try{if(null!==i.getAttribute("data-fp-omit"))continue;void 0!==i._flatpickr&&(i._flatpickr.destroy(),i._flatpickr=void 0);i._flatpickr=rt(i,t||{});r.push(i._flatpickr)}catch(n){console.error(n)}}return 1===r.length?r[0]:r}var i=function(n){return("0"+n).slice(-2)},r=function(n){return!0===n?1:0},a=function(n){return n instanceof Array?n:[n]},v=function(){},y=function(n,t,i){return i.months[t?"shorthand":"longhand"][n]},nt={D:v,F:function(n,t,i){n.setMonth(i.months.longhand.indexOf(t))},G:function(n,t){n.setHours(parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,i){n.setHours(n.getHours()%12+12*r(new RegExp(i.amPM[1],"i").test(t)))},M:function(n,t,i){n.setMonth(i.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(1e3*parseFloat(t))},W:function(n,t){var i=parseInt(t);return new Date(n.getFullYear(),0,2+7*(i-1),0,0,0,0)},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours(parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:v,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},w:v,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},p={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})"},e={Z:function(n){return n.toISOString()},D:function(n,t,i){return t.weekdays.shorthand[e.w(n,t,i)]},F:function(n,t,i){return y(e.n(n,t,i)-1,!1,t)},G:function(n,t,r){return i(e.h(n,t,r))},H:function(n){return i(n.getHours())},J:function(n,t){return void 0!==t.ordinal?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[r(11<n.getHours())]},M:function(n,t){return y(n.getMonth(),!0,t)},S:function(n){return i(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,i){return i.getWeek(n)},Y:function(n){return n.getFullYear()},d:function(n){return i(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return i(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return i(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},o={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(n){var t=n%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"},d=function(n){var i=n.config,t=void 0===i?h:i,r=n.l10n,u=void 0===r?o:r;return function(n,i,r){var f=r||u;return void 0!==t.formatDate?t.formatDate(n,i,f):i.split("").map(function(i,r,u){return e[i]&&"\\"!==u[r-1]?e[i](n,f,t):"\\"!==i?i:""}).join("")}},w=function(n){var i=n.config,t=void 0===i?h:i,r=n.l10n,u=void 0===r?o:r;return function(n,i,r,f){var e,y,w,o,c,v;if(0===n||n){if(y=f||u,w=n,n instanceof Date)e=new Date(n.getTime());else if("string"!=typeof n&&void 0!==n.toFixed)e=new Date(n);else if("string"==typeof n)if(o=i||(t||h).dateFormat,c=String(n).trim(),"today"===c)e=new Date,r=!0;else if(/Z$/.test(c)||/GMT$/.test(c))e=new Date(n);else if(t&&t.parseDate)e=t.parseDate(n,o);else{e=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var b,k=[],l=0,g=0,a="";l<o.length;l++){var s=o[l],d="\\"===s,tt="\\"===o[l-1]||d;p[s]&&!tt?(a+=p[s],v=new RegExp(a).exec(n),v&&(b=!0)&&k["Y"!==s?"push":"unshift"]({fn:nt[s],val:v[++g]})):d||(a+=".");k.forEach(function(n){var t=n.fn,i=n.val;return e=t(e,i,y)||e})}e=b?e:void 0}if(e instanceof Date&&!isNaN(e.getTime()))return!0===r&&e.setHours(0,0,0,0),e;t.errorHandler(new Error("Invalid date provided: "+w))}}},tt=function(n,t,i){return n>Math.min(t,i)&&n<Math.max(t,i)},it={DAY:864e5},b=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],h={_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(n){return"undefined"!=typeof console&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime()),i;return t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7),i=new Date(t.getFullYear(),0,4),1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.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},g,t;return"function"!=typeof Object.assign&&(Object.assign=function(n){var f,i;if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=arguments.length,u=new Array(1<r?r-1:0),t=1;t<r;t++)u[t-1]=arguments[t];for(f=function(){var t=u[i];t&&Object.keys(t).forEach(function(i){return n[i]=t[i]})},i=0;i<u.length;i++)f();return n}),g=300,"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return s(this,n)},HTMLElement.prototype.flatpickr=function(n){return s([this],n)}),t=function(n,t){return n instanceof NodeList?s(n,t):s("string"==typeof n?window.document.querySelectorAll(n):[n],t)},t.defaultConfig=h,t.l10ns={en:Object.assign({},o),"default":Object.assign({},o)},t.localize=function(n){t.l10ns.default=Object.assign({},t.l10ns.default,n)},t.setDefaults=function(n){t.defaultConfig=Object.assign({},t.defaultConfig,n)},t.parseDate=w({}),t.formatDate=d({}),t.compareDates=u,"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(n){return s(this,n)}),Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof n?parseInt(n,10):n))},"undefined"!=typeof window&&(window.flatpickr=t),t}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t(n.cs={})}(this,function(n){"use strict";var t=typeof window!="undefined"&&window.flatpickr!==undefined?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Ne","Po","Út","St","Čt","Pá","So"],longhand:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota"]},months:{shorthand:["Led","Ún","Bře","Dub","Kvě","Čer","Čvc","Srp","Zář","Říj","Lis","Pro"],longhand:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"]},firstDayOfWeek:1,ordinal:function(){return"."},rangeSeparator:" do ",weekAbbreviation:"Týd.",scrollTitle:"Rolujte pro změnu",toggleTitle:"Přepnout dopoledne/odpoledne",amPM:["dop.","odp."],yearAriaLabel:"Rok"},r;t.l10ns.cs=i;r=t.l10ns;n.Czech=i;n.default=r;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.rangePlugin=t()}(this,function(){"use strict";function n(n){return n===void 0&&(n={}),function(t){var f="",i,u,r,o=function(){if(n.input?i=n.input instanceof Element?n.input:window.document.querySelector(n.input):(i=t._input.cloneNode(),i.removeAttribute("id"),i._flatpickr=undefined),i.value){var r=t.parseDate(i.value);r&&t.selectedDates.push(r)}i.setAttribute("data-fp-omit","");t._bind(i,["focus","click"],function(){t.selectedDates[1]&&(t.latestSelectedDateObj=t.selectedDates[1],t._setHoursFromDate(t.selectedDates[1]),t.jumpToDate(t.selectedDates[1]));u=!0;t.isOpen=!1;t.open(undefined,i)});t._bind(t._input,["focus","click"],function(n){n.preventDefault();t.isOpen=!1;t.open()});t.config.allowInput&&t._bind(i,"keydown",function(n){n.key==="Enter"&&(t.setDate([t.selectedDates[0],i.value],!0,f),i.click())});n.input||t._input.parentNode&&t._input.parentNode.insertBefore(i,t._input.nextSibling)},e={onParseConfig:function(){t.config.mode="range";f=t.config.altInput?t.config.altFormat:t.config.dateFormat},onReady:function(){o();t.config.ignoredFocusElements.push(i);t.config.allowInput?(t._input.removeAttribute("readonly"),i.removeAttribute("readonly")):i.setAttribute("readonly","readonly");t._bind(t._input,"focus",function(){t.latestSelectedDateObj=t.selectedDates[0];t._setHoursFromDate(t.selectedDates[0]);u=!1;t.jumpToDate(t.selectedDates[0])});t.config.allowInput&&t._bind(t._input,"keydown",function(n){n.key==="Enter"&&t.setDate([t._input.value,t.selectedDates[1]],!0,f)});t.setDate(t.selectedDates,!1);e.onValueUpdate(t.selectedDates)},onPreCalendarPosition:function(){u&&(t._positionElement=i,setTimeout(function(){t._positionElement=t._input},0))},onChange:function(){t.selectedDates.length||setTimeout(function(){t.selectedDates.length||(i.value="",r=[])},10);u&&setTimeout(function(){i.focus()},0)},onDestroy:function(){n.input||i.parentNode&&i.parentNode.removeChild(i)},onValueUpdate:function(n){var e,o,s,h,c;i&&(r=!r||n.length>=r.length?n.concat():r,r.length>n.length&&(e=n[0],o=u?[r[0],e]:[e,r[1]],t.setDate(o,!1),r=o.concat()),s=t.selectedDates.map(function(n){return t.formatDate(n,f)}),h=s[0],t._input.value=h===void 0?"":h,c=s[1],i.value=c===void 0?"":c)}};return e}}return n})