';\n html += ''; // lightpick__month-title-bar\n\n html += '';\n for (var w = opts.firstDay + 4; w < 7 + opts.firstDay + 4; ++w) {\n html += '
' + weekdayName(opts, w) + '
';\n }\n html += '
'; // lightpick__days-of-the-week\n\n html += '';\n\n if (day.isoWeekday() !== opts.firstDay) {\n var prevDays = day.isoWeekday() - opts.firstDay > 0 ? day.isoWeekday() - opts.firstDay : day.isoWeekday(),\n prevMonth = moment(day).subtract(prevDays, 'day'),\n daysInMonth = prevMonth.daysInMonth();\n\n for (var d = prevMonth.get('date'); d <= daysInMonth; d++) {\n html += renderDay(opts, prevMonth, i > 0, 'is-previous-month');\n\n prevMonth.add(1, 'day');\n }\n }\n\n daysInMonth = day.daysInMonth();\n\n for (var j = 0; j < daysInMonth; j++) {\n html += renderDay(opts, day);\n\n day.add(1, 'day');\n }\n\n var nextMonth = moment(day),\n nextDays = 7 - nextMonth.isoWeekday() + opts.firstDay;\n\n if (nextDays < 7) {\n for (var h = nextMonth.get('date'); h <= nextDays; h++) {\n html += renderDay(opts, nextMonth, i < opts.numberOfMonths - 1, 'is-next-month');\n\n nextMonth.add(1, 'day');\n }\n }\n\n html += '
'; // lightpick__days\n\n html += ''; // lightpick__month\n\n monthDate.add(1, 'month');\n }\n\n opts.calendar[1] = moment(monthDate);\n\n el.querySelector('.lightpick__months').innerHTML = html;\n },\n\n updateDates = function (el, opts)\n {\n var days = el.querySelectorAll('.lightpick__day');\n [].forEach.call(days, function (day) {\n day.outerHTML = renderDay(opts, parseInt(day.getAttribute('data-time'), 10), false, day.className.split(' '));\n });\n\n checkDisabledDatesInRange(el, opts);\n },\n\n checkDisabledDatesInRange = function (el, opts)\n {\n if (opts.disabledDatesInRange || !opts.startDate || opts.endDate || !opts.disableDates) return;\n\n var days = el.querySelectorAll('.lightpick__day'),\n disabledArray = opts.disableDates.map(function (entry) {\n return entry instanceof Array || Object.prototype.toString.call(entry) === '[object Array]' ? entry[0] : entry;\n }),\n closestPrev = moment(disabledArray.filter(function (d) {\n return moment(d).isBefore(opts.startDate);\n }).sort(function (a, b) {\n return moment(b).isAfter(moment(a));\n })[0]),\n closestNext = moment(disabledArray.filter(function (d) {\n return moment(d).isAfter(opts.startDate);\n }).sort(function (a, b) {\n return moment(a).isAfter(moment(b));\n })[0]);\n\n [].forEach.call(days, function (dayCell) {\n var day = moment(parseInt(dayCell.getAttribute('data-time'), 10));\n if (\n (closestPrev && day.isBefore(closestPrev) && opts.startDate.isAfter(closestPrev))\n || (closestNext && day.isAfter(closestNext) && closestNext.isAfter(opts.startDate))\n ) {\n dayCell.classList.remove('is-available');\n dayCell.classList.add('is-disabled');\n }\n });\n },\n\n Lightpick = function (options)\n {\n var self = this,\n opts = self.config(options);\n\n self.el = document.createElement('section');\n\n self.el.className = 'lightpick lightpick--' + opts.numberOfColumns + '-columns is-hidden';\n\n if (opts.inline) {\n self.el.className += ' lightpick--inlined';\n }\n\n var html = ''\n + (opts.numberOfMonths > 1 ? renderTopButtons(opts) : '')\n + '
'\n + '
';\n\n if (opts.footer) {\n html += '';\n }\n\n html += '
';\n\n self.el.innerHTML = html;\n\n\n if (opts.parentEl instanceof Node) {\n opts.parentEl.appendChild(self.el);\n }\n else if (opts.parentEl === 'body' && opts.inline) {\n opts.field.parentNode.appendChild(self.el);\n }\n else {\n document.querySelector(opts.parentEl).appendChild(self.el);\n }\n\n self._onMouseDown = function (e)\n {\n if (!self.isShowing) {\n return;\n }\n\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n\n e.stopPropagation();\n\n if (!target.classList.contains('lightpick__select')) {\n e.preventDefault();\n }\n\n var opts = self._opts;\n\n if (target.classList.contains('lightpick__day') && target.classList.contains('is-available')) {\n\n var day = moment(parseInt(target.getAttribute('data-time'), 10));\n\n if (!opts.disabledDatesInRange && opts.disableDates && opts.startDate) {\n var start = day.isAfter(opts.startDate) ? moment(opts.startDate) : moment(day),\n end = day.isAfter(opts.startDate) ? moment(day) : moment(opts.startDate),\n\n isInvalidRange = opts.disableDates.filter(function (d) {\n if (d instanceof Array || Object.prototype.toString.call(d) === '[object Array]') {\n var _from = moment(d[0]),\n _to = moment(d[1]);\n\n return _from.isValid() && _to.isValid() && (_from.isBetween(start, end, 'day', '[]') || _to.isBetween(start, end, 'day', '[]'));\n }\n\n return moment(d).isBetween(start, end, 'day', '[]');\n });\n\n if (isInvalidRange.length) {\n self.setStartDate(null);\n self.setEndDate(null);\n\n target.dispatchEvent(new Event('mousedown'));\n self.el.querySelector('.lightpick__tooltip').style.visibility = 'hidden';\n\n updateDates(self.el, opts);\n return;\n }\n }\n\n if (opts.singleDate || (!opts.startDate && !opts.endDate) || (opts.startDate && opts.endDate)) {\n if (opts.repick && opts.startDate && opts.endDate) {\n if (opts.repickTrigger === opts.field) {\n self.setStartDate(day);\n target.classList.add('is-start-date');\n }\n else {\n self.setEndDate(day);\n target.classList.add('is-end-date');\n }\n\n if (opts.startDate.isAfter(opts.endDate)) {\n self.swapDate();\n }\n\n if (opts.autoclose) {\n setTimeout(function () {\n self.hide();\n }, 100);\n }\n }\n else {\n self.setStartDate(day);\n self.setEndDate(null);\n\n target.classList.add('is-start-date');\n\n if (opts.singleDate && opts.autoclose) {\n setTimeout(function () {\n self.hide();\n }, 100);\n }\n else if (!opts.singleDate || opts.inline || !opts.autoclose) {\n updateDates(self.el, opts);\n }\n }\n }\n else if (opts.startDate && !opts.endDate) {\n self.setEndDate(day);\n\n if (opts.startDate.isAfter(opts.endDate)) {\n self.swapDate();\n }\n\n target.classList.add('is-end-date');\n\n\n if (opts.autoclose) {\n setTimeout(function () {\n self.hide();\n }, 100);\n }\n else {\n updateDates(self.el, opts);\n }\n }\n\n if (!opts.disabledDatesInRange) {\n if (self.el.querySelectorAll('.lightpick__day.is-available').length === 0) {\n self.setStartDate(null);\n updateDates(self.el, opts);\n\n if (opts.footer) {\n if (typeof self._opts.onError === 'function') {\n self._opts.onError.call(self, 'Invalid range');\n }\n else {\n var footerMessage = self.el.querySelector('.lightpick__footer-message');\n\n if (footerMessage) {\n footerMessage.innerHTML = opts.locale.not_allowed_range;\n\n setTimeout(function () {\n footerMessage.innerHTML = '';\n }, 3000);\n }\n }\n }\n }\n }\n }\n else if (target.classList.contains('lightpick__previous-action')) {\n self.prevMonth();\n }\n else if (target.classList.contains('lightpick__next-action')) {\n self.nextMonth();\n }\n else if (target.classList.contains('lightpick__close-action') || target.classList.contains('lightpick__apply-action')) {\n self.hide();\n }\n else if (target.classList.contains('lightpick__reset-action')) {\n self.reset();\n }\n };\n self._onMouseEnter = function (e)\n {\n if (!self.isShowing) {\n return;\n }\n\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n\n var opts = self._opts;\n\n if (target.classList.contains('lightpick__day') && target.classList.contains('disabled-tooltip') && opts.locale.tooltipOnDisabled) {\n self.showTooltip(target, opts.locale.tooltipOnDisabled);\n return;\n }\n else {\n self.hideTooltip();\n }\n\n if (opts.singleDate || (!opts.startDate && !opts.endDate)) {\n return;\n }\n\n if (!target.classList.contains('lightpick__day') && !target.classList.contains('is-available')) {\n return;\n }\n\n if ((opts.startDate && !opts.endDate) || opts.repick) {\n var hoverDate = moment(parseInt(target.getAttribute('data-time'), 10));\n\n if (!hoverDate.isValid()) {\n return;\n }\n\n var startDate = (opts.startDate && !opts.endDate) || (opts.repick && opts.repickTrigger === opts.secondField) ? opts.startDate : opts.endDate;\n\n var days = self.el.querySelectorAll('.lightpick__day');\n [].forEach.call(days, function (day) {\n var dt = moment(parseInt(day.getAttribute('data-time'), 10));\n\n day.classList.remove('is-flipped');\n\n if (dt.isValid() && dt.isSameOrAfter(startDate, 'day') && dt.isSameOrBefore(hoverDate, 'day')) {\n day.classList.add('is-in-range');\n\n if (opts.repickTrigger === opts.field && dt.isSameOrAfter(opts.endDate)) {\n day.classList.add('is-flipped');\n }\n }\n else if (dt.isValid() && dt.isSameOrAfter(hoverDate, 'day') && dt.isSameOrBefore(startDate, 'day')) {\n day.classList.add('is-in-range');\n\n if (((opts.startDate && !opts.endDate) || opts.repickTrigger === opts.secondField) && dt.isSameOrBefore(opts.startDate)) {\n day.classList.add('is-flipped');\n }\n }\n else {\n day.classList.remove('is-in-range');\n }\n\n if (opts.startDate && opts.endDate && opts.repick && opts.repickTrigger === opts.field) {\n day.classList.remove('is-start-date');\n }\n else {\n day.classList.remove('is-end-date');\n }\n });\n\n if (opts.hoveringTooltip) {\n days = Math.abs(hoverDate.isAfter(startDate) ? hoverDate.diff(startDate, 'day') : startDate.diff(hoverDate, 'day'));\n\n if (!opts.tooltipNights) {\n days += 1;\n }\n\n if (days > 0 && !target.classList.contains('is-disabled')) {\n\n var pluralText = '';\n if (typeof opts.locale.pluralize === 'function') {\n pluralText = opts.locale.pluralize.call(self, days, opts.locale.tooltip);\n }\n\n self.showTooltip(target, days + ' ' + pluralText);\n }\n else {\n self.hideTooltip();\n }\n }\n\n if (opts.startDate && opts.endDate && opts.repick && opts.repickTrigger === opts.field) {\n target.classList.add('is-start-date');\n }\n else {\n target.classList.add('is-end-date');\n }\n }\n };\n self._onChange = function (e)\n {\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n\n if (target.classList.contains('lightpick__select-months')) {\n if (typeof self._opts.onMonthsChange === 'function') {\n self._opts.onMonthsChange.call(this, target.value);\n }\n\n self.gotoMonth(target.value);\n }\n else if (target.classList.contains('lightpick__select-years')) {\n if (typeof self._opts.onYearsChange === 'function') {\n self._opts.onYearsChange.call(this, target.value);\n }\n\n self.gotoYear(target.value);\n }\n };\n\n self._onInputChange = function (_e)\n {\n if (self._opts.singleDate) {\n if (!self._opts.autoclose) {\n self.gotoDate(opts.field.value);\n }\n }\n\n self.syncFields();\n\n if (!self.isShowing) {\n self.show();\n }\n };\n\n self._onInputFocus = function (e)\n {\n var target = e.target || e.srcElement;\n\n self.show(target);\n };\n\n self._onInputClick = function (e)\n {\n var target = e.target || e.srcElement;\n\n self.show(target);\n };\n\n self._onClick = function (e)\n {\n e = e || window.event;\n var target = e.target || e.srcElement,\n parentEl = target;\n\n if (!target) {\n return;\n }\n\n do {\n if ((parentEl.classList && parentEl.classList.contains('lightpick')) || parentEl === opts.field || (opts.secondField && parentEl === opts.secondField)) {\n return;\n }\n }\n while ((parentEl = parentEl.parentNode));\n\n if (self.isShowing && opts.hideOnBodyClick && target !== opts.field && parentEl !== opts.field) {\n self.hide();\n }\n };\n\n self.showTooltip = function (target, text)\n {\n var tooltip = self.el.querySelector('.lightpick__tooltip');\n\n var hasParentEl = self.el.classList.contains('lightpick--inlined'),\n dayBounding = target.getBoundingClientRect(),\n pickerBouding = hasParentEl ? self.el.parentNode.getBoundingClientRect() : self.el.getBoundingClientRect(),\n _left = (dayBounding.left - pickerBouding.left) + (dayBounding.width / 2),\n _top = dayBounding.top - pickerBouding.top;\n\n tooltip.style.visibility = 'visible';\n tooltip.textContent = text;\n\n var tooltipBounding = tooltip.getBoundingClientRect();\n\n _top -= tooltipBounding.height;\n _left -= (tooltipBounding.width / 2);\n\n setTimeout(function () {\n tooltip.style.top = _top + 'px';\n tooltip.style.left = _left + 'px';\n }, 10);\n };\n\n self.hideTooltip = function ()\n {\n var tooltip = self.el.querySelector('.lightpick__tooltip');\n tooltip.style.visibility = 'hidden';\n };\n\n self.el.addEventListener('mousedown', self._onMouseDown, true);\n self.el.addEventListener('mouseenter', self._onMouseEnter, true);\n self.el.addEventListener('touchend', self._onMouseDown, true);\n self.el.addEventListener('change', self._onChange, true);\n\n if (opts.inline) {\n self.show();\n }\n else {\n self.hide();\n }\n\n opts.field.addEventListener('change', self._onInputChange);\n opts.field.addEventListener('click', self._onInputClick);\n opts.field.addEventListener('focus', self._onInputFocus);\n\n if (opts.secondField) {\n opts.secondField.addEventListener('change', self._onInputChange);\n opts.secondField.addEventListener('click', self._onInputClick);\n opts.secondField.addEventListener('focus', self._onInputFocus);\n }\n };\n\n Lightpick.prototype = {\n config: function (options)\n {\n var opts = Object.assign({}, defaults, options);\n\n opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;\n\n opts.calendar = [moment().set('date', 1)];\n\n if (opts.numberOfMonths === 1 && opts.numberOfColumns > 1) {\n opts.numberOfColumns = 1;\n }\n\n opts.minDate = opts.minDate && moment(opts.minDate, opts.format).isValid() ? moment(opts.minDate, opts.format) : null;\n\n opts.maxDate = opts.maxDate && moment(opts.maxDate, opts.format).isValid() ? moment(opts.maxDate, opts.format) : null;\n\n if (opts.lang === 'auto') {\n var browserLang = navigator.language || navigator.userLanguage;\n if (browserLang) {\n opts.lang = browserLang;\n }\n else {\n opts.lang = 'en-US';\n }\n }\n\n if (opts.secondField && opts.singleDate) {\n opts.singleDate = false;\n }\n\n if (opts.hoveringTooltip && opts.singleDate) {\n opts.hoveringTooltip = false;\n }\n\n if (Object.prototype.toString.call(options.locale) === '[object Object]') {\n opts.locale = Object.assign({}, defaults.locale, options.locale);\n }\n\n if (window.innerWidth < 480 && opts.numberOfMonths > 1) {\n opts.numberOfMonths = 1;\n opts.numberOfColumns = 1;\n }\n\n if (opts.repick && !opts.secondField) {\n opts.repick = false;\n }\n\n if (opts.inline) {\n opts.autoclose = false;\n opts.hideOnBodyClick = false;\n }\n\n this._opts = Object.assign({}, opts);\n\n this.syncFields();\n\n this.setStartDate(this._opts.startDate, true);\n this.setEndDate(this._opts.endDate, true);\n\n return this._opts;\n },\n\n syncFields: function ()\n {\n if (this._opts.singleDate || this._opts.secondField) {\n if (moment(this._opts.field.value, this._opts.format).isValid()) {\n this._opts.startDate = moment(this._opts.field.value, this._opts.format);\n }\n\n if (this._opts.secondField && moment(this._opts.secondField.value, this._opts.format).isValid()) {\n this._opts.endDate = moment(this._opts.secondField.value, this._opts.format);\n }\n }\n else {\n var dates = this._opts.field.value.split(this._opts.separator);\n\n if (dates.length === 2) {\n if (moment(dates[0], this._opts.format).isValid()) {\n this._opts.startDate = moment(dates[0], this._opts.format);\n }\n\n if (moment(dates[1], this._opts.format).isValid()) {\n this._opts.endDate = moment(dates[1], this._opts.format);\n }\n }\n }\n },\n\n swapDate: function ()\n {\n var tmp = moment(this._opts.startDate);\n this.setDateRange(this._opts.endDate, tmp);\n },\n\n gotoToday: function ()\n {\n this.gotoDate(new Date());\n },\n\n gotoDate: function (inputDate)\n {\n var date = moment(inputDate, this._opts.format);\n\n if (!date.isValid()) {\n date = moment();\n }\n\n date.set('date', 1);\n\n this._opts.calendar = [moment(date)];\n\n renderCalendar(this.el, this._opts);\n },\n\n gotoMonth: function (month)\n {\n if (isNaN(month)) {\n return;\n }\n\n this._opts.calendar[0].set('month', month);\n\n renderCalendar(this.el, this._opts);\n },\n\n gotoYear: function (year)\n {\n if (isNaN(year)) {\n return;\n }\n\n this._opts.calendar[0].set('year', year);\n\n renderCalendar(this.el, this._opts);\n },\n\n prevMonth: function ()\n {\n this._opts.calendar[0] = moment(this._opts.calendar[0]).subtract(this._opts.numberOfMonths, 'month');\n\n renderCalendar(this.el, this._opts);\n\n checkDisabledDatesInRange(this.el, this._opts);\n },\n\n nextMonth: function ()\n {\n this._opts.calendar[0] = moment(this._opts.calendar[1]);\n\n renderCalendar(this.el, this._opts);\n\n checkDisabledDatesInRange(this.el, this._opts);\n },\n\n updatePosition: function ()\n {\n if (this.el.classList.contains('lightpick--inlined')) return;\n\n // remove `is-hidden` class for getBoundingClientRect\n this.el.classList.remove('is-hidden');\n\n var rect = this._opts.field.getBoundingClientRect(),\n calRect = this.el.getBoundingClientRect(),\n orientation = this._opts.orientation.split(' '),\n top = 0,\n left = 0;\n\n if (orientation[0] == 'auto' || !(/top|bottom/.test(orientation[0]))) {\n if (rect.bottom + calRect.height > window.innerHeight && window.pageYOffset > calRect.height) {\n top = (rect.top + window.pageYOffset) - calRect.height;\n }\n else {\n top = rect.bottom + window.pageYOffset;\n }\n }\n else {\n top = rect[orientation[0]] + window.pageYOffset;\n\n if (orientation[0] == 'top') {\n top -= calRect.height;\n }\n }\n\n if (!(/left|right/.test(orientation[0])) && (!orientation[1] || orientation[1] == 'auto' || !(/left|right/.test(orientation[1])))) {\n if (rect.left + calRect.width > window.innerWidth) {\n left = (rect.right + window.pageXOffset) - calRect.width;\n }\n else {\n left = rect.left + window.pageXOffset;\n }\n }\n else {\n if (/left|right/.test(orientation[0])) {\n left = rect[orientation[0]] + window.pageXOffset;\n }\n else {\n left = rect[orientation[1]] + window.pageXOffset;\n }\n\n if (orientation[0] == 'right' || orientation[1] == 'right') {\n left -= calRect.width;\n }\n }\n\n this.el.classList.add('is-hidden');\n\n this.el.style.top = top + 'px';\n this.el.style.left = left + 'px';\n },\n\n setStartDate: function (date, preventOnSelect)\n {\n var dateISO = moment(date, moment.ISO_8601),\n dateOptFormat = moment(date, this._opts.format);\n\n if (!dateISO.isValid() && !dateOptFormat.isValid()) {\n this._opts.startDate = null;\n this._opts.field.value = '';\n return;\n }\n\n this._opts.startDate = moment(dateISO.isValid() ? dateISO : dateOptFormat);\n\n if (this._opts.singleDate || this._opts.secondField) {\n this._opts.field.value = this._opts.startDate.format(this._opts.format);\n }\n else {\n this._opts.field.value = this._opts.startDate.format(this._opts.format) + this._opts.separator + '...';\n }\n\n if (!preventOnSelect && typeof this._opts.onSelect === 'function') {\n this._opts.onSelect.call(this, this.getStartDate(), this.getEndDate());\n }\n\n if (!preventOnSelect && !this._opts.singleDate && typeof this._opts.onSelectStart === 'function') {\n this._opts.onSelectStart.call(this, this.getStartDate());\n }\n },\n\n setEndDate: function (date, preventOnSelect)\n {\n var dateISO = moment(date, moment.ISO_8601),\n dateOptFormat = moment(date, this._opts.format);\n\n if (!dateISO.isValid() && !dateOptFormat.isValid()) {\n this._opts.endDate = null;\n\n if (this._opts.secondField) {\n this._opts.secondField.value = '';\n }\n else if (!this._opts.singleDate && this._opts.startDate) {\n this._opts.field.value = this._opts.startDate.format(this._opts.format) + this._opts.separator + '...';\n }\n return;\n }\n\n this._opts.endDate = moment(dateISO.isValid() ? dateISO : dateOptFormat);\n\n if (this._opts.secondField) {\n this._opts.field.value = this._opts.startDate.format(this._opts.format);\n this._opts.secondField.value = this._opts.endDate.format(this._opts.format);\n }\n else {\n this._opts.field.value = this._opts.startDate.format(this._opts.format) + this._opts.separator + this._opts.endDate.format(this._opts.format);\n }\n\n if (!preventOnSelect && typeof this._opts.onSelect === 'function') {\n this._opts.onSelect.call(this, this.getStartDate(), this.getEndDate());\n }\n\n if (!preventOnSelect && !this._opts.singleDate && typeof this._opts.onSelectEnd === 'function') {\n this._opts.onSelectEnd.call(this, this.getEndDate());\n }\n },\n\n setDate: function (date, preventOnSelect)\n {\n if (!this._opts.singleDate) {\n return;\n }\n this.setStartDate(date, preventOnSelect);\n\n if (this.isShowing) {\n updateDates(this.el, this._opts);\n }\n },\n\n setDateRange: function (start, end, preventOnSelect)\n {\n if (this._opts.singleDate) {\n return;\n }\n this.setStartDate(start, true);\n this.setEndDate(end, true);\n\n if (this.isShowing) {\n updateDates(this.el, this._opts);\n }\n\n if (!preventOnSelect && typeof this._opts.onSelect === 'function') {\n this._opts.onSelect.call(this, this.getStartDate(), this.getEndDate());\n }\n },\n\n setDisableDates: function (dates)\n {\n this._opts.disableDates = dates;\n\n if (this.isShowing) {\n updateDates(this.el, this._opts);\n }\n },\n\n getStartDate: function ()\n {\n return moment(this._opts.startDate).isValid() ? this._opts.startDate.clone() : null;\n },\n\n getEndDate: function ()\n {\n return moment(this._opts.endDate).isValid() ? this._opts.endDate.clone() : null;\n },\n\n getDate: function ()\n {\n return moment(this._opts.startDate).isValid() ? this._opts.startDate.clone() : null;\n },\n\n toString: function (format)\n {\n if (this._opts.singleDate) {\n return moment(this._opts.startDate).isValid() ? this._opts.startDate.format(format) : '';\n }\n\n if (moment(this._opts.startDate).isValid() && moment(this._opts.endDate).isValid()) {\n return this._opts.startDate.format(format) + this._opts.separator + this._opts.endDate.format(format);\n }\n\n if (moment(this._opts.startDate).isValid() && !moment(this._opts.endDate).isValid()) {\n return this._opts.startDate.format(format) + this._opts.separator + '...';\n }\n\n if (!moment(this._opts.startDate).isValid() && moment(this._opts.endDate).isValid()) {\n return '...' + this._opts.separator + this._opts.endDate.format(format);\n }\n\n return '';\n },\n\n show: function (target)\n {\n if (!this.isShowing) {\n this.isShowing = true;\n\n if (this._opts.repick) {\n this._opts.repickTrigger = target;\n }\n\n this.syncFields();\n\n if (this._opts.secondField && this._opts.secondField === target && this._opts.endDate) {\n this.gotoDate(this._opts.endDate);\n }\n else {\n this.gotoDate(this._opts.startDate);\n }\n\n document.addEventListener('click', this._onClick);\n\n this.updatePosition();\n\n this.el.classList.remove('is-hidden');\n\n if (typeof this._opts.onOpen === 'function') {\n this._opts.onOpen.call(this);\n }\n\n if (document.activeElement && document.activeElement != document.body) {\n document.activeElement.blur();\n }\n }\n },\n\n hide: function ()\n {\n if (this.isShowing) {\n this.isShowing = false;\n\n document.removeEventListener('click', this._onClick);\n\n this.el.classList.add('is-hidden');\n\n this.el.querySelector('.lightpick__tooltip').style.visibility = 'hidden';\n\n if (typeof this._opts.onClose === 'function') {\n this._opts.onClose.call(this);\n }\n }\n },\n\n destroy: function ()\n {\n var opts = this._opts;\n\n this.hide();\n\n this.el.removeEventListener('mousedown', self._onMouseDown, true);\n this.el.removeEventListener('mouseenter', self._onMouseEnter, true);\n this.el.removeEventListener('touchend', self._onMouseDown, true);\n this.el.removeEventListener('change', self._onChange, true);\n\n opts.field.removeEventListener('change', this._onInputChange);\n opts.field.removeEventListener('click', this._onInputClick);\n opts.field.removeEventListener('focus', this._onInputFocus);\n\n if (opts.secondField) {\n opts.secondField.removeEventListener('change', this._onInputChange);\n opts.secondField.removeEventListener('click', this._onInputClick);\n opts.secondField.removeEventListener('focus', this._onInputFocus);\n }\n\n if (this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n }\n },\n\n reset: function ()\n {\n this.setStartDate(null, true);\n this.setEndDate(null, true);\n\n updateDates(this.el, this._opts);\n\n if (typeof this._opts.onSelect === 'function') {\n this._opts.onSelect.call(this, this.getStartDate(), this.getEndDate());\n }\n\n this.el.querySelector('.lightpick__tooltip').style.visibility = 'hidden';\n },\n\n reloadOptions: function (options)\n {\n var dropdowns = this._opts.dropdowns;\n var locale = this._opts.locale;\n\n Object.assign(this._opts, this._opts, options);\n Object.assign(this._opts.dropdowns, dropdowns, options.dropdowns);\n Object.assign(this._opts.locale, locale, options.locale);\n }\n\n };\n\n return Lightpick;\n}));\n","var processInclude = require('./util');\n\n$(document).ready(function () {\n processInclude(require('./contactUs/contactUs'));\n});\n","var Lightpick = require('./lightpick-original');\nvar formValidation = require('../components/formValidation');\nvar datePicker;\n\n/**\n * Display the returned message.\n * @param {string} data - data returned from the server's ajax call\n */\nfunction displayMessage(data) {\n var status;\n if (data.success) {\n status = 'alert-success';\n } else {\n status = 'alert-danger';\n }\n\n if ($('.contact-us-signup-message').length === 0) {\n $('body').append(\n '