{e.classList.remove(...i)})):e.classList.remove(...i)}(this.$el.querySelectorAll(\".air-datepicker-nav--action\"),\"-disabled-\")}_buildBaseHtml(){let{prevHtml:e,nextHtml:t}=this.opts;this.$el.innerHTML=`${e}
${t}
`}get isNavIsFunction(){let{navTitles:e}=this.opts;return Object.keys(e).find((t=>\"function\"==typeof e[t]))}}var x={today:{content:e=>e.locale.today,onClick:e=>e.setViewDate(new Date)},clear:{content:e=>e.locale.clear,onClick:e=>e.clear()}};class H{constructor(e){let{dp:t,opts:i}=e;this.dp=t,this.opts=i,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=n({className:\"air-datepicker-buttons\"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML=\"\",this}generateButtons(){let{buttons:e}=this.opts;Array.isArray(e)||(e=[e]),e.forEach((e=>{let t=e;\"string\"==typeof e&&x[e]&&(t=x[e]);let i=this.createButton(t);t.onClick&&this.attachEventToButton(i,t.onClick),this.$el.appendChild(i)}))}attachEventToButton(e,t){e.addEventListener(\"click\",(()=>{t(this.dp)}))}createButton(e){let{content:t,className:i,tagName:s=\"button\",attrs:a={}}=e;return n({tagName:s,innerHtml:`${\"function\"==typeof t?t(this.dp):t}`,className:u(\"air-datepicker-button\",i),attrs:a})}render(){this.generateButtons()}}function E(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,\"string\");if(\"object\"!=typeof s)return s;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class L{constructor(){let{opts:e,dp:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};E(this,\"toggleTimepickerIsActive\",(e=>{this.dp.timepickerIsActive=e})),E(this,\"onChangeSelectedDate\",(e=>{let{date:t,updateTime:i=!1}=e;t&&(this.setMinMaxTime(t),this.setCurrentTime(!!i&&t),this.addTimeToDate(t))})),E(this,\"onChangeLastSelectedDate\",(e=>{e&&(this.setTime(e),this.render())})),E(this,\"onChangeInputRange\",(e=>{let t=e.target;this[t.getAttribute(\"name\")]=t.value,this.updateText(),this.dp.trigger(i.eventChangeTime,{hours:this.hours,minutes:this.minutes})})),E(this,\"onMouseEnterLeave\",(e=>{let t=e.target.getAttribute(\"name\"),i=this.$minutesText;\"hours\"===t&&(i=this.$hoursText),i.classList.toggle(\"-focus-\")})),E(this,\"onFocus\",(()=>{this.toggleTimepickerIsActive(!0)})),E(this,\"onBlur\",(()=>{this.toggleTimepickerIsActive(!1)})),this.opts=e,this.dp=t;let{timeFormat:s}=this.dp.locale;s&&(s.match(k(\"h\"))||s.match(k(\"hh\")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(i.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let e=\"input\";navigator.userAgent.match(/trident/gi)&&(e=\"change\"),D(this.$ranges,e,this.onChangeInputRange),D(this.$ranges,\"mouseenter\",this.onMouseEnterLeave),D(this.$ranges,\"mouseleave\",this.onMouseEnterLeave),D(this.$ranges,\"focus\",this.onFocus),D(this.$ranges,\"mousedown\",this.onFocus),D(this.$ranges,\"blur\",this.onBlur)}createElement(){this.$el=n({className:u(\"air-datepicker-time\",{\"-am-pm-\":this.dp.ampm})})}destroy(){this.dp.off(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(i.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:e,hours:t,displayHours:i,minutes:s,minHours:a,minMinutes:n,maxHours:r,maxMinutes:o,dayPeriod:h,opts:{hoursStep:l,minutesStep:c}}=this;this.$el.innerHTML=` ${d(i)} : ${d(s)} `+(e?`${h}`:\"\")+'
`}defineDOM(){let e=e=>a(e,this.$el);this.$ranges=this.$el.querySelectorAll('[type=\"range\"]'),this.$hours=e('[name=\"hours\"]'),this.$minutes=e('[name=\"minutes\"]'),this.$hoursText=e(\".air-datepicker-time--current-hours\"),this.$minutesText=e(\".air-datepicker-time--current-minutes\"),this.$ampm=e(\".air-datepicker-time--current-ampm\")}setTime(e){this.setMinMaxTime(e),this.setCurrentTime(e)}addTimeToDate(e){e&&(e.setHours(this.hours),e.setMinutes(this.minutes))}setMinMaxTime(e){if(this.setMinMaxTimeFromOptions(),e){let{minDate:t,maxDate:i}=this.dp;t&&p(e,t)&&this.setMinTimeFromMinDate(t),i&&p(e,i)&&this.setMaxTimeFromMaxDate(i)}}setCurrentTime(e){let{hours:t,minutes:i}=e?h(e):this;this.hours=f(t,this.minHours,this.maxHours),this.minutes=f(i,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:e,minMinutes:t,maxHours:i,maxMinutes:s}=this.opts;this.minHours=f(e,0,23),this.minMinutes=f(t,0,59),this.maxHours=f(i,0,23),this.maxMinutes=f(s,0,59)}setMinTimeFromMinDate(e){let{lastSelectedDate:t}=this.dp;this.minHours=e.getHours(),t&&t.getHours()>e.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=e.getMinutes()}setMaxTimeFromMaxDate(e){let{lastSelectedDate:t}=this.dp;this.maxHours=e.getHours(),t&&t.getHours()e.month++],[[[\"Control\",\"ArrowLeft\"],[\"Control\",\"ArrowDown\"]],e=>e.month--],[[[\"Shift\",\"ArrowRight\"],[\"Shift\",\"ArrowUp\"]],e=>e.year++],[[[\"Shift\",\"ArrowLeft\"],[\"Shift\",\"ArrowDown\"]],e=>e.year--],[[[\"Alt\",\"ArrowRight\"],[\"Alt\",\"ArrowUp\"]],e=>e.year+=10],[[[\"Alt\",\"ArrowLeft\"],[\"Alt\",\"ArrowDown\"]],e=>e.year-=10],[[\"Control\",\"Shift\",\"ArrowUp\"],(e,t)=>t.up()]])),O(this,\"handleHotKey\",(e=>{let t=this.hotKeys.get(e),i=h(this.getInitialFocusDate());t(i,this.dp);let{year:s,month:a,date:n}=i,r=o(new Date(s,a));r{let e=!1,t=this.pressedKeys.size,i=e=>this.pressedKeys.has(e);for(let[s]of this.hotKeys){if(e)break;if(Array.isArray(s[0]))s.forEach((a=>{e||t!==a.length||(e=a.every(i)&&s)}));else{if(t!==s.length)continue;e=s.every(i)&&s}}return e})),O(this,\"isArrow\",(e=>e>=37&&e<=40)),O(this,\"onKeyDown\",(e=>{let{key:t,which:i}=e,{dp:s,dp:{focusDate:a},opts:n}=this;this.registerKey(t);let r=this.isHotKeyPressed();if(r)return e.preventDefault(),void this.handleHotKey(r);if(this.isArrow(i))return e.preventDefault(),void this.focusNextCell(t);if(\"Enter\"===t){if(s.currentView!==n.minView)return void s.down();if(a){let e=s._checkIfDateIsSelected(a);return void(e?s._handleAlreadySelectedDates(e,a):s.selectDate(a))}}\"Escape\"===t&&this.dp.hide()})),O(this,\"onKeyUp\",(e=>{this.removeKey(e.key)})),this.dp=t,this.opts=i,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:e}=this.dp;e.addEventListener(\"keydown\",this.onKeyDown),e.addEventListener(\"keyup\",this.onKeyUp)}destroy(){let{$el:e}=this.dp;e.removeEventListener(\"keydown\",this.onKeyDown),e.removeEventListener(\"keyup\",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:e,currentView:t,selectedDates:s,parsedViewDate:{year:a,month:n}}=this.dp,r=e||s[s.length-1];if(!r)switch(t){case i.days:r=new Date(a,n,(new Date).getDate());break;case i.months:r=new Date(a,n,1);break;case i.years:r=new Date(a,0,1)}return r}focusNextCell(e){let t=this.getInitialFocusDate(),{currentView:s}=this.dp,{days:a,months:n,years:r}=i,o=h(t),l=o.year,d=o.month,c=o.date;switch(e){case\"ArrowLeft\":s===a&&(c-=1),s===n&&(d-=1),s===r&&(l-=1);break;case\"ArrowUp\":s===a&&(c-=7),s===n&&(d-=3),s===r&&(l-=4);break;case\"ArrowRight\":s===a&&(c+=1),s===n&&(d+=1),s===r&&(l+=1);break;case\"ArrowDown\":s===a&&(c+=7),s===n&&(d+=3),s===r&&(l+=4)}let u=this.dp.getClampedDate(new Date(l,d,c));this.dp.setFocusDate(u,{viewDateTransition:!0})}registerKey(e){this.pressedKeys.add(e)}removeKey(e){this.pressedKeys.delete(e)}}let N={on(e,t){this.__events||(this.__events={}),this.__events[e]?this.__events[e].push(t):this.__events[e]=[t]},off(e,t){this.__events&&this.__events[e]&&(this.__events[e]=this.__events[e].filter((e=>e!==t)))},removeAllEvents(){this.__events={}},trigger(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s{e(...i)}))}};function I(e,t,i){return(t=function(e){var t=function(e,t){if(\"object\"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,\"string\");if(\"object\"!=typeof s)return s;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return String(e)}(e);return\"symbol\"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}let P=\"\",j=\"\",B=!1;class R{static buildGlobalContainer(e){B=!0,P=n({className:e,id:e}),a(\"body\").appendChild(P)}constructor(e,t){var r=this;if(I(this,\"viewIndexes\",[i.days,i.months,i.years]),I(this,\"next\",(()=>{let{year:e,month:t}=this.parsedViewDate;switch(this.currentView){case i.days:this.setViewDate(new Date(e,t+1,1));break;case i.months:this.setViewDate(new Date(e+1,t,1));break;case i.years:this.setViewDate(new Date(e+10,0,1))}})),I(this,\"prev\",(()=>{let{year:e,month:t}=this.parsedViewDate;switch(this.currentView){case i.days:this.setViewDate(new Date(e,t-1,1));break;case i.months:this.setViewDate(new Date(e-1,t,1));break;case i.years:this.setViewDate(new Date(e-10,0,1))}})),I(this,\"_finishHide\",(()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)})),I(this,\"setPosition\",(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(\"function\"==typeof(e=e||r.opts.position))return void(r.customHide=e({$datepicker:r.$datepicker,$target:r.$el,$pointer:r.$pointer,isViewChange:t,done:r._finishHide}));let i,s,{isMobile:a}=r.opts,n=r.$el.getBoundingClientRect(),o=r.$el.getBoundingClientRect(),h=r.$datepicker.offsetParent,l=r.$el.offsetParent,d=r.$datepicker.getBoundingClientRect(),c=e.split(\" \"),u=window.scrollY,p=window.scrollX,m=r.opts.offset,v=c[0],g=c[1];if(a)r.$datepicker.style.cssText=\"left: 50%; top: 50%\";else{if(h===l&&h!==document.body&&(o={top:r.$el.offsetTop,left:r.$el.offsetLeft,width:n.width,height:r.$el.offsetHeight},u=0,p=0),h!==l&&h!==document.body){let e=h.getBoundingClientRect();o={top:n.top-e.top,left:n.left-e.left,width:n.width,height:n.height},u=0,p=0}switch(v){case\"top\":i=o.top-d.height-m;break;case\"right\":s=o.left+o.width+m;break;case\"bottom\":i=o.top+o.height+m;break;case\"left\":s=o.left-d.width-m}switch(g){case\"top\":i=o.top;break;case\"right\":s=o.left+o.width-d.width;break;case\"bottom\":i=o.top+o.height-d.height;break;case\"left\":s=o.left;break;case\"center\":/left|right/.test(v)?i=o.top+o.height/2-d.height/2:s=o.left+o.width/2-d.width/2}r.$datepicker.style.cssText=`left: ${s+p}px; top: ${i+u}px`}})),I(this,\"_setInputValue\",(()=>{let{opts:e,$altField:t,locale:{dateFormat:i}}=this,{altFieldDateFormat:s,altField:a}=e;a&&t&&(t.value=this._getInputValue(s)),this.$el.value=this._getInputValue(i)})),I(this,\"_getInputValue\",(e=>{let{selectedDates:t,opts:i}=this,{multipleDates:s,multipleDatesSeparator:a}=i;if(!t.length)return\"\";let n=\"function\"==typeof e,r=n?e(s?t:t[0]):t.map((t=>this.formatDate(t,e)));return r=n?r:r.join(a),r})),I(this,\"_checkIfDateIsSelected\",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.days,s=!1;return r.selectedDates.some((i=>{let a=p(e,i,t);return s=a&&i,a})),s})),I(this,\"_scheduleCallAfterTransition\",(e=>{this._cancelScheduledCall(),e&&e(!1),this._onTransitionEnd=()=>{e&&e(!0)},this.$datepicker.addEventListener(\"transitionend\",this._onTransitionEnd,{once:!0})})),I(this,\"_cancelScheduledCall\",(()=>{this.$datepicker.removeEventListener(\"transitionend\",this._onTransitionEnd)})),I(this,\"setViewDate\",(e=>{if(!((e=b(e))instanceof Date))return;if(p(e,this.viewDate))return;let t=this.viewDate;this.viewDate=e;let{onChangeViewDate:s}=this.opts;if(s){let{month:e,year:t}=this.parsedViewDate;s({month:e,year:t,decade:this.curDecade})}this.trigger(i.eventChangeViewDate,e,t)})),I(this,\"setFocusDate\",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!e||(e=b(e))instanceof Date)&&(r.focusDate=e,r.trigger(i.eventChangeFocusDate,e,t))})),I(this,\"setCurrentView\",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.viewIndexes.includes(e)){if(r.currentView=e,r.elIsInput&&r.visible&&r.setPosition(void 0,!0),r.trigger(i.eventChangeCurrentView,e),!r.views[e]){let t=r.views[e]=new T({dp:r,opts:r.opts,type:e});r.shouldUpdateDOM&&r.$content.appendChild(t.$el)}r.opts.onChangeView&&!t.silent&&r.opts.onChangeView(e)}})),I(this,\"_updateLastSelectedDate\",(e=>{this.lastSelectedDate=e,this.trigger(i.eventChangeLastSelectedDate,e)})),I(this,\"destroy\",(()=>{if(this.isDestroyed)return;let{showEvent:e,isMobile:t}=this.opts,i=this.$datepicker.parentNode;i&&i.removeChild(this.$datepicker),this.$el.removeEventListener(e,this._onFocus),this.$el.removeEventListener(\"blur\",this._onBlur),window.removeEventListener(\"resize\",this._onResize),t&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0})),I(this,\"update\",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=w({},r.opts),{silent:a}=t;w(r.opts,e);let{timepicker:n,buttons:o,range:h,selectedDates:l,isMobile:d}=r.opts,c=r.visible||r.treatAsInline;r._createMinMaxDates(),r._limitViewDateByMaxMinDates(),r._handleLocale(),l&&(r.selectedDates=[],r.selectDate(l,{silent:a})),e.view&&r.setCurrentView(e.view,{silent:a}),r._setInputValue(),s.range&&!h?(r.rangeDateTo=!1,r.rangeDateFrom=!1):!s.range&&h&&r.selectedDates.length&&(r.rangeDateFrom=r.selectedDates[0],r.rangeDateTo=r.selectedDates[1]),s.timepicker&&!n?(c&&r.timepicker.destroy(),r.timepicker=!1,r.$timepicker.parentNode.removeChild(r.$timepicker)):!s.timepicker&&n&&r._addTimepicker(),!s.buttons&&o?r._addButtons():s.buttons&&!o?(r.buttons.destroy(),r.$buttons.parentNode.removeChild(r.$buttons)):c&&s.buttons&&o&&r.buttons.clearHtml().render(),!s.isMobile&&d?(r.treatAsInline||j||r._createMobileOverlay(),r._addMobileAttributes(),r.visible&&r._showMobileOverlay()):s.isMobile&&!d&&(r._removeMobileAttributes(),r.visible&&(j.classList.remove(\"-active-\"),\"function\"!=typeof r.opts.position&&r.setPosition())),c&&(r.nav.update(),r.views[r.currentView].render(),r.currentView===i.days&&r.views[r.currentView].renderDayNames())})),I(this,\"disableDate\",((e,t)=>{(Array.isArray(e)?e:[e]).forEach((e=>{let i=b(e);if(!i)return;let s=t?\"delete\":\"add\";this.disabledDates[s](this.formatDate(i,\"yyyy-MM-dd\"));let a=this.getCell(i,this.currentViewSingular);a&&a.adpCell.render()}),[])})),I(this,\"enableDate\",(e=>{this.disableDate(e,!0)})),I(this,\"isDateDisabled\",(e=>{let t=b(e);return this.disabledDates.has(this.formatDate(t,\"yyyy-MM-dd\"))})),I(this,\"isOtherMonth\",(e=>{let{month:t}=h(e);return t!==this.parsedViewDate.month})),I(this,\"isOtherYear\",(e=>{let{year:t}=h(e);return t!==this.parsedViewDate.year})),I(this,\"isOtherDecade\",(e=>{let{year:t}=h(e),[i,s]=c(this.viewDate);return ts})),I(this,\"_onChangeSelectedDate\",(e=>{let{silent:t}=e;setTimeout((()=>{this._setInputValue(),this.opts.onSelect&&!t&&this._triggerOnSelect()}))})),I(this,\"_onChangeFocusedDate\",(function(e){let{viewDateTransition:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;let i=!1;t&&(i=r.isOtherMonth(e)||r.isOtherYear(e)||r.isOtherDecade(e)),i&&r.setViewDate(e),r.opts.onFocus&&r.opts.onFocus({datepicker:r,date:e})})),I(this,\"_onChangeTime\",(e=>{let{hours:t,minutes:i}=e,s=new Date,{lastSelectedDate:a,opts:{onSelect:n}}=this,r=a;a||(r=s);let o=this.getCell(r,this.currentViewSingular),h=o&&o.adpCell;h&&h.isDisabled||(r.setHours(t),r.setMinutes(i),a?(this._setInputValue(),n&&this._triggerOnSelect()):this.selectDate(r))})),I(this,\"_onFocus\",(e=>{this.visible||this.show()})),I(this,\"_onBlur\",(e=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()})),I(this,\"_onMouseDown\",(e=>{this.inFocus=!0})),I(this,\"_onMouseUp\",(e=>{this.inFocus=!1,this.$el.focus()})),I(this,\"_onResize\",(()=>{this.visible&&\"function\"!=typeof this.opts.position&&this.setPosition()})),I(this,\"_onClickOverlay\",(()=>{this.visible&&this.hide()})),I(this,\"getViewDates\",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.days;return T.getDatesFunction(e)(r)})),I(this,\"isWeekend\",(e=>this.opts.weekends.includes(e))),I(this,\"getClampedDate\",(e=>{let{minDate:t,maxDate:i}=this,s=e;return i&&m(e,i)?s=i:t&&v(e,t)&&(s=t),s})),this.$el=a(e),!this.$el)return;this.$datepicker=n({className:\"air-datepicker\"}),this.opts=w({},s,t),this.$customContainer=!!this.opts.container&&a(this.opts.container),this.$altField=a(this.opts.altField||!1);let{view:o,startDate:l}=this.opts;l||(this.opts.startDate=new Date),\"INPUT\"===this.$el.nodeName&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=b(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute(\"readonly\"),this.customHide=!1,this.currentView=o,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom=\"\",this.rangeDateTo=\"\",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:e,treatAsInline:t,opts:{inline:i,isMobile:s,selectedDates:n,keyboardNav:r,onlyTimepicker:o}}=this,h=a(\"body\");(!B||B&&P&&!h.contains(P))&&!i&&this.elIsInput&&!this.$customContainer&&R.buildGlobalContainer(R.defaultGlobalContainerId),!s||j||t||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(i||this._bindEvents(),r&&!o&&(this.keyboardNav=new A({dp:this,opts:e}))),n&&this.selectDate(n,{silent:!0}),this.opts.visible&&!t&&this.show(),s&&!t&&this.$el.setAttribute(\"readonly\",!0),t&&this._createComponents()}_createMobileOverlay(){j=n({className:\"air-datepicker-overlay\"}),P.appendChild(j)}_createComponents(){let{opts:e,treatAsInline:t,opts:{inline:i,buttons:s,timepicker:a,position:n,classes:r,onlyTimepicker:o,isMobile:h}}=this;this._buildBaseHtml(),this.elIsInput&&(i||this._setPositionClasses(n)),!i&&this.elIsInput||this.$datepicker.classList.add(\"-inline-\"),r&&this.$datepicker.classList.add(...r.split(\" \")),o&&this.$datepicker.classList.add(\"-only-timepicker-\"),h&&!t&&this._addMobileAttributes(),this.views[this.currentView]=new T({dp:this,type:this.currentView,opts:e}),this.nav=new V({dp:this,opts:e}),a&&this._addTimepicker(),s&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let e in this.views)this.views[e].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){j.addEventListener(\"click\",this._onClickOverlay),this.$datepicker.classList.add(\"-is-mobile-\"),this.$el.setAttribute(\"readonly\",!0)}_removeMobileAttributes(){j.removeEventListener(\"click\",this._onClickOverlay),this.$datepicker.classList.remove(\"-is-mobile-\"),this.initialReadonly||\"\"===this.initialReadonly||this.$el.removeAttribute(\"readonly\")}_createMinMaxDates(){let{minDate:e,maxDate:t}=this.opts;this.minDate=!!e&&b(e),this.maxDate=!!t&&b(t)}_addTimepicker(){this.$timepicker=n({className:\"air-datepicker--time\"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new L({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=n({className:\"air-datepicker--buttons\"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new H({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(i.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(i.eventChangeFocusDate,this._onChangeFocusedDate),this.on(i.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:e}=this.opts;var t,i;this.elIsInput?e?(t=this.$datepicker,(i=this.$el).parentNode.insertBefore(t,i.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='',this.$content=a(\".air-datepicker--content\",this.$datepicker),this.$pointer=a(\".air-datepicker--pointer\",this.$datepicker),this.$nav=a(\".air-datepicker--navigation\",this.$datepicker)}_handleLocale(){let{locale:e,dateFormat:t,firstDay:i,timepicker:s,onlyTimepicker:a,timeFormat:n,dateTimeSeparator:r}=this.opts;var o;this.locale=(o=e,JSON.parse(JSON.stringify(o))),t&&(this.locale.dateFormat=t),void 0!==n&&\"\"!==n&&(this.locale.timeFormat=n);let{timeFormat:h}=this.locale;if(\"\"!==i&&(this.locale.firstDay=i),s&&\"function\"!=typeof t){let e=h?r:\"\";this.locale.dateFormat=[this.locale.dateFormat,h||\"\"].join(e)}a&&\"function\"!=typeof t&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(e){if(\"function\"==typeof e)return void this.$datepicker.classList.add(\"-custom-position-\");let t=(e=e.split(\" \"))[0],i=`air-datepicker -${t}-${e[1]}- -from-${t}-`;this.$datepicker.classList.add(...i.split(\" \"))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener(\"blur\",this._onBlur),this.$datepicker.addEventListener(\"mousedown\",this._onMouseDown),this.$datepicker.addEventListener(\"mouseup\",this._onMouseUp),window.addEventListener(\"resize\",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:e,minDate:t,maxDate:i}=this;i&&m(e,i)&&this.setViewDate(i),t&&v(e,t)&&this.setViewDate(t)}formatDate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewDate,t=arguments.length>1?arguments[1]:void 0;if(e=b(e),!(e instanceof Date))return;let i=t,s=this.locale,a=h(e),n=a.dayPeriod,r=c(e),o=R.replacer,l={T:e.getTime(),m:a.minutes,mm:a.fullMinutes,h:a.hours12,hh:a.fullHours12,H:a.hours,HH:a.fullHours,aa:n,AA:n.toUpperCase(),E:s.daysShort[a.day],EEEE:s.days[a.day],d:a.date,dd:a.fullDate,M:a.month+1,MM:a.fullMonth,MMM:s.monthsShort[a.month],MMMM:s.months[a.month],yy:a.year.toString().slice(-2),yyyy:a.year,yyyy1:r[0],yyyy2:r[1]};for(let[e,t]of Object.entries(l))i=o(i,k(e),t);return i}down(e){this._handleUpDownActions(e,\"down\")}up(e){this._handleUpDownActions(e,\"up\")}selectDate(e){let t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{currentView:a,parsedViewDate:n,selectedDates:r}=this,{updateTime:o}=s,{moveToOtherMonthsOnSelect:h,moveToOtherYearsOnSelect:l,multipleDates:d,range:c,autoClose:u,onBeforeSelect:p}=this.opts,v=r.length;if(Array.isArray(e))return e.forEach((e=>{this.selectDate(e,s)})),new Promise((e=>{setTimeout(e)}));if((e=b(e))instanceof Date){if(p&&!p({date:e,datepicker:this}))return Promise.resolve();if(a===i.days&&e.getMonth()!==n.month&&h&&(t=new Date(e.getFullYear(),e.getMonth(),1)),a===i.years&&e.getFullYear()!==n.year&&l&&(t=new Date(e.getFullYear(),0,1)),t&&this.setViewDate(t),d&&!c){if(v===d)return;this._checkIfDateIsSelected(e)||r.push(e)}else if(c)switch(v){case 1:r.push(e),this.rangeDateTo||(this.rangeDateTo=e),m(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=e),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[e],this.rangeDateFrom=e,this.rangeDateTo=\"\";break;default:this.selectedDates=[e],this.rangeDateFrom=e}else this.selectedDates=[e];return this.trigger(i.eventChangeSelectedDate,{action:i.actionSelectDate,silent:null==s?void 0:s.silent,date:e,updateTime:o}),this._updateLastSelectedDate(e),u&&!this.timepickerIsActive&&this.visible&&(d||c?c&&1===v&&this.hide():this.hide()),new Promise((e=>{setTimeout(e)}))}}unselectDate(e){let t=this.selectedDates,s=this;if((e=b(e))instanceof Date)return t.some(((a,n)=>{if(p(a,e))return t.splice(n,1),s.selectedDates.length?(s.rangeDateTo=\"\",s.rangeDateFrom=t[0],s._updateLastSelectedDate(s.selectedDates[s.selectedDates.length-1])):(s.rangeDateFrom=\"\",s.rangeDateTo=\"\",s._updateLastSelectedDate(!1)),this.trigger(i.eventChangeSelectedDate,{action:i.actionUnselectDate,date:e}),!0}))}replaceDate(e,t){let s=this.selectedDates.find((t=>p(t,e,this.currentView))),a=this.selectedDates.indexOf(s);a<0||p(this.selectedDates[a],t,this.currentView)||(this.selectedDates[a]=t,this.trigger(i.eventChangeSelectedDate,{action:i.actionSelectDate,date:t,updateTime:!0}),this._updateLastSelectedDate(t))}clear(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(i.eventChangeSelectedDate,{action:i.actionUnselectDate,silent:e.silent}),new Promise((e=>{setTimeout(e)}))}show(){let{onShow:e,isMobile:t}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add(\"-active-\"),this.visible=!0,e&&this._scheduleCallAfterTransition(e),t&&this._showMobileOverlay()}hide(){let{onHide:e,isMobile:t}=this.opts,i=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove(\"-active-\"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition((t=>{!this.customHide&&(t&&i||!t&&!i)&&this._finishHide(),e&&e(t)})),t&&j.classList.remove(\"-active-\")}_triggerOnSelect(){let e=[],t=[],{selectedDates:i,locale:s,opts:{onSelect:a,multipleDates:n,range:r}}=this,o=n||r,h=\"function\"==typeof s.dateFormat;i.length&&(e=i.map(g),t=h?n?s.dateFormat(e):e.map((e=>s.dateFormat(e))):e.map((e=>this.formatDate(e,s.dateFormat)))),a({date:o?e:e[0],formattedDate:o?t:t[0],datepicker:this})}_handleAlreadySelectedDates(e,t){let{selectedDates:i,rangeDateFrom:s,rangeDateTo:a}=this,{range:n,toggleSelected:r}=this.opts,o=i.length,h=\"function\"==typeof r?r({datepicker:this,date:t}):r,l=Boolean(n&&1===o&&e),d=l?g(t):t;n&&!h&&(2!==o&&this.selectDate(d),2===o&&p(s,a))||(h?this.unselectDate(d):this._updateLastSelectedDate(l?d:e))}_handleUpDownActions(e,t){if(!((e=b(e||this.focusDate||this.viewDate))instanceof Date))return;let i=\"up\"===t?this.viewIndex+1:this.viewIndex-1;i>2&&(i=2),i<0&&(i=0),this.setViewDate(new Date(e.getFullYear(),e.getMonth(),1)),this.setCurrentView(this.viewIndexes[i])}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.day;if(!((e=b(e))instanceof Date))return;let{year:s,month:a,date:n}=h(e),r=`[data-year=\"${s}\"]`,o=`[data-month=\"${a}\"]`,l={[i.day]:`${r}${o}[data-date=\"${n}\"]`,[i.month]:`${r}${o}`,[i.year]:`${r}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(l[t]):void 0}_showMobileOverlay(){j.classList.add(\"-active-\")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue(\"transition-duration\").split(\", \").reduce(((e,t)=>parseFloat(t)+e),0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return h(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return c(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===i.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===i.days}get $container(){return this.$customContainer||P}static replacer(e,t,i){return e.replace(t,(function(e,t,s,a){return t+i+a}))}}var K;return I(R,\"defaults\",s),I(R,\"version\",\"3.5.3\"),I(R,\"defaultGlobalContainerId\",\"air-datepicker-global-container\"),K=R.prototype,Object.assign(K,N),t.default}()}));","import AirDatepicker from './air-datepicker';\nexport default AirDatepicker","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n daysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n today: 'Today',\n clear: 'Clear',\n dateFormat: 'MM/dd/yyyy',\n timeFormat: 'hh:mm aa',\n firstDay: 0\n};\nexports.default = _default;","/*! BigText - v1.0.1 - 2017-06-01\n * https://github.com/zachleat/bigtext\n * Copyright (c) 2017 Zach Leatherman (@zachleat)\n * MIT License */\n\n(function(window, $) {\n \"use strict\";\n\n var counter = 0,\n $headCache = $('head'),\n oldBigText = window.BigText,\n oldjQueryMethod = $.fn.bigtext,\n BigText = {\n DEBUG_MODE: false,\n DEFAULT_MIN_FONT_SIZE_PX: null,\n DEFAULT_MAX_FONT_SIZE_PX: 528,\n GLOBAL_STYLE_ID: 'bigtext-style',\n STYLE_ID: 'bigtext-id',\n LINE_CLASS_PREFIX: 'bigtext-line',\n EXEMPT_CLASS: 'bigtext-exempt',\n noConflict: function(restore)\n {\n if(restore) {\n $.fn.bigtext = oldjQueryMethod;\n window.BigText = oldBigText;\n }\n return BigText;\n },\n supports: {\n wholeNumberFontSizeOnly: (function() {\n if( !( 'getComputedStyle' in window ) ) {\n return true;\n }\n var test = $('').css({\n position: 'absolute',\n 'font-size': '14.1px'\n }).insertBefore( $('script').eq(0) ),\n computedStyle = window.getComputedStyle( test[0], null );\n\n var ret = computedStyle && computedStyle.getPropertyValue( 'font-size' ) === '14px';\n test.remove();\n return ret;\n })()\n },\n init: function() {\n if(!$('#'+BigText.GLOBAL_STYLE_ID).length) {\n $headCache.append(BigText.generateStyleTag(BigText.GLOBAL_STYLE_ID, ['.bigtext * { white-space: nowrap; } .bigtext > * { display: block; }',\n '.bigtext .' + BigText.EXEMPT_CLASS + ', .bigtext .' + BigText.EXEMPT_CLASS + ' * { white-space: normal; }']));\n }\n },\n bindResize: function(eventName, resizeFunction) {\n var timeoutId;\n $(window).unbind(eventName).bind(eventName, function() {\n if( timeoutId ) {\n clearTimeout( timeoutId );\n }\n timeoutId = setTimeout( resizeFunction, 100 );\n });\n },\n getStyleId: function(id)\n {\n return BigText.STYLE_ID + '-' + id;\n },\n generateStyleTag: function(id, css)\n {\n return $('').attr('id', id);\n },\n clearCss: function(id)\n {\n var styleId = BigText.getStyleId(id);\n $('#' + styleId).remove();\n },\n generateCss: function(id, linesFontSizes, lineWordSpacings, minFontSizes)\n {\n var css = [];\n\n BigText.clearCss(id);\n\n for(var j=0, k=linesFontSizes.length; j= maxWidth) {\n // console.log(width, ' previous: ' + previousWidth, property + ' at ' + interval, 'prior: ' + (parseFloat(size) - interval), 'new:' + parseFloat(size));\n $line.css(property, '');\n\n if(width === maxWidth) {\n return {\n match: 'exact',\n size: parseFloat((parseFloat(size) - 0.1).toFixed(3))\n };\n }\n\n // Since this is an estimate, we calculate how far over the width we went with the new value.\n // If this is word-spacing (our last resort guess) and the over is less than the under, we keep the higher value.\n // Otherwise, we revert to the underestimate.\n var under = maxWidth - previousWidth,\n over = width - maxWidth;\n\n return {\n match: 'estimate',\n size: parseFloat((parseFloat(size) - (property === 'word-spacing' && previousWidth && ( over < under ) ? 0 : interval)).toFixed(3))\n };\n }\n\n return width;\n },\n calculateSizes: function($t, $children, maxWidth, maxFontSize, minFontSize)\n {\n var $c = $t.clone(true)\n .addClass('bigtext-cloned')\n .css({\n fontFamily: $t.css('font-family'),\n textTransform: $t.css('text-transform'),\n wordSpacing: $t.css('word-spacing'),\n letterSpacing: $t.css('letter-spacing'),\n position: 'absolute',\n left: BigText.DEBUG_MODE ? 0 : -9999,\n top: BigText.DEBUG_MODE ? 0 : -9999\n })\n .appendTo(document.body);\n\n // font-size isn't the only thing we can modify, we can also mess with:\n // word-spacing and letter-spacing. WebKit does not respect subpixel\n // letter-spacing, word-spacing, or font-size.\n // TODO try -webkit-transform: scale() as a workaround.\n var fontSizes = [],\n wordSpacings = [],\n minFontSizes = [],\n ratios = [];\n\n $children.css('float', 'left').each(function() {\n var $line = $(this),\n // TODO replace 8, 4 with a proportional size to the calculated font-size.\n intervals = BigText.supports.wholeNumberFontSizeOnly ? [8, 4, 1] : [8, 4, 1, 0.1],\n lineMax,\n newFontSize;\n\n if($line.hasClass(BigText.EXEMPT_CLASS)) {\n fontSizes.push(null);\n ratios.push(null);\n minFontSizes.push(false);\n return;\n }\n\n // TODO we can cache this ratio?\n var autoGuessSubtraction = 32, // font size in px\n currentFontSize = parseFloat($line.css('font-size')),\n ratio = ( $line.width() / currentFontSize ).toFixed(6);\n\n newFontSize = parseInt( maxWidth / ratio, 10 ) - autoGuessSubtraction;\n\n outer: for(var m=0, n=intervals.length; m maxFontSize) {\n newFontSize = maxFontSize;\n break outer;\n }\n\n lineMax = BigText.testLineDimensions($line, maxWidth, 'font-size', newFontSize + j*intervals[m], intervals[m], 'px', lineMax);\n if(typeof lineMax !== 'number') {\n newFontSize = lineMax.size;\n\n if(lineMax.match === 'exact') {\n break outer;\n }\n break inner;\n }\n }\n }\n\n ratios.push(maxWidth / newFontSize);\n\n if(newFontSize > maxFontSize) {\n fontSizes.push(maxFontSize);\n minFontSizes.push(false);\n } else if(!!minFontSize && newFontSize < minFontSize) {\n fontSizes.push(minFontSize);\n minFontSizes.push(true);\n } else {\n fontSizes.push(newFontSize);\n minFontSizes.push(false);\n }\n }).each(function(lineNumber) {\n var $line = $(this),\n wordSpacing = 0,\n interval = 1,\n maxWordSpacing;\n\n if($line.hasClass(BigText.EXEMPT_CLASS)) {\n wordSpacings.push(null);\n return;\n }\n\n // must re-use font-size, even though it was removed above.\n $line.css('font-size', fontSizes[lineNumber] + 'px');\n\n for(var m=1, n=3; m 1 ) {\n x = utils.modulo( x, this.slideableWidth );\n x -= this.slideableWidth;\n this.shiftWrapCells( x );\n }\n\n this.setTranslateX( x, this.isAnimating );\n this.dispatchScrollEvent();\n};\n\nproto.setTranslateX = function( x, is3d ) {\n x += this.cursorPosition;\n // reverse if right-to-left and using transform\n x = this.options.rightToLeft ? -x : x;\n var translateX = this.getPositionValue( x );\n // use 3D transforms for hardware acceleration on iOS\n // but use 2D when settled, for better font-rendering\n this.slider.style.transform = is3d ?\n 'translate3d(' + translateX + ',0,0)' : 'translateX(' + translateX + ')';\n};\n\nproto.dispatchScrollEvent = function() {\n var firstSlide = this.slides[0];\n if ( !firstSlide ) {\n return;\n }\n var positionX = -this.x - firstSlide.target;\n var progress = positionX / this.slidesWidth;\n this.dispatchEvent( 'scroll', null, [ progress, positionX ] );\n};\n\nproto.positionSliderAtSelected = function() {\n if ( !this.cells.length ) {\n return;\n }\n this.x = -this.selectedSlide.target;\n this.velocity = 0; // stop wobble\n this.positionSlider();\n};\n\nproto.getPositionValue = function( position ) {\n if ( this.options.percentPosition ) {\n // percent position, round to 2 digits, like 12.34%\n return ( Math.round( ( position / this.size.innerWidth ) * 10000 ) * 0.01 ) + '%';\n } else {\n // pixel positioning\n return Math.round( position ) + 'px';\n }\n};\n\nproto.settle = function( previousX ) {\n // keep track of frames where x hasn't moved\n var isResting = !this.isPointerDown &&\n Math.round( this.x * 100 ) == Math.round( previousX * 100 );\n if ( isResting ) {\n this.restingFrames++;\n }\n // stop animating if resting for 3 or more frames\n if ( this.restingFrames > 2 ) {\n this.isAnimating = false;\n delete this.isFreeScrolling;\n // render position with translateX when settled\n this.positionSlider();\n this.dispatchEvent( 'settle', null, [ this.selectedIndex ] );\n }\n};\n\nproto.shiftWrapCells = function( x ) {\n // shift before cells\n var beforeGap = this.cursorPosition + x;\n this._shiftCells( this.beforeShiftCells, beforeGap, -1 );\n // shift after cells\n var afterGap = this.size.innerWidth - ( x + this.slideableWidth + this.cursorPosition );\n this._shiftCells( this.afterShiftCells, afterGap, 1 );\n};\n\nproto._shiftCells = function( cells, gap, shift ) {\n for ( var i = 0; i < cells.length; i++ ) {\n var cell = cells[i];\n var cellShift = gap > 0 ? shift : 0;\n cell.wrapShift( cellShift );\n gap -= cell.size.outerWidth;\n }\n};\n\nproto._unshiftCells = function( cells ) {\n if ( !cells || !cells.length ) {\n return;\n }\n for ( var i = 0; i < cells.length; i++ ) {\n cells[i].wrapShift( 0 );\n }\n};\n\n// -------------------------- physics -------------------------- //\n\nproto.integratePhysics = function() {\n this.x += this.velocity;\n this.velocity *= this.getFrictionFactor();\n};\n\nproto.applyForce = function( force ) {\n this.velocity += force;\n};\n\nproto.getFrictionFactor = function() {\n return 1 - this.options[ this.isFreeScrolling ? 'freeScrollFriction' : 'friction' ];\n};\n\nproto.getRestingPosition = function() {\n // my thanks to Steven Wittens, who simplified this math greatly\n return this.x + this.velocity / ( 1 - this.getFrictionFactor() );\n};\n\nproto.applyDragForce = function() {\n if ( !this.isDraggable || !this.isPointerDown ) {\n return;\n }\n // change the position to drag position by applying force\n var dragVelocity = this.dragX - this.x;\n var dragForce = dragVelocity - this.velocity;\n this.applyForce( dragForce );\n};\n\nproto.applySelectedAttraction = function() {\n // do not attract if pointer down or no slides\n var dragDown = this.isDraggable && this.isPointerDown;\n if ( dragDown || this.isFreeScrolling || !this.slides.length ) {\n return;\n }\n var distance = this.selectedSlide.target * -1 - this.x;\n var force = distance * this.options.selectedAttraction;\n this.applyForce( force );\n};\n\nreturn proto;\n\n} ) );\n","// Flickity.Cell\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'get-size/get-size',\n ], function( getSize ) {\n return factory( window, getSize );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('get-size')\n );\n } else {\n // browser global\n window.Flickity = window.Flickity || {};\n window.Flickity.Cell = factory(\n window,\n window.getSize\n );\n }\n\n}( window, function factory( window, getSize ) {\n\n'use strict';\n\nfunction Cell( elem, parent ) {\n this.element = elem;\n this.parent = parent;\n\n this.create();\n}\n\nvar proto = Cell.prototype;\n\nproto.create = function() {\n this.element.style.position = 'absolute';\n this.element.setAttribute( 'aria-hidden', 'true' );\n this.x = 0;\n this.shift = 0;\n this.element.style[ this.parent.originSide ] = 0;\n};\n\nproto.destroy = function() {\n // reset style\n this.unselect();\n this.element.style.position = '';\n var side = this.parent.originSide;\n this.element.style[ side ] = '';\n this.element.style.transform = '';\n this.element.removeAttribute('aria-hidden');\n};\n\nproto.getSize = function() {\n this.size = getSize( this.element );\n};\n\nproto.setPosition = function( x ) {\n this.x = x;\n this.updateTarget();\n this.renderPosition( x );\n};\n\n// setDefaultTarget v1 method, backwards compatibility, remove in v3\nproto.updateTarget = proto.setDefaultTarget = function() {\n var marginProperty = this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight';\n this.target = this.x + this.size[ marginProperty ] +\n this.size.width * this.parent.cellAlign;\n};\n\nproto.renderPosition = function( x ) {\n // render position of cell with in slider\n var sideOffset = this.parent.originSide === 'left' ? 1 : -1;\n\n var adjustedX = this.parent.options.percentPosition ?\n x * sideOffset * ( this.parent.size.innerWidth / this.size.width ) :\n x * sideOffset;\n\n this.element.style.transform = 'translateX(' +\n this.parent.getPositionValue( adjustedX ) + ')';\n};\n\nproto.select = function() {\n this.element.classList.add('is-selected');\n this.element.removeAttribute('aria-hidden');\n};\n\nproto.unselect = function() {\n this.element.classList.remove('is-selected');\n this.element.setAttribute( 'aria-hidden', 'true' );\n};\n\n/**\n * @param {Integer} shift - 0, 1, or -1\n */\nproto.wrapShift = function( shift ) {\n this.shift = shift;\n this.renderPosition( this.x + this.parent.slideableWidth * shift );\n};\n\nproto.remove = function() {\n this.element.parentNode.removeChild( this.element );\n};\n\nreturn Cell;\n\n} ) );\n","// drag\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n './flickity',\n 'unidragger/unidragger',\n 'fizzy-ui-utils/utils',\n ], function( Flickity, Unidragger, utils ) {\n return factory( window, Flickity, Unidragger, utils );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('./flickity'),\n require('unidragger'),\n require('fizzy-ui-utils')\n );\n } else {\n // browser global\n window.Flickity = factory(\n window,\n window.Flickity,\n window.Unidragger,\n window.fizzyUIUtils\n );\n }\n\n}( window, function factory( window, Flickity, Unidragger, utils ) {\n\n'use strict';\n\n// ----- defaults ----- //\n\nutils.extend( Flickity.defaults, {\n draggable: '>1',\n dragThreshold: 3,\n} );\n\n// ----- create ----- //\n\nFlickity.createMethods.push('_createDrag');\n\n// -------------------------- drag prototype -------------------------- //\n\nvar proto = Flickity.prototype;\nutils.extend( proto, Unidragger.prototype );\nproto._touchActionValue = 'pan-y';\n\n// -------------------------- -------------------------- //\n\nproto._createDrag = function() {\n this.on( 'activate', this.onActivateDrag );\n this.on( 'uiChange', this._uiChangeDrag );\n this.on( 'deactivate', this.onDeactivateDrag );\n this.on( 'cellChange', this.updateDraggable );\n // TODO updateDraggable on resize? if groupCells & slides change\n};\n\nproto.onActivateDrag = function() {\n this.handles = [ this.viewport ];\n this.bindHandles();\n this.updateDraggable();\n};\n\nproto.onDeactivateDrag = function() {\n this.unbindHandles();\n this.element.classList.remove('is-draggable');\n};\n\nproto.updateDraggable = function() {\n // disable dragging if less than 2 slides. #278\n if ( this.options.draggable == '>1' ) {\n this.isDraggable = this.slides.length > 1;\n } else {\n this.isDraggable = this.options.draggable;\n }\n if ( this.isDraggable ) {\n this.element.classList.add('is-draggable');\n } else {\n this.element.classList.remove('is-draggable');\n }\n};\n\n// backwards compatibility\nproto.bindDrag = function() {\n this.options.draggable = true;\n this.updateDraggable();\n};\n\nproto.unbindDrag = function() {\n this.options.draggable = false;\n this.updateDraggable();\n};\n\nproto._uiChangeDrag = function() {\n delete this.isFreeScrolling;\n};\n\n// -------------------------- pointer events -------------------------- //\n\nproto.pointerDown = function( event, pointer ) {\n if ( !this.isDraggable ) {\n this._pointerDownDefault( event, pointer );\n return;\n }\n var isOkay = this.okayPointerDown( event );\n if ( !isOkay ) {\n return;\n }\n\n this._pointerDownPreventDefault( event );\n this.pointerDownFocus( event );\n // blur\n if ( document.activeElement != this.element ) {\n // do not blur if already focused\n this.pointerDownBlur();\n }\n\n // stop if it was moving\n this.dragX = this.x;\n this.viewport.classList.add('is-pointer-down');\n // track scrolling\n this.pointerDownScroll = getScrollPosition();\n window.addEventListener( 'scroll', this );\n\n this._pointerDownDefault( event, pointer );\n};\n\n// default pointerDown logic, used for staticClick\nproto._pointerDownDefault = function( event, pointer ) {\n // track start event position\n // Safari 9 overrides pageX and pageY. These values needs to be copied. #779\n this.pointerDownPointer = {\n pageX: pointer.pageX,\n pageY: pointer.pageY,\n };\n // bind move and end events\n this._bindPostStartEvents( event );\n this.dispatchEvent( 'pointerDown', event, [ pointer ] );\n};\n\nvar focusNodes = {\n INPUT: true,\n TEXTAREA: true,\n SELECT: true,\n};\n\nproto.pointerDownFocus = function( event ) {\n var isFocusNode = focusNodes[ event.target.nodeName ];\n if ( !isFocusNode ) {\n this.focus();\n }\n};\n\nproto._pointerDownPreventDefault = function( event ) {\n var isTouchStart = event.type == 'touchstart';\n var isTouchPointer = event.pointerType == 'touch';\n var isFocusNode = focusNodes[ event.target.nodeName ];\n if ( !isTouchStart && !isTouchPointer && !isFocusNode ) {\n event.preventDefault();\n }\n};\n\n// ----- move ----- //\n\nproto.hasDragStarted = function( moveVector ) {\n return Math.abs( moveVector.x ) > this.options.dragThreshold;\n};\n\n// ----- up ----- //\n\nproto.pointerUp = function( event, pointer ) {\n delete this.isTouchScrolling;\n this.viewport.classList.remove('is-pointer-down');\n this.dispatchEvent( 'pointerUp', event, [ pointer ] );\n this._dragPointerUp( event, pointer );\n};\n\nproto.pointerDone = function() {\n window.removeEventListener( 'scroll', this );\n delete this.pointerDownScroll;\n};\n\n// -------------------------- dragging -------------------------- //\n\nproto.dragStart = function( event, pointer ) {\n if ( !this.isDraggable ) {\n return;\n }\n this.dragStartPosition = this.x;\n this.startAnimation();\n window.removeEventListener( 'scroll', this );\n this.dispatchEvent( 'dragStart', event, [ pointer ] );\n};\n\nproto.pointerMove = function( event, pointer ) {\n var moveVector = this._dragPointerMove( event, pointer );\n this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] );\n this._dragMove( event, pointer, moveVector );\n};\n\nproto.dragMove = function( event, pointer, moveVector ) {\n if ( !this.isDraggable ) {\n return;\n }\n event.preventDefault();\n\n this.previousDragX = this.dragX;\n // reverse if right-to-left\n var direction = this.options.rightToLeft ? -1 : 1;\n if ( this.options.wrapAround ) {\n // wrap around move. #589\n moveVector.x %= this.slideableWidth;\n }\n var dragX = this.dragStartPosition + moveVector.x * direction;\n\n if ( !this.options.wrapAround && this.slides.length ) {\n // slow drag\n var originBound = Math.max( -this.slides[0].target, this.dragStartPosition );\n dragX = dragX > originBound ? ( dragX + originBound ) * 0.5 : dragX;\n var endBound = Math.min( -this.getLastSlide().target, this.dragStartPosition );\n dragX = dragX < endBound ? ( dragX + endBound ) * 0.5 : dragX;\n }\n\n this.dragX = dragX;\n\n this.dragMoveTime = new Date();\n this.dispatchEvent( 'dragMove', event, [ pointer, moveVector ] );\n};\n\nproto.dragEnd = function( event, pointer ) {\n if ( !this.isDraggable ) {\n return;\n }\n if ( this.options.freeScroll ) {\n this.isFreeScrolling = true;\n }\n // set selectedIndex based on where flick will end up\n var index = this.dragEndRestingSelect();\n\n if ( this.options.freeScroll && !this.options.wrapAround ) {\n // if free-scroll & not wrap around\n // do not free-scroll if going outside of bounding slides\n // so bounding slides can attract slider, and keep it in bounds\n var restingX = this.getRestingPosition();\n this.isFreeScrolling = -restingX > this.slides[0].target &&\n -restingX < this.getLastSlide().target;\n } else if ( !this.options.freeScroll && index == this.selectedIndex ) {\n // boost selection if selected index has not changed\n index += this.dragEndBoostSelect();\n }\n delete this.previousDragX;\n // apply selection\n // TODO refactor this, selecting here feels weird\n // HACK, set flag so dragging stays in correct direction\n this.isDragSelect = this.options.wrapAround;\n this.select( index );\n delete this.isDragSelect;\n this.dispatchEvent( 'dragEnd', event, [ pointer ] );\n};\n\nproto.dragEndRestingSelect = function() {\n var restingX = this.getRestingPosition();\n // how far away from selected slide\n var distance = Math.abs( this.getSlideDistance( -restingX, this.selectedIndex ) );\n // get closet resting going up and going down\n var positiveResting = this._getClosestResting( restingX, distance, 1 );\n var negativeResting = this._getClosestResting( restingX, distance, -1 );\n // use closer resting for wrap-around\n var index = positiveResting.distance < negativeResting.distance ?\n positiveResting.index : negativeResting.index;\n return index;\n};\n\n/**\n * given resting X and distance to selected cell\n * get the distance and index of the closest cell\n * @param {Number} restingX - estimated post-flick resting position\n * @param {Number} distance - distance to selected cell\n * @param {Integer} increment - +1 or -1, going up or down\n * @returns {Object} - { distance: {Number}, index: {Integer} }\n */\nproto._getClosestResting = function( restingX, distance, increment ) {\n var index = this.selectedIndex;\n var minDistance = Infinity;\n var condition = this.options.contain && !this.options.wrapAround ?\n // if contain, keep going if distance is equal to minDistance\n function( dist, minDist ) {\n return dist <= minDist;\n } : function( dist, minDist ) {\n return dist < minDist;\n };\n while ( condition( distance, minDistance ) ) {\n // measure distance to next cell\n index += increment;\n minDistance = distance;\n distance = this.getSlideDistance( -restingX, index );\n if ( distance === null ) {\n break;\n }\n distance = Math.abs( distance );\n }\n return {\n distance: minDistance,\n // selected was previous index\n index: index - increment,\n };\n};\n\n/**\n * measure distance between x and a slide target\n * @param {Number} x - horizontal position\n * @param {Integer} index - slide index\n * @returns {Number} - slide distance\n */\nproto.getSlideDistance = function( x, index ) {\n var len = this.slides.length;\n // wrap around if at least 2 slides\n var isWrapAround = this.options.wrapAround && len > 1;\n var slideIndex = isWrapAround ? utils.modulo( index, len ) : index;\n var slide = this.slides[ slideIndex ];\n if ( !slide ) {\n return null;\n }\n // add distance for wrap-around slides\n var wrap = isWrapAround ? this.slideableWidth * Math.floor( index/len ) : 0;\n return x - ( slide.target + wrap );\n};\n\nproto.dragEndBoostSelect = function() {\n // do not boost if no previousDragX or dragMoveTime\n if ( this.previousDragX === undefined || !this.dragMoveTime ||\n // or if drag was held for 100 ms\n new Date() - this.dragMoveTime > 100 ) {\n return 0;\n }\n\n var distance = this.getSlideDistance( -this.dragX, this.selectedIndex );\n var delta = this.previousDragX - this.dragX;\n if ( distance > 0 && delta > 0 ) {\n // boost to next if moving towards the right, and positive velocity\n return 1;\n } else if ( distance < 0 && delta < 0 ) {\n // boost to previous if moving towards the left, and negative velocity\n return -1;\n }\n return 0;\n};\n\n// ----- staticClick ----- //\n\nproto.staticClick = function( event, pointer ) {\n // get clickedCell, if cell was clicked\n var clickedCell = this.getParentCell( event.target );\n var cellElem = clickedCell && clickedCell.element;\n var cellIndex = clickedCell && this.cells.indexOf( clickedCell );\n this.dispatchEvent( 'staticClick', event, [ pointer, cellElem, cellIndex ] );\n};\n\n// ----- scroll ----- //\n\nproto.onscroll = function() {\n var scroll = getScrollPosition();\n var scrollMoveX = this.pointerDownScroll.x - scroll.x;\n var scrollMoveY = this.pointerDownScroll.y - scroll.y;\n // cancel click/tap if scroll is too much\n if ( Math.abs( scrollMoveX ) > 3 || Math.abs( scrollMoveY ) > 3 ) {\n this._pointerDone();\n }\n};\n\n// ----- utils ----- //\n\nfunction getScrollPosition() {\n return {\n x: window.pageXOffset,\n y: window.pageYOffset,\n };\n}\n\n// ----- ----- //\n\nreturn Flickity;\n\n} ) );\n","// Flickity main\n/* eslint-disable max-params */\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'ev-emitter/ev-emitter',\n 'get-size/get-size',\n 'fizzy-ui-utils/utils',\n './cell',\n './slide',\n './animate',\n ], function( EvEmitter, getSize, utils, Cell, Slide, animatePrototype ) {\n return factory( window, EvEmitter, getSize, utils, Cell, Slide, animatePrototype );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('ev-emitter'),\n require('get-size'),\n require('fizzy-ui-utils'),\n require('./cell'),\n require('./slide'),\n require('./animate')\n );\n } else {\n // browser global\n var _Flickity = window.Flickity;\n\n window.Flickity = factory(\n window,\n window.EvEmitter,\n window.getSize,\n window.fizzyUIUtils,\n _Flickity.Cell,\n _Flickity.Slide,\n _Flickity.animatePrototype\n );\n }\n\n}( window, function factory( window, EvEmitter, getSize,\n utils, Cell, Slide, animatePrototype ) {\n\n/* eslint-enable max-params */\n'use strict';\n\n// vars\nvar jQuery = window.jQuery;\nvar getComputedStyle = window.getComputedStyle;\nvar console = window.console;\n\nfunction moveElements( elems, toElem ) {\n elems = utils.makeArray( elems );\n while ( elems.length ) {\n toElem.appendChild( elems.shift() );\n }\n}\n\n// -------------------------- Flickity -------------------------- //\n\n// globally unique identifiers\nvar GUID = 0;\n// internal store of all Flickity intances\nvar instances = {};\n\nfunction Flickity( element, options ) {\n var queryElement = utils.getQueryElement( element );\n if ( !queryElement ) {\n if ( console ) {\n console.error( 'Bad element for Flickity: ' + ( queryElement || element ) );\n }\n return;\n }\n this.element = queryElement;\n // do not initialize twice on same element\n if ( this.element.flickityGUID ) {\n var instance = instances[ this.element.flickityGUID ];\n if ( instance ) instance.option( options );\n return instance;\n }\n\n // add jQuery\n if ( jQuery ) {\n this.$element = jQuery( this.element );\n }\n // options\n this.options = utils.extend( {}, this.constructor.defaults );\n this.option( options );\n\n // kick things off\n this._create();\n}\n\nFlickity.defaults = {\n accessibility: true,\n // adaptiveHeight: false,\n cellAlign: 'center',\n // cellSelector: undefined,\n // contain: false,\n freeScrollFriction: 0.075, // friction when free-scrolling\n friction: 0.28, // friction when selecting\n namespaceJQueryEvents: true,\n // initialIndex: 0,\n percentPosition: true,\n resize: true,\n selectedAttraction: 0.025,\n setGallerySize: true,\n // watchCSS: false,\n // wrapAround: false\n};\n\n// hash of methods triggered on _create()\nFlickity.createMethods = [];\n\nvar proto = Flickity.prototype;\n// inherit EventEmitter\nutils.extend( proto, EvEmitter.prototype );\n\nproto._create = function() {\n // add id for Flickity.data\n var id = this.guid = ++GUID;\n this.element.flickityGUID = id; // expando\n instances[ id ] = this; // associate via id\n // initial properties\n this.selectedIndex = 0;\n // how many frames slider has been in same position\n this.restingFrames = 0;\n // initial physics properties\n this.x = 0;\n this.velocity = 0;\n this.originSide = this.options.rightToLeft ? 'right' : 'left';\n // create viewport & slider\n this.viewport = document.createElement('div');\n this.viewport.className = 'flickity-viewport';\n this._createSlider();\n\n if ( this.options.resize || this.options.watchCSS ) {\n window.addEventListener( 'resize', this );\n }\n\n // add listeners from on option\n for ( var eventName in this.options.on ) {\n var listener = this.options.on[ eventName ];\n this.on( eventName, listener );\n }\n\n Flickity.createMethods.forEach( function( method ) {\n this[ method ]();\n }, this );\n\n if ( this.options.watchCSS ) {\n this.watchCSS();\n } else {\n this.activate();\n }\n\n};\n\n/**\n * set options\n * @param {Object} opts - options to extend\n */\nproto.option = function( opts ) {\n utils.extend( this.options, opts );\n};\n\nproto.activate = function() {\n if ( this.isActive ) {\n return;\n }\n this.isActive = true;\n this.element.classList.add('flickity-enabled');\n if ( this.options.rightToLeft ) {\n this.element.classList.add('flickity-rtl');\n }\n\n this.getSize();\n // move initial cell elements so they can be loaded as cells\n var cellElems = this._filterFindCellElements( this.element.children );\n moveElements( cellElems, this.slider );\n this.viewport.appendChild( this.slider );\n this.element.appendChild( this.viewport );\n // get cells from children\n this.reloadCells();\n\n if ( this.options.accessibility ) {\n // allow element to focusable\n this.element.tabIndex = 0;\n // listen for key presses\n this.element.addEventListener( 'keydown', this );\n }\n\n this.emitEvent('activate');\n this.selectInitialIndex();\n // flag for initial activation, for using initialIndex\n this.isInitActivated = true;\n // ready event. #493\n this.dispatchEvent('ready');\n};\n\n// slider positions the cells\nproto._createSlider = function() {\n // slider element does all the positioning\n var slider = document.createElement('div');\n slider.className = 'flickity-slider';\n slider.style[ this.originSide ] = 0;\n this.slider = slider;\n};\n\nproto._filterFindCellElements = function( elems ) {\n return utils.filterFindElements( elems, this.options.cellSelector );\n};\n\n// goes through all children\nproto.reloadCells = function() {\n // collection of item elements\n this.cells = this._makeCells( this.slider.children );\n this.positionCells();\n this._getWrapShiftCells();\n this.setGallerySize();\n};\n\n/**\n * turn elements into Flickity.Cells\n * @param {[Array, NodeList, HTMLElement]} elems - elements to make into cells\n * @returns {Array} items - collection of new Flickity Cells\n */\nproto._makeCells = function( elems ) {\n var cellElems = this._filterFindCellElements( elems );\n\n // create new Flickity for collection\n var cells = cellElems.map( function( cellElem ) {\n return new Cell( cellElem, this );\n }, this );\n\n return cells;\n};\n\nproto.getLastCell = function() {\n return this.cells[ this.cells.length - 1 ];\n};\n\nproto.getLastSlide = function() {\n return this.slides[ this.slides.length - 1 ];\n};\n\n// positions all cells\nproto.positionCells = function() {\n // size all cells\n this._sizeCells( this.cells );\n // position all cells\n this._positionCells( 0 );\n};\n\n/**\n * position certain cells\n * @param {Integer} index - which cell to start with\n */\nproto._positionCells = function( index ) {\n index = index || 0;\n // also measure maxCellHeight\n // start 0 if positioning all cells\n this.maxCellHeight = index ? this.maxCellHeight || 0 : 0;\n var cellX = 0;\n // get cellX\n if ( index > 0 ) {\n var startCell = this.cells[ index - 1 ];\n cellX = startCell.x + startCell.size.outerWidth;\n }\n var len = this.cells.length;\n for ( var i = index; i < len; i++ ) {\n var cell = this.cells[i];\n cell.setPosition( cellX );\n cellX += cell.size.outerWidth;\n this.maxCellHeight = Math.max( cell.size.outerHeight, this.maxCellHeight );\n }\n // keep track of cellX for wrap-around\n this.slideableWidth = cellX;\n // slides\n this.updateSlides();\n // contain slides target\n this._containSlides();\n // update slidesWidth\n this.slidesWidth = len ? this.getLastSlide().target - this.slides[0].target : 0;\n};\n\n/**\n * cell.getSize() on multiple cells\n * @param {Array} cells - cells to size\n */\nproto._sizeCells = function( cells ) {\n cells.forEach( function( cell ) {\n cell.getSize();\n } );\n};\n\n// -------------------------- -------------------------- //\n\nproto.updateSlides = function() {\n this.slides = [];\n if ( !this.cells.length ) {\n return;\n }\n\n var slide = new Slide( this );\n this.slides.push( slide );\n var isOriginLeft = this.originSide == 'left';\n var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft';\n\n var canCellFit = this._getCanCellFit();\n\n this.cells.forEach( function( cell, i ) {\n // just add cell if first cell in slide\n if ( !slide.cells.length ) {\n slide.addCell( cell );\n return;\n }\n\n var slideWidth = ( slide.outerWidth - slide.firstMargin ) +\n ( cell.size.outerWidth - cell.size[ nextMargin ] );\n\n if ( canCellFit.call( this, i, slideWidth ) ) {\n slide.addCell( cell );\n } else {\n // doesn't fit, new slide\n slide.updateTarget();\n\n slide = new Slide( this );\n this.slides.push( slide );\n slide.addCell( cell );\n }\n }, this );\n // last slide\n slide.updateTarget();\n // update .selectedSlide\n this.updateSelectedSlide();\n};\n\nproto._getCanCellFit = function() {\n var groupCells = this.options.groupCells;\n if ( !groupCells ) {\n return function() {\n return false;\n };\n } else if ( typeof groupCells == 'number' ) {\n // group by number. 3 -> [0,1,2], [3,4,5], ...\n var number = parseInt( groupCells, 10 );\n return function( i ) {\n return ( i % number ) !== 0;\n };\n }\n // default, group by width of slide\n // parse '75%\n var percentMatch = typeof groupCells == 'string' &&\n groupCells.match( /^(\\d+)%$/ );\n var percent = percentMatch ? parseInt( percentMatch[1], 10 ) / 100 : 1;\n return function( i, slideWidth ) {\n /* eslint-disable-next-line no-invalid-this */\n return slideWidth <= ( this.size.innerWidth + 1 ) * percent;\n };\n};\n\n// alias _init for jQuery plugin .flickity()\nproto._init =\nproto.reposition = function() {\n this.positionCells();\n this.positionSliderAtSelected();\n};\n\nproto.getSize = function() {\n this.size = getSize( this.element );\n this.setCellAlign();\n this.cursorPosition = this.size.innerWidth * this.cellAlign;\n};\n\nvar cellAlignShorthands = {\n // cell align, then based on origin side\n center: {\n left: 0.5,\n right: 0.5,\n },\n left: {\n left: 0,\n right: 1,\n },\n right: {\n right: 0,\n left: 1,\n },\n};\n\nproto.setCellAlign = function() {\n var shorthand = cellAlignShorthands[ this.options.cellAlign ];\n this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign;\n};\n\nproto.setGallerySize = function() {\n if ( this.options.setGallerySize ) {\n var height = this.options.adaptiveHeight && this.selectedSlide ?\n this.selectedSlide.height : this.maxCellHeight;\n this.viewport.style.height = height + 'px';\n }\n};\n\nproto._getWrapShiftCells = function() {\n // only for wrap-around\n if ( !this.options.wrapAround ) {\n return;\n }\n // unshift previous cells\n this._unshiftCells( this.beforeShiftCells );\n this._unshiftCells( this.afterShiftCells );\n // get before cells\n // initial gap\n var gapX = this.cursorPosition;\n var cellIndex = this.cells.length - 1;\n this.beforeShiftCells = this._getGapCells( gapX, cellIndex, -1 );\n // get after cells\n // ending gap between last cell and end of gallery viewport\n gapX = this.size.innerWidth - this.cursorPosition;\n // start cloning at first cell, working forwards\n this.afterShiftCells = this._getGapCells( gapX, 0, 1 );\n};\n\nproto._getGapCells = function( gapX, cellIndex, increment ) {\n // keep adding cells until the cover the initial gap\n var cells = [];\n while ( gapX > 0 ) {\n var cell = this.cells[ cellIndex ];\n if ( !cell ) {\n break;\n }\n cells.push( cell );\n cellIndex += increment;\n gapX -= cell.size.outerWidth;\n }\n return cells;\n};\n\n// ----- contain ----- //\n\n// contain cell targets so no excess sliding\nproto._containSlides = function() {\n if ( !this.options.contain || this.options.wrapAround || !this.cells.length ) {\n return;\n }\n var isRightToLeft = this.options.rightToLeft;\n var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft';\n var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight';\n var contentWidth = this.slideableWidth - this.getLastCell().size[ endMargin ];\n // content is less than gallery size\n var isContentSmaller = contentWidth < this.size.innerWidth;\n // bounds\n var beginBound = this.cursorPosition + this.cells[0].size[ beginMargin ];\n var endBound = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign );\n // contain each cell target\n this.slides.forEach( function( slide ) {\n if ( isContentSmaller ) {\n // all cells fit inside gallery\n slide.target = contentWidth * this.cellAlign;\n } else {\n // contain to bounds\n slide.target = Math.max( slide.target, beginBound );\n slide.target = Math.min( slide.target, endBound );\n }\n }, this );\n};\n\n// ----- ----- //\n\n/**\n * emits events via eventEmitter and jQuery events\n * @param {String} type - name of event\n * @param {Event} event - original event\n * @param {Array} args - extra arguments\n */\nproto.dispatchEvent = function( type, event, args ) {\n var emitArgs = event ? [ event ].concat( args ) : args;\n this.emitEvent( type, emitArgs );\n\n if ( jQuery && this.$element ) {\n // default trigger with type if no event\n type += this.options.namespaceJQueryEvents ? '.flickity' : '';\n var $event = type;\n if ( event ) {\n // create jQuery event\n var jQEvent = new jQuery.Event( event );\n jQEvent.type = type;\n $event = jQEvent;\n }\n this.$element.trigger( $event, args );\n }\n};\n\n// -------------------------- select -------------------------- //\n\n/**\n * @param {Integer} index - index of the slide\n * @param {Boolean} isWrap - will wrap-around to last/first if at the end\n * @param {Boolean} isInstant - will immediately set position at selected cell\n */\nproto.select = function( index, isWrap, isInstant ) {\n if ( !this.isActive ) {\n return;\n }\n index = parseInt( index, 10 );\n this._wrapSelect( index );\n\n if ( this.options.wrapAround || isWrap ) {\n index = utils.modulo( index, this.slides.length );\n }\n // bail if invalid index\n if ( !this.slides[ index ] ) {\n return;\n }\n var prevIndex = this.selectedIndex;\n this.selectedIndex = index;\n this.updateSelectedSlide();\n if ( isInstant ) {\n this.positionSliderAtSelected();\n } else {\n this.startAnimation();\n }\n if ( this.options.adaptiveHeight ) {\n this.setGallerySize();\n }\n // events\n this.dispatchEvent( 'select', null, [ index ] );\n // change event if new index\n if ( index != prevIndex ) {\n this.dispatchEvent( 'change', null, [ index ] );\n }\n // old v1 event name, remove in v3\n this.dispatchEvent('cellSelect');\n};\n\n// wraps position for wrapAround, to move to closest slide. #113\nproto._wrapSelect = function( index ) {\n var len = this.slides.length;\n var isWrapping = this.options.wrapAround && len > 1;\n if ( !isWrapping ) {\n return index;\n }\n var wrapIndex = utils.modulo( index, len );\n // go to shortest\n var delta = Math.abs( wrapIndex - this.selectedIndex );\n var backWrapDelta = Math.abs( ( wrapIndex + len ) - this.selectedIndex );\n var forewardWrapDelta = Math.abs( ( wrapIndex - len ) - this.selectedIndex );\n if ( !this.isDragSelect && backWrapDelta < delta ) {\n index += len;\n } else if ( !this.isDragSelect && forewardWrapDelta < delta ) {\n index -= len;\n }\n // wrap position so slider is within normal area\n if ( index < 0 ) {\n this.x -= this.slideableWidth;\n } else if ( index >= len ) {\n this.x += this.slideableWidth;\n }\n};\n\nproto.previous = function( isWrap, isInstant ) {\n this.select( this.selectedIndex - 1, isWrap, isInstant );\n};\n\nproto.next = function( isWrap, isInstant ) {\n this.select( this.selectedIndex + 1, isWrap, isInstant );\n};\n\nproto.updateSelectedSlide = function() {\n var slide = this.slides[ this.selectedIndex ];\n // selectedIndex could be outside of slides, if triggered before resize()\n if ( !slide ) {\n return;\n }\n // unselect previous selected slide\n this.unselectSelectedSlide();\n // update new selected slide\n this.selectedSlide = slide;\n slide.select();\n this.selectedCells = slide.cells;\n this.selectedElements = slide.getCellElements();\n // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility\n // Remove in v3?\n this.selectedCell = slide.cells[0];\n this.selectedElement = this.selectedElements[0];\n};\n\nproto.unselectSelectedSlide = function() {\n if ( this.selectedSlide ) {\n this.selectedSlide.unselect();\n }\n};\n\nproto.selectInitialIndex = function() {\n var initialIndex = this.options.initialIndex;\n // already activated, select previous selectedIndex\n if ( this.isInitActivated ) {\n this.select( this.selectedIndex, false, true );\n return;\n }\n // select with selector string\n if ( initialIndex && typeof initialIndex == 'string' ) {\n var cell = this.queryCell( initialIndex );\n if ( cell ) {\n this.selectCell( initialIndex, false, true );\n return;\n }\n }\n\n var index = 0;\n // select with number\n if ( initialIndex && this.slides[ initialIndex ] ) {\n index = initialIndex;\n }\n // select instantly\n this.select( index, false, true );\n};\n\n/**\n * select slide from number or cell element\n * @param {[Element, Number]} value - zero-based index or element to select\n * @param {Boolean} isWrap - enables wrapping around for extra index\n * @param {Boolean} isInstant - disables slide animation\n */\nproto.selectCell = function( value, isWrap, isInstant ) {\n // get cell\n var cell = this.queryCell( value );\n if ( !cell ) {\n return;\n }\n\n var index = this.getCellSlideIndex( cell );\n this.select( index, isWrap, isInstant );\n};\n\nproto.getCellSlideIndex = function( cell ) {\n // get index of slides that has cell\n for ( var i = 0; i < this.slides.length; i++ ) {\n var slide = this.slides[i];\n var index = slide.cells.indexOf( cell );\n if ( index != -1 ) {\n return i;\n }\n }\n};\n\n// -------------------------- get cells -------------------------- //\n\n/**\n * get Flickity.Cell, given an Element\n * @param {Element} elem - matching cell element\n * @returns {Flickity.Cell} cell - matching cell\n */\nproto.getCell = function( elem ) {\n // loop through cells to get the one that matches\n for ( var i = 0; i < this.cells.length; i++ ) {\n var cell = this.cells[i];\n if ( cell.element == elem ) {\n return cell;\n }\n }\n};\n\n/**\n * get collection of Flickity.Cells, given Elements\n * @param {[Element, Array, NodeList]} elems - multiple elements\n * @returns {Array} cells - Flickity.Cells\n */\nproto.getCells = function( elems ) {\n elems = utils.makeArray( elems );\n var cells = [];\n elems.forEach( function( elem ) {\n var cell = this.getCell( elem );\n if ( cell ) {\n cells.push( cell );\n }\n }, this );\n return cells;\n};\n\n/**\n * get cell elements\n * @returns {Array} cellElems\n */\nproto.getCellElements = function() {\n return this.cells.map( function( cell ) {\n return cell.element;\n } );\n};\n\n/**\n * get parent cell from an element\n * @param {Element} elem - child element\n * @returns {Flickit.Cell} cell - parent cell\n */\nproto.getParentCell = function( elem ) {\n // first check if elem is cell\n var cell = this.getCell( elem );\n if ( cell ) {\n return cell;\n }\n // try to get parent cell elem\n elem = utils.getParent( elem, '.flickity-slider > *' );\n return this.getCell( elem );\n};\n\n/**\n * get cells adjacent to a slide\n * @param {Integer} adjCount - number of adjacent slides\n * @param {Integer} index - index of slide to start\n * @returns {Array} cells - array of Flickity.Cells\n */\nproto.getAdjacentCellElements = function( adjCount, index ) {\n if ( !adjCount ) {\n return this.selectedSlide.getCellElements();\n }\n index = index === undefined ? this.selectedIndex : index;\n\n var len = this.slides.length;\n if ( 1 + ( adjCount * 2 ) >= len ) {\n return this.getCellElements();\n }\n\n var cellElems = [];\n for ( var i = index - adjCount; i <= index + adjCount; i++ ) {\n var slideIndex = this.options.wrapAround ? utils.modulo( i, len ) : i;\n var slide = this.slides[ slideIndex ];\n if ( slide ) {\n cellElems = cellElems.concat( slide.getCellElements() );\n }\n }\n return cellElems;\n};\n\n/**\n * select slide from number or cell element\n * @param {[Element, String, Number]} selector - element, selector string, or index\n * @returns {Flickity.Cell} - matching cell\n */\nproto.queryCell = function( selector ) {\n if ( typeof selector == 'number' ) {\n // use number as index\n return this.cells[ selector ];\n }\n if ( typeof selector == 'string' ) {\n // do not select invalid selectors from hash: #123, #/. #791\n if ( selector.match( /^[#.]?[\\d/]/ ) ) {\n return;\n }\n // use string as selector, get element\n selector = this.element.querySelector( selector );\n }\n // get cell from element\n return this.getCell( selector );\n};\n\n// -------------------------- events -------------------------- //\n\nproto.uiChange = function() {\n this.emitEvent('uiChange');\n};\n\n// keep focus on element when child UI elements are clicked\nproto.childUIPointerDown = function( event ) {\n // HACK iOS does not allow touch events to bubble up?!\n if ( event.type != 'touchstart' ) {\n event.preventDefault();\n }\n this.focus();\n};\n\n// ----- resize ----- //\n\nproto.onresize = function() {\n this.watchCSS();\n this.resize();\n};\n\nutils.debounceMethod( Flickity, 'onresize', 150 );\n\nproto.resize = function() {\n // #1177 disable resize behavior when animating or dragging for iOS 15\n if ( !this.isActive || this.isAnimating || this.isDragging ) {\n return;\n }\n this.getSize();\n // wrap values\n if ( this.options.wrapAround ) {\n this.x = utils.modulo( this.x, this.slideableWidth );\n }\n this.positionCells();\n this._getWrapShiftCells();\n this.setGallerySize();\n this.emitEvent('resize');\n // update selected index for group slides, instant\n // TODO: position can be lost between groups of various numbers\n var selectedElement = this.selectedElements && this.selectedElements[0];\n this.selectCell( selectedElement, false, true );\n};\n\n// watches the :after property, activates/deactivates\nproto.watchCSS = function() {\n var watchOption = this.options.watchCSS;\n if ( !watchOption ) {\n return;\n }\n\n var afterContent = getComputedStyle( this.element, ':after' ).content;\n // activate if :after { content: 'flickity' }\n if ( afterContent.indexOf('flickity') != -1 ) {\n this.activate();\n } else {\n this.deactivate();\n }\n};\n\n// ----- keydown ----- //\n\n// go previous/next if left/right keys pressed\nproto.onkeydown = function( event ) {\n // only work if element is in focus\n var isNotFocused = document.activeElement && document.activeElement != this.element;\n if ( !this.options.accessibility || isNotFocused ) {\n return;\n }\n\n var handler = Flickity.keyboardHandlers[ event.keyCode ];\n if ( handler ) {\n handler.call( this );\n }\n};\n\nFlickity.keyboardHandlers = {\n // left arrow\n 37: function() {\n var leftMethod = this.options.rightToLeft ? 'next' : 'previous';\n this.uiChange();\n this[ leftMethod ]();\n },\n // right arrow\n 39: function() {\n var rightMethod = this.options.rightToLeft ? 'previous' : 'next';\n this.uiChange();\n this[ rightMethod ]();\n },\n};\n\n// ----- focus ----- //\n\nproto.focus = function() {\n // TODO remove scrollTo once focus options gets more support\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus ...\n // #Browser_compatibility\n var prevScrollY = window.pageYOffset;\n this.element.focus({ preventScroll: true });\n // hack to fix scroll jump after focus, #76\n if ( window.pageYOffset != prevScrollY ) {\n window.scrollTo( window.pageXOffset, prevScrollY );\n }\n};\n\n// -------------------------- destroy -------------------------- //\n\n// deactivate all Flickity functionality, but keep stuff available\nproto.deactivate = function() {\n if ( !this.isActive ) {\n return;\n }\n this.element.classList.remove('flickity-enabled');\n this.element.classList.remove('flickity-rtl');\n this.unselectSelectedSlide();\n // destroy cells\n this.cells.forEach( function( cell ) {\n cell.destroy();\n } );\n this.element.removeChild( this.viewport );\n // move child elements back into element\n moveElements( this.slider.children, this.element );\n if ( this.options.accessibility ) {\n this.element.removeAttribute('tabIndex');\n this.element.removeEventListener( 'keydown', this );\n }\n // set flags\n this.isActive = false;\n this.emitEvent('deactivate');\n};\n\nproto.destroy = function() {\n this.deactivate();\n window.removeEventListener( 'resize', this );\n this.allOff();\n this.emitEvent('destroy');\n if ( jQuery && this.$element ) {\n jQuery.removeData( this.element, 'flickity' );\n }\n delete this.element.flickityGUID;\n delete instances[ this.guid ];\n};\n\n// -------------------------- prototype -------------------------- //\n\nutils.extend( proto, animatePrototype );\n\n// -------------------------- extras -------------------------- //\n\n/**\n * get Flickity instance from element\n * @param {[Element, String]} elem - element or selector string\n * @returns {Flickity} - Flickity instance\n */\nFlickity.data = function( elem ) {\n elem = utils.getQueryElement( elem );\n var id = elem && elem.flickityGUID;\n return id && instances[ id ];\n};\n\nutils.htmlInit( Flickity, 'flickity' );\n\nif ( jQuery && jQuery.bridget ) {\n jQuery.bridget( 'flickity', Flickity );\n}\n\n// set internal jQuery, for Webpack + jQuery v3, #478\nFlickity.setJQuery = function( jq ) {\n jQuery = jq;\n};\n\nFlickity.Cell = Cell;\nFlickity.Slide = Slide;\n\nreturn Flickity;\n\n} ) );\n","/*!\n * Flickity v2.3.0\n * Touch, responsive, flickable carousels\n *\n * Licensed GPLv3 for open source use\n * or Flickity Commercial License for commercial use\n *\n * https://flickity.metafizzy.co\n * Copyright 2015-2021 Metafizzy\n */\n\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n './flickity',\n './drag',\n './prev-next-button',\n './page-dots',\n './player',\n './add-remove-cell',\n './lazyload',\n ], factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('./flickity'),\n require('./drag'),\n require('./prev-next-button'),\n require('./page-dots'),\n require('./player'),\n require('./add-remove-cell'),\n require('./lazyload')\n );\n }\n\n} )( window, function factory( Flickity ) {\n return Flickity;\n} );\n","// lazyload\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n './flickity',\n 'fizzy-ui-utils/utils',\n ], function( Flickity, utils ) {\n return factory( window, Flickity, utils );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('./flickity'),\n require('fizzy-ui-utils')\n );\n } else {\n // browser global\n factory(\n window,\n window.Flickity,\n window.fizzyUIUtils\n );\n }\n\n}( window, function factory( window, Flickity, utils ) {\n'use strict';\n\nFlickity.createMethods.push('_createLazyload');\nvar proto = Flickity.prototype;\n\nproto._createLazyload = function() {\n this.on( 'select', this.lazyLoad );\n};\n\nproto.lazyLoad = function() {\n var lazyLoad = this.options.lazyLoad;\n if ( !lazyLoad ) {\n return;\n }\n // get adjacent cells, use lazyLoad option for adjacent count\n var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0;\n var cellElems = this.getAdjacentCellElements( adjCount );\n // get lazy images in those cells\n var lazyImages = [];\n cellElems.forEach( function( cellElem ) {\n var lazyCellImages = getCellLazyImages( cellElem );\n lazyImages = lazyImages.concat( lazyCellImages );\n } );\n // load lazy images\n lazyImages.forEach( function( img ) {\n new LazyLoader( img, this );\n }, this );\n};\n\nfunction getCellLazyImages( cellElem ) {\n // check if cell element is lazy image\n if ( cellElem.nodeName == 'IMG' ) {\n var lazyloadAttr = cellElem.getAttribute('data-flickity-lazyload');\n var srcAttr = cellElem.getAttribute('data-flickity-lazyload-src');\n var srcsetAttr = cellElem.getAttribute('data-flickity-lazyload-srcset');\n if ( lazyloadAttr || srcAttr || srcsetAttr ) {\n return [ cellElem ];\n }\n }\n // select lazy images in cell\n var lazySelector = 'img[data-flickity-lazyload], ' +\n 'img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]';\n var imgs = cellElem.querySelectorAll( lazySelector );\n return utils.makeArray( imgs );\n}\n\n// -------------------------- LazyLoader -------------------------- //\n\n/**\n * class to handle loading images\n * @param {Image} img - Image element\n * @param {Flickity} flickity - Flickity instance\n */\nfunction LazyLoader( img, flickity ) {\n this.img = img;\n this.flickity = flickity;\n this.load();\n}\n\nLazyLoader.prototype.handleEvent = utils.handleEvent;\n\nLazyLoader.prototype.load = function() {\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n // get src & srcset\n var src = this.img.getAttribute('data-flickity-lazyload') ||\n this.img.getAttribute('data-flickity-lazyload-src');\n var srcset = this.img.getAttribute('data-flickity-lazyload-srcset');\n // set src & serset\n this.img.src = src;\n if ( srcset ) {\n this.img.setAttribute( 'srcset', srcset );\n }\n // remove attr\n this.img.removeAttribute('data-flickity-lazyload');\n this.img.removeAttribute('data-flickity-lazyload-src');\n this.img.removeAttribute('data-flickity-lazyload-srcset');\n};\n\nLazyLoader.prototype.onload = function( event ) {\n this.complete( event, 'flickity-lazyloaded' );\n};\n\nLazyLoader.prototype.onerror = function( event ) {\n this.complete( event, 'flickity-lazyerror' );\n};\n\nLazyLoader.prototype.complete = function( event, className ) {\n // unbind events\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n\n var cell = this.flickity.getParentCell( this.img );\n var cellElem = cell && cell.element;\n this.flickity.cellSizeChange( cellElem );\n\n this.img.classList.add( className );\n this.flickity.dispatchEvent( 'lazyLoad', event, cellElem );\n};\n\n// ----- ----- //\n\nFlickity.LazyLoader = LazyLoader;\n\nreturn Flickity;\n\n} ) );\n","// page dots\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n './flickity',\n 'unipointer/unipointer',\n 'fizzy-ui-utils/utils',\n ], function( Flickity, Unipointer, utils ) {\n return factory( window, Flickity, Unipointer, utils );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('./flickity'),\n require('unipointer'),\n require('fizzy-ui-utils')\n );\n } else {\n // browser global\n factory(\n window,\n window.Flickity,\n window.Unipointer,\n window.fizzyUIUtils\n );\n }\n\n}( window, function factory( window, Flickity, Unipointer, utils ) {\n\n// -------------------------- PageDots -------------------------- //\n\n'use strict';\n\nfunction PageDots( parent ) {\n this.parent = parent;\n this._create();\n}\n\nPageDots.prototype = Object.create( Unipointer.prototype );\n\nPageDots.prototype._create = function() {\n // create holder element\n this.holder = document.createElement('ol');\n this.holder.className = 'flickity-page-dots';\n // create dots, array of elements\n this.dots = [];\n // events\n this.handleClick = this.onClick.bind( this );\n this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) );\n};\n\nPageDots.prototype.activate = function() {\n this.setDots();\n this.holder.addEventListener( 'click', this.handleClick );\n this.bindStartEvent( this.holder );\n // add to DOM\n this.parent.element.appendChild( this.holder );\n};\n\nPageDots.prototype.deactivate = function() {\n this.holder.removeEventListener( 'click', this.handleClick );\n this.unbindStartEvent( this.holder );\n // remove from DOM\n this.parent.element.removeChild( this.holder );\n};\n\nPageDots.prototype.setDots = function() {\n // get difference between number of slides and number of dots\n var delta = this.parent.slides.length - this.dots.length;\n if ( delta > 0 ) {\n this.addDots( delta );\n } else if ( delta < 0 ) {\n this.removeDots( -delta );\n }\n};\n\nPageDots.prototype.addDots = function( count ) {\n var fragment = document.createDocumentFragment();\n var newDots = [];\n var length = this.dots.length;\n var max = length + count;\n\n for ( var i = length; i < max; i++ ) {\n var dot = document.createElement('li');\n dot.className = 'dot';\n dot.setAttribute( 'aria-label', 'Page dot ' + ( i + 1 ) );\n fragment.appendChild( dot );\n newDots.push( dot );\n }\n\n this.holder.appendChild( fragment );\n this.dots = this.dots.concat( newDots );\n};\n\nPageDots.prototype.removeDots = function( count ) {\n // remove from this.dots collection\n var removeDots = this.dots.splice( this.dots.length - count, count );\n // remove from DOM\n removeDots.forEach( function( dot ) {\n this.holder.removeChild( dot );\n }, this );\n};\n\nPageDots.prototype.updateSelected = function() {\n // remove selected class on previous\n if ( this.selectedDot ) {\n this.selectedDot.className = 'dot';\n this.selectedDot.removeAttribute('aria-current');\n }\n // don't proceed if no dots\n if ( !this.dots.length ) {\n return;\n }\n this.selectedDot = this.dots[ this.parent.selectedIndex ];\n this.selectedDot.className = 'dot is-selected';\n this.selectedDot.setAttribute( 'aria-current', 'step' );\n};\n\nPageDots.prototype.onTap = // old method name, backwards-compatible\nPageDots.prototype.onClick = function( event ) {\n var target = event.target;\n // only care about dot clicks\n if ( target.nodeName != 'LI' ) {\n return;\n }\n\n this.parent.uiChange();\n var index = this.dots.indexOf( target );\n this.parent.select( index );\n};\n\nPageDots.prototype.destroy = function() {\n this.deactivate();\n this.allOff();\n};\n\nFlickity.PageDots = PageDots;\n\n// -------------------------- Flickity -------------------------- //\n\nutils.extend( Flickity.defaults, {\n pageDots: true,\n} );\n\nFlickity.createMethods.push('_createPageDots');\n\nvar proto = Flickity.prototype;\n\nproto._createPageDots = function() {\n if ( !this.options.pageDots ) {\n return;\n }\n this.pageDots = new PageDots( this );\n // events\n this.on( 'activate', this.activatePageDots );\n this.on( 'select', this.updateSelectedPageDots );\n this.on( 'cellChange', this.updatePageDots );\n this.on( 'resize', this.updatePageDots );\n this.on( 'deactivate', this.deactivatePageDots );\n};\n\nproto.activatePageDots = function() {\n this.pageDots.activate();\n};\n\nproto.updateSelectedPageDots = function() {\n this.pageDots.updateSelected();\n};\n\nproto.updatePageDots = function() {\n this.pageDots.setDots();\n};\n\nproto.deactivatePageDots = function() {\n this.pageDots.deactivate();\n};\n\n// ----- ----- //\n\nFlickity.PageDots = PageDots;\n\nreturn Flickity;\n\n} ) );\n","// player & autoPlay\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'ev-emitter/ev-emitter',\n 'fizzy-ui-utils/utils',\n './flickity',\n ], function( EvEmitter, utils, Flickity ) {\n return factory( EvEmitter, utils, Flickity );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n require('ev-emitter'),\n require('fizzy-ui-utils'),\n require('./flickity')\n );\n } else {\n // browser global\n factory(\n window.EvEmitter,\n window.fizzyUIUtils,\n window.Flickity\n );\n }\n\n}( window, function factory( EvEmitter, utils, Flickity ) {\n\n'use strict';\n\n// -------------------------- Player -------------------------- //\n\nfunction Player( parent ) {\n this.parent = parent;\n this.state = 'stopped';\n // visibility change event handler\n this.onVisibilityChange = this.visibilityChange.bind( this );\n this.onVisibilityPlay = this.visibilityPlay.bind( this );\n}\n\nPlayer.prototype = Object.create( EvEmitter.prototype );\n\n// start play\nPlayer.prototype.play = function() {\n if ( this.state == 'playing' ) {\n return;\n }\n // do not play if page is hidden, start playing when page is visible\n var isPageHidden = document.hidden;\n if ( isPageHidden ) {\n document.addEventListener( 'visibilitychange', this.onVisibilityPlay );\n return;\n }\n\n this.state = 'playing';\n // listen to visibility change\n document.addEventListener( 'visibilitychange', this.onVisibilityChange );\n // start ticking\n this.tick();\n};\n\nPlayer.prototype.tick = function() {\n // do not tick if not playing\n if ( this.state != 'playing' ) {\n return;\n }\n\n var time = this.parent.options.autoPlay;\n // default to 3 seconds\n time = typeof time == 'number' ? time : 3000;\n var _this = this;\n // HACK: reset ticks if stopped and started within interval\n this.clear();\n this.timeout = setTimeout( function() {\n _this.parent.next( true );\n _this.tick();\n }, time );\n};\n\nPlayer.prototype.stop = function() {\n this.state = 'stopped';\n this.clear();\n // remove visibility change event\n document.removeEventListener( 'visibilitychange', this.onVisibilityChange );\n};\n\nPlayer.prototype.clear = function() {\n clearTimeout( this.timeout );\n};\n\nPlayer.prototype.pause = function() {\n if ( this.state == 'playing' ) {\n this.state = 'paused';\n this.clear();\n }\n};\n\nPlayer.prototype.unpause = function() {\n // re-start play if paused\n if ( this.state == 'paused' ) {\n this.play();\n }\n};\n\n// pause if page visibility is hidden, unpause if visible\nPlayer.prototype.visibilityChange = function() {\n var isPageHidden = document.hidden;\n this[ isPageHidden ? 'pause' : 'unpause' ]();\n};\n\nPlayer.prototype.visibilityPlay = function() {\n this.play();\n document.removeEventListener( 'visibilitychange', this.onVisibilityPlay );\n};\n\n// -------------------------- Flickity -------------------------- //\n\nutils.extend( Flickity.defaults, {\n pauseAutoPlayOnHover: true,\n} );\n\nFlickity.createMethods.push('_createPlayer');\nvar proto = Flickity.prototype;\n\nproto._createPlayer = function() {\n this.player = new Player( this );\n\n this.on( 'activate', this.activatePlayer );\n this.on( 'uiChange', this.stopPlayer );\n this.on( 'pointerDown', this.stopPlayer );\n this.on( 'deactivate', this.deactivatePlayer );\n};\n\nproto.activatePlayer = function() {\n if ( !this.options.autoPlay ) {\n return;\n }\n this.player.play();\n this.element.addEventListener( 'mouseenter', this );\n};\n\n// Player API, don't hate the ... thanks I know where the door is\n\nproto.playPlayer = function() {\n this.player.play();\n};\n\nproto.stopPlayer = function() {\n this.player.stop();\n};\n\nproto.pausePlayer = function() {\n this.player.pause();\n};\n\nproto.unpausePlayer = function() {\n this.player.unpause();\n};\n\nproto.deactivatePlayer = function() {\n this.player.stop();\n this.element.removeEventListener( 'mouseenter', this );\n};\n\n// ----- mouseenter/leave ----- //\n\n// pause auto-play on hover\nproto.onmouseenter = function() {\n if ( !this.options.pauseAutoPlayOnHover ) {\n return;\n }\n this.player.pause();\n this.element.addEventListener( 'mouseleave', this );\n};\n\n// resume auto-play on hover off\nproto.onmouseleave = function() {\n this.player.unpause();\n this.element.removeEventListener( 'mouseleave', this );\n};\n\n// ----- ----- //\n\nFlickity.Player = Player;\n\nreturn Flickity;\n\n} ) );\n","// prev/next buttons\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n './flickity',\n 'unipointer/unipointer',\n 'fizzy-ui-utils/utils',\n ], function( Flickity, Unipointer, utils ) {\n return factory( window, Flickity, Unipointer, utils );\n } );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('./flickity'),\n require('unipointer'),\n require('fizzy-ui-utils')\n );\n } else {\n // browser global\n factory(\n window,\n window.Flickity,\n window.Unipointer,\n window.fizzyUIUtils\n );\n }\n\n}( window, function factory( window, Flickity, Unipointer, utils ) {\n'use strict';\n\nvar svgURI = 'http://www.w3.org/2000/svg';\n\n// -------------------------- PrevNextButton -------------------------- //\n\nfunction PrevNextButton( direction, parent ) {\n this.direction = direction;\n this.parent = parent;\n this._create();\n}\n\nPrevNextButton.prototype = Object.create( Unipointer.prototype );\n\nPrevNextButton.prototype._create = function() {\n // properties\n this.isEnabled = true;\n this.isPrevious = this.direction == -1;\n var leftDirection = this.parent.options.rightToLeft ? 1 : -1;\n this.isLeft = this.direction == leftDirection;\n\n var element = this.element = document.createElement('button');\n element.className = 'flickity-button flickity-prev-next-button';\n element.className += this.isPrevious ? ' previous' : ' next';\n // prevent button from submitting form http://stackoverflow.com/a/10836076/182183\n element.setAttribute( 'type', 'button' );\n // init as disabled\n this.disable();\n\n element.setAttribute( 'aria-label', this.isPrevious ? 'Previous' : 'Next' );\n\n // create arrow\n var svg = this.createSVG();\n element.appendChild( svg );\n // events\n this.parent.on( 'select', this.update.bind( this ) );\n this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) );\n};\n\nPrevNextButton.prototype.activate = function() {\n this.bindStartEvent( this.element );\n this.element.addEventListener( 'click', this );\n // add to DOM\n this.parent.element.appendChild( this.element );\n};\n\nPrevNextButton.prototype.deactivate = function() {\n // remove from DOM\n this.parent.element.removeChild( this.element );\n // click events\n this.unbindStartEvent( this.element );\n this.element.removeEventListener( 'click', this );\n};\n\nPrevNextButton.prototype.createSVG = function() {\n var svg = document.createElementNS( svgURI, 'svg' );\n svg.setAttribute( 'class', 'flickity-button-icon' );\n svg.setAttribute( 'viewBox', '0 0 100 100' );\n var path = document.createElementNS( svgURI, 'path' );\n var pathMovements = getArrowMovements( this.parent.options.arrowShape );\n path.setAttribute( 'd', pathMovements );\n path.setAttribute( 'class', 'arrow' );\n // rotate arrow\n if ( !this.isLeft ) {\n path.setAttribute( 'transform', 'translate(100, 100) rotate(180) ' );\n }\n svg.appendChild( path );\n return svg;\n};\n\n// get SVG path movmement\nfunction getArrowMovements( shape ) {\n // use shape as movement if string\n if ( typeof shape == 'string' ) {\n return shape;\n }\n // create movement string\n return 'M ' + shape.x0 + ',50' +\n ' L ' + shape.x1 + ',' + ( shape.y1 + 50 ) +\n ' L ' + shape.x2 + ',' + ( shape.y2 + 50 ) +\n ' L ' + shape.x3 + ',50 ' +\n ' L ' + shape.x2 + ',' + ( 50 - shape.y2 ) +\n ' L ' + shape.x1 + ',' + ( 50 - shape.y1 ) +\n ' Z';\n}\n\nPrevNextButton.prototype.handleEvent = utils.handleEvent;\n\nPrevNextButton.prototype.onclick = function() {\n if ( !this.isEnabled ) {\n return;\n }\n this.parent.uiChange();\n var method = this.isPrevious ? 'previous' : 'next';\n this.parent[ method ]();\n};\n\n// ----- ----- //\n\nPrevNextButton.prototype.enable = function() {\n if ( this.isEnabled ) {\n return;\n }\n this.element.disabled = false;\n this.isEnabled = true;\n};\n\nPrevNextButton.prototype.disable = function() {\n if ( !this.isEnabled ) {\n return;\n }\n this.element.disabled = true;\n this.isEnabled = false;\n};\n\nPrevNextButton.prototype.update = function() {\n // index of first or last slide, if previous or next\n var slides = this.parent.slides;\n // enable is wrapAround and at least 2 slides\n if ( this.parent.options.wrapAround && slides.length > 1 ) {\n this.enable();\n return;\n }\n var lastIndex = slides.length ? slides.length - 1 : 0;\n var boundIndex = this.isPrevious ? 0 : lastIndex;\n var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable';\n this[ method ]();\n};\n\nPrevNextButton.prototype.destroy = function() {\n this.deactivate();\n this.allOff();\n};\n\n// -------------------------- Flickity prototype -------------------------- //\n\nutils.extend( Flickity.defaults, {\n prevNextButtons: true,\n arrowShape: {\n x0: 10,\n x1: 60, y1: 50,\n x2: 70, y2: 40,\n x3: 30,\n },\n} );\n\nFlickity.createMethods.push('_createPrevNextButtons');\nvar proto = Flickity.prototype;\n\nproto._createPrevNextButtons = function() {\n if ( !this.options.prevNextButtons ) {\n return;\n }\n\n this.prevButton = new PrevNextButton( -1, this );\n this.nextButton = new PrevNextButton( 1, this );\n\n this.on( 'activate', this.activatePrevNextButtons );\n};\n\nproto.activatePrevNextButtons = function() {\n this.prevButton.activate();\n this.nextButton.activate();\n this.on( 'deactivate', this.deactivatePrevNextButtons );\n};\n\nproto.deactivatePrevNextButtons = function() {\n this.prevButton.deactivate();\n this.nextButton.deactivate();\n this.off( 'deactivate', this.deactivatePrevNextButtons );\n};\n\n// -------------------------- -------------------------- //\n\nFlickity.PrevNextButton = PrevNextButton;\n\nreturn Flickity;\n\n} ) );\n","// slide\n( function( window, factory ) {\n // universal module definition\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory();\n } else {\n // browser global\n window.Flickity = window.Flickity || {};\n window.Flickity.Slide = factory();\n }\n\n}( window, function factory() {\n'use strict';\n\nfunction Slide( parent ) {\n this.parent = parent;\n this.isOriginLeft = parent.originSide == 'left';\n this.cells = [];\n this.outerWidth = 0;\n this.height = 0;\n}\n\nvar proto = Slide.prototype;\n\nproto.addCell = function( cell ) {\n this.cells.push( cell );\n this.outerWidth += cell.size.outerWidth;\n this.height = Math.max( cell.size.outerHeight, this.height );\n // first cell stuff\n if ( this.cells.length == 1 ) {\n this.x = cell.x; // x comes from first cell\n var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight';\n this.firstMargin = cell.size[ beginMargin ];\n }\n};\n\nproto.updateTarget = function() {\n var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft';\n var lastCell = this.getLastCell();\n var lastMargin = lastCell ? lastCell.size[ endMargin ] : 0;\n var slideWidth = this.outerWidth - ( this.firstMargin + lastMargin );\n this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign;\n};\n\nproto.getLastCell = function() {\n return this.cells[ this.cells.length - 1 ];\n};\n\nproto.select = function() {\n this.cells.forEach( function( cell ) {\n cell.select();\n } );\n};\n\nproto.unselect = function() {\n this.cells.forEach( function( cell ) {\n cell.unselect();\n } );\n};\n\nproto.getCellElements = function() {\n return this.cells.map( function( cell ) {\n return cell.element;\n } );\n};\n\nreturn Slide;\n\n} ) );\n","/*!\r\n * JavaScript Custom Forms : Checkbox Module\r\n *\r\n * Copyright 2014-2015 PSD2HTML - http://psd2html.com/jcf\r\n * Released under the MIT license (LICENSE.txt)\r\n *\r\n * Version: 1.2.3\r\n */\r\n\r\n(function(jcf) {\r\n\r\njcf.addModule(function($) {\r\n\t'use strict';\r\n\r\n\treturn {\r\n\t\tname: 'Checkbox',\r\n\t\tselector: 'input[type=\"checkbox\"]',\r\n\t\toptions: {\r\n\t\t\twrapNative: true,\r\n\t\t\tcheckedClass: 'jcf-checked',\r\n\t\t\tuncheckedClass: 'jcf-unchecked',\r\n\t\t\tlabelActiveClass: 'jcf-label-active',\r\n\t\t\tfakeStructure: ''\r\n\t\t},\r\n\t\tmatchElement: function(element) {\r\n\t\t\treturn element.is(':checkbox');\r\n\t\t},\r\n\t\tinit: function() {\r\n\t\t\tthis.initStructure();\r\n\t\t\tthis.attachEvents();\r\n\t\t\tthis.refresh();\r\n\t\t},\r\n\t\tinitStructure: function() {\r\n\t\t\t// prepare structure\r\n\t\t\tthis.doc = $(document);\r\n\t\t\tthis.realElement = $(this.options.element);\r\n\t\t\tthis.fakeElement = $(this.options.fakeStructure).insertAfter(this.realElement);\r\n\t\t\tthis.labelElement = this.getLabelFor();\r\n\r\n\t\t\tif (this.options.wrapNative) {\r\n\t\t\t\t// wrap native checkbox inside fake block\r\n\t\t\t\tthis.realElement.appendTo(this.fakeElement).css({\r\n\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\theight: '100%',\r\n\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\topacity: 0,\r\n\t\t\t\t\tmargin: 0\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t// just hide native checkbox\r\n\t\t\t\tthis.realElement.addClass(this.options.hiddenClass);\r\n\t\t\t}\r\n\t\t},\r\n\t\tattachEvents: function() {\r\n\t\t\t// add event handlers\r\n\t\t\tthis.realElement.on({\r\n\t\t\t\tfocus: this.onFocus,\r\n\t\t\t\tclick: this.onRealClick\r\n\t\t\t});\r\n\t\t\tthis.fakeElement.on('click', this.onFakeClick);\r\n\t\t\tthis.fakeElement.on('jcf-pointerdown', this.onPress);\r\n\t\t},\r\n\t\tonRealClick: function(e) {\r\n\t\t\t// just redraw fake element (setTimeout handles click that might be prevented)\r\n\t\t\tvar self = this;\r\n\t\t\tthis.savedEventObject = e;\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tself.refresh();\r\n\t\t\t}, 0);\r\n\t\t},\r\n\t\tonFakeClick: function(e) {\r\n\t\t\t// skip event if clicked on real element inside wrapper\r\n\t\t\tif (this.options.wrapNative && this.realElement.is(e.target)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// toggle checked class\r\n\t\t\tif (!this.realElement.is(':disabled')) {\r\n\t\t\t\tdelete this.savedEventObject;\r\n\t\t\t\tthis.stateChecked = this.realElement.prop('checked');\r\n\t\t\t\tthis.realElement.prop('checked', !this.stateChecked);\r\n\t\t\t\tthis.fireNativeEvent(this.realElement, 'click');\r\n\t\t\t\tif (this.savedEventObject && this.savedEventObject.isDefaultPrevented()) {\r\n\t\t\t\t\tthis.realElement.prop('checked', this.stateChecked);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.fireNativeEvent(this.realElement, 'change');\r\n\t\t\t\t}\r\n\t\t\t\tdelete this.savedEventObject;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonFocus: function() {\r\n\t\t\tif (!this.pressedFlag || !this.focusedFlag) {\r\n\t\t\t\tthis.focusedFlag = true;\r\n\t\t\t\tthis.fakeElement.addClass(this.options.focusClass);\r\n\t\t\t\tthis.realElement.on('blur', this.onBlur);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonBlur: function() {\r\n\t\t\tif (!this.pressedFlag) {\r\n\t\t\t\tthis.focusedFlag = false;\r\n\t\t\t\tthis.fakeElement.removeClass(this.options.focusClass);\r\n\t\t\t\tthis.realElement.off('blur', this.onBlur);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonPress: function(e) {\r\n\t\t\tif (!this.focusedFlag && e.pointerType === 'mouse') {\r\n\t\t\t\tthis.realElement.focus();\r\n\t\t\t}\r\n\t\t\tthis.pressedFlag = true;\r\n\t\t\tthis.fakeElement.addClass(this.options.pressedClass);\r\n\t\t\tthis.doc.on('jcf-pointerup', this.onRelease);\r\n\t\t},\r\n\t\tonRelease: function(e) {\r\n\t\t\tif (this.focusedFlag && e.pointerType === 'mouse') {\r\n\t\t\t\tthis.realElement.focus();\r\n\t\t\t}\r\n\t\t\tthis.pressedFlag = false;\r\n\t\t\tthis.fakeElement.removeClass(this.options.pressedClass);\r\n\t\t\tthis.doc.off('jcf-pointerup', this.onRelease);\r\n\t\t},\r\n\t\tgetLabelFor: function() {\r\n\t\t\tvar parentLabel = this.realElement.closest('label'),\r\n\t\t\t\telementId = this.realElement.prop('id');\r\n\r\n\t\t\tif (!parentLabel.length && elementId) {\r\n\t\t\t\tparentLabel = $('label[for=\"' + elementId + '\"]');\r\n\t\t\t}\r\n\t\t\treturn parentLabel.length ? parentLabel : null;\r\n\t\t},\r\n\t\trefresh: function() {\r\n\t\t\t// redraw custom checkbox\r\n\t\t\tvar isChecked = this.realElement.is(':checked'),\r\n\t\t\t\tisDisabled = this.realElement.is(':disabled');\r\n\r\n\t\t\tthis.fakeElement.toggleClass(this.options.checkedClass, isChecked)\r\n\t\t\t\t\t\t\t.toggleClass(this.options.uncheckedClass, !isChecked)\r\n\t\t\t\t\t\t\t.toggleClass(this.options.disabledClass, isDisabled);\r\n\r\n\t\t\tif (this.labelElement) {\r\n\t\t\t\tthis.labelElement.toggleClass(this.options.labelActiveClass, isChecked);\r\n\t\t\t}\r\n\t\t},\r\n\t\tdestroy: function() {\r\n\t\t\t// restore structure\r\n\t\t\tif (this.options.wrapNative) {\r\n\t\t\t\tthis.realElement.insertBefore(this.fakeElement).css({\r\n\t\t\t\t\tposition: '',\r\n\t\t\t\t\twidth: '',\r\n\t\t\t\t\theight: '',\r\n\t\t\t\t\topacity: '',\r\n\t\t\t\t\tmargin: ''\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tthis.realElement.removeClass(this.options.hiddenClass);\r\n\t\t\t}\r\n\r\n\t\t\t// removing element will also remove its event handlers\r\n\t\t\tthis.fakeElement.off('jcf-pointerdown', this.onPress);\r\n\t\t\tthis.fakeElement.remove();\r\n\r\n\t\t\t// remove other event handlers\r\n\t\t\tthis.doc.off('jcf-pointerup', this.onRelease);\r\n\t\t\tthis.realElement.off({\r\n\t\t\t\tfocus: this.onFocus,\r\n\t\t\t\tclick: this.onRealClick\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n});\r\n\r\n}(jcf));\r\n","/*!\r\n * JavaScript Custom Forms\r\n *\r\n * Copyright 2014-2015 PSD2HTML - http://psd2html.com/jcf\r\n * Released under the MIT license (LICENSE.txt)\r\n *\r\n * Version: 1.2.3\r\n */\r\n;(function(root, factory) {\r\n\t'use strict';\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(['jquery'], factory);\r\n\t} else if (typeof exports === 'object') {\r\n\t\tmodule.exports = factory(require('jquery'));\r\n\t} else {\r\n\t\troot.jcf = factory(jQuery);\r\n\t}\r\n}(this, function($) {\r\n\t'use strict';\r\n\r\n\t// define version\r\n\tvar version = '1.2.3';\r\n\r\n\t// private variables\r\n\tvar customInstances = [];\r\n\r\n\t// default global options\r\n\tvar commonOptions = {\r\n\t\toptionsKey: 'jcf',\r\n\t\tdataKey: 'jcf-instance',\r\n\t\trtlClass: 'jcf-rtl',\r\n\t\tfocusClass: 'jcf-focus',\r\n\t\tpressedClass: 'jcf-pressed',\r\n\t\tdisabledClass: 'jcf-disabled',\r\n\t\thiddenClass: 'jcf-hidden',\r\n\t\tresetAppearanceClass: 'jcf-reset-appearance',\r\n\t\tunselectableClass: 'jcf-unselectable'\r\n\t};\r\n\r\n\t// detect device type\r\n\tvar isTouchDevice = ('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch,\r\n\t\tisWinPhoneDevice = /Windows Phone/.test(navigator.userAgent);\r\n\tcommonOptions.isMobileDevice = !!(isTouchDevice || isWinPhoneDevice);\r\n\r\n\t// create global stylesheet if custom forms are used\r\n\tvar createStyleSheet = function() {\r\n\t\tvar styleTag = $('