/home/techb158/primomovers.ca/wp-content/plugins/everest-forms/assets/js/flatpickr
Edit: /home/techb158/primomovers.ca/wp-content/plugins/everest-forms/assets/js/flatpickr/flatpickr.min.js (49486B)
/* flatpickr v4.6.3, @license MIT */
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).flatpickr=n()}(this,function(){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var ue=function(){return(ue=Object.assign||function ue(e){for(var n,t=1,a=arguments.length;t
",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:undefined,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,"static":!1,time_24hr:!1,weekNumbers:!1,wrap:!1},me={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){e%=100;if(3Math.min(n,t)&&ea)&&(g.amPM.textContent=g.l10n.amPM[pe(g.amPM.textContent===g.l10n.amPM[0])]),n.value=ge(e));var n,t,a,i,o,r,d=g._input.value;c(),T(),g._input.value!==d&&g._debouncedChange()}function c(){var e,n,t,a,i,o;g.hourElement!==undefined&&g.minuteElement!==undefined&&(i=(parseInt(g.hourElement.value.slice(-2),10)||0)%24,e=(parseInt(g.minuteElement.value,10)||0)%60,n=g.secondElement!==undefined?(parseInt(g.secondElement.value,10)||0)%60:0,g.amPM!==undefined&&(t=i,a=g.amPM.textContent,i=t%12+12*pe(a===g.l10n.amPM[1])),t=g.config.minTime!==undefined||g.config.minDate&&g.minDateHasTime&&g.latestSelectedDateObj&&0===Te(g.latestSelectedDateObj,g.config.minDate,!0),(g.config.maxTime!==undefined||g.config.maxDate&&g.maxDateHasTime&&g.latestSelectedDateObj&&0===Te(g.latestSelectedDateObj,g.config.maxDate,!0))&&(a=g.config.maxTime!==undefined?g.config.maxTime:g.config.maxDate,(e=(i=Math.min(i,a.getHours()))===a.getHours()?Math.min(e,a.getMinutes()):e)===a.getMinutes())&&(n=Math.min(n,a.getSeconds())),t&&(o=g.config.minTime!==undefined?g.config.minTime:g.config.minDate,(e=(i=Math.max(i,o.getHours()))===o.getHours()?Math.max(e,o.getMinutes()):e)===o.getMinutes())&&(n=Math.max(n,o.getSeconds())),r(i,e,n))}function a(e){e=e||g.latestSelectedDateObj;e&&r(e.getHours(),e.getMinutes(),e.getSeconds())}function L(){var e,n,t=g.config.defaultHour,a=g.config.defaultMinute,i=g.config.defaultSeconds;g.config.minDate!==undefined&&(e=g.config.minDate.getHours(),n=g.config.minDate.getMinutes(),(t=Math.max(t,e))===e&&(a=Math.max(n,a)),t===e)&&a===n&&(i=g.config.minDate.getSeconds()),g.config.maxDate!==undefined&&(e=g.config.maxDate.getHours(),n=g.config.maxDate.getMinutes(),(t=Math.min(t,e))===e&&(a=Math.min(n,a)),t===e)&&a===n&&(i=g.config.maxDate.getSeconds()),r(t,a,i)}function r(e,n,t){g.latestSelectedDateObj!==undefined&&g.latestSelectedDateObj.setHours(e%24,n,t||0,0),g.hourElement&&g.minuteElement&&!g.isMobile&&(g.hourElement.value=ge(g.config.time_24hr?e:(12+e)%12+12*pe(e%12==0)),g.minuteElement.value=ge(n),g.amPM!==undefined&&(g.amPM.textContent=g.l10n.amPM[pe(12<=e)]),g.secondElement!==undefined)&&(g.secondElement.value=ge(t))}function W(e){var n=parseInt(e.target.value)+(e.delta||0);(1g.now?g.config.minDate:g.config.maxDate&&g.config.maxDate"+g.config.getWeek(n)+""),x("onDayCreate",o),o}function p(e){e.focus(),"range"===g.config.mode&&z(e)}function h(e){for(var n=0=Math.abs(i))return void p(m)}g.changeMonth(d),D(h(d),0),undefined}function s(){if(g.daysContainer!==undefined){Ce(g.daysContainer),g.weekNumbers&&Ce(g.weekNumbers);for(var e=document.createDocumentFragment(),n=0;ng.config.maxDate.getMonth()||((e=ve("option","flatpickr-monthDropdown-month")).value=new Date(g.currentYear,n).getMonth().toString(),e.textContent=Me(n,g.config.shorthandCurrentMonth,g.l10n),e.tabIndex=-1,g.currentMonth===n&&(e.selected=!0),g.monthsDropdownContainer.appendChild(e))}}function B(){Ce(g.monthNav),g.monthNav.appendChild(g.prevMonthNav),g.config.showMonths&&(g.yearElements=[],g.monthElements=[]);for(var e,n,t,a,i,o=g.config.showMonths;o--;){i=a=r=t=n=e=void 0,e=ve("div","flatpickr-month"),n=window.document.createDocumentFragment(),t=1\n "+n.join("")+"\n \n "}}function U(e,n){n=(n=void 0===n?!0:n)?e:e-g.currentMonth;n<0&&!0===g._hidePrevMonthArrow||0g.config.maxDate.getFullYear()||(n=g.currentYear!==e,g.currentYear=e||g.currentYear,g.config.maxDate&&g.currentYear===g.config.maxDate.getFullYear()?g.currentMonth=Math.min(g.config.maxDate.getMonth(),g.currentMonth):g.config.minDate&&g.currentYear===g.config.minDate.getFullYear()&&(g.currentMonth=Math.max(g.config.minDate.getMonth(),g.currentMonth)),n&&(g.redraw(),x("onYearChange"),m()))}function C(e,n){void 0===n&&(n=!0);var t=g.parseDate(e,undefined,n);if(g.config.minDate&&t&&Te(t,g.config.minDate,n!==undefined?n:!g.minDateHasTime)<0||g.config.maxDate&&t&&0=d.from.getTime()&&t.getTime()<=d.to.getTime())return i}return!i}function b(e){return g.daysContainer!==undefined&&-1===e.className.indexOf("hidden")&&g.daysContainer.contains(e)}function $(e){var n=e.target===g._input,t=g.config.allowInput,a=g.isOpen&&(!t||!n),i=g.config.inline&&n&&!t;if(13===e.keyCode&&n){if(t)return g.setDate(g._input.value,!0,e.target===g.altInput?g.config.altFormat:g.config.dateFormat),e.target.blur();g.open()}else if(w(e.target)||a||i){var o,r=!!g.timeContainer&&g.timeContainer.contains(e.target);switch(e.keyCode){case 13:r?(e.preventDefault(),l(),ee()):ne(e);break;case 27:e.preventDefault(),ee();break;case 8:case 46:n&&!g.config.allowInput&&(e.preventDefault(),g.clear());break;case 37:case 39:r||n?g.hourElement&&g.hourElement.focus():(e.preventDefault(),g.daysContainer!==undefined&&(!1===t||document.activeElement&&b(document.activeElement))&&(d=39===e.keyCode?1:-1,e.ctrlKey?(e.stopPropagation(),U(d),D(h(1),0)):D(undefined,d)));break;case 38:case 40:e.preventDefault();var d=40===e.keyCode?1:-1;g.daysContainer&&e.target.$i!==undefined||e.target===g.input||e.target===g.altInput?e.ctrlKey?(e.stopPropagation(),v(g.currentYear-d),D(h(1),0)):r||D(undefined,7*d):e.target===g.currentYearElement?v(g.currentYear-d):g.config.enableTime&&(!r&&g.hourElement&&g.hourElement.focus(),l(e),g._debouncedChange());break;case 9:r?-1!==(o=(d=[g.hourElement,g.minuteElement,g.secondElement,g.amPM].concat(g.pluginElements).filter(function(e){return e})).indexOf(e.target))&&(o=d[o+(e.shiftKey?-1:1)],e.preventDefault(),(o||g._input).focus()):!g.config.noCalendar&&g.daysContainer&&g.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),g._input.focus())}}if(g.amPM!==undefined&&e.target===g.amPM)switch(e.key){case g.l10n.amPM[0].charAt(0):case g.l10n.amPM[0].charAt(0).toLowerCase():g.amPM.textContent=g.l10n.amPM[0],c(),T();break;case g.l10n.amPM[1].charAt(0):case g.l10n.amPM[1].charAt(0).toLowerCase():g.amPM.textContent=g.l10n.amPM[1],c(),T()}(n||w(e.target))&&x("onKeyDown",e)}function z(a){if(1===g.selectedDates.length&&(!a||a.classList.contains("flatpickr-day")&&!a.classList.contains("flatpickr-disabled"))){for(var i=(a||g.days.firstElementChild).dateObj.getTime(),o=g.parseDate(g.selectedDates[0],undefined,!0).getTime(),e=Math.min(i,g.selectedDates[0].getTime()),n=Math.max(i,g.selectedDates[0].getTime()),r=!1,d=0,l=0,t=e;tt,a=window.pageYOffset+n.top+(o?-t-2:e.offsetHeight+2),we(g.calendarContainer,"arrowTop",!o),we(g.calendarContainer,"arrowBottom",o),g.config.inline)||(t=window.pageXOffset+n.left-(null!=i&&"center"===i?(r-n.width)/2:0),e=window.document.body.offsetWidth-(window.pageXOffset+n.right),o=t+r>window.document.body.offsetWidth,i=e+r>window.document.body.offsetWidth,we(g.calendarContainer,"rightMost",o),g.config["static"])||(g.calendarContainer.style.top=a+"px",o?i?(a=document.styleSheets[0])!==undefined&&(o=window.document.body.offsetWidth,i=Math.max(0,o/2-r/2),o=a.cssRules.length,r="{left:"+n.left+"px;right:auto;}",we(g.calendarContainer,"rightMost",!1),we(g.calendarContainer,"centerMost",!0),a.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+r,o),g.calendarContainer.style.left=i+"px",g.calendarContainer.style.right="auto"):(g.calendarContainer.style.left="auto",g.calendarContainer.style.right=e+"px"):(g.calendarContainer.style.left=t+"px",g.calendarContainer.style.right="auto"))}function X(){g.config.noCalendar||g.isMobile||(E(),s())}function ee(){g._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||navigator.msMaxTouchPoints!==undefined?setTimeout(g.close,0):g.close()}function ne(e){e.preventDefault(),e.stopPropagation();var n,t,a,e=function i(e,n){return n(e)?e:e.parentNode?i(e.parentNode,n):undefined}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});e!==undefined&&(e=e,n=((t=g.latestSelectedDateObj=new Date(e.dateObj.getTime())).getMonth()g.currentMonth+g.config.showMonths-1)&&"range"!==g.config.mode,g.selectedDateElem=e,"single"===g.config.mode?g.selectedDates=[t]:"multiple"===g.config.mode?(a=oe(t))?g.selectedDates.splice(parseInt(a),1):g.selectedDates.push(t):"range"===g.config.mode&&(2===g.selectedDates.length&&g.clear(!1,!1),g.latestSelectedDateObj=t,g.selectedDates.push(t),0!==Te(t,g.selectedDates[0],!0))&&g.selectedDates.sort(function(e,n){return e.getTime()-n.getTime()}),c(),n&&(a=g.currentYear!==t.getFullYear(),g.currentYear=t.getFullYear(),g.currentMonth=t.getMonth(),a&&(x("onYearChange"),m()),x("onMonthChange")),E(),s(),T(),g.config.enableTime&&setTimeout(function(){return g.showTimeInput=!0},50),n||"range"===g.config.mode||1!==g.config.showMonths?g.selectedDateElem!==undefined&&g.hourElement===undefined&&g.selectedDateElem&&g.selectedDateElem.focus():p(e),g.hourElement!==undefined&&g.hourElement!==undefined&&g.hourElement.focus(),g.config.closeOnSelect&&(t="single"===g.config.mode&&!g.config.enableTime,a="range"===g.config.mode&&2===g.selectedDates.length&&!g.config.enableTime,t||a)&&ee(),o())}g.parseDate=Ee({config:g.config,l10n:g.l10n}),g._handlers=[],g.pluginElements=[],g.loadedPlugins=[],g._bind=d,g._setHoursFromDate=a,g._positionCalendar=M,g.changeMonth=U,g.changeYear=v,g.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);g.input.value="",g.altInput!==undefined&&(g.altInput.value="");g.mobileInput!==undefined&&(g.mobileInput.value="");g.selectedDates=[],g.latestSelectedDateObj=undefined,!0===n&&(g.currentYear=g._initialDate.getFullYear(),g.currentMonth=g._initialDate.getMonth());!(g.showTimeInput=!1)===g.config.enableTime&&L();g.redraw(),e&&x("onChange")},g.close=function(){g.isOpen=!1,g.isMobile||(g.calendarContainer!==undefined&&g.calendarContainer.classList.remove("open"),g._input!==undefined&&g._input.classList.remove("active"));x("onClose")},g._createElement=ve,g.destroy=function(){g.config!==undefined&&x("onDestroy");for(var e=g._handlers.length;e--;){var n=g._handlers[e];n.element.removeEventListener(n.event,n.handler,n.options)}if(g._handlers=[],g.mobileInput)g.mobileInput.parentNode&&g.mobileInput.parentNode.removeChild(g.mobileInput),g.mobileInput=undefined;else if(g.calendarContainer&&g.calendarContainer.parentNode)if(g.config["static"]&&g.calendarContainer.parentNode){var t=g.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else g.calendarContainer.parentNode.removeChild(g.calendarContainer);g.altInput&&(g.input.type="text",g.altInput.parentNode&&g.altInput.parentNode.removeChild(g.altInput),delete g.altInput);g.input&&(g.input.type=g.input._type,g.input.classList.remove("flatpickr-input"),g.input.removeAttribute("readonly"),g.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","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete g[e]}catch(n){}})},g.isEnabled=C,g.jumpToDate=i,g.open=function(e,n){void 0===n&&(n=g._positionElement);var t;!0===g.isMobile?(e&&(e.preventDefault(),e.target)&&e.target.blur(),g.mobileInput!==undefined&&(g.mobileInput.focus(),g.mobileInput.click()),x("onOpen")):g._input.disabled||g.config.inline||(t=g.isOpen,g.isOpen=!0,t||(g.calendarContainer.classList.add("open"),g._input.classList.add("active"),x("onOpen"),M(n)),!0===g.config.enableTime&&!0===g.config.noCalendar&&(0===g.selectedDates.length&&V(),!1!==g.config.allowInput||e!==undefined&&g.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return g.hourElement.select()},50)))},g.redraw=X,g.set=function(e,n){if(null!==e&&"object"==typeof e)for(var t in Object.assign(g.config,e),e)y[t]!==undefined&&y[t].forEach(function(e){return e()});else g.config[e]=n,y[e]!==undefined?y[e].forEach(function(e){return e()}):-1g.config.maxDate.getMonth():g.currentYear>g.config.maxDate.getFullYear()))}function re(n){return g.selectedDates.map(function(e){return g.formatDate(e,n)}).filter(function(e,n,t){return"range"!==g.config.mode||g.config.enableTime||t.indexOf(e)===n}).join("range"!==g.config.mode?g.config.conjunction:g.l10n.rangeSeparator)}function T(e){void 0===e&&(e=!0),g.mobileInput!==undefined&&g.mobileFormatStr&&(g.mobileInput.value=g.latestSelectedDateObj!==undefined?g.formatDate(g.latestSelectedDateObj,g.mobileFormatStr):""),g.input.value=re(g.config.dateFormat),g.altInput!==undefined&&(g.altInput.value=re(g.config.altFormat)),!1!==e&&x("onValueUpdate")}function de(e){var n=g.prevMonthNav.contains(e.target),t=g.nextMonthNav.contains(e.target);n||t?U(n?-1:1):0<=g.yearElements.indexOf(e.target)?e.target.select():e.target.classList.contains("arrowUp")?g.changeYear(g.currentYear+1):e.target.classList.contains("arrowDown")&&g.changeYear(g.currentYear-1)}g.element=g.input=e,g.isOpen=!1;var t=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],k=ue({},P,JSON.parse(JSON.stringify(e.dataset||{}))),I={},S=(g.config.parseDate=k.parseDate,g.config.formatDate=k.formatDate,Object.defineProperty(g.config,"enable",{get:function(){return g.config._enable},set:function(e){g.config._enable=ae(e)}}),Object.defineProperty(g.config,"disable",{get:function(){return g.config._disable},set:function(e){g.config._disable=ae(e)}}),"time"===k.mode);k.dateFormat||!k.enableTime&&!S||(F=Oe.defaultConfig.dateFormat||fe.dateFormat,I.dateFormat=k.noCalendar||S?"H:i"+(k.enableSeconds?":S":""):F+" H:i"+(k.enableSeconds?":S":"")),k.altInput&&(k.enableTime||S)&&!k.altFormat&&(F=Oe.defaultConfig.altFormat||fe.altFormat,I.altFormat=k.noCalendar||S?"h:i"+(k.enableSeconds?":S K":" K"):F+(" h:i"+(k.enableSeconds?":S":""))+" K"),k.altInputClass||(g.config.altInputClass=g.input.className+" "+g.config.altInputClass),Object.defineProperty(g.config,"minDate",{get:function(){return g.config._minDate},set:Z("min")}),Object.defineProperty(g.config,"maxDate",{get:function(){return g.config._maxDate},set:Z("max")}),S=function(n){return function(e){g.config["min"===n?"_minTime":"_maxTime"]=g.parseDate(e,"H:i:S")}},Object.defineProperty(g.config,"minTime",{get:function(){return g.config._minTime},set:S("min")}),Object.defineProperty(g.config,"maxTime",{get:function(){return g.config._maxTime},set:S("max")}),"time"===k.mode&&(g.config.noCalendar=!0,g.config.enableTime=!0),Object.assign(g.config,I,k);for(var O=0;Og.now.getTime()?g.config.minDate:g.config.maxDate&&g.config.maxDate.getTime()