plugins.min.js 85 KB

12
  1. /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.2.9*/
  2. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=t()}(this,function(){"use strict";var ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function he(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var s=arguments[t],r=0,a=s.length;r<a;r++,o++)i[o]=s[r];return i}var ue=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],de={_disable:[],allowInput:!1,allowInvalidPreload:!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",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var e=new Date(e.getTime()),t=(e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7),new Date(e.getFullYear(),0,4));return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",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},fe={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(3<e&&e<21)return"th";switch(e%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",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pe=function(e,t){return("000"+e).slice(-1*(t=void 0===t?2:t))},_e=function(e){return!0===e?1:0};function me(t,n){var i;return function(){var e=this;clearTimeout(i),i=setTimeout(function(){return t.apply(e,arguments)},n)}}var ge=function(e){return e instanceof Array?e:[e]};function ve(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function ye(e,t,n){e=window.document.createElement(e);return n=n||"",e.className=t=t||"",void 0!==n&&(e.textContent=n),e}function be(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function we(e,t){var n=ye("div","numInputWrapper"),i=ye("input","numInput "+e),e=ye("span","arrowUp"),o=ye("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?i.type="number":(i.type="text",i.pattern="\\d*"),void 0!==t)for(var s in t)i.setAttribute(s,t[s]);return n.appendChild(i),n.appendChild(e),n.appendChild(o),n}function De(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}function e(){}var Ce=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},g={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*_e(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,n){t=parseInt(t),e=new Date(e.getFullYear(),0,2+7*(t-1),0,0,0,0);return e.setDate(e.getDate()-e.getDay()+n.firstDayOfWeek),e},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))},u:function(e,t){return new Date(parseFloat(t))},w:e,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},xe={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)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},a={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[a.w(e,t,n)]},F:function(e,t,n){return Ce(a.n(e,t,n)-1,!1,t)},G:function(e,t,n){return pe(a.h(e,t,n))},H:function(e){return pe(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[_e(11<e.getHours())]},M:function(e,t){return Ce(e.getMonth(),!0,t)},S:function(e){return pe(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return pe(e.getFullYear(),4)},d:function(e){return pe(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return pe(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return pe(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},Me=function(e){var t=e.config,s=void 0===t?de:t,t=e.l10n,n=void 0===t?fe:t,t=e.isMobile,r=void 0!==t&&t;return function(i,e,t){var o=t||n;return void 0===s.formatDate||r?e.split("").map(function(e,t,n){return a[e]&&"\\"!==n[t-1]?a[e](i,o,s):"\\"!==e?e:""}).join(""):s.formatDate(i,e,o)}},ke=function(e){var t=e.config,_=void 0===t?de:t,t=e.l10n,m=void 0===t?fe:t;return function(e,t,n,i){if(0===e||e){var o=i||m,i=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var s=t||(_||de).dateFormat,t=String(e).trim();if("today"===t)r=new Date,n=!0;else if(/Z$/.test(t)||/GMT$/.test(t))r=new Date(e);else if(_&&_.parseDate)r=_.parseDate(e,s);else{for(var r=_&&_.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),a=void 0,l=[],c=0,h=0,u="";c<s.length;c++){var d=s[c],f="\\"===d,p="\\"===s[c-1]||f;xe[d]&&!p?(u+=xe[d],(p=new RegExp(u).exec(e))&&(a=!0)&&l["Y"!==d?"push":"unshift"]({fn:g[d],val:p[++h]})):f||(u+="."),l.forEach(function(e){var t=e.fn,e=e.val;return r=t(r,e,o)||r})}r=a?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===n&&r.setHours(0,0,0,0),r;_.errorHandler(new Error("Invalid date provided: "+i))}}};function Ee(e,t,n){return!1!==(n=void 0===n?!0:n)?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var Te=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},Oe={DAY:864e5};function Se(e){var t,n,i,o=e.defaultHour,s=e.defaultMinute,r=e.defaultSeconds;return void 0!==e.minDate&&(n=e.minDate.getHours(),i=e.minDate.getMinutes(),t=e.minDate.getSeconds(),(o=o<n?n:o)===n&&s<i&&(s=i),o===n&&s===i&&r<t&&(r=e.minDate.getSeconds())),void 0!==e.maxDate&&(n=e.maxDate.getHours(),i=e.maxDate.getMinutes(),(o=Math.min(o,n))===n&&(s=Math.min(i,s)),o===n&&s===i&&(r=e.maxDate.getSeconds())),{hours:o,minutes:s,seconds:r}}"function"!=typeof Object.assign&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=0,o=e;i<o.length;i++)!function(t){t&&Object.keys(t).forEach(function(e){return n[e]=t[e]})}(o[i]);return n});var Ae=300;function r(c,P){var p={config:ce(ce({},de),Ie.defaultConfig),l10n:fe};function Y(e){return e.bind(p)}function H(){var t=p.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame(function(){var e;void 0!==p.calendarContainer&&(p.calendarContainer.style.visibility="hidden",p.calendarContainer.style.display="block"),void 0!==p.daysContainer&&(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 h(e){0===p.selectedDates.length&&(o=void 0===p.config.minDate||0<=Ee(new Date,p.config.minDate)?new Date:new Date(p.config.minDate.getTime()),s=Se(p.config),o.setHours(s.hours,s.minutes,s.seconds,o.getMilliseconds()),p.selectedDates=[o],p.latestSelectedDateObj=o),void 0!==e&&"blur"!==e.type&&((s=e).preventDefault(),o="keydown"===s.type,t=e=De(s),void 0!==p.amPM&&e===p.amPM&&(p.amPM.textContent=p.l10n.amPM[_e(p.amPM.textContent===p.l10n.amPM[0])]),e=parseFloat(t.getAttribute("min")),a=parseFloat(t.getAttribute("max")),n=parseFloat(t.getAttribute("step")),i=parseInt(t.value,10),o=s.delta||(o?38===s.which?1:-1:0),s=i+n*o,void 0!==t.value&&2===t.value.length&&(o=t===p.hourElement,r=t===p.minuteElement,s<e?(s=a+s+_e(!o)+(_e(o)&&_e(!p.amPM)),r&&l(void 0,-1,p.hourElement)):a<s&&(s=t===p.hourElement?s-a-_e(!p.amPM):e,r&&l(void 0,1,p.hourElement)),p.amPM&&o&&(1===n?s+i===23:Math.abs(s-i)>n)&&(p.amPM.textContent=p.l10n.amPM[_e(p.amPM.textContent===p.l10n.amPM[0])]),t.value=pe(s)));var t,n,i,o,s,r,a=p._input.value;u(),T(),p._input.value!==a&&p._debouncedChange()}function u(){var e,t,n,i,o,s;void 0!==p.hourElement&&void 0!==p.minuteElement&&(o=(parseInt(p.hourElement.value.slice(-2),10)||0)%24,e=(parseInt(p.minuteElement.value,10)||0)%60,t=void 0!==p.secondElement?(parseInt(p.secondElement.value,10)||0)%60:0,void 0!==p.amPM&&(n=o,i=p.amPM.textContent,o=n%12+12*_e(i===p.l10n.amPM[1])),n=void 0!==p.config.minTime||p.config.minDate&&p.minDateHasTime&&p.latestSelectedDateObj&&0===Ee(p.latestSelectedDateObj,p.config.minDate,!0),(void 0!==p.config.maxTime||p.config.maxDate&&p.maxDateHasTime&&p.latestSelectedDateObj&&0===Ee(p.latestSelectedDateObj,p.config.maxDate,!0))&&(i=void 0!==p.config.maxTime?p.config.maxTime:p.config.maxDate,(e=(o=Math.min(o,i.getHours()))===i.getHours()?Math.min(e,i.getMinutes()):e)===i.getMinutes()&&(t=Math.min(t,i.getSeconds()))),n&&(s=void 0!==p.config.minTime?p.config.minTime:p.config.minDate,(e=(o=Math.max(o,s.getHours()))===s.getHours()&&e<s.getMinutes()?s.getMinutes():e)===s.getMinutes()&&(t=Math.max(t,s.getSeconds()))),r(o,e,t))}function i(e){e=e||p.latestSelectedDateObj;e&&r(e.getHours(),e.getMinutes(),e.getSeconds())}function r(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=pe(p.config.time_24hr?e:(12+e)%12+12*_e(e%12==0)),p.minuteElement.value=pe(t),void 0!==p.amPM&&(p.amPM.textContent=p.l10n.amPM[_e(12<=e)]),void 0!==p.secondElement&&(p.secondElement.value=pe(n)))}function L(e){var t=De(e),t=parseInt(t.value)+(e.delta||0);(1<t/1e3||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&w(t)}function a(t,n,i,o){return n instanceof Array?n.forEach(function(e){return a(t,e,i,o)}):t instanceof Array?t.forEach(function(e){return a(e,n,i,o)}):(t.addEventListener(n,i,o),void p._handlers.push({remove:function(){return t.removeEventListener(n,i)}}))}function o(){k("onChange")}function s(t,e){var t=void 0!==t?p.parseDate(t):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),n=p.currentYear,i=p.currentMonth;try{void 0!==t&&(p.currentYear=t.getFullYear(),p.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,p.config.errorHandler(e)}e&&p.currentYear!==n&&(k("onYearChange"),v()),!e||p.currentYear===n&&p.currentMonth===i||k("onMonthChange"),p.redraw()}function R(e){var t=De(e);~t.className.indexOf("arrow")&&l(e,t.classList.contains("arrowUp")?1:-1)}function l(e,t,n){e=e&&De(e),n=n||e&&e.parentNode&&e.parentNode.firstChild,e=ie("increment");e.delta=t,n&&n.dispatchEvent(e)}function d(e,t,n,i){var o=D(t,!0),s=ye("span","flatpickr-day "+e,t.getDate().toString());return s.dateObj=t,s.$i=i,s.setAttribute("aria-label",p.formatDate(t,p.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===Ee(t,p.now)&&((p.todayDateElem=s).classList.add("today"),s.setAttribute("aria-current","date")),o?(s.tabIndex=-1,oe(t)&&(s.classList.add("selected"),p.selectedDateElem=s,"range"===p.config.mode&&(ve(s,"startRange",p.selectedDates[0]&&0===Ee(t,p.selectedDates[0],!0)),ve(s,"endRange",p.selectedDates[1]&&0===Ee(t,p.selectedDates[1],!0)),"nextMonthDay"===e&&s.classList.add("inRange")))):s.classList.add("flatpickr-disabled"),"range"===p.config.mode&&(i=t,"range"!==p.config.mode||p.selectedDates.length<2||!(0<=Ee(i,p.selectedDates[0])&&Ee(i,p.selectedDates[1])<=0)||oe(t)||s.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>"),k("onDayCreate",s),s}function _(e){e.focus(),"range"===p.config.mode&&K(e)}function m(e){for(var t=0<e?0:p.config.showMonths-1,n=0<e?p.config.showMonths:-1,i=t;i!=n;i+=e)for(var o=p.daysContainer.children[i],s=0<e?0:o.children.length-1,r=0<e?o.children.length:-1,a=s;a!=r;a+=e){var l=o.children[a];if(-1===l.className.indexOf("hidden")&&D(l.dateObj))return l}}function g(e,t){var n=C(document.activeElement||document.body),e=void 0!==e?e:n?document.activeElement:void 0!==p.selectedDateElem&&C(p.selectedDateElem)?p.selectedDateElem:void 0!==p.todayDateElem&&C(p.todayDateElem)?p.todayDateElem:m(0<t?1:-1);if(void 0===e)p._input.focus();else if(n){for(var i=e,o=t,s=-1===i.className.indexOf("Month")?i.dateObj.getMonth():p.currentMonth,r=0<o?p.config.showMonths:-1,a=0<o?1:-1,l=s-p.currentMonth;l!=r;l+=a)for(var c=p.daysContainer.children[l],h=s-p.currentMonth===l?i.$i+o:o<0?c.children.length-1:0,u=c.children.length,d=h;0<=d&&d<u&&d!=(0<o?u:-1);d+=a){var f=c.children[d];if(-1===f.className.indexOf("hidden")&&D(f.dateObj)&&Math.abs(i.$i-d)>=Math.abs(o))return void _(f)}p.changeMonth(a),g(m(a),0)}else _(e)}function f(){if(void 0!==p.daysContainer){be(p.daysContainer),p.weekNumbers&&be(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(function(e,t){for(var n=(new Date(e,t,1).getDay()-p.l10n.firstDayOfWeek+7)%7,i=p.utils.getDaysInMonth((t-1+12)%12,e),o=p.utils.getDaysInMonth(t,e),s=window.document.createDocumentFragment(),r=1<p.config.showMonths,a=r?"prevMonthDay hidden":"prevMonthDay",l=r?"nextMonthDay hidden":"nextMonthDay",c=i+1-n,h=0;c<=i;c++,h++)s.appendChild(d(a,new Date(e,t-1,c),c,h));for(c=1;c<=o;c++,h++)s.appendChild(d("",new Date(e,t,c),c,h));for(var u=o+1;u<=42-n&&(1===p.config.showMonths||h%7!=0);u++,h++)s.appendChild(d(l,new Date(e,t+1,u%o),u,h));return(r=ye("div","dayContainer")).appendChild(s),r}(n.getFullYear(),n.getMonth()))}p.daysContainer.appendChild(e),p.days=p.daysContainer.firstChild,"range"===p.config.mode&&1===p.selectedDates.length&&K()}}function v(){if(!(1<p.config.showMonths||"dropdown"!==p.config.monthSelectorType)){p.monthsDropdownContainer.tabIndex=-1,p.monthsDropdownContainer.innerHTML="";for(var e,t=0;t<12;t++)e=t,void 0!==p.config.minDate&&p.currentYear===p.config.minDate.getFullYear()&&e<p.config.minDate.getMonth()||void 0!==p.config.maxDate&&p.currentYear===p.config.maxDate.getFullYear()&&e>p.config.maxDate.getMonth()||((e=ye("option","flatpickr-monthDropdown-month")).value=new Date(p.currentYear,t).getMonth().toString(),e.textContent=Ce(t,p.config.shorthandCurrentMonth,p.l10n),e.tabIndex=-1,p.currentMonth===t&&(e.selected=!0),p.monthsDropdownContainer.appendChild(e))}}function q(){be(p.monthNav),p.monthNav.appendChild(p.prevMonthNav),p.config.showMonths&&(p.yearElements=[],p.monthElements=[]);for(var e,t,n,i,o,s=p.config.showMonths;s--;){o=i=r=n=t=e=void 0,e=ye("div","flatpickr-month"),t=window.document.createDocumentFragment(),n=1<p.config.showMonths||"static"===p.config.monthSelectorType?ye("span","cur-month"):(p.monthsDropdownContainer=ye("select","flatpickr-monthDropdown-months"),p.monthsDropdownContainer.setAttribute("aria-label",p.l10n.monthAriaLabel),a(p.monthsDropdownContainer,"change",function(e){e=De(e),e=parseInt(e.value,10);p.changeMonth(e-p.currentMonth),k("onMonthChange")}),v(),p.monthsDropdownContainer),r=we("cur-year",{tabindex:"-1"}),(i=r.getElementsByTagName("input")[0]).setAttribute("aria-label",p.l10n.yearAriaLabel),p.config.minDate&&i.setAttribute("min",p.config.minDate.getFullYear().toString()),p.config.maxDate&&(i.setAttribute("max",p.config.maxDate.getFullYear().toString()),i.disabled=!!p.config.minDate&&p.config.minDate.getFullYear()===p.config.maxDate.getFullYear()),(o=ye("div","flatpickr-current-month")).appendChild(n),o.appendChild(r),t.appendChild(o),e.appendChild(t);var r={container:e,yearElement:i,monthElement:n};p.yearElements.push(r.yearElement),p.monthElements.push(r.monthElement),p.monthNav.appendChild(r.container)}p.monthNav.appendChild(p.nextMonthNav)}function W(){p.weekdayContainer?be(p.weekdayContainer):p.weekdayContainer=ye("div","flatpickr-weekdays");for(var e=p.config.showMonths;e--;){var t=ye("div","flatpickr-weekdaycontainer");p.weekdayContainer.appendChild(t)}return B(),p.weekdayContainer}function B(){if(p.weekdayContainer){var e=p.l10n.firstDayOfWeek,t=he(p.l10n.weekdays.shorthand);0<e&&e<t.length&&(t=he(t.splice(e,t.length),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 y(e,t){t=(t=void 0===t?!0:t)?e:e-p.currentMonth;t<0&&!0===p._hidePrevMonthArrow||0<t&&!0===p._hideNextMonthArrow||(p.currentMonth+=t,(p.currentMonth<0||11<p.currentMonth)&&(p.currentYear+=11<p.currentMonth?1:-1,p.currentMonth=(p.currentMonth+12)%12,k("onYearChange"),v()),f(),k("onMonthChange"),E())}function b(e){return!(!p.config.appendTo||!p.config.appendTo.contains(e))||p.calendarContainer.contains(e)}function z(e){var t,n,i;p.isOpen&&!p.config.inline&&(i=b(t=De(e)),n=t===p.input||t===p.altInput||p.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(p.input)||~e.path.indexOf(p.altInput)),n="blur"===e.type?n&&e.relatedTarget&&!b(e.relatedTarget):!n&&!i&&!b(e.relatedTarget),i=!p.config.ignoredFocusElements.some(function(e){return e.contains(t)}),n&&i&&(void 0!==p.timeContainer&&void 0!==p.minuteElement&&void 0!==p.hourElement&&""!==p.input.value&&void 0!==p.input.value&&h(),p.close(),p.config&&"range"===p.config.mode&&1===p.selectedDates.length&&(p.clear(!1),p.redraw())))}function w(e){var t;!e||p.config.minDate&&e<p.config.minDate.getFullYear()||p.config.maxDate&&e>p.config.maxDate.getFullYear()||(t=p.currentYear!==e,p.currentYear=e||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)),t&&(p.redraw(),k("onYearChange"),v()))}function D(e,t){var n=p.parseDate(e,void 0,t=void 0===t?!0:t);if(p.config.minDate&&n&&Ee(n,p.config.minDate,void 0!==t?t:!p.minDateHasTime)<0||p.config.maxDate&&n&&0<Ee(n,p.config.maxDate,void 0!==t?t:!p.maxDateHasTime))return!1;if(!p.config.enable&&0===p.config.disable.length)return!0;if(void 0===n)return!1;for(var i,o=!!p.config.enable,s=null!=(e=p.config.enable)?e:p.config.disable,r=0,a=void 0;r<s.length;r++){if("function"==typeof(a=s[r])&&a(n))return o;if(a instanceof Date&&void 0!==n&&a.getTime()===n.getTime())return o;if("string"==typeof a)return(i=p.parseDate(a,void 0,!0))&&i.getTime()===n.getTime()?o:!o;if("object"==typeof a&&void 0!==n&&a.from&&a.to&&n.getTime()>=a.from.getTime()&&n.getTime()<=a.to.getTime())return o}return!o}function C(e){return void 0!==p.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&p.daysContainer.contains(e))}function U(e){e.target===p._input&&(0<p.selectedDates.length||0<p._input.value.length)&&(!e.relatedTarget||!b(e.relatedTarget))&&p.setDate(p._input.value,!0,e.target===p.altInput?p.config.altFormat:p.config.dateFormat)}function J(e){var t=De(e),n=p.config.wrap?c.contains(t):t===p._input,i=p.config.allowInput,o=p.isOpen&&(!i||!n),s=p.config.inline&&n&&!i;if(13===e.keyCode&&n){if(i)return p.setDate(p._input.value,!0,t===p.altInput?p.config.altFormat:p.config.dateFormat),t.blur();p.open()}else if(b(t)||o||s){var r,a=!!p.timeContainer&&p.timeContainer.contains(t);switch(e.keyCode){case 13:a?(e.preventDefault(),h(),Z()):ee(e);break;case 27:e.preventDefault(),Z();break;case 8:case 46:n&&!p.config.allowInput&&(e.preventDefault(),p.clear());break;case 37:case 39:a||n?p.hourElement&&p.hourElement.focus():(e.preventDefault(),void 0!==p.daysContainer&&(!1===i||document.activeElement&&C(document.activeElement))&&(l=39===e.keyCode?1:-1,e.ctrlKey?(e.stopPropagation(),y(l),g(m(1),0)):g(void 0,l)));break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;p.daysContainer&&void 0!==t.$i||t===p.input||t===p.altInput?e.ctrlKey?(e.stopPropagation(),w(p.currentYear-l),g(m(1),0)):a||g(void 0,7*l):t===p.currentYearElement?w(p.currentYear-l):p.config.enableTime&&(!a&&p.hourElement&&p.hourElement.focus(),h(e),p._debouncedChange());break;case 9:a?-1!==(r=(l=[p.hourElement,p.minuteElement,p.secondElement,p.amPM].concat(p.pluginElements).filter(function(e){return e})).indexOf(t))&&(l=l[r+(e.shiftKey?-1:1)],e.preventDefault(),(l||p._input).focus()):!p.config.noCalendar&&p.daysContainer&&p.daysContainer.contains(t)&&e.shiftKey&&(e.preventDefault(),p._input.focus())}}if(void 0!==p.amPM&&t===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],u(),T();break;case p.l10n.amPM[1].charAt(0):case p.l10n.amPM[1].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[1],u(),T()}(n||b(t))&&k("onKeyDown",e)}function K(i){if(1===p.selectedDates.length&&(!i||i.classList.contains("flatpickr-day")&&!i.classList.contains("flatpickr-disabled"))){for(var o=(i||p.days.firstElementChild).dateObj.getTime(),s=p.parseDate(p.selectedDates[0],void 0,!0).getTime(),e=Math.min(o,p.selectedDates[0].getTime()),t=Math.max(o,p.selectedDates[0].getTime()),r=!1,a=0,l=0,n=e;n<t;n+=Oe.DAY)D(new Date(n),!0)||(r=r||e<n&&n<t,n<s&&(!a||a<n)?a=n:s<n&&(!l||n<l)&&(l=n));for(var c=0;c<p.config.showMonths;c++)for(var h=p.daysContainer.children[c],u=0,d=h.children.length;u<d;u++)!function(e){var t=h.children[e],e=t.dateObj.getTime(),n=0<a&&e<a||0<l&&l<e;n?(t.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)})):r&&!n||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==i&&(i.classList.add(o<=p.selectedDates[0].getTime()?"startRange":"endRange"),s<o&&e===s?t.classList.add("startRange"):o<s&&e===s&&t.classList.add("endRange"),a<=e&&(0===l||e<=l)&&Te(e,s,o)&&t.classList.add("inRange")))}(u)}}function $(){!p.isOpen||p.config.static||p.config.inline||x()}function Q(n){return function(e){var e=p.config["_"+n+"Date"]=p.parseDate(e,p.config.dateFormat),t=p.config["_"+("min"===n?"max":"min")+"Date"];void 0!==e&&(p["min"===n?"minDateHasTime":"maxDateHasTime"]=0<e.getHours()||0<e.getMinutes()||0<e.getSeconds()),p.selectedDates&&(p.selectedDates=p.selectedDates.filter(function(e){return D(e)}),p.selectedDates.length||"min"!==n||i(e),T()),p.daysContainer&&(X(),void 0!==e?p.currentYearElement[n]=e.getFullYear().toString():p.currentYearElement.removeAttribute(n),p.currentYearElement.disabled=!!t&&void 0!==e&&t.getFullYear()===e.getFullYear())}}function V(){return p.config.wrap?c.querySelector("[data-input]"):c}function G(){"object"!=typeof p.config.locale&&void 0===Ie.l10ns[p.config.locale]&&p.config.errorHandler(new Error("flatpickr: invalid locale "+p.config.locale)),p.l10n=ce(ce({},Ie.l10ns.default),"object"==typeof p.config.locale?p.config.locale:"default"!==p.config.locale?Ie.l10ns[p.config.locale]:void 0),xe.K="("+p.l10n.amPM[0]+"|"+p.l10n.amPM[1]+"|"+p.l10n.amPM[0].toLowerCase()+"|"+p.l10n.amPM[1].toLowerCase()+")",void 0===ce(ce({},P),JSON.parse(JSON.stringify(c.dataset||{}))).time_24hr&&void 0===Ie.defaultConfig.time_24hr&&(p.config.time_24hr=p.l10n.time_24hr),p.formatDate=Me(p),p.parseDate=ke({config:p.config,l10n:p.l10n})}function x(e){var t,n,i,o,s,r;"function"==typeof p.config.position?p.config.position(p,e):void 0!==p.calendarContainer&&(k("onPreCalendarPosition"),e=e||p._positionElement,n=Array.prototype.reduce.call(p.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),r=p.calendarContainer.offsetWidth,s=(i=p.config.position.split(" "))[0],i=1<i.length?i[1]:null,t=e.getBoundingClientRect(),o=window.innerHeight-t.bottom,s="above"===s||"below"!==s&&o<n&&t.top>n,o=window.pageYOffset+t.top+(s?-n-2:e.offsetHeight+2),ve(p.calendarContainer,"arrowTop",!s),ve(p.calendarContainer,"arrowBottom",s),p.config.inline||(n=window.pageXOffset+t.left,s=e=!1,"center"===i?(n-=(r-t.width)/2,e=!0):"right"===i&&(n-=r-t.width,s=!0),ve(p.calendarContainer,"arrowLeft",!e&&!s),ve(p.calendarContainer,"arrowCenter",e),ve(p.calendarContainer,"arrowRight",s),i=window.document.body.offsetWidth-(window.pageXOffset+t.right),e=n+r>window.document.body.offsetWidth,s=i+r>window.document.body.offsetWidth,ve(p.calendarContainer,"rightMost",e),p.config.static||(p.calendarContainer.style.top=o+"px",e?s?void 0!==(o=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];try{n.cssRules}catch(e){continue}e=n;break}return null!=e?e:function(){var e=document.createElement("style");return document.head.appendChild(e),e.sheet}()}())&&(e=window.document.body.offsetWidth,s=Math.max(0,e/2-r/2),e=o.cssRules.length,r="{left:"+t.left+"px;right:auto;}",ve(p.calendarContainer,"rightMost",!1),ve(p.calendarContainer,"centerMost",!0),o.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+r,e),p.calendarContainer.style.left=s+"px",p.calendarContainer.style.right="auto"):(p.calendarContainer.style.left="auto",p.calendarContainer.style.right=i+"px"):(p.calendarContainer.style.left=n+"px",p.calendarContainer.style.right="auto"))))}function X(){p.config.noCalendar||p.isMobile||(v(),E(),f())}function Z(){p._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(p.close,0):p.close()}function ee(e){e.preventDefault(),e.stopPropagation();var t,n,i,e=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(De(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});void 0!==e&&(e=e,t=((n=p.latestSelectedDateObj=new Date(e.dateObj.getTime())).getMonth()<p.currentMonth||n.getMonth()>p.currentMonth+p.config.showMonths-1)&&"range"!==p.config.mode,p.selectedDateElem=e,"single"===p.config.mode?p.selectedDates=[n]:"multiple"===p.config.mode?(i=oe(n))?p.selectedDates.splice(parseInt(i),1):p.selectedDates.push(n):"range"===p.config.mode&&(2===p.selectedDates.length&&p.clear(!1,!1),p.latestSelectedDateObj=n,p.selectedDates.push(n),0!==Ee(n,p.selectedDates[0],!0)&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})),u(),t&&(i=p.currentYear!==n.getFullYear(),p.currentYear=n.getFullYear(),p.currentMonth=n.getMonth(),i&&(k("onYearChange"),v()),k("onMonthChange")),E(),f(),T(),t||"range"===p.config.mode||1!==p.config.showMonths?void 0!==p.selectedDateElem&&void 0===p.hourElement&&p.selectedDateElem&&p.selectedDateElem.focus():_(e),void 0!==p.hourElement&&void 0!==p.hourElement&&p.hourElement.focus(),p.config.closeOnSelect&&(n="single"===p.config.mode&&!p.config.enableTime,i="range"===p.config.mode&&2===p.selectedDates.length&&!p.config.enableTime,(n||i)&&Z()),o())}p.parseDate=ke({config:p.config,l10n:p.l10n}),p._handlers=[],p.pluginElements=[],p.loadedPlugins=[],p._bind=a,p._setHoursFromDate=i,p._positionCalendar=x,p.changeMonth=y,p.changeYear=w,p.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);p.input.value="",void 0!==p.altInput&&(p.altInput.value="");void 0!==p.mobileInput&&(p.mobileInput.value="");p.selectedDates=[],!(p.latestSelectedDateObj=void 0)===t&&(p.currentYear=p._initialDate.getFullYear(),p.currentMonth=p._initialDate.getMonth());{var n,i;!0===p.config.enableTime&&(t=Se(p.config),n=t.hours,i=t.minutes,t=t.seconds,r(n,i,t))}p.redraw(),e&&k("onChange")},p.close=function(){p.isOpen=!1,p.isMobile||(void 0!==p.calendarContainer&&p.calendarContainer.classList.remove("open"),void 0!==p._input&&p._input.classList.remove("active"));k("onClose")},p._createElement=ye,p.destroy=function(){void 0!==p.config&&k("onDestroy");for(var e=p._handlers.length;e--;)p._handlers[e].remove();if(p._handlers=[],p.mobileInput)p.mobileInput.parentNode&&p.mobileInput.parentNode.removeChild(p.mobileInput),p.mobileInput=void 0;else if(p.calendarContainer&&p.calendarContainer.parentNode)if(p.config.static&&p.calendarContainer.parentNode){var t=p.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 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"));["_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 p[e]}catch(e){}})},p.isEnabled=D,p.jumpToDate=s,p.open=function(e,t){void 0===t&&(t=p._positionElement);var n;!0===p.isMobile?(e&&(e.preventDefault(),(n=De(e))&&n.blur()),void 0!==p.mobileInput&&(p.mobileInput.focus(),p.mobileInput.click()),k("onOpen")):p._input.disabled||p.config.inline||(n=p.isOpen,p.isOpen=!0,n||(p.calendarContainer.classList.add("open"),p._input.classList.add("active"),k("onOpen"),x(t)),!0!==p.config.enableTime||!0!==p.config.noCalendar||!1!==p.config.allowInput||void 0!==e&&p.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return p.hourElement.select()},50))},p.redraw=X,p.set=function(e,t){if(null!==e&&"object"==typeof e)for(var n in Object.assign(p.config,e),e)void 0!==M[n]&&M[n].forEach(function(e){return e()});else p.config[e]=t,void 0!==M[e]?M[e].forEach(function(e){return e()}):-1<ue.indexOf(e)&&(p.config[e]=ge(t));p.redraw(),T(!0)},p.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=p.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return p.clear(t);te(e,n),p.latestSelectedDateObj=p.selectedDates[p.selectedDates.length-1],p.redraw(),s(void 0,t),i(),0===p.selectedDates.length&&p.clear(!1);T(t),t&&k("onChange")},p.toggle=function(e){if(!0===p.isOpen)return p.close();p.open(e)};var M={locale:[G,B],showMonths:[q,H,W],minDate:[s],maxDate:[s],clickOpens:[function(){!0===p.config.clickOpens?(a(p._input,"focus",p.open),a(p._input,"click",p.open)):(p._input.removeEventListener("focus",p.open),p._input.removeEventListener("click",p.open))}]};function te(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=p.config.allowInvalidPreload?n:n.filter(function(e){return e instanceof Date&&D(e,!1)}),"range"===p.config.mode&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function ne(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 k(e,t){if(void 0!==p.config){var n=p.config[e];if(void 0!==n&&0<n.length)for(var i=0;n[i]&&i<n.length;i++)n[i](p.selectedDates,p.input.value,p,t);"onChange"===e&&(p.input.dispatchEvent(ie("change")),p.input.dispatchEvent(ie("input")))}}function ie(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function oe(e){for(var t=0;t<p.selectedDates.length;t++)if(0===Ee(p.selectedDates[t],e))return""+t;return!1}function E(){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),1<p.config.showMonths||"static"===p.config.monthSelectorType?p.monthElements[t].textContent=Ce(n.getMonth(),p.config.shorthandCurrentMonth,p.l10n)+" ":p.monthsDropdownContainer.value=n.getMonth().toString(),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 se(t){return p.selectedDates.map(function(e){return p.formatDate(e,t)}).filter(function(e,t,n){return"range"!==p.config.mode||p.config.enableTime||n.indexOf(e)===t}).join("range"!==p.config.mode?p.config.conjunction:p.l10n.rangeSeparator)}function T(e){void 0===e&&(e=!0),void 0!==p.mobileInput&&p.mobileFormatStr&&(p.mobileInput.value=void 0!==p.latestSelectedDateObj?p.formatDate(p.latestSelectedDateObj,p.mobileFormatStr):""),p.input.value=se(p.config.dateFormat),void 0!==p.altInput&&(p.altInput.value=se(p.config.altFormat)),!1!==e&&k("onValueUpdate")}function re(e){var e=De(e),t=p.prevMonthNav.contains(e),n=p.nextMonthNav.contains(e);t||n?y(t?-1:1):0<=p.yearElements.indexOf(e)?e.select():e.classList.contains("arrowUp")?p.changeYear(p.currentYear+1):e.classList.contains("arrowDown")&&p.changeYear(p.currentYear-1)}p.element=p.input=c,p.isOpen=!1;var e=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=ce(ce({},JSON.parse(JSON.stringify(c.dataset||{}))),P),n={},O=(p.config.parseDate=t.parseDate,p.config.formatDate=t.formatDate,Object.defineProperty(p.config,"enable",{get:function(){return p.config._enable},set:function(e){p.config._enable=ne(e)}}),Object.defineProperty(p.config,"disable",{get:function(){return p.config._disable},set:function(e){p.config._disable=ne(e)}}),"time"===t.mode);function ae(t){return function(e){p.config["min"===t?"_minTime":"_maxTime"]=p.parseDate(e,"H:i:S")}}t.dateFormat||!t.enableTime&&!O||(N=Ie.defaultConfig.dateFormat||de.dateFormat,n.dateFormat=t.noCalendar||O?"H:i"+(t.enableSeconds?":S":""):N+" H:i"+(t.enableSeconds?":S":"")),t.altInput&&(t.enableTime||O)&&!t.altFormat&&(N=Ie.defaultConfig.altFormat||de.altFormat,n.altFormat=t.noCalendar||O?"h:i"+(t.enableSeconds?":S K":" K"):N+(" h:i"+(t.enableSeconds?":S":""))+" K"),Object.defineProperty(p.config,"minDate",{get:function(){return p.config._minDate},set:Q("min")}),Object.defineProperty(p.config,"maxDate",{get:function(){return p.config._maxDate},set:Q("max")}),Object.defineProperty(p.config,"minTime",{get:function(){return p.config._minTime},set:ae("min")}),Object.defineProperty(p.config,"maxTime",{get:function(){return p.config._maxTime},set:ae("max")}),"time"===t.mode&&(p.config.noCalendar=!0,p.config.enableTime=!0),Object.assign(p.config,n,t);for(var S=0;S<e.length;S++)p.config[e[S]]=!0===p.config[e[S]]||"true"===p.config[e[S]];for(ue.filter(function(e){return void 0!==p.config[e]}).forEach(function(e){p.config[e]=ge(p.config[e]||[]).map(Y)}),p.isMobile=!p.config.disableMobile&&!p.config.inline&&"single"===p.config.mode&&!p.config.disable.length&&!p.config.enable&&!p.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),S=0;S<p.config.plugins.length;S++){var A,le=p.config.plugins[S](p)||{};for(A in le)-1<ue.indexOf(A)?p.config[A]=ge(le[A]).map(Y).concat(p.config[A]):void 0===t[A]&&(p.config[A]=le[A])}if(t.altInputClass||(p.config.altInputClass=V().className+" "+p.config.altInputClass),k("onParseConfig"),G(),p.input=V(),p.input?(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=ye(p.input.nodeName,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.setAttribute("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):p.config.errorHandler(new Error("Invalid input element specified")),p.selectedDates=[],p.now=p.parseDate(p.config.now)||new Date,(O=p.config.defaultDate||("INPUT"!==p.input.nodeName&&"TEXTAREA"!==p.input.nodeName||!p.input.placeholder||p.input.value!==p.input.placeholder?p.input.value:null))&&te(O,p.config.dateFormat),p._initialDate=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=p._initialDate.getFullYear(),p.currentMonth=p._initialDate.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()),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){var I,N=window.document.createDocumentFragment(),F=(p.calendarContainer=ye("div","flatpickr-calendar"),p.calendarContainer.tabIndex=-1,p.config.noCalendar||(N.appendChild((p.monthNav=ye("div","flatpickr-months"),p.yearElements=[],p.monthElements=[],p.prevMonthNav=ye("span","flatpickr-prev-month"),p.prevMonthNav.innerHTML=p.config.prevArrow,p.nextMonthNav=ye("span","flatpickr-next-month"),p.nextMonthNav.innerHTML=p.config.nextArrow,q(),Object.defineProperty(p,"_hidePrevMonthArrow",{get:function(){return p.__hidePrevMonthArrow},set:function(e){p.__hidePrevMonthArrow!==e&&(ve(p.prevMonthNav,"flatpickr-disabled",e),p.__hidePrevMonthArrow=e)}}),Object.defineProperty(p,"_hideNextMonthArrow",{get:function(){return p.__hideNextMonthArrow},set:function(e){p.__hideNextMonthArrow!==e&&(ve(p.nextMonthNav,"flatpickr-disabled",e),p.__hideNextMonthArrow=e)}}),p.currentYearElement=p.yearElements[0],E(),p.monthNav)),p.innerContainer=ye("div","flatpickr-innerContainer"),p.config.weekNumbers&&(F=function(){p.calendarContainer.classList.add("hasWeeks");var e=ye("div","flatpickr-weekwrapper"),t=(e.appendChild(ye("span","flatpickr-weekday",p.l10n.weekAbbreviation)),ye("div","flatpickr-weeks"));return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),I=F.weekWrapper,F=F.weekNumbers,p.innerContainer.appendChild(I),p.weekNumbers=F,p.weekWrapper=I),p.rContainer=ye("div","flatpickr-rContainer"),p.rContainer.appendChild(W()),p.daysContainer||(p.daysContainer=ye("div","flatpickr-days"),p.daysContainer.tabIndex=-1),f(),p.rContainer.appendChild(p.daysContainer),p.innerContainer.appendChild(p.rContainer),N.appendChild(p.innerContainer)),p.config.enableTime&&N.appendChild(function(){p.calendarContainer.classList.add("hasTime"),p.config.noCalendar&&p.calendarContainer.classList.add("noCalendar");var e=Se(p.config),t=(p.timeContainer=ye("div","flatpickr-time"),p.timeContainer.tabIndex=-1,ye("span","flatpickr-time-separator",":")),n=we("flatpickr-hour",{"aria-label":p.l10n.hourAriaLabel}),i=(p.hourElement=n.getElementsByTagName("input")[0],we("flatpickr-minute",{"aria-label":p.l10n.minuteAriaLabel}));p.minuteElement=i.getElementsByTagName("input")[0],p.hourElement.tabIndex=p.minuteElement.tabIndex=-1,p.hourElement.value=pe(p.latestSelectedDateObj?p.latestSelectedDateObj.getHours():p.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),p.minuteElement.value=pe(p.latestSelectedDateObj?p.latestSelectedDateObj.getMinutes():e.minutes),p.hourElement.setAttribute("step",p.config.hourIncrement.toString()),p.minuteElement.setAttribute("step",p.config.minuteIncrement.toString()),p.hourElement.setAttribute("min",p.config.time_24hr?"0":"1"),p.hourElement.setAttribute("max",p.config.time_24hr?"23":"12"),p.hourElement.setAttribute("maxlength","2"),p.minuteElement.setAttribute("min","0"),p.minuteElement.setAttribute("max","59"),p.minuteElement.setAttribute("maxlength","2"),p.timeContainer.appendChild(n),p.timeContainer.appendChild(t),p.timeContainer.appendChild(i),p.config.time_24hr&&p.timeContainer.classList.add("time24hr");p.config.enableSeconds&&(p.timeContainer.classList.add("hasSeconds"),n=we("flatpickr-second"),p.secondElement=n.getElementsByTagName("input")[0],p.secondElement.value=pe(p.latestSelectedDateObj?p.latestSelectedDateObj.getSeconds():e.seconds),p.secondElement.setAttribute("step",p.minuteElement.getAttribute("step")),p.secondElement.setAttribute("min","0"),p.secondElement.setAttribute("max","59"),p.secondElement.setAttribute("maxlength","2"),p.timeContainer.appendChild(ye("span","flatpickr-time-separator",":")),p.timeContainer.appendChild(n));p.config.time_24hr||(p.amPM=ye("span","flatpickr-am-pm",p.l10n.amPM[_e(11<(p.latestSelectedDateObj?p.hourElement.value:p.config.defaultHour))]),p.amPM.title=p.l10n.toggleTitle,p.amPM.tabIndex=-1,p.timeContainer.appendChild(p.amPM));return p.timeContainer}()),ve(p.calendarContainer,"rangeMode","range"===p.config.mode),ve(p.calendarContainer,"animate",!0===p.config.animate),ve(p.calendarContainer,"multiMonth",1<p.config.showMonths),p.calendarContainer.appendChild(N),void 0!==p.config.appendTo&&void 0!==p.config.appendTo.nodeType);(p.config.inline||p.config.static)&&(p.calendarContainer.classList.add(p.config.inline?"inline":"static"),p.config.inline&&(!F&&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&&(I=ye("div","flatpickr-wrapper"),p.element.parentNode&&p.element.parentNode.insertBefore(I,p.element),I.appendChild(p.element),p.altInput&&I.appendChild(p.altInput),I.appendChild(p.calendarContainer))),p.config.static||p.config.inline||(void 0!==p.config.appendTo?p.config.appendTo:window.document.body).appendChild(p.calendarContainer)}if(p.config.wrap&&["open","close","toggle","clear"].forEach(function(t){Array.prototype.forEach.call(p.element.querySelectorAll("[data-"+t+"]"),function(e){return a(e,"click",p[t])})}),p.isMobile){var j=p.config.enableTime?p.config.noCalendar?"time":"datetime-local":"date";p.mobileInput=ye("input",p.input.className+" flatpickr-mobile"),p.mobileInput.tabIndex=1,p.mobileInput.type=j,p.mobileInput.disabled=p.input.disabled,p.mobileInput.required=p.input.required,p.mobileInput.placeholder=p.input.placeholder,p.mobileFormatStr="datetime-local"==j?"Y-m-d\\TH:i:S":"date"==j?"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.getAttribute("step")&&(p.mobileInput.step=String(p.input.getAttribute("step"))),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){}a(p.mobileInput,"change",function(e){p.setDate(De(e).value,!1,p.mobileFormatStr),k("onChange"),k("onClose")})}else j=me($,50),p._debouncedChange=me(o,Ae),p.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&a(p.daysContainer,"mouseover",function(e){"range"===p.config.mode&&K(De(e))}),a(window.document.body,"keydown",J),p.config.inline||p.config.static||a(window,"resize",j),void 0!==window.ontouchstart?a(window.document,"touchstart",z):a(window.document,"mousedown",z),a(window.document,"focus",z,{capture:!0}),!0===p.config.clickOpens&&(a(p._input,"focus",p.open),a(p._input,"click",p.open)),void 0!==p.daysContainer&&(a(p.monthNav,"click",re),a(p.monthNav,["keyup","increment"],L),a(p.daysContainer,"click",ee)),void 0!==p.timeContainer&&void 0!==p.minuteElement&&void 0!==p.hourElement&&(a(p.timeContainer,["increment"],h),a(p.timeContainer,"blur",h,{capture:!0}),a(p.timeContainer,"click",R),a([p.hourElement,p.minuteElement],["focus","click"],function(e){return De(e).select()}),void 0!==p.secondElement&&a(p.secondElement,"focus",function(){return p.secondElement&&p.secondElement.select()}),void 0!==p.amPM&&a(p.amPM,"click",function(e){h(e),o()})),p.config.allowInput&&a(p._input,"blur",U);return(p.selectedDates.length||p.config.noCalendar)&&(p.config.enableTime&&i(p.config.noCalendar?p.latestSelectedDateObj:void 0),T(!1)),H(),n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),!p.isMobile&&n&&x(),k("onReady"),p}function n(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),i=[],o=0;o<n.length;o++){var s=n[o];try{null===s.getAttribute("data-fp-omit")&&(void 0!==s._flatpickr&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=r(s,t||{}),i.push(s._flatpickr))}catch(e){console.error(e)}}return 1===i.length?i[0]:i}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return n(this,e)},HTMLElement.prototype.flatpickr=function(e){return n([this],e)});var Ie=function(e,t){return"string"==typeof e?n(window.document.querySelectorAll(e),t):e instanceof Node?n([e],t):n(e,t)};return Ie.defaultConfig={},Ie.l10ns={en:ce({},fe),default:ce({},fe)},Ie.localize=function(e){Ie.l10ns.default=ce(ce({},Ie.l10ns.default),e)},Ie.setDefaults=function(e){Ie.defaultConfig=ce(ce({},Ie.defaultConfig),e)},Ie.parseDate=ke({}),Ie.formatDate=Me({}),Ie.compareDates=Ee,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return n(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=Ie),Ie}),function(r){function t(e,t){this.element=r(e),this.options=t,this.init()}t.prototype.init=function(){this.element.chosen(this.options),this.container=this.element.next(".chosen-container"),this.search_field=this.container.find(".chosen-search-input"),this.is_multiple=this.container.hasClass("chosen-container-multi"),this.is_typing=!1,this.chosenXhr=null,this.events()},t.prototype.events=function(){var e=this;this.search_field.on("compositionstart",function(){e.is_typing=!0}),this.search_field.on("compositionend",function(){e.is_typing=!1,e.update_list()}),this.search_field.on("keyup",function(){e.update_list()}),this.search_field.on("focus",function(){e.search_field_focused()})},t.prototype.search_field_focused=function(){this.search_welcome_message(),0===this.options.min_length&&0===this.search_field.val().length&&this.update_list()},t.prototype.search_welcome_message=function(){var e=r.trim(this.search_field.val()),t=this.container.find(".chosen-results");0===t.children().length&&0===e.length&&t.html('<li class="no-results">'+this.options.typing_text.replace("%s",this.options.min_length-e.length)+"</li>")},t.prototype.update_list=function(){var e,t,n=this;this.search_welcome_message(),this.is_typing||(t=(e=r.trim(this.search_field.val())).length<this.options.min_length?this.options.typing_text.replace("%s",this.options.min_length-e.length):this.options.searching_text,this.container.find(".no-results").text(t),e!==this.search_field.data("prevVal")&&(this.search_field.data("prevVal",e),this.timer&&clearTimeout(this.timer),e.length<this.options.min_length||(this.timer=setTimeout(function(){n.chosenXhr&&n.chosenXhr.abort(),n.options.data.term=e,n.chosenXhr=window.wp.ajax.post("csf-chosen",n.options.data).done(function(e){n.show_results(e)}).fail(function(e){n.container.find(".no-results").text(e.error)})},this.options.type_delay))))},t.prototype.show_results=function(e){var n,t,i,o,s=this;this.is_typing||null===e||(0===e.length?(this.element.data().chosen.no_results_clear(),this.element.data().chosen.no_results(this.search_field.val())):(n=[],this.element.find("option").each(function(){r(this).is(":selected")?n.push(r(this).val()+"-"+r(this).text()):r(this).attr("value").length&&r(this).remove()}),r.each(e,function(e,t){-1===r.inArray(t.value+"-"+t.text,n)&&r("<option />").attr("value",t.value).html(t.text).appendTo(s.element)}),t=this.search_field.val(),i=this.search_field.innerWidth(),this.element.trigger("chosen:updated"),this.is_multiple&&(o=this.element.parent().find(".csf-hide-select").val()||[],this.element.CSFChosenOrder(o,!0),this.search_field.css("width",i)),this.search_field.val(t),null!==this.chosenXhr.done&&this.chosenXhr.done(e)))},r.fn.CSFAjaxChosen=function(e){return this.each(function(){new t(this,e)})}}(jQuery),function(){var s,r,a=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},l={}.hasOwnProperty;function e(){}e.insertAt=function(e,t,n){return n.insertBefore(e,n.children[t].nextSibling)},e.getFlattenedOptionsAndGroups=function(e){for(var t,n,i,o,s,r=Array.prototype.filter.call(e.childNodes,function(e){return"OPTION"===(e=e.nodeName.toUpperCase())||"OPTGROUP"===e}),a=[],l=0,c=r.length;l<c;l++)if(t=r[l],a.push(t),"OPTGROUP"===t.nodeName.toUpperCase())for(o=0,s=(i=Array.prototype.filter.call(t.childNodes,function(e){return"OPTION"===e.nodeName.toUpperCase()})).length;o<s;o++)n=i[o],a.push(n);return a},e.isValidMultipleSelectElement=function(e){return null!=e&&"SELECT"===e.nodeName&&e.multiple},e.getChosenUIContainer=function(e){return""!==e.id?document.getElementById(e.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(e)},e.isChosenified=function(e){return null!=this.getChosenUIContainer(e)},e.forceSelection=function(e,t){for(var n,i,o=this.getFlattenedOptionsAndGroups(e),s=0;s<o.length;)i=(n=o[s]).getAttribute("value"),0<=a.call(t,i)?(n.selected=!0,n.setAttribute("selected","")):(n.selected=!1,n.removeAttribute("selected")),s++;return this.triggerEvent(e,"chosen:updated")},e.CSFChosenOrder=function(e,t,n){var i,o,s,r,a,l,c,h,u,d,f,p,_;if(null!=this.getDOMElement&&(e=this.getDOMElement(e)),this.isValidMultipleSelectElement(e)&&null!=(i=this.getChosenUIContainer(e))&&t instanceof Array){for(t=t.map(Function.prototype.call,String.prototype.trim),l=this.getFlattenedOptionsAndGroups(e),null!=n&&!0===n&&this.forceSelection(e,t),_=[],o=u=0,f=t.length;u<f;o=++u){for(r=t[o],c=null,s=d=0,p=l.length;d<p;s=++d)l[s].value===r&&(c=s);a=i.querySelectorAll(".search-choice"),h=this.relAttributeName,null!=(a=Array.prototype.filter.call(a,function(e){return null!=e.querySelector("a.search-choice-close["+h+'="'+c+'"]')})[0])&&(i.querySelector("ul.chosen-choices"),_.push(this.insertAt(a,o,i.querySelector("ul.chosen-choices"))))}return _}},r=e,(s=jQuery).fn.extend({CSFChosenOrder:function(e,t){return _CSFChosenOrder.CSFChosenOrder(this,e,t)}}),this._CSFChosenOrder=function(){var e,t=o,n=r;for(e in n)l.call(n,e)&&(t[e]=n[e]);function i(){this.constructor=t}function o(){return o.__super__.constructor.apply(this,arguments)}return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,o.relAttributeName="data-option-array-index",o.isjQueryObject=function(e){return"undefined"!=typeof jQuery&&null!==jQuery&&e instanceof jQuery},o.getDOMElement=function(e){return this.isjQueryObject(e)?e.get(0):e},o.searchChosenUIContainer=function(e){return null!=s(e).data("chosen")?s(e).data("chosen").container[0]:s(e).next(".chosen-container.chosen-container-multi").get(0)},o.triggerEvent=function(e,t){return s(e).trigger(t)},o}()}.call(this),function(){var a,s,o,r,l={}.hasOwnProperty;function e(){this.options_index=0,this.parsed=[]}function c(e,t){var n,i;this.form_field=e,this.options=null!=t?t:{},this.label_click_handler=(n=this.label_click_handler,i=this,function(){return n.apply(i,arguments)}),c.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,i,o,s,r=this.parsed.length;for(this.parsed.push({array_index:r,group:!0,label:e.label,title:e.title||void 0,children:0,disabled:e.disabled,classes:e.className}),s=[],t=0,n=(o=e.childNodes).length;t<n;t++)i=o[t],s.push(this.add_option(i,r,e.disabled));return s},e.prototype.add_option=function(e,t,n){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title||void 0,selected:e.selected,disabled:!0===n?n:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},(r=e).select_to_array=function(e){for(var t,n=new r,i=e.childNodes,o=0,s=i.length;o<s;o++)t=i[o],n.add_node(t);return n.parsed},c.prototype.set_default_values=function(){var t,n;return this.click_test_action=(t=this,function(e){return t.test_active_click(e)}),this.activate_action=(n=this,function(e){return n.activate_field(e)}),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},c.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||c.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||c.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||c.default_no_result_text},c.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+this.escape_html(e.group_label)+"</b>"+e.html:e.html},c.prototype.mouse_enter=function(){return this.mouse_on_container=!0},c.prototype.mouse_leave=function(){return this.mouse_on_container=!1},c.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout((t=this,function(){return t.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var t},c.prototype.input_blur=function(e){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((t=this,function(){return t.blur_test()}),100);var t},c.prototype.label_click_handler=function(e){return this.is_multiple?this.container_mousedown(e):this.activate_field()},c.prototype.results_option_build=function(e){for(var t,n,i="",o=0,s=this.results_data,r=0,a=s.length;r<a&&((n="")!==(n=(t=s[r]).group?this.result_add_group(t):this.result_add_option(t))&&(o++,i+=n),null!=e&&e.first&&(t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(t))),!(o>=this.max_shown_results));r++);return i},c.prototype.result_add_option=function(e){var t,n;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),(n=document.createElement("li")).className=t.join(" "),e.style&&(n.style.cssText=e.style),n.setAttribute("data-option-array-index",e.array_index),n.innerHTML=e.highlighted_html||e.html,e.title&&(n.title=e.title),this.outerHTML(n)):""},c.prototype.result_add_group=function(e){var t,n;return(e.search_match||e.group_match)&&0<e.active_options?((t=[]).push("group-result"),e.classes&&t.push(e.classes),(n=document.createElement("li")).className=t.join(" "),n.innerHTML=e.highlighted_html||this.escape_html(e.label),e.title&&(n.title=e.title),this.outerHTML(n)):""},c.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},c.prototype.reset_single_select_options=function(){for(var e,t=this.results_data,n=[],i=0,o=t.length;i<o;i++)(e=t[i]).selected?n.push(e.selected=!1):n.push(void 0);return n},c.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},c.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},c.prototype.winnow_results=function(e){var t,n,i,o,s,r,a,l,c,h,u,d,f;for(this.no_results_clear(),h=0,t=(a=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(t),i=0,o=(l=this.results_data).length;i<o;i++)(s=l[i]).search_match=!1,u=null,s.highlighted_html="",this.include_option_in_results(s)&&(s.group&&(s.group_match=!1,s.active_options=0),null!=s.group_array_index&&this.results_data[s.group_array_index]&&(0===(u=this.results_data[s.group_array_index]).active_options&&u.search_match&&(h+=1),u.active_options+=1),f=s.group?s.label:s.text,s.group&&!this.group_search||(d=this.search_string_match(f,c),s.search_match=null!=d,s.search_match&&!s.group&&(h+=1),s.search_match?(a.length&&(d=d.index,r=f.slice(0,d),n=f.slice(d,d+a.length),f=f.slice(d+a.length),s.highlighted_html=this.escape_html(r)+"<em>"+this.escape_html(n)+"</em>"+this.escape_html(f)),null!=u&&(u.group_match=!0)):null!=s.group_array_index&&this.results_data[s.group_array_index].search_match&&(s.search_match=!0)));return this.result_clear_highlight(),h<1&&a.length?(this.update_results_content(""),this.no_results(a)):(this.update_results_content(this.results_option_build()),null!=e&&e.skip_highlight?void 0:this.winnow_results_set_highlight())},c.prototype.get_search_regex=function(e){var t,e=this.search_contains?e:"(^|\\s|\\b)"+e+"[^\\s]*";return this.enable_split_word_search||this.search_contains||(e="^"+e),t=this.case_sensitive_search?"":"i",new RegExp(e,t)},c.prototype.search_string_match=function(e,t){t=t.exec(e);return!this.search_contains&&null!=t&&t[1]&&(t.index+=1),t},c.prototype.choices_count=function(){var e,t,n;if(null==this.selected_option_count)for(e=this.selected_option_count=0,t=(n=this.form_field.options).length;e<t;e++)n[e].selected&&(this.selected_option_count+=1);return this.selected_option_count},c.prototype.choices_click=function(e){if(e.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},c.prototype.keydown_checker=function(e){var t=null!=(t=e.which)?t:e.keyCode;switch(this.search_field_scale(),8!==t&&this.pending_backstroke&&this.clear_backstroke(),t){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},c.prototype.keyup_checker=function(e){var t=null!=(t=e.which)?t:e.keyCode;switch(this.search_field_scale(),t){case 8:this.is_multiple&&this.backstroke_length<1&&0<this.choices_count()?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:e.preventDefault(),this.results_showing&&this.result_select(e);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},c.prototype.clipboard_event_checker=function(e){var t;if(!this.is_disabled)return setTimeout((t=this,function(){return t.results_search()}),50)},c.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},c.prototype.include_option_in_results=function(e){return!(this.is_multiple&&!this.display_selected_options&&e.selected)&&(!(!this.display_disabled_options&&e.disabled)&&!e.empty)},c.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},c.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},c.prototype.search_results_touchend=function(e){if(this.touch_started)return this.search_results_mouseup(e)},c.prototype.outerHTML=function(e){var t;return e.outerHTML||((t=document.createElement("div")).appendChild(e),t.innerHTML)},c.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},c.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},c.prototype.get_no_results_html=function(e){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(e)+"</span>\n</li>"},c.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?8<=document.documentMode:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},c.default_multiple_text="Select Some Options",c.default_single_text="Select an Option",c.default_no_result_text="No results match",s=c,(a=jQuery).fn.extend({chosen:function(i){return s.browser_is_supported()?this.each(function(e){var t=a(this),n=t.data("chosen");"destroy"===i?n instanceof o&&n.destroy():n instanceof o||t.data("chosen",new o(this,i))}):this}}),o=function(){var e,t=o,n=s;for(e in n)l.call(n,e)&&(t[e]=n[e]);function i(){this.constructor=t}function o(){return o.__super__.constructor.apply(this,arguments)}return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,o.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},o.prototype.set_up_html=function(){var e=["chosen-container"];return e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),e={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(e.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",e),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},o.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},o.prototype.register_observers=function(){var t,n,i,o,s,r,a,l,c,h,u,d,f,p,_,m,g,v,y,b,w,D,C,x;return this.container.on("touchstart.chosen",(t=this,function(e){t.container_mousedown(e)})),this.container.on("touchend.chosen",(n=this,function(e){n.container_mouseup(e)})),this.container.on("mousedown.chosen",(i=this,function(e){i.container_mousedown(e)})),this.container.on("mouseup.chosen",(o=this,function(e){o.container_mouseup(e)})),this.container.on("mouseenter.chosen",(s=this,function(e){s.mouse_enter(e)})),this.container.on("mouseleave.chosen",(r=this,function(e){r.mouse_leave(e)})),this.search_results.on("mouseup.chosen",(a=this,function(e){a.search_results_mouseup(e)})),this.search_results.on("mouseover.chosen",(l=this,function(e){l.search_results_mouseover(e)})),this.search_results.on("mouseout.chosen",(c=this,function(e){c.search_results_mouseout(e)})),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",(h=this,function(e){h.search_results_mousewheel(e)})),this.search_results.on("touchstart.chosen",(u=this,function(e){u.search_results_touchstart(e)})),this.search_results.on("touchmove.chosen",(d=this,function(e){d.search_results_touchmove(e)})),this.search_results.on("touchend.chosen",(f=this,function(e){f.search_results_touchend(e)})),this.form_field_jq.on("chosen:updated.chosen",(p=this,function(e){p.results_update_field(e)})),this.form_field_jq.on("chosen:activate.chosen",(_=this,function(e){_.activate_field(e)})),this.form_field_jq.on("chosen:open.chosen",(m=this,function(e){m.container_mousedown(e)})),this.form_field_jq.on("chosen:close.chosen",(g=this,function(e){g.close_field(e)})),this.search_field.on("blur.chosen",(v=this,function(e){v.input_blur(e)})),this.search_field.on("keyup.chosen",(y=this,function(e){y.keyup_checker(e)})),this.search_field.on("keydown.chosen",(b=this,function(e){b.keydown_checker(e)})),this.search_field.on("focus.chosen",(w=this,function(e){w.input_focus(e)})),this.search_field.on("cut.chosen",(D=this,function(e){D.clipboard_event_checker(e)})),this.search_field.on("paste.chosen",(C=this,function(e){C.clipboard_event_checker(e)})),this.is_multiple?this.search_choices.on("click.chosen",(x=this,function(e){x.choices_click(e)})):this.container.on("click.chosen",function(e){e.preventDefault()})},o.prototype.destroy=function(){return a(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),0<this.form_field_label.length&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},o.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},o.prototype.container_mousedown=function(e){var t;if(!this.is_disabled)return!e||"mousedown"!==(t=e.type)&&"touchstart"!==t||this.results_showing||e.preventDefault(),null!=e&&a(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||a(e.target)[0]!==this.selected_item[0]&&!a(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},o.prototype.container_mouseup=function(e){if("ABBR"===e.target.nodeName&&!this.is_disabled)return this.results_reset(e)},o.prototype.search_results_mousewheel=function(e){var t;if(null!=(t=e.originalEvent?e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail:t))return e.preventDefault(),"DOMMouseScroll"===e.type&&(t*=40),this.search_results.scrollTop(t+this.search_results.scrollTop())},o.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},o.prototype.close_field=function(){return a(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},o.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},o.prototype.test_active_click=function(e){e=a(e.target).closest(".chosen-container");return e.length&&this.container[0]===e[0]?this.active_field=!0:this.close_field()},o.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=r.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},o.prototype.result_do_highlight=function(e){var t,n,i;if(e.length)return this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),(e=parseInt(this.search_results.css("maxHeight"),10))+(i=this.search_results.scrollTop())<=(t=(n=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())?this.search_results.scrollTop(0<t-e?t-e:0):n<i?this.search_results.scrollTop(n):void 0},o.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},o.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},o.prototype.update_results_content=function(e){return this.search_results.html(e)},o.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},o.prototype.set_tab_index=function(e){var t;if(this.form_field.tabIndex)return t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=t},o.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),0<this.form_field_label.length)return this.form_field_label.on("click.chosen",this.label_click_handler)},o.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},o.prototype.search_results_mouseup=function(e){var t=a(e.target).hasClass("active-result")?a(e.target):a(e.target).parents(".active-result").first();if(t.length)return this.result_highlight=t,this.result_select(e),this.search_field.focus()},o.prototype.search_results_mouseover=function(e){e=a(e.target).hasClass("active-result")?a(e.target):a(e.target).parents(".active-result").first();if(e)return this.result_do_highlight(e)},o.prototype.search_results_mouseout=function(e){if(a(e.target).hasClass("active-result")||a(e.target).parents(".active-result").first())return this.result_clear_highlight()},o.prototype.choice_build=function(e){var t,n=a("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(e)+"</span>");return e.disabled?n.addClass("search-choice-disabled"):((e=a("<a />",{class:"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",(t=this,function(e){return t.choice_destroy_link_click(e)})),n.append(e)),this.search_container.before(n)},o.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(a(e.target))},o.prototype.choice_destroy=function(e){if(this.result_deselect(e[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&0<this.choices_count()&&this.get_search_field_value().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},o.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},o.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},o.prototype.result_select=function(e){var t;if(this.result_highlight)return t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),t.addClass("result-selected"),(t=this.results_data[t[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[t.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(t):this.single_set_selected_text(this.choice_label(t)),this.is_multiple&&(!this.hide_results_on_select||e.metaKey||e.ctrlKey)?e.metaKey||e.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),!this.is_multiple&&this.form_field.selectedIndex===this.current_selectedIndex||this.trigger_form_field_change({selected:this.form_field.options[t.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())},o.prototype.single_set_selected_text=function(e){return(e=null==e?this.default_text:e)===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(e)},o.prototype.result_deselect=function(e){e=this.results_data[e];return!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},o.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},o.prototype.get_search_field_value=function(){return this.search_field.val()},o.prototype.get_search_text=function(){return a.trim(this.get_search_field_value())},o.prototype.escape_html=function(e){return a("<div/>").text(e).html()},o.prototype.winnow_results_set_highlight=function(){var e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=(e.length?e:this.search_results.find(".active-result")).first();if(null!=e)return this.result_do_highlight(e)},o.prototype.no_results=function(e){e=this.get_no_results_html(e);return this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},o.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},o.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},o.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(e.first()):(0<this.choices_count()&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},o.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last()).length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},o.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},o.prototype.search_field_scale=function(){var e,t,n,i,o,s,r;if(this.is_multiple){for(o={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},t=0,n=(s=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;t<n;t++)o[i=s[t]]=this.search_field.css(i);return(e=a("<div />").css(o)).text(this.get_search_field_value()),a("body").append(e),r=e.width()+25,e.remove(),this.container.is(":visible")&&(r=Math.min(this.container.outerWidth()-10,r)),this.search_field.width(r)}},o.prototype.trigger_form_field_change=function(e){return this.form_field_jq.trigger("input",e),this.form_field_jq.trigger("change",e)},o}()}.call(this),function(r){"use strict";function i(e,t,n){this.init(e,t,n)}function e(){this.rules=[]}r.extend(i.prototype,{init:function(e,t,n){this.controller=e,this.condition=t,this.value=n,this.rules=[],this.controls=[]},evalCondition:function(e,t,n,i,o){if("=="==n)return this.checkBoolean(i)==this.checkBoolean(o);if("!="==n)return this.checkBoolean(i)!=this.checkBoolean(o);if(">="==n)return Number(o)>=Number(i);if("<="==n)return Number(o)<=Number(i);if(">"==n)return Number(o)>Number(i);if("<"==n)return Number(o)<Number(i);if("()"==n)return window[i](e,t,o);if("any"==n){if(r.isArray(o)){for(var s=o.length-1;0<=s;s--)if(-1!==r.inArray(o[s],i.split(",")))return!0}else if(-1!==r.inArray(o,i.split(",")))return!0}else if("not-any"==n)if(r.isArray(o)){for(s=o.length-1;0<=s;s--)if(-1==r.inArray(o[s],i.split(",")))return!0}else if(-1==r.inArray(o,i.split(",")))return!0;return!1},checkBoolean:function(e){switch(e){case!0:case"true":case 1:case"1":e=!0;break;case null:case!1:case"false":case 0:case"0":e=!1}return e},checkCondition:function(e){if(!this.condition)return!0;var t=e.find(this.controller),n=this.getControlValue(e,t);return void 0!==n&&(n=this.normalizeValue(t,this.value,n),this.evalCondition(e,t,this.condition,this.value,n))},normalizeValue:function(e,t,n){return"number"==typeof t?parseFloat(n):n},getControlValue:function(e,t){return 1<t.length&&("radio"==t.attr("type")||"checkbox"==t.attr("type"))?t.filter(":checked").map(function(){return this.value}).get():"checkbox"==t.attr("type")||"radio"==t.attr("type")?t.is(":checked"):t.val()},createRule:function(e,t,n){e=new i(e,t,n);return this.rules.push(e),e},include:function(e){this.controls.push(e)},applyRule:function(n,e){var e=void 0===e?this.checkCondition(n):e,t=r.map(this.controls,function(e,t){return n.find(e)});e?(r(t).each(function(){r(this).removeClass("csf-depend-on")}),r(this.rules).each(function(){this.applyRule(n)})):(r(t).each(function(){r(this).addClass("csf-depend-on")}),r(this.rules).each(function(){this.applyRule(n,!1)}))}}),r.extend(e.prototype,{createRule:function(e,t,n){e=new i(e,t,n);return this.rules.push(e),e},applyRules:function(e){r(this.rules).each(function(){this.applyRule(e)})}}),r.csf_deps={createRuleset:function(){return new e},enable:function(t,n,i){return t.on("change keyup",function(e){e=e.target.getAttribute("data-depend-id")||e.target.getAttribute("data-sub-depend-id");-1!==i.indexOf(e)&&n.applyRules(t)}),n.applyRules(t),!0}}}(jQuery),function(e,t){var n;"function"==typeof define&&define.amd?define(["exports","jquery"],t):"undefined"!=typeof exports?(n=require("jquery"),t(exports,n)):t(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t){var a={validate:/^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,named:/^[a-zA-Z0-9_-]+$/,push:/^$/,fixed:/^\d+$/};function n(i,e){var t={},o={};function s(e,t,n){return e[t]=n,e}function n(e,t){for(var n,i=e.match(a.key);void 0!==(n=i.pop());)a.push.test(n)?t=s([],function(e){void 0===o[e]&&(o[e]=0);return o[e]++}(e.replace(/\[\]$/,"")),t):a.fixed.test(n)?t=s([],n,t):a.named.test(n)&&(t=s({},n,t));return t}function r(){return t}this.addPair=function(e){return a.validate.test(e.name)&&(e=n(e.name,e.value),t=i.extend(!0,t,e)),this},this.addPairs=function(e){if(!i.isArray(e))throw new Error("formSerializer.addPairs expects an Array");for(var t=0,n=e.length;t<n;t++)this.addPair(e[t]);return this},this.serialize=r,this.serializeJSON=function(){return JSON.stringify(t)}}return n.patterns=a,n.serializeObject=function(){return new n(t).addPairs(this.serializeArray()).serialize()},n.serializeJSON=function(){return new n(t).addPairs(this.serializeArray()).serializeJSON()},void 0!==t.fn&&(t.fn.serializeObjectCSF=n.serializeObject,t.fn.serializeJSONCSF=n.serializeJSON),e.FormSerializer=n});