vendor: 8,855 bytes, lines 1-2
1 2var t,e;t=this,e=function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var u=function(t){return"string"==typeof t?document.querySelector(t):t()},a=function(t,e){var n="string"==typeof t?document.createElement(t):t;for(var r in e){var i=e[r];if("inside"===r)i.append(n);else if("dest"===r)u(i[0]).insertAdjacentElement(i[1],n);else if("around"===r){var o=i;o.parentNode.insertBefore(n,o),n.append(o),null!=o.getAttribute("autofocus")&&o.focus()}else r in n?n[r]=i:n.setAttribute(r,i)}return n},c=function(t,e){return t=t.toString().toLowerCase(),e?t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t},l=function(t,n){return a("mark",e({innerHTML:t},"string"==typeof n&&{class:n})).outerHTML},f=function(t,e){e.input.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e.feedback,cancelable:!0}))},p=function(t,e,n){var r=n||{},i=r.mode,o=r.diacritics,s=r.highlight,u=c(e,o);if(e=e.toString(),t=c(t,o),"loose"===i){var a=(t=t.replace(/ /g,"")).length,f=0,p=Array.from(e).map((function(e,n){return f<a&&u[n]===t[f]&&(e=s?l(e,s):e,f++),e})).join("");if(f===a)return p}else{var d=u.indexOf(t);if(~d)return t=e.substring(d,d+t.length),d=s?e.replace(t,l(t,s)):e}},d=function(t,e){return new Promise((function(n,r){var i;return(i=t.data).cache&&i.store?n():new Promise((function(t,n){return"function"==typeof i.src?i.src(e).then(t,n):t(i.src)})).then((function(e){try{return t.feedback=i.store=e,f("response",t),n()}catch(t){return r(t)}}),r)}))},h=function(t,e){var n=e.data,r=e.searchEngine,i=[];n.store.forEach((function(s,u){var a=function(n){var o=n?s[n]:s,u="function"==typeof r?r(t,o):p(t,o,{mode:r,diacritics:e.diacritics,highlight:e.resultItem.highlight});if(u){var a={match:u,value:s};n&&(a.key=n),i.push(a)}};if(n.keys){var c,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){a=!0,s=t},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw s}}}}(n.keys);try{for(l.s();!(c=l.n()).done;)a(c.value)}catch(t){l.e(t)}finally{l.f()}}else a()})),n.filter&&(i=n.filter(i));var s=i.slice(0,e.resultsList.maxResults);e.feedback={query:t,matches:i,results:s},f("results",e)},m="aria-expanded",b="aria-activedescendant",y="aria-selected",v=function(t,n){t.feedback.selection=e({index:n},t.feedback.results[n])},g=function(t){t.isOpen||((t.wrapper||t.input).setAttribute(m,!0),t.list.removeAttribute("hidden"),t.isOpen=!0,f("open",t))},w=function(t){t.isOpen&&((t.wrapper||t.input).setAttribute(m,!1),t.input.setAttribute(b,""),t.list.setAttribute("hidden",""),t.isOpen=!1,f("close",t))},O=function(t,e){var n=e.resultItem,r=e.list.getElementsByTagName(n.tag),o=!!n.selected&&n.selected.split(" ");if(e.isOpen&&r.length){var s,u,a=e.cursor;t>=r.length&&(t=0),t<0&&(t=r.length-1),e.cursor=t,a>-1&&(r[a].removeAttribute(y),o&&(u=r[a].classList).remove.apply(u,i(o))),r[t].setAttribute(y,!0),o&&(s=r[t].classList).add.apply(s,i(o)),e.input.setAttribute(b,r[e.cursor].id),e.list.scrollTop=r[t].offsetTop-e.list.clientHeight+r[t].clientHeight+5,e.feedback.cursor=e.cursor,v(e,t),f("navigate",e)}},A=function(t){O(t.cursor+1,t)},k=function(t){O(t.cursor-1,t)},L=function(t,e,n){(n=n>=0?n:t.cursor)<0||(t.feedback.event=e,v(t,n),f("selection",t),w(t))};function j(t,n){var r=this;return new Promise((function(i,o){var s,u;return s=n||((u=t.input)instanceof HTMLInputElement||u instanceof HTMLTextAreaElement?u.value:u.innerHTML),function(t,e,n){return e?e(t):t.length>=n}(s=t.query?t.query(s):s,t.trigger,t.threshold)?d(t,s).then((function(n){try{return t.feedback instanceof Error?i():(h(s,t),t.resultsList&&function(t){var n=t.resultsList,r=t.list,i=t.resultItem,o=t.feedback,s=o.matches,u=o.results;if(t.cursor=-1,r.innerHTML="",s.length||n.noResults){var c=new DocumentFragment;u.forEach((function(t,n){var r=a(i.tag,e({id:"".concat(i.id,"_").concat(n),role:"option",innerHTML:t.match,inside:c},i.class&&{class:i.class}));i.element&&i.element(r,t)})),r.append(c),n.element&&n.element(r,o),g(t)}else w(t)}(t),c.call(r))}catch(t){return o(t)}}),o):(w(t),c.call(r));function c(){return i()}}))}var S=function(t,e){for(var n in t)for(var r in t[n])e(n,r)},T=function(t){var n,r,i,o=t.events,s=(n=function(){return j(t)},r=t.debounce,function(){clearTimeout(i),i=setTimeout((function(){return n()}),r)}),u=t.events=e({input:e({},o&&o.input)},t.resultsList&&{list:o?e({},o.list):{}}),a={input:{input:function(){s()},keydown:function(e){!function(t,e){switch(t.keyCode){case 40:case 38:t.preventDefault(),40===t.keyCode?A(e):k(e);break;case 13:e.submit||t.preventDefault(),e.cursor>=0&&L(e,t);break;case 9:e.resultsList.tabSelect&&e.cursor>=0&&L(e,t);break;case 27:e.input.value="",w(e)}}(e,t)},blur:function(){w(t)}},list:{mousedown:function(t){t.preventDefault()},click:function(e){!function(t,e){var n=e.resultItem.tag.toUpperCase(),r=Array.from(e.list.querySelectorAll(n)),i=t.target.closest(n);i&&i.nodeName===n&&L(e,t,r.indexOf(i))}(e,t)}}};S(a,(function(e,n){(t.resultsList||"input"===n)&&(u[e][n]||(u[e][n]=a[e][n]))})),S(u,(function(e,n){t[e].addEventListener(n,u[e][n])}))};function E(t){var n=this;return new Promise((function(r,i){var o,s,u;if(o=t.placeHolder,u={role:"combobox","aria-owns":(s=t.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},a(t.input,e(e({"aria-controls":s.id,"aria-autocomplete":"both"},o&&{placeholder:o}),!t.wrapper&&e({},u))),t.wrapper&&(t.wrapper=a("div",e({around:t.input,class:t.name+"_wrapper"},u))),s&&(t.list=a(s.tag,e({dest:[s.destination,s.position],id:s.id,role:"listbox",hidden:"hidden"},s.class&&{class:s.class}))),T(t),t.data.cache)return d(t).then((function(t){try{return c.call(n)}catch(t){return i(t)}}),i);function c(){return f("init",t),r()}return c.call(n)}))}function x(t){var e=t.prototype;e.init=function(){E(this)},e.start=function(t){j(this,t)},e.unInit=function(){if(this.wrapper){var t=this.wrapper.parentNode;t.insertBefore(this.input,this.wrapper),t.removeChild(this.wrapper)}var e;S((e=this).events,(function(t,n){e[t].removeEventListener(n,e.events[t][n])}))},e.open=function(){g(this)},e.close=function(){w(this)},e.goTo=function(t){O(t,this)},e.next=function(){A(this)},e.previous=function(){k(this)},e.select=function(t){L(this,null,t)},e.search=function(t,e,n){return p(t,e,n)}}return function t(e){this.options=e,this.id=t.instances=(t.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"},function(t){var e=t.name,r=t.options,i=t.resultsList,o=t.resultItem;for(var s in r)if("object"===n(r[s]))for(var a in t[s]||(t[s]={}),r[s])t[s][a]=r[s][a];else t[s]=r[s];t.selector=t.selector||"#"+e,i.destination=i.destination||t.selector,i.id=i.id||e+"_list_"+t.id,o.id=o.id||e+"_result",t.input
2=u(t.selector)}(this),x.call(this,t),E(this)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).autoComplete=e(); 3 4/*! 5 * 6 * litepicker.js 7 * Litepicker v2.0.12 (https://github.com/wakirin/Litepicker) 8 * Package: litepicker (https://www.npmjs.com/package/litepicker) 9 * License: MIT (https://github.com/wakirin/Litepicker/blob/master/LICENCE.md) 10 * Copyright 2019-2021 Rinat G. 11 * 12 * Hash: a5019ade4d1fcf3e6277 13 * 14 */ 15var Litepicker = function (t) { 16 var e = {}; 17 18 function i (n) { 19 if (e[n]) return e[n].exports; 20 var o = e[n] = { i: n, l: !1, exports: {} }; 21 return t[n].call(o.exports, o, o.exports, i), o.l = !0, o.exports; 22 } 23 24 return i.m = t, i.c = e, i.d = function (t, e, n) { 25 i.o(t, e) || Object.defineProperty(t, e, { 26 enumerable: !0, 27 get: n 28 }); 29 }, i.r = function (t) {'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), Object.defineProperty(t, '__esModule', { value: !0 });}, i.t = function (t, e) { 30 if (1 & e && (t = i(t)), 8 & e) return t; 31 if (4 & e && 'object' == typeof t && t && t.__esModule) return t; 32 var n = Object.create(null); 33 if (i.r(n), Object.defineProperty(n, 'default', { 34 enumerable: !0, 35 value: t 36 }), 2 & e && 'string' != typeof t) for (var o in t) i.d(n, o, function (e) {return t[e];}.bind(null, o)); 37 return n; 38 }, i.n = function (t) { 39 var e = t && t.__esModule ? function () {return t.default;} : function () {return t;}; 40 return i.d(e, 'a', e), e; 41 }, i.o = function (t, e) {return Object.prototype.hasOwnProperty.call(t, e);}, i.p = '', i(i.s = 4); 42}([function (t, e, i) { 43 'use strict'; 44 Object.defineProperty(e, '__esModule', { value: !0 }); 45 var n = function () { 46 function t (e, i, n) {void 0 === e && (e = null), void 0 === i && (i = null), void 0 === n && (n = 'en-US'), this.dateInstance = 'object' == typeof i && null !== i ? i.parse(e instanceof t ? e.clone().toJSDate() : e) : 'string' == typeof i ? t.parseDateTime(e, i, n) : e ? t.parseDateTime(e) : t.parseDateTime(new Date), this.lang = n;} 47 48 return t.parseDateTime = function (e, i, n) { 49 if (void 0 === i && (i = 'YYYY-MM-DD'), void 0 === n && (n = 'en-US'), !e) return new Date(NaN); 50 if (e instanceof Date) return new Date(e); 51 if (e instanceof t) return e.clone().toJSDate(); 52 if (/^-?\d{10,}$/.test(e)) return t.getDateZeroTime(new Date(Number(e))); 53 if ('string' == typeof e) { 54 for (var o = [], s = null; null != (s = t.regex.exec(i));) '\\' !== s[1] && o.push(s); 55 if (o.length) { 56 var r = { year: null, month: null, shortMonth: null, longMonth: null, day: null, value: '' }; 57 o[0].index > 0 && (r.value += '.*?'); 58 for (var a = 0, l = Object.entries(o); a < l.length; a++) { 59 var c = l[a], h = c[0], p = c[1], d = Number(h), u = t.formatPatterns(p[0], n), m = u.group, f = u.pattern; 60 r[m] = d + 1, r.value += f, r.value += '.*?'; 61 } 62 var g = new RegExp('^' + r.value + '$'); 63 if (g.test(e)) { 64 var v = g.exec(e), y = Number(v[r.year]), b = null; 65 r.month ? b = Number(v[r.month]) - 1 : r.shortMonth ? b = t.shortMonths(n).indexOf(v[r.shortMonth]) : r.longMonth && (b = t.longMonths(n).indexOf(v[r.longMonth])); 66 var k = Number(v[r.day]) || 1; 67 return new Date(y, b, k, 0, 0, 0, 0); 68 } 69 } 70 } 71 return t.getDateZeroTime(new Date(e)); 72 }, t.convertArray = function (e, i) {return e.map((function (e) {return e instanceof Array ? e.map((function (e) {return new t(e, i);})) : new t(e, i);}));}, t.getDateZeroTime = function (t) {return new Date(t.getFullYear(), t.getMonth(), t.getDate(), 0, 0, 0, 0);}, t.shortMonths = function (e) {return t.MONTH_JS.map((function (t) {return new Date(2019, t).toLocaleString(e, { month: 'short' });}));}, t.longMonths = function (e) {return t.MONTH_JS.map((function (t) {return new Date(2019, t).toLocaleStr
72ing(e, { month: 'long' });}));}, t.formatPatterns = function (e, i) { 73 switch (e) { 74 case'YY': 75 case'YYYY': 76 return { group: 'year', pattern: '(\\d{' + e.length + '})' }; 77 case'M': 78 return { group: 'month', pattern: '(\\d{1,2})' }; 79 case'MM': 80 return { group: 'month', pattern: '(\\d{2})' }; 81 case'MMM': 82 return { group: 'shortMonth', pattern: '(' + t.shortMonths(i).join('|') + ')' }; 83 case'MMMM': 84 return { group: 'longMonth', pattern: '(' + t.longMonths(i).join('|') + ')' }; 85 case'D': 86 return { group: 'day', pattern: '(\\d{1,2})' }; 87 case'DD': 88 return { group: 'day', pattern: '(\\d{2})' }; 89 } 90 }, t.prototype.toJSDate = function () {return this.dateInstance;}, t.prototype.toLocaleString = function (t, e) {return this.dateInstance.toLocaleString(t, e);}, t.prototype.toDateString = function () {return this.dateInstance.toDateString();}, t.prototype.getSeconds = function () {return this.dateInstance.getSeconds();}, t.prototype.getDay = function () {return this.dateInstance.getDay();}, t.prototype.getTime = function () {return this.dateInstance.getTime();}, t.prototype.getDate = function () {return this.dateInstance.getDate();}, t.prototype.getMonth = function () {return this.dateInstance.getMonth();}, t.prototype.getFullYear = function () {return this.dateInstance.getFullYear();}, t.prototype.setMonth = function (t) {return this.dateInstance.setMonth(t);}, t.prototype.setHours = function (t, e, i, n) {void 0 === t && (t = 0), void 0 === e && (e = 0), void 0 === i && (i = 0), void 0 === n && (n = 0), this.dateInstance.setHours(t, e, i, n);}, t.prototype.setSeconds = function (t) {return this.dateInstance.setSeconds(t);}, t.prototype.setDate = function (t) {return this.dateInstance.setDate(t);}, t.prototype.setFullYear = function (t) {return this.dateInstance.setFullYear(t);}, t.prototype.getWeek = function (t) { 91 var e = new Date(this.timestamp()), i = (this.getDay() + (7 - t)) % 7; 92 e.setDate(e.getDate() - i); 93 var n = e.getTime(); 94 return e.setMonth(0, 1), e.getDay() !== t && e.setMonth(0, 1 + (4 - e.getDay() + 7) % 7), 1 + Math.ceil((n - e.getTime()) / 6048e5); 95 }, t.prototype.clone = function () {return new t(this.toJSDate());}, t.prototype.isBetween = function (t, e, i) { 96 switch (void 0 === i && (i = '()'), i) { 97 default: 98 case'()': 99 return this.timestamp() > t.getTime() && this.timestamp() < e.getTime(); 100 case'[)': 101 return this.timestamp() >= t.getTime() && this.timestamp() < e.getTime(); 102 case'(]': 103 return this.timestamp() > t.getTime() && this.timestamp() <= e.getTime(); 104 case'[]': 105 return this.timestamp() >= t.getTime() && this.timestamp() <= e.getTime(); 106 } 107 }, t.prototype.isBefore = function (t, e) { 108 switch (void 0 === e && (e = 'seconds'), e) { 109 case'second': 110 case'seconds': 111 return t.getTime() > this.getTime(); 112 case'day': 113 case'days': 114 return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() > new Date(this.getFullYear(), this.getMonth(), this.getDate()).getTime(); 115 case'month': 116 case'months': 117 return new Date(t.getFullYear(), t.getMonth(), 1).getTime() > new Date(this.getFullYear(), this.getMonth(), 1).getTime(); 118 case'year': 119 case'years': 120 return t.getFullYear() > this.getFullYear(); 121 } 122 throw new Error('isBefore: Invalid unit!'); 123 }, t.prototype.isSameOrBefore = function (t, e) { 124 switch (void 0 === e && (e = 'seconds'), e) { 125 case'second': 126 case'seconds': 127 return t.getTime() >= this.getTime(); 128 case'day': 129 case'days': 130 return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() >= new Date(this.getFullYear(), this.getMonth(), this.getDate()).getTime(); 131 case'month': 132 case'months': 133 return new Date(t.getFullYear(), t.getMonth(), 1).getTime() >= new Date(this.getFullYear(), this.getMonth(), 1).getTime(); 134 } 135 throw new Error('isSameOrBefore: Invalid unit!'); 136 }, t.prototype.isAfter = function (t, e) { 137 switch (void 0 === e && (e = 'seconds'), e) { 138 case'second': 139 case'seconds': 140 return this.getTime() > t.getTime(); 141 case'day': 142 case'days': 143 return new Date(this.getFullYear(), this.getMonth(), this.getDate()).getTime() > new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime(); 144 case'month': 145 case'months': 146 return new Date(this.getFullYear(), this.getMonth(), 1).getTime() > new Date(t.getFullYear(), t.getMonth(), 1).getTime(); 147 case'year': 148 case'years': 149 return this.getFullYear() > t.getFullYear(); 150 } 151 throw new Error('isAfter: Invalid unit!'); 152 }, t.prototype.isSameOrAfter = function (t, e) { 153 switch (void 0 === e && (e = 'seconds'), e) { 154 case'second': 155 case'seconds': 156 return this.getTime() >= t.getTime(); 157 case'day': 158 case'days': 159 return new Date(this.getFullYear(), this.getMonth(), this.getDate()).getTime() >= new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime(); 160 case'month': 161 case'months': 162 return new Date(this.getFullYear(), this.getMonth(), 1).getTime() >= new Date(t.getFullYear(), t.getMonth(), 1).getTime(); 163 } 164 throw new Error('isSameOrAfter: Invalid unit!'); 165 }, t.prototype.isSame = function (t, e) { 166 switch (void 0 === e && (e = 'seconds'), e) { 167 case'second': 168 case'seconds': 169 return this.getTime() === t.getTime(); 170 case'day': 171 case'days': 172 return new Date(this.getFullYear(), this.getMonth(), this.getDate()).getTime() === new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime(); 173 case'month': 174 case'months': 175 return new Date(this.getFullYear(), this.getMonth(), 1).getTime() === new Date(t.getFullYear(), t.getMonth(), 1).getTime(); 176 } 177 throw new Error('isSame: Invalid unit!'); 178 }, t.prototype.add = function (t, e) { 179 switch (void 0 === e && (e = 'seconds'), e) { 180 case'second': 181 case'seconds': 182 this.setSeconds(this.getSeconds() + t); 183 break; 184 case'day': 185 case'days': 186 this.setDate(this.getDate() + t); 187 break; 188 case'month': 189 case'months': 190 this.setMonth(this.getMonth() + t); 191 } 192 return this; 193 }, t.prototype.subtract = function (t, e) { 194 switch (void 0 === e && (e = 'seconds'), e) { 195 case'second': 196 case'seconds': 197 this.setSeconds(this.getSeconds() - t); 198 break; 199 case'day': 200 case'days': 201 this.setDate(this.getDate() - t); 202 break; 203 case'month': 204 case'months': 205 this.setMonth(this.getMonth() - t); 206 } 207 return this; 208 }, t.prototype.diff = function (t, e) { 209 void 0 === e && (e = 'seconds'); 210 switch (e) { 211 default: 212 case'second': 213 case'seconds': 214 return this.getTime() - t.getTime(); 215 case'day': 216 case'days': 217 return Math.round((this.timestamp() - t.getTime()) / 864e5); 218 case'month': 219 case'months': 220 } 221 }, t.prototype.format = function (e, i) { 222 if (void 0 === i && (i = 'en-US'), 'object' == typeof e) return e.output(this.clone().toJSDate()); 223 for (var n = '', o = [], s = null; null != (s = t.regex.exec(e));) '\\' !== s[1] && o.push(s); 224 if (o.length) { 225 o[0].index > 0 && (n += e.substring(0, o[0].index)); 226 for (var r = 0, a = Object.entries(o); r < a.length; r++) { 227 var l = a[r], c = l[0], h = l[1], p = Number(c); 228 n += this.formatTokens(h[0], i), o[p + 1] && (n += e.substring(h.index + h[0].length, o[p + 1].index)), p === o.length - 1 && (n += e.substring(h.index + h[0].length)); 229 } 230 } 231 return n.replace(/\\/g, ''); 232 }, t.prototype.timestamp = function () {return new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0, 0).getTime();}, t.prototype.formatTokens = function (e, i) { 233 switch (e) { 234 case'YY': 235 return String(this.getFullYear()).slice(-2); 236 case'YYYY': 237 return String(this.getFullYear()); 238 case'M': 239 return String(this.getMonth() + 1); 240 case'MM': 241 return ('0' + (this.getMonth() + 1)).slice(-2); 242 case'MMM': 243 return t.shortMonths(i)[this.getMonth()]; 244 case'MMMM': 245 return t.longMonths(i)[this.getMonth()]; 246 case'D': 247 return String(this.getDate()); 248 case'DD': 249 return ('0' + this.getDate()).slice(-2); 250 default: 251 return ''; 252 } 253 }, t.regex = /(\\)?(Y{2,4}|M{1,4}|D{1,2}|d{1,4})/g, t.MONTH_JS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], t; 254 }(); 255 e.DateTime = n; 256}, function (t, e, i) { 257 'use strict'; 258 var n, 259 o = this && this.__extends || (n = function (t, e) {return (n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) {t.__proto__ = e;} || function (t, e) {for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);})(t, e);}, function (t, e) { 260 function i () {this.constructor = t;} 261 262 n(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i); 263 }), s = this && this.__spreadArrays || function () { 264 for (var t = 0, e = 0, i = arguments.length; e < i; e++) t += arguments[e].length; 265 var n = Array(t), o = 0; 266 for (e = 0; e < i; e++) for (var s = arguments[e], r = 0, a = s.length; r < a; r++, o++) n[o] = s[r]; 267 return n; 268 }; 269 Object.defineProperty(e, '__esModule', { value: !0 });
270 var r = i(5), a = i(0), l = i(3), c = i(2), h = function (t) { 271 function e (e) { 272 var i = t.call(this, e) || this; 273 return i.preventClick = !1, i.bindEvents(), i; 274 } 275 276 return o(e, t), e.prototype.scrollToDate = function (t) { 277 if (this.options.scrollToDate) { 278 var e = this.options.startDate instanceof a.DateTime ? this.options.startDate.clone() : null, 279 i = this.options.endDate instanceof a.DateTime ? this.options.endDate.clone() : null; 280 !this.options.startDate || t && t !== this.options.element ? t && this.options.endDate && t === this.options.elementEnd && (i.setDate(1), this.options.numberOfMonths > 1 && i.isAfter(e) && i.setMonth(i.getMonth() - (this.options.numberOfMonths - 1)), this.calendars[0] = i.clone()) : (e.setDate(1), this.calendars[0] = e.clone()); 281 } 282 }, e.prototype.bindEvents = function () { 283 document.addEventListener('click', this.onClick.bind(this), !0), this.ui = document.createElement('div'), this.ui.className = l.litepicker, this.ui.style.display = 'none', this.ui.addEventListener('mouseenter', this.onMouseEnter.bind(this), !0), this.ui.addEventListener('mouseleave', this.onMouseLeave.bind(this), !1), this.options.autoRefresh ? (this.options.element instanceof HTMLElement && this.options.element.addEventListener('keyup', this.onInput.bind(this), !0), this.options.elementEnd instanceof HTMLElement && this.options.elementEnd.addEventListener('keyup', this.onInput.bind(this), !0)) : (this.options.element instanceof HTMLElement && this.options.element.addEventListener('change', this.onInput.bind(this), !0), this.options.elementEnd instanceof HTMLElement && this.options.elementEnd.addEventListener('change', this.onInput.bind(this), !0)), this.options.parentEl ? this.options.parentEl instanceof HTMLElement ? this.options.parentEl.appendChild(this.ui) : document.querySelector(this.options.parentEl).appendChild(this.ui) : this.options.inlineMode ? this.options.element instanceof HTMLInputElement ? this.options.element.parentNode.appendChild(this.ui) : this.options.element.appendChild(this.ui) : document.body.appendChild(this.ui), this.updateInput(), this.init(), 'function' == typeof this.options.setup && this.options.setup.call(this, this), this.render(), this.options.inlineMode && this.show(); 284 }, e.prototype.updateInput = function () { 285 if (this.options.element instanceof HTMLInputElement) { 286 var t = this.options.startDate, e = this.options.endDate; 287 if (this.options.singleMode && t) this.options.element.value = t.format(this.options.format, this.options.lang); else if (!this.options.singleMode && t && e) { 288 var i = t.format(this.options.format, this.options.lang), 289 n = e.format(this.options.format, this.options.lang); 290 this.options.elementEnd instanceof HTMLInputElement ? (this.options.element.value = i, this.options.elementEnd.value = n) : this.options.element.value = '' + i + this.options.delimiter + n; 291 } 292 t || e || (this.options.element.value = '', this.options.elementEnd instanceof HTMLInputElement && (this.options.elementEnd.value = '')); 293 } 294 }, e.prototype.isSamePicker = function (t) {return t.closest('.' + l.litepicker) === this.ui;}, e.prototype.shouldShown = function (t) {return !t.disabled && (t === this.options.element || this.options.elementEnd && t === this.options.elementEnd);}, e.prototype.shouldResetDatePicked = function () {return this.options.singleMode || 2 === this.datePicked.length;}, e.prototype.shouldSwapDatePicked = function () {return 2 === this.datePicked.length && this.datePicked[0].getTime() > this.datePicked[1].getTime();}, e.prototype.shouldCheckLockDays = function () {return this.options.disallowLockDaysInRange && 2 === this.datePicked.length;}, e.prototype.onClick = function (t) { 295 var e = t.target; 296 if (t.target.shadowRoot && (e = t.composedPath()[0]), e && this.ui) if (this.shouldShown(e)) this.show(e); else if (e.closest('.' + l.litepicker) || !this.isShowning()) {
297 if (this.isSamePicker(e)) if (this.emit('before:click', e), this.preventClick) this.preventClick = !1; else { 298 if (e.classList.contains(l.dayItem)) { 299 if (t.preventDefault(), e.classList.contains(l.isLocked)) return; 300 if (this.shouldResetDatePicked() && (this.datePicked.length = 0), this.datePicked[this.datePicked.length] = new a.DateTime(e.dataset.time), this.shouldSwapDatePicked()) { 301 var i = this.datePicked[1].clone(); 302 this.datePicked[1] = this.datePicked[0].clone(), this.datePicked[0] = i.clone(); 303 } 304 if (this.shouldCheckLockDays()) c.rangeIsLocked(this.datePicked, this.options) && (this.emit('error:range', this.datePicked), this.datePicked.length = 0); 305 return this.render(), this.emit.apply(this, s(['preselect'], s(this.datePicked).map((function (t) {return t.clone();})))), void (this.options.autoApply && (this.options.singleMode && this.datePicked.length ? (this.setDate(this.datePicked[0]), this.hide()) : this.options.singleMode || 2 !== this.datePicked.length || (this.setDateRange(this.datePicked[0], this.datePicked[1]), this.hide()))); 306 } 307 if (e.classList.contains(l.buttonPreviousMonth)) { 308 t.preventDefault(); 309 var n = 0, o = this.options.switchingMonths || this.options.numberOfMonths; 310 if (this.options.splitView) { 311 var r = e.closest('.' + l.monthItem); 312 n = c.findNestedMonthItem(r), o = 1; 313 } 314 return this.calendars[n].setMonth(this.calendars[n].getMonth() - o), this.gotoDate(this.calendars[n], n), void this.emit('change:month', this.calendars[n], n); 315 } 316 if (e.classList.contains(l.buttonNextMonth)) { 317 t.preventDefault(); 318 n = 0, o = this.options.switchingMonths || this.options.numberOfMonths; 319 if (this.options.splitView) { 320 r = e.closest('.' + l.monthItem); 321 n = c.findNestedMonthItem(r), o = 1; 322 } 323 return this.calendars[n].setMonth(this.calendars[n].getMonth() + o), this.gotoDate(this.calendars[n], n), void this.emit('change:month', this.calendars[n], n); 324 } 325 e.classList.contains(l.buttonCancel) && (t.preventDefault(), this.hide(), this.emit('button:cancel')), e.classList.contains(l.buttonApply) && (t.preventDefault(), this.options.singleMode && this.datePicked.length ? this.setDate(this.datePicked[0]) : this.options.singleMode || 2 !== this.datePicked.length || this.setDateRange(this.datePicked[0], this.datePicked[1]), this.hide(), this.emit('button:apply', this.options.startDate, this.options.endDate)); 326 } 327 } else this.hide(); 328 }, e.prototype.showTooltip = function (t, e) { 329 var i = this.ui.querySelector('.' + l.containerTooltip); 330 i.style.visibility = 'visible', i.innerHTML = e; 331 var n = this.ui.getBoundingClientRect(), o = i.getBoundingClientRect(), s = t.getBoundingClientRect(), r = s.top, 332 a = s.left; 333 if (this.options.inlineMode && this.options.parentEl) { 334 var c = this.ui.parentNode.getBoundingClientRect(); 335 r -= c.top, a -= c.left; 336 } else r -= n.top, a -= n.left; 337 r -= o.height, a -= o.width / 2, a += s.width / 2, i.style.top = r + 'px', i.style.left = a + 'px', this.emit('tooltip', i, t); 338 }, e.prototype.hideTooltip = function () {this.ui.querySelector('.' + l.containerTooltip).style.visibility = 'hidden';}, e.prototype.shouldAllowMouseEnter = function (t) {return !this.options.singleMode && !t.classList.contains(l.isLocked);}, e.prototype.shouldAllowRepick = function () {return this.options.elementEnd && this.options.allowRepick && this.options.startDate && this.options.endDate;}, e.prototype.isDayItem = function (t) {return t.classList.contains(l.dayItem);}, e.prototype.onMouseEnter = function (t) { 339 var e = this, i = t.target; 340 if (this.isDayItem(i) && this.shouldAllowMouseEnter(i)) { 341 if (this.shouldAllowRepick() && (this.triggerElement === this.options.element ? this.datePicked[0] = this.options.endDate.clone() : this.triggerElement === this.options.elementEnd && (this.datePicked[0] = this.options.startDate.clone())), 1 !== this.datePicked.length) return; 342 var n = this.ui.querySelector('.' + l.dayItem + '[data-time="' + this.datePicked[0].getTime() + '"]'), 343 o = this.datePicked[0].clone(), s = new a.DateTime(i.dataset.time), r = !1; 344 if (o.getTime() > s.getTime()) { 345 var c = o.clone(); 346 o = s.clone(), s = c.clone(), r = !0; 347 } 348 if (Array.prototype.slice.call(this.ui.querySelectorAll('.' + l.dayItem)).forEac
348h((function (t) { 349 var i = new a.DateTime(t.dataset.time), n = e.renderDay(i); 350 i.isBetween(o, s) && n.classList.add(l.isInRange), t.className = n.className; 351 })), i.classList.add(l.isEndDate), r ? (n && n.classList.add(l.isFlipped), i.classList.add(l.isFlipped)) : (n && n.classList.remove(l.isFlipped), i.classList.remove(l.isFlipped)), this.options.showTooltip) { 352 var h = s.diff(o, 'day') + 1; 353 if ('function' == typeof this.options.tooltipNumber && (h = this.options.tooltipNumber.call(this, h)), h > 0) { 354 var p = this.pluralSelector(h), 355 d = h + ' ' + (this.options.tooltipText[p] ? this.options.tooltipText[p] : '[' + p + ']'); 356 this.showTooltip(i, d); 357 var u = window.navigator.userAgent, m = /(iphone|ipad)/i.test(u), f = /OS 1([0-2])/i.test(u); 358 m && f && i.dispatchEvent(new Event('click')); 359 } else this.hideTooltip(); 360 } 361 } 362 }, e.prototype.onMouseLeave = function (t) { 363 t.target; 364 this.options.allowRepick && (!this.options.allowRepick || this.options.startDate || this.options.endDate) && (this.datePicked.length = 0, this.render()); 365 }, e.prototype.onInput = function (t) { 366 var e = this.parseInput(), i = e[0], n = e[1], o = this.options.format; 367 if (this.options.elementEnd ? i instanceof a.DateTime && n instanceof a.DateTime && i.format(
367o) === this.options.element.value && n.format(o) === this.options.elementEnd.value : this.options.singleMode ? i instanceof a.DateTime && i.format(o) === this.options.element.value : i instanceof a.DateTime && n instanceof a.DateTime && '' + i.format(o) + this.options.delimiter + n.format(o) === this.options.element.value) { 368 if (n && i.getTime() > n.getTime()) { 369 var s = i.clone(); 370 i = n.clone(), n = s.clone(); 371 } 372 this.options.startDate = new a.DateTime(i, this.options.format, this.options.lang), n && (this.options.endDate = new a.DateTime(n, this.options.format, this.options.lang)), this.updateInput(), this.render(); 373 var r = i.clone(), l = 0; 374 (this.options.elementEnd ? i.format(o) === t.target.value : t.target.value.startsWith(i.format(o))) || (r = n.clone(), l = this.options.numberOfMonths - 1), this.emit('selected', this.getStartDate(), this.getEndDate()), this.gotoDate(r, l); 375 } 376 }, e; 377 }(r.Calendar); 378 e.Litepicker = h; 379}, function (t, e, i) { 380 'use strict'; 381 Object.defineProperty(e, '__esModule', { value: !0 }), e.findNestedMonthItem = function (t) { 382 for (var e = t.parentNode.childNodes, i = 0; i < e.length; i += 1) {if (e.item(i) === t) return i;} 383 return 0; 384 }, e.dateIsLocked = function (t, e, i) { 385 var n = !1; 386 return e.lockDays.length && (n = e.lockDays.filter((function (i) {return i instanceof Array ? t.isBetween(i[0], i[1], e.lockDaysInclusivity) : i.isSame(t, 'day');})).length), n || 'function' != typeof e.lockDaysFilter || (n = e.lockDaysFilter.call(this, t.clone(), null, i)), n; 387 }, e.rangeIsLocked = function (t, e) { 388 var i = !1; 389 return e.lockDays.length && (i = e.lockDays.filter((function (i) { 390 if (i instanceof Array) { 391 var n = t[0].toDateString() === i[0].toDateString() && t[1].toDateString() === i[1].toDateString(); 392 return i[0].isBetween(t[0], t[1], e.lockDaysInclusivity) || i[1].isBetween(t[0], t[1], e.lockDaysInclusivity) || n; 393 } 394 return i.isBetween(t[0], t[1], e.lockDaysInclusivity); 395 })).length), i || 'function' != typeof e.lockDaysFilter || (i = e.lockDaysFilter.call(this, t[0].clone(), t[1].clone(), t)), i; 396 }; 397}, function (t, e, i) { 398 var n = i(8); 399 'string' == typeof n && (n = [[t.i, n, '']]); 400 var o = { 401 insert: function (t) { 402 var e = document.querySelector('head'), i = window._lastElementInsertedByStyleLoader; 403 window.disableLitepickerStyles || (i ? i.nextSibling ? e.insertBefore(t, i.nextSibling) : e.appendChild(t) : e.insertBefore(t, e.firstChild), window._lastElementInsertedByStyleLoader = t); 404 }, singleton: !1 405 }; 406 i(10)(n, o); 407 n.locals && (t.exports = n.locals); 408}, function (t, e, i) { 409 'use strict'; 410 Object.defineProperty(e, '__esModule', { value: !0 }); 411 var n = i(1); 412 e.Litepicker = n.Litepicker, i(11), window.Litepicker = n.Litepicker, e.default = n.Litepicker; 413}, function (t, e, i) { 414 'use strict'; 415 var n, 416 o = this && this.__extends || (n = function (t, e) {return (n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) {t.__proto__ = e;} || function (t, e) {for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);})(t, e);}, function (t, e) { 417 function i () {this.constructor = t;} 418 419 n(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i); 420 }); 421 Object.defineProperty(e, '__esModule', { value: !0 }); 422 var s = i(6), r = i(0), a = i(3), l = i(2), c = function (t) { 423 function e (e) {return t.call(this, e) || this;} 424 425 return o(e, t), e.prototype.render = function () { 426 var t = this; 427 this.emit('before:render', this.ui); 428 var e = document.createElement('div'); 429 e.className = a.containerMain; 430 var i = document.createElement('div'); 431 i.className = a.containerMonths, a['columns' + this.options.numberOfColumns] && (i.classList.remove(a.columns2, a.columns3, a.columns4), i.classList.add(a['columns' + this.options.numberOfColumns])), this.options.splitView && i.classList.add(a.splitView), this.options.showWeekNumbers && i.classList.add(a.showWeekNumbers); 432 for (var n = this.calendars[0].clone(), o = n.getMonth(), s = n.getMonth() + this.options.numberOfMonths, r = 0, l = o; l < s; l += 1) { 433 var c = n.clone(); 434 c.setDate(1), c.setHours(0, 0, 0, 0), this.options.splitView ? c = this.calendars[r].clone() : c.setMonth(l), i.appendChild(this.renderMonth(c, r)), r += 1; 435 } 436 if (this.ui.innerHTML = '', e.appendChild(i), this.options.resetButton) { 437 var h = void 0; 438 'function' == typeof this.options.resetButton ? h = this.options.resetButton.call(this) : ((h = document.createElement('button')).type = 'button', h.
438className = a.resetButton, h.innerHTML = this.options.buttonText.reset), h.addEventListener('click', (function (e) {e.preventDefault(), t.clearSelection();})), e.querySelector('.' + a.monthItem + ':last-child').querySelector('.' + a.monthItemHeader).appendChild(h); 439 } 440 this.ui.appendChild(e), this.options.autoApply && !this.options.footerHTML || this.ui.appendChild(this.renderFooter()), this.options.showTooltip && this.ui.appendChild(this.renderTooltip()), this.ui.dataset.plugins = (this.options.plugins || []).join('|'), this.emit('render', this.ui); 441 }, e.prototype.renderMonth = function (t, e) { 442 var i = this, n = t.clone(), o = 32 - new Date(n.getFullYear(), n.getMonth(), 32).getDate(), 443 s = document.createElement('div'); 444 s.className = a.monthItem; 445 var c = document.createElement('div'); 446 c.className = a.monthItemHeader; 447 var h = document.createElement('div'); 448 if (this.options.dropdowns.months) { 449 var p = document.createElement('select'); 450 p.className = a.monthItemName; 451 for (var d = 0; d < 12; d += 1) { 452 var u = document.createElement('option'), m = new r.DateTime(new Date(t.getFullYear(), d, 2, 0, 0, 0)), 453 f = new r.DateTime(new Date(t.getFullYear(), d, 1, 0, 0, 0)); 454 u.value = String(d), u.text = m.toLocaleString(this.options.lang, { month: 'long' }), u.disabled = this.options.minDate && f.isBefore(new r.DateTime(this.options.minDate), 'month') || this.options.maxDate && f.isAfter(new r.DateTime(this.options.maxDate), 'month'), u.selected = f.getMonth() === t.getMonth(), p.appendChild(u); 455 } 456 p.addEventListener('change', (function (t) { 457 var e = t.target, n = 0; 458 if (i.options.splitView) { 459 var o = e.closest('.' + a.monthItem); 460 n = l.findNestedMonthItem(o); 461 } 462 i.calendars[n].setMonth(Number(e.value)), i.render(), i.emit('change:month', i.calendars[n], n, t); 463 })), h.appendChild(p); 464 } else {(m = document.createElement('strong')).className = a.monthItemName, m.innerHTML = t.toLocaleString(this.options.lang, { month: 'long' }), h.appendChild(m);} 465 if (this.options.dropdowns.years) { 466 var g = document.createElement('select'); 467 g.className = a.monthItemYear; 468 var v = this.options.dropdowns.minYear, 469 y = this.options.dropdowns.maxYear ? this.options.dropdowns.maxYear : (new Date).getFullYear(); 470 if (t.getFullYear() > y) (u = document.createElement('option')).value = String(t.getFullYear()), u.text = String(t.getFullYear()), u.selected = !0, u.disabled = !0, g.appendChild(u); 471 for (d = y; d >= v; d -= 1) { 472 var u = document.createElement('option'), b = new r.DateTime(new Date(d, 0, 1, 0, 0, 0)); 473 u.value = String(d), u.text = String(d), u.disabled = this.options.minDate && b.isBefore(new r.DateTime(this.options.minDate), 'year') || this.options.maxDate && b.isAfter(new r.DateTime(this.options.maxDate), 'year'), u.selected = t.getFullYear() === d, g.appendChild(u); 474 } 475 if (t.getFullYear() < v) (u = document.createElement('option')).value = String(t.getFullYear()), u.text = String(t.getFullYear()), u.selected = !0, u.disabled = !0, g.appendChild(u); 476 if ('asc' === this.options.dropdowns.years) { 477 var k = Array.prototype.slice.call(g.childNodes).reverse(); 478 g.innerHTML = '', k.forEach((function (t) {t.innerHTML = t.value, g.appendChild(t);})); 479 } 480 g.addEventListener('change', (function (t) { 481 var e = t.target, n = 0; 482 if (i.options.splitView) { 483 var o = e.closest('.' + a.monthItem); 484 n = l.findNestedMonthItem(o); 485 } 486 i.calendars[n].setFullYear(Number(e.value)), i.render(), i.emit('change:year', i.calendars[n], n, t); 487 })), h.appendChild(g); 488 } else { 489 var D = document.createElement('span'); 490 D.className = a.monthItemYear, D.innerHTML = String(t.getFullYear()), h.appendChild(D); 491 } 492 var w = document.createElement('button'); 493 w.type = 'button', w.className = a.buttonPreviousMonth, w.setAttribute('aria-label', this.options.buttonText.previousMonthLabel), w.innerHTML = this.options.buttonText.previousMonth; 494 var x = document.createElement('button'); 495 x.type = 'button', x.className = a.buttonNextMonth, x.setAttribute('aria-label', this.options.buttonText.nextMonthLabel), x.innerHTML = this.options.buttonText.nextMonth, c.appendChild(w), c.appendChild(h), c.appendChild(x), this.options.minDate && n.isSameOrBefore(new r.DateTime(this.options.minDate), 'month') && s.classList.add(a.noPreviousMonth), this.options.maxDate && n.isSameOrAfter(new r.DateTime(this.options.maxDate), 'month') && s.classList.add(a.noNextMonth); 496 var M = document.createElement('div'); 497 M.className = a.monthItemWeekdaysRow, this.options.showWeekNumbers && (M.innerHTML = '<div>W</div>'); 498 for (var _ = 1; _ <= 7; _ += 1) { 499 var T = 3 + this.options.firstDay + _, L = document.createElement('div'); 500 L.innerHTML = this.weekdayName(T), L.title = this.weekdayName(T, 'long'), M.appendChild(L); 501 } 502 var E = document.createElement('div'); 503 E.className = a.containerDays; 504 var S = this.calcSkipDays(n); 505 this.options.showWeekNumbers && S && E.appendChild(this.renderWeekNumber(n)); 506 for (var I = 0; I < S; I += 1) { 507 var P = document.createElement('div'); 508 E.appendChild(P); 509 } 510 for (I = 1; I <= o; I += 1) n.setDate(I), this.options.showWeekNumbers && n.getDay() === this.options.firstDay && E.appendChild(this.renderWeekNumber(n)), E.appendChild(this.renderDay(n)); 511 return s.appendChild(c), s.appendChild(M), s.appendChild(E), this.emit
511('render:month', s, t), s; 512 }, e.prototype.renderDay = function (t) { 513 t.setHours(); 514 var e = document.createElement('div'); 515 if (e.className = a.dayItem, e.innerHTML = String(t.getDate()), e.dataset.time = String(t.getTime()), t.toDateString() === (new Date).toDateString() && e.classList.add(a.isToday), this.datePicked.length) this.datePicked[0].toDateString() === t.toDateString() && (e.classList.add(a.isStartDate), this.options.singleMode && e.classList.add(a.isEndDate)), 2 === this.datePicked.length && this.datePicked[1].toDateString() === t.toDateString() && e.classList.add(a.isEndDate), 2 === this.datePicked.length && t.isBetween(this.datePicked[0], this.datePicked[1]) && e.classList.add(a.isInRange); else if (this.options.startDate) { 516 var i = this.options.startDate, n = this.options.endDate; 517 i.toDateString() === t.toDateString() && (e.classList.add(a.isStartDate), this.options.singleMode && e.classList.add(a.isEndDate)), n && n.toDateString() === t.toDateString() && e.classList.add(a.isEndDate), i && n && t.isBetween(i, n) && e.classList.add(a.isInRange); 518 } 519 if (this.options.minDate && t.isBefore(new r.DateTime(this.options.minDate)) && e.classList.add(a.isLocked), this.options.maxDate && t.isAfter(new r.DateTime(this.options.maxDate)) && e.classList.add(a.isLocked), this.options.minDays > 1 && 1 === this.datePicked.length) { 520 var o = this.options.minDays - 1, s = this.datePicked[0].clone().subtract(o, 'day'), 521 c = this.datePicked[0].clone().add(o, 'day'); 522 t.isBetween(s, this.datePicked[0], '(]') && e.classList.add(a.isLocked), t.isBetween(this.datePicked[0], c, '[)') && e.classList.add(a.isLocked); 523 } 524 if (this.options.maxDays && 1 === this.datePicked.length) { 525 var h = this.options.maxDays; 526 s = this.datePicked[0].clone().subtract(h, 'day'), c = this.datePicked[0].clone().add(h, 'day'); 527 t.isSameOrBefore(s) && e.classList.add(a.isLocked), t.isSameOrAfter(c) && e.classList.add(a.isLocked); 528 } 529 (this.options.selectForward && 1 === this.datePicked.length && t.isBefore(this.datePicked[0]) && e.classList.add(a.isLocked), this.options.selectBackward && 1 === this.datePicked.length && t.isAfter(this.datePicked[0]) && e.classList.add(a.isLocked), l.dateIsLocked(t, this.options, this.datePicked) && e.classList.add(a.isLocked), this.options.highlightedDays.length) && (this.options.highlightedDays.filter((function (e) {return e instanceof Array ? t.isBetween(e[0], e[1], '[]') : e.isSame(t, 'day');})).length && e.classList.add(a.isHighlighted)); 530 return e.tabIndex = e.classList.contains('is-locked') ? -1 : 0, this.emit('render:day', e, t), e; 531 }, e.prototype.renderFooter = function () { 532 var t = document.createElement('div'); 533 if (t.className = a.containerFooter, this.options.footerHTML ? t.innerHTML = this.options.footerHTML : t.innerHTML = '\n <span class="' + a.previewDateRange + '"></span>\n <button type="button" class="' + a.buttonCancel + '">' + this.options.buttonText.cancel + '</button>\n <button type="button" class="' + a.buttonApply + '">' + this.options.buttonText.apply + '</button>\n ', this.options.singleMode) { 534 if (1 === this.datePicked.length) { 535 var e = this.datePicked[0].format(this.options.format, this.options.lang); 536 t.querySelector('.' + a.previewDateRange).innerHTML = e; 537 } 538 } else if (1 === this.datePicked.length && t.querySelector('.' + a.buttonApply).setAttribute('disabled', ''), 2 === this.datePicked.length) { 539 e = this.datePicked[0].format(this.options.format, this.options.lang); 540 var i = this.datePicked[1].format(this.options.format, this.options.lang); 541 t.querySelector('.' + a.previewDateRange).innerHTML = '' + e + this.options.delimiter + i; 542 } 543 return this.emit('render:footer', t), t; 544 }, e.prototype.renderWeekNumber = function (t) { 545 var e = document.createElement('div'), i = t.getWeek(this.options.firstDay); 546 return e.className = a.weekNumber, e.innerHTML = 53 === i && 0 === t.getMonth() ? '53 / 1' : i, e; 547 }, e.prototype.renderTooltip = function () { 548 var t = document.createElement('div'); 549 return t.className = a.containerTooltip, t; 550 }, e.prototype.weekdayName = function (t, e) {return void 0 === e && (e = 'short'), new Date(1970, 0, t, 12, 0, 0, 0).toLocaleStr
550ing(this.options.lang, { weekday: e });}, e.prototype.calcSkipDays = function (t) { 551 var e = t.getDay() - this.options.firstDay; 552 return e < 0 && (e += 7), e; 553 }, e; 554 }(s.LPCore); 555 e.Calendar = c; 556}, function (t, e, i) { 557 'use strict'; 558 var n, 559 o = this && this.__extends || (n = function (t, e) {return (n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) {t.__proto__ = e;} || function (t, e) {for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);})(t, e);}, function (t, e) { 560 function i () {this.constructor = t;} 561 562 n(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i); 563 }), s = this && this.__assign || function () { 564 return (s = Object.assign || function (t) { 565 for (var e, i = 1, n = arguments.length; i < n; i++) for (var o in e = arguments[i]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); 566 return t; 567 }).apply(this, arguments); 568 }; 569 Object.defineProperty(e, '__esModule', { value: !0 }); 570 var r = i(7), a = i(0), l = i(1), c = function (t) { 571 function e (e) { 572 var i = t.call(this) || this; 573 i.datePicked = [], i.calendars = [], i.options = { 574 element: null, 575 elementEnd: null, 576 parentEl: null, 577 firstDay: 1, 578 format: 'YYYY-MM-DD', 579 lang: 'en-US', 580 delimiter: ' - ', 581 numberOfMonths: 1, 582 numberOfColumns: 1, 583 startDate: null, 584 endDate: null, 585 zIndex: 9999, 586 position: 'auto', 587 selectForward: !1, 588 selectBackward: !1, 589 splitView: !1, 590 inlineMode: !1, 591 singleMode: !0, 592 autoApply: !0, 593 allowRepick: !1, 594 showWeekNumbers: !1, 595 showTooltip: !0, 596 scrollToDate: !0, 597 mobileFriendly: !0, 598 resetButton: !1, 599 autoRefresh: !1, 600 lockDaysFormat: 'YYYY-MM-DD', 601 lockDays: [], 602 disallowLockDaysInRange: !1, 603 lockDaysInclusivity: '[]', 604 highlightedDaysFormat: 'YYYY-MM-DD', 605 highlightedDays: [], 606 dropdowns: { minYear: 1990, maxYear: null, months: !1, years: !1 }, 607 buttonText: { 608 apply: 'Apply', 609 cancel: 'Cancel', 610 previousMonth: '<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>', 611 previousMonthLabel: 'Switch to previous month', 612 nextMonth: '<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>', 613 nextMonthLabel: 'Switch to next month', 614 reset: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/>\n </svg>' 615 }, 616 tooltipText: { one: 'day', other: 'days' } 617 }, i.options = s(s({}, i.options), e.element.dataset), Object.keys(i.options).forEach((function (t) {'true' !== i.options[t] && 'false' !== i.options[t] || (i.options[t] = 'true' === i.options[t]);})); 618 var n = s(s({}, i.options.dropdowns), e.dropdowns), o = s(s({}, i.options.buttonText), e.buttonText), 619 r = s(s({}, i.options.tooltipText), e.tooltipText); 620 i.options = s(s({}, i.options), e), i.options.dropdowns = s({}, n), i.options.buttonText = s({}, o), i.options.tooltipText = s({}, r), i.options.elementEnd || (i.options.allowRepick = !1), i.options.lockDays.length && (i.options.lockDays = a.DateTime.convertArray(i.options.lockDays, i.options.lockDaysFormat)), i.options.highlightedDays.length && (i.options.highlightedDays = a.DateTime.convertArray(i.options.highlightedDays, i.options.highlightedDaysFormat)); 621 var l = i.parseInput(), c = l[0], h = l[1]; 622 i.options.startDate && (i.options.singleMode || i.options.endDate) && (c = new a.DateTime(i.options.startDate, i.options.format, i.options.lang)), c && i.options.endDate && (h = new a.DateTime(i.options.endDate, i.options.format, i.options.lang)), c instanceof a.DateTime && !isNaN(c.getTime()) && (i.options.startDate = c), i.options.startDate && h instanceof a.DateTime && !isNaN(h.getTime()) && (i.options.endDate = h), !i.options.singleMode || i.options.startDate instanceof a.DateTime || (i.options.startDate = null), i.options.singleMode || i.options.startDate instanceof a.DateTime && i.options.endDate instanceof a.DateTime || (i.options.startDate = null, i.options.endDate = null); 623 for (var p = 0; p < i.options.numberOfMonths; p += 1) { 624 var d = i.options.startDate instanceof a.DateTime ? i.options.startDate.clone() : new a.DateTime; 625 if (!i.options.startDate && (0 === p || i.options.splitView)) { 626 var u = i.options.maxDate ? new a.DateTime(i.options.maxDate) : null, 627 m = i.options.minDate ? new a.DateTime(i.options.minDate) : null, f = i.options.numberOfMonths - 1; 628 m && u && d.isAfter(u) ? (d = m.clone()).setDate(1) : !m && u && d.isAfter(u) && ((d = u.clone()).setDate(1), d.setMonth(d.getMonth() - f)); 629 } 630 d.setDate(1), d.setMonth(d.getMonth() + p), i.calendars[p] = d; 631 } 632 if (i.options.showTooltip) if (i.options.tooltipPluralSelector) i.pluralSelector = i.options.tooltipPluralSelector; else try { 633 var g = new Intl.PluralRules(i.options.lang); 634 i.pluralSelector = g.select.bind(g); 635 } catch (t) {i.pluralSelector = function (t) {return 0 === Math.abs(t) ? 'one' : 'other';};} 636 return i; 637 } 638 639 return o(e, t), e.add = function (t, e) {l.Litepicker.prototype[t] = e;}, e.prototype.DateTime = function (t, e) {return t ? new a.DateTime(t, e) : new a.DateTime;}, e.prototype.init = function () { 640 var t = this; 641 this.options.plugins && this.options.plugins.length && this.options.plugins.forEach((function (e) {l.Litepicker.prototype.hasOwnProperty(e) ? l.Litepicker.prototype[e].init.call(t, t) : console.warn('Litepicker: plugin «' + e + '» not found.');})); 642 }, e.prototype.parseInput = function () { 643 var t = this.options.delimiter, e = new RegExp('' + t), 644 i = this.options.element instanceof HTMLInputElement ? this.options.element.value.split(t) : []; 645 if (this.options.elementEnd) {if (this.options.element instanceof HTMLInputElement && this.options.element.value.length && this.options.elementEnd instanceof HTMLInputElement && this.options.elementEnd.value.length) return [new a.DateTime(this.options.element.value, this.options.format), new a.DateTime(this.options.elementEnd.value, this.options.format)];} else if (this.options.singleMode) {if (this.options.element instanceof HTMLInputElement && this.options.element.value.length) return [new a.DateTime(this.options.element.value, this.options.format)];} else if (this.options.element instanceof HTMLInputElement && e.test(this.options.element.value) && i.length && i.length % 2 == 0) { 646 var n = i.slice(0, i.length / 2).join(t), o = i.slice(i.length / 2).join(t); 647 return [new a.DateTime(n, this.options.format), new a.DateTime(o, this.options.format)]; 648 } 649 return []; 650 }, e.prototype.isShowning = function () {return this.ui && 'none' !== this.ui.style.display;}, e.prototype.findPosition = function (t) { 651 var e = t.getBoundingClientRect(), i = this.ui.getBoundingClientRect(), n = this.options.position.split(' '), 652 o = window.scrollX || window.pageXOffset, s = window.scrollY || window.pageYOffset, r = 0, a = 0; 653 if ('auto' !== n[0] && /top|bottom/.test(n[0])) r = e[n[0]] + s, 'top' === n[0] && (r -= i.height); else { 654 r = e.bottom + s; 655 var l = e.bottom + i.height > window.innerHeight, c = e.top + s - i.height >= i.height; 656 l && c && (r = e.top + s - i.height); 657 } 658 if (/left|right/.test(n[0]) || n[1] && 'auto' !== n[1] && /left|right/.test(n[1])) a = /left|right/.test(n[0]) ? e[n[0]] + o : e[n[1]] + o, 'right' !== n[0] && 'right' !== n[1] || (a -= i.width); else { 659 a = e.left + o; 660 l = e.left + i.width > window.innerWidth; 661 var h = e.right + o - i.width >= 0; 662 l && h && (a = e.right + o - i.width); 663 } 664 return { left: a, top: r }; 665 }, e; 666 }(r.EventEmitter); 667 e.LPCore = c; 668}, function (t, e, i) { 669 'use strict'; 670 var n, o = 'object' == typeof Reflect ? Reflect : null, 671 s = o && 'function' == typeof o.apply ? o.apply : function (t, e, i) {return Function.prototype.apply.call(t, e, i);}; 672 n = o && 'function' == typeof o.ownKeys ? o.ownKeys : Object.getOwnPropertySymbols ? function (t) {return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));} : function (t) {return Object.getOwnPropertyNames(t);}; 673 var r = Number.isNaN || function (t) {return t != t;}; 674 675 function a () {a.init.call(this);} 676 677 t.exports = a, a.EventEmitter = a, a.prototype._events = void 0, a.prototype._eventsCount = 0, a.prototype._maxListeners = void 0; 678 var l = 10; 679 680 function c (t) {return void 0 === t._maxListeners ? a.defaultMaxListeners : t._maxListeners;} 681 682 function h (t, e, i, n) { 683 var o, s, r, a; 684 if ('function' != typeof i) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof i); 685 if (void 0 === (s = t._events) ? (s = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== s.newListener && (t.emit('newListener', e, i.listener ? i.listener : i), s = t._events), r = s[e]), void 0 === r) r = s[e] = i, ++t._eventsCount; else if ('function' == typeof r ? r = s[e] = n ? [i, r] : [r, i] : n ? r.unshift(i) : r.push(i), (o = c(t)) > 0 && r.length > o && !r.warned) { 686 r.warned = !0; 687 var l = new Error('Possible EventEmitter memory leak detected. ' + r.length + ' ' + String(e) + ' listeners added. Use emitter.setMaxListeners() to increase limit'); 688 l.name = 'MaxListenersExceededWarning', l.emitter = t, l.type = e, l.count = r.length, a = l, console && console.warn && console.warn(a); 689 } 690 return t; 691 } 692 693 function p () { 694 for (var t = [], e = 0; e < arguments.length; e++) t.push(arguments[e]); 695 this.fired || (this.target.removeListener(this.type, this.wrapFn), this.fired = !0, s(this.listener, this.target, t)); 696 } 697 698 function d (t, e, i) { 699 var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: i }, o = p.bind(n); 700 return o.listener = i, n.wrapFn = o, o; 701 } 702 703 function u (t, e, i) { 704 var n = t._events; 705 if (void 0 === n) return []; 706 var o = n[e]; 707 return void 0 === o ? [] : 'function' == typeof o ? i ? [o.listener || o] : [o] : i ? function (t) { 708 for (var e = new Array(t.length), i = 0; i < e.length; ++i) e[i] = t[i].listener || t[i]; 709 return e; 710 }(o) : f(o, o.length); 711 } 712 713 function m (t) { 714 var e = this._events; 715 if (void 0 !== e) { 716 var i = e[t]; 717 if ('function' == typeof i) return 1; 718 if (void 0 !== i) return i.length; 719 } 720 return 0; 721 } 722 723 function f (t, e) { 724 for (var i = new Array(e), n = 0; n < e; ++n) i[n] = t[n]; 725 return i; 726 } 727 728 Object.defineProperty(a, 'defaultMaxListeners', { 729 enumerable: !0, 730 get: function () {return l;}, 731 set: function (t) { 732 if ('number' != typeof t || t < 0 || r(t)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + '.'); 733 l = t; 734 } 735 }), a.init = function () {void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;}, a.prototype.setMaxListeners = function (t) { 736 if ('number' != typeof t || t < 0 || r(t)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + '.'); 737 return this._maxListeners = t, this; 738 }, a.prototype.getMaxListeners = function () {return c(this);}, a.prototype.emit = function (t) { 739 for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]); 740 var n = 'error' === t, o = this._events; 741 if (void 0 !== o) n = n && void 0 === o.error; else if (!n) return !1; 742 if (n) { 743 var r; 744 if (e.length > 0 && (r = e[0]), r instanceof Error) throw r; 745 var a = new Error('Unhandled error.' + (r ? ' (' + r.message + ')' : '')); 746 throw a.context = r, a; 747 } 748 var l = o[t]; 749 if (void 0 === l) return !1; 750 if ('function' == typeof l) s(l, this, e); else {
751 var c = l.length, h = f(l, c); 752 for (i = 0; i < c; ++i) s(h[i], this, e); 753 } 754 return !0; 755 }, a.prototype.addListener = function (t, e) {return h(this, t, e, !1);}, a.prototype.on = a.prototype.addListener, a.prototype.prependListener = function (t, e) {return h(this, t, e, !0);}, a.prototype.once = function (t, e) { 756 if ('function' != typeof e) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e); 757 return this.on(t, d(this, t, e)), this; 758 }, a.prototype.prependOnceListener = function (t, e) { 759 if ('function' != typeof e) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e); 760 return this.prependListener(t, d(this, t, e)), this; 761 }, a.prototype.removeListener = function (t, e) { 762 var i, n, o, s, r; 763 if ('function' != typeof e) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e); 764 if (void 0 === (n = this._events)) return this; 765 if (void 0 === (i = n[t])) return this; 766 if (i === e || i.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete n[t], n.removeListener && this.emit('removeListener', t, i.listener || e)); else if ('function' != typeof i) { 767 for (o = -1, s = i.length - 1; s >= 0; s--) if (i[s] === e || i[s].listener === e) { 768 r = i[s].listener, o = s; 769 break; 770 } 771 if (o < 0) return this; 772 0 === o ? i.shift() : function (t, e) { 773 for (; e + 1 < t.length; e++) t[e] = t[e + 1]; 774 t.pop(); 775 }(i, o), 1 === i.length && (n[t] = i[0]), void 0 !== n.removeListener && this.emit('removeListener', t, r || e); 776 } 777 return this; 778 }, a.prototype.off = a.prototype.removeListener, a.prototype.removeAllListeners = function (t) { 779 var e, i, n; 780 if (void 0 === (i = this._events)) return this; 781 if (void 0 === i.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== i[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete i[t]), this; 782 if (0 === arguments.length) { 783 var o, s = Object.keys(i); 784 for (n = 0; n < s.length; ++n) 'removeListener' !== (o = s[n]) && this.removeAllListeners(o); 785 return this.removeAllListeners('removeListener'), this._events = Object.create(null), this._eventsCount = 0, this; 786 } 787 if ('function' == typeof (e = i[t])) this.removeListener(t, e); else if (void 0 !== e) for (n = e.length - 1; n >= 0; n--) this.removeListener(t, e[n]); 788 return this; 789 }, a.prototype.listeners = function (t) {return u(this, t, !0);}, a.prototype.rawListeners = function (t) {return u(this, t, !1);}, a.listenerCount = function (t, e) {return 'function' == typeof t.listenerCount ? t.listenerCount(e) : m.call(t, e);}, a.prototype.listenerCount = m, a.prototype.eventNames = function () {return this._eventsCount > 0 ? n(this._events) : [];}; 790}, function (t, e, i) { 791 (e = i(9)(!1)).push([t.i,
vendor: 10,875 bytes, line 791
791':root{--litepicker-container-months-color-bg: #fff;--litepicker-container-months-box-shadow-color: #ddd;--litepicker-footer-color-bg: #fafafa;--litepicker-footer-box-shadow-color: #ddd;--litepicker-tooltip-color-bg: #fff;--litepicker-month-header-color: #333;--litepicker-button-prev-month-color: #9e9e9e;--litepicker-button-next-month-color: #9e9e9e;--litepicker-button-prev-month-color-hover: #2196f3;--litepicker-button-next-month-color-hover: #2196f3;--litepicker-month-width: calc(var(--litepicker-day-width) * 7);--litepicker-month-weekday-color: #9e9e9e;--litepicker-month-week-number-color: #9e9e9e;--litepicker-day-width: 38px;--litepicker-day-color: #333;--litepicker-day-color-hover: #2196f3;--litepicker-is-today-color: #f44336;--litepicker-is-in-range-color: #bbdefb;--litepicker-is-locked-color: #9e9e9e;--litepicker-is-start-color: #fff;--litepicker-is-start-color-bg: #2196f3;--litepicker-is-end-color: #fff;--litepicker-is-end-color-bg: #2196f3;--litepicker-button-cancel-color: #fff;--litepicker-button-cancel-color-bg: #9e9e9e;--litepicker-button-apply-color: #fff;--litepicker-button-apply-color-bg: #2196f3;--litepicker-button-reset-color: #909090;--litepicker-button-reset-color-hover: #2196f3;--litepicker-highlighted-day-color: #333;--litepicker-highlighted-day-color-bg: #ffeb3b}.show-week-numbers{--litepicker-month-width: calc(var(--litepicker-day-width) * 8)}.litepicker{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:0.8em;display:none}.litepicker button{border:none;background:none}.litepicker .container__main{display:-webkit-box;display:-ms-flexbox;display:flex}.litepicker .container__months{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:var(--litepicker-container-months-color-bg);border-radius:5px;-webkit-box-shadow:0 0 5px var(--litepicker-container-months-box-shadow-color);box-shadow:0 0 5px var(--litepicker-container-months-box-shadow-color);width:calc(var(--litepicker-month-width) + 10px);-webkit-box-sizing:content-box;box-sizing:content-box}.litepicker .container__months.columns-2{width:calc((var(--litepicker-month-width) * 2) + 20px)}.litepicker .container__months.columns-3{width:calc((var(--litepicker-month-width) * 3) + 30px)}.litepicker .container__months.columns-4{width:calc((var(--litepicker-month-width) * 4) + 40px)}.litepicker .container__months.split-view .month-item-header .button-previous-month,.litepicker .container__months.split-view .month-item-header .button-next-month{visibility:visible}.litepicker .container__months .month-item{padding:5px;width:var(--litepicker-month-width);-webkit-box-sizing:content-box;box-sizing:content-box}.litepicker .container__months .month-item-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;font-weight:500;padding:10px 5px;text-align:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--litepicker-month-header-color)}.litepicker .container__months .month-item-header div{-webkit-box-flex:1;-ms-flex:1;flex:1}.litepicker .container__months .month-item-header div>.month-item-name{margin-right:5px}.litepicker .container__months .month-item-header div>.month-item-year{padding:0}.litepicker .container__months .month-item-header .reset-button{color:var(--litepicker-button-reset-color)}.litepicker .container__months .month-item-header .reset-button>svg{fill:var(--litepicker-button-reset-color)}.litepicker .container__months .month-item-header .reset-button *{pointer-events:none}.litepicker .container__months .month-item-header .reset-button:hover{color:var(--litepicker-button-reset-color-hover)}.litepicker .container__months .month-item-header .reset-button:hover>svg{fill:var(--litepicker-button-reset-color-hover)}.litepicker .container__months .month-item-header .button-previous-month,.litepicker .container__months .month-item-header .button-next-month{visibility:hidden;text-decoration:none;padding:3px 5px;border-radius:3px;-webkit-transition:color 0.3s, border 0.3s;transition:color 0.3s, border 0.3s;cursor:default}.litepicker .container__months .month-item-header .button-previous-month *,.litepicker .container__months .month-item-header .button-next-month *{pointer-events:none}.litepicker .container__months .month-item-header .button-previous-month{color:var(--litepicker-button-prev-month-color)}.litepicker .container__months .month-item-header .button-previous-month>svg,.litepicker .container__months .month-item-header .button-previous-month>img{fill:var(--litepicker-button-prev-month-color)}.litepicker .container__months .month-item-header .button-previous-month:hover{color:var(--litepicker-button-prev-month-color-hover)}.litepicker .container__months .month-item-header .button-previous-month:hover>svg{fill:var(--litepicker-button-prev-month-color-hover)}.litepicker .container__months .month-item-header .button-next-month{color:var(--litepicker-button-next-month-color)}.litepicker .container__months .month-item-header .button-next-month>svg,.litepicker .container__months .month-item-header .button-next-month>img{fill:var(--litepicker-button-next-month-color)}.litepicker .container__months .month-item-header .button-next-month:hover{color:var(--litepicker-button-next-month-color-hover)}.litepicker .container__months .month-item-header .button-next-month:hover>svg{fill:var(--litepicker-button-next-month-color-hover)}.litepicker .container__months .month-item-weekdays-row{display:-webkit-box;display:-ms-flexbox;display:flex;justify-self:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;color:var(--litepicker-month-weekday-color)}.litepicker .container__months .month-item-weekdays-row>div{padding:5px 0;font-size:85%;-webkit-box-flex:1;-ms-flex:1;flex:1;width:var(--litepicker-day-width);text-align:center}.litepicker .container__months .month-item:first-child .button-previous-month{visibility:visible}.litepicker .container__months .month-item:last-child .button-next-month{visibility:visible}.litepicker .container__months .month-item.no-previous-month .button-previous-month{visibility:hidden}.litepicker .container__months .month-item.no-next-month .button-next-month{visibility:hidden}.litepicker .container__days{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-self:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:center;-webkit-box-sizing:content-box;box-sizing:content-box}.litepicker .container__days>div,.litepicker .container__days>a{padding:5px 0;width:var(--litepicker-day-width)}.litepicker .container__days .day-item{color:var(--litepicker-day-color);text-align:center;text-decoration:none;border-radius:3px;-webkit-transition:color 0.3s, border 0.3s;transition:color 0.3s, border 0.3s;cursor:default}.litepicker .container__days .day-item:hover{color:var(--litepicker-day-color-hover);-webkit-box-shadow:inset 0 0 0 1px var(--litepicker-day-color-hover);box-shadow:inset 0 0 0 1px var(--litepicker-day-color-hover)}.litepicker .container__days .day-item.is-today{color:var(--litepicker-is-today-color)}.litepicker .container__days .day-item.is-locked{color:var(--litepicker-is-locked-color)}.litepicker .container__days .day-item.is-locked:hover{color:var(--litepicker-is-locked-color);-webkit-box-shadow:none;box-shadow:none;cursor:default}.litepicker .container__days .day-item.is-in-range{background-color:var(--litepicker-is-in-range-color);border-radius:0}.litepicker .container__days .day-item.is-start-date{color:var(--litepicker-is-start-color);background-color:var(--litepicker-is-start-color-bg);border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-right-radius:0;border-bottom-right-radius:0}.litepicker .container__days .day-item.is-start-date.is-flipped{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:5px;border-bottom-right-radius:5px}.litepicker .container__days .day-item.is-end-date{color:var(--litepicker-is-end-color);background-color:var(--litepicker-is-end-color-bg);border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:5px;border-bottom-right-radius:5px}.litepicker .container__days .day-item.is-end-date.is-flipped{border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-right-radius:0;border-bottom-right-radius:0}.litepicker .container__days .day-item.is-start-date.is-end-date{border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px}.litepicker .container__days .day-item.is-highlighted{color:var(--litepicker-highlighted-day-color);background-color:var(--litepicker-highlighted-day-color-bg)}.litepicker .container__days .week-number{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:var(--litepicker-month-week-number-color);font-size:85%}.litepicker .container__footer{text-align:right;padding:10px 5px;margin:0 5px;background-color:var(--litepicker-footer-color-bg);-webkit-box-shadow:inset 0px 3px 3px 0px var(--litepicker-footer-box-shadow-color);box-shadow:inset 0px 3px 3px 0px var(--litepicker-footer-box-shadow-color);border-bottom-left-radius:5px;border-bottom-right-radius:5px}.litepicker .container__footer .preview-date-range{margin-right:10px;font-size:90%}.litepicker .container__footer .button-cancel{background-color:var(--litepicker-button-cancel-color-bg);color:var(--litepicker-button-cancel-color);border:0;padding:3px 7px 4px;border-radius:3px}.litepicker .container__footer .button-cancel *{pointer-events:none}.litepicker .container__footer .button-apply{background-color:var(--litepicker-button-apply-color-bg);color:var(--litepicker-button-apply-color);border:0;padding:3px 7px 4px;border-radius:3px;margin-left:10px;margin-right:10px}.litepicker .container__footer .button-apply:disabled{opacity:0.7}.litepicker .container__footer .button-apply *{pointer-events:none}.litepicker .container__tooltip{position:absolute;margin-top:-4px;padding:4px 8px;border-radius:4px;background-color:var(--litepicker-tooltip-color-bg);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.25);box-shadow:0 1px 3px rgba(0,0,0,0.25);white-space:nowrap;font-size:11px;pointer-events:none;visibility:hidden}.litepicker .container__tooltip:before{position:absolute;bottom:-5px;left:calc(50% - 5px);border-top:5px solid rgba(0,0,0,0.12);border-right:5px solid transparent;border-left:5px solid transparent;content:""}.litepicker .container__tooltip:after{position:absolute;bottom:-4px;left:calc(50% - 4px);border-top:4px solid var(--litepicker-tooltip-color-bg);border-right:4px solid transparent;border-left:4px solid transparent;content:""}\n',
791 '']), e.locals = { 792 showWeekNumbers: 'show-week-numbers', 793 litepicker: 'litepicker', 794 containerMain: 'container__main', 795 containerMonths: 'container__months', 796 columns2: 'columns-2', 797 columns3: 'columns-3', 798 columns4: 'columns-4', 799 splitView: 'split-view', 800 monthItemHeader: 'month-item-header', 801 buttonPreviousMonth: 'button-previous-month', 802 buttonNextMonth: 'button-next-month', 803 monthItem: 'month-item', 804 monthItemName: 'month-item-name', 805 monthItemYear: 'month-item-year', 806 resetButton: 'reset-button', 807 monthItemWeekdaysRow: 'month-item-weekdays-row', 808 noPreviousMonth: 'no-previous-month', 809 noNextMonth: 'no-next-month', 810 containerDays: 'container__days', 811 dayItem: 'day-item', 812 isToday: 'is-today', 813 isLocked: 'is-locked', 814 isInRange: 'is-in-range', 815 isStartDate: 'is-start-date', 816 isFlipped: 'is-flipped', 817 isEndDate: 'is-end-date',
818 isHighlighted: 'is-highlighted', 819 weekNumber: 'week-number', 820 containerFooter: 'container__footer', 821 previewDateRange: 'preview-date-range', 822 buttonCancel: 'button-cancel', 823 buttonApply: 'button-apply', 824 containerTooltip: 'container__tooltip' 825 }, t.exports = e; 826}, function (t, e, i) { 827 'use strict'; 828 t.exports = function (t) { 829 var e = []; 830 return e.toString = function () { 831 return this.map((function (e) { 832 var i = function (t, e) { 833 var i = t[1] || '', n = t[3]; 834 if (!n) return i; 835 if (e && 'function' == typeof btoa) { 836 var o = (r = n, a = btoa(unescape(encodeURIComponent(JSON.stringify(r)))), l = 'sourceMappingURL=data:application/json;charset=utf-8;base64,'.concat(a), '/*# '.concat(l, ' */')), 837 s = n.sources.map((function (t) {return '/*# sourceURL='.concat(n.sourceRoot || '').concat(t, ' */');})); 838 return [i].concat(s).concat([o]).join('\n'); 839 } 840 var r, a, l; 841 return [i].join('\n'); 842 }(e, t); 843 return e[2] ? '@media '.concat(e[2], ' {').concat(i, '}') : i; 844 })).join(''); 845 }, e.i = function (t, i, n) { 846 'string' == typeof t && (t = [[null, t, '']]); 847 var o = {}; 848 if (n) for (var s = 0; s < this.length; s++) { 849 var r = this[s][0]; 850 null != r && (o[r] = !0); 851 } 852 for (var a = 0; a < t.length; a++) { 853 var l = [].concat(t[a]); 854 n && o[l[0]] || (i && (l[2] ? l[2] = ''.concat(i, ' and ').concat(l[2]) : l[2] = i), e.push(l)); 855 } 856 }, e; 857 }; 858}, function (t, e, i) { 859 'use strict'; 860 var n, o = {}, 861 s = function () {return void 0 === n && (n = Boolean(window && document && document.all && !window.atob)), n;}, 862 r = function () { 863 var t = {}; 864 return function (e) { 865 if (void 0 === t[e]) { 866 var i = document.querySelector(e); 867 if (window.HTMLIFrameElement && i instanceof window.HTMLIFrameElement) try {i = i.contentDocument.head;} catch (t) {i = null;} 868 t[e] = i; 869 } 870 return t[e]; 871 }; 872 }(); 873 874 function a (t, e) { 875 for (var i = [], n = {}, o = 0; o < t.length; o++) { 876 var s = t[o], r = e.base ? s[0] + e.base : s[0], a = { css: s[1], media: s[2], sourceMap: s[3] }; 877 n[r] ? n[r].parts.push(a) : i.push(n[r] = { id: r, parts: [a] }); 878 } 879 return i; 880 } 881 882 function l (t, e) { 883 for (var i = 0; i < t.length; i++) { 884 var n = t[i], s = o[n.id], r = 0; 885 if (s) { 886 for (s.refs++; r < s.parts.length; r++) s.parts[r](n.parts[r]); 887 for (; r < n.parts.length; r++) s.parts.push(g(n.parts[r], e)); 888 } else { 889 for (var a = []; r < n.parts.length; r++) a.push(g(n.parts[r], e)); 890 o[n.id] = { id: n.id, refs: 1, parts: a }; 891 } 892 } 893 } 894 895 function c (t) { 896 var e = document.createElement('style'); 897 if (void 0 === t.attributes.nonce) { 898 var n = i.nc; 899 n && (t.attributes.nonce = n); 900 } 901 if (Object.keys(t.attributes).forEach((function (i) {e.setAttribute(i, t.attributes[i]);})), 'function' == typeof t.insert) t.insert(e); else { 902 var o = r(t.insert || 'head'); 903 if (!o) throw new Error('Couldn\'t find a style target. This probably means that the value for the \'insert\' parameter is invalid.'); 904 o.appendChild(e); 905 } 906 return e; 907 } 908 909 var h, p = (h = [], function (t, e) {return h[t] = e, h.filter(Boolean).join('\n');}); 910 911 function d (t, e, i, n) { 912 var o = i ? '' : n.css; 913 if (t.styleSheet) t.styleSheet.cssText = p(e, o); else { 914 var s = document.createTextNode(o), r = t.childNodes; 915 r[e] && t.removeChild(r[e]), r.length ? t.insertBefore(s, r[e]) : t.appendChild(s); 916 } 917 } 918 919 function u (t, e, i) { 920 var n = i.css, o = i.media, s = i.sourceMap; 921 if (o && t.setAttribute('media', o), s && btoa && (n += '\n/*# sourceMappingURL=data:application/json;base64,'.concat(btoa(unescape(encodeURIComponent(JSON.stringify(s)))), ' */')), t.styleSheet) t.styleSheet.cssText = n; else { 922 for (; t.firstChild;) t.removeChild(t.firstChild); 923 t.appendChild(document.createTextNode(n)); 924 } 925 } 926 927 var m = null, f = 0; 928
929 function g (t, e) { 930 var i, n, o; 931 if (e.singleton) { 932 var s = f++; 933 i = m || (m = c(e)), n = d.bind(null, i, s, !1), o = d.bind(null, i, s, !0); 934 } else i = c(e), n = u.bind(null, i, e), o = function () { 935 !function (t) { 936 if (null === t.parentNode) return !1; 937 t.parentNode.removeChild(t); 938 }(i); 939 }; 940 return n(t), function (e) { 941 if (e) { 942 if (e.css === t.css && e.media === t.media && e.sourceMap === t.sourceMap) return; 943 n(t = e); 944 } else o(); 945 }; 946 } 947 948 t.exports = function (t, e) { 949 (e = e || {}).attributes = 'object' == typeof e.attributes ? e.attributes : {}, e.singleton || 'boolean' == typeof e.singleton || (e.singleton = s()); 950 var i = a(t, e); 951 return l(i, e), function (t) { 952 for (var n = [], s = 0; s < i.length; s++) { 953 var r = i[s], c = o[r.id]; 954 c && (c.refs--, n.push(c)); 955 } 956 t && l(a(t, e), e); 957 for (var h = 0; h < n.length; h++) { 958 var p = n[h]; 959 if (0 === p.refs) { 960 for (var d = 0; d < p.parts.length; d++) p.parts[d](); 961 delete o[p.id]; 962 } 963 } 964 }; 965 }; 966}, function (t, e, i) { 967 'use strict'; 968 var n = this && this.__assign || function () { 969 return (n = Object.assign || function (t) { 970 for (var e, i = 1, n = arguments.length; i < n; i++) for (var o in e = arguments[i]) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); 971 return t; 972 }).apply(this, arguments); 973 }; 974 Object.defineProperty(e, '__esModule', { value: !0 }); 975 var o = i(0), s = i(1), r = i(2); 976 s.Litepicker.prototype.show = function (t) { 977 void 0 === t && (t = null), this.emit('before:show', t); 978 var e = t || this.options.element; 979 if (this.triggerElement = e, !this.isShowning()) { 980 if (this.options.inlineMode) return this.ui.style.position = 'relative', this.ui.style.display = 'inline-block', this.ui.style.top = null, this.ui.style.left = null, this.ui.style.bottom = null, void (this.ui.style.right = null); 981 this.scrollToDate(t), this.render(), this.ui.style.position = 'absolute', this.ui.style.display = 'block', this.ui.style.zIndex = this.options.zIndex; 982 var i = this.findPosition(e); 983 this.ui.style.top = i.top + 'px', this.ui.style.left = i.left + 'px', this.ui.style.right = null, this.ui.style.bottom = null, this.emit('show', t); 984 } 985 }, s.Litepicker.prototype.hide = function () {this.isShowning() && (this.datePicked.length = 0, this.updateInput(), this.options.inlineMode ? this.render() : (this.ui.style.display = 'none', this.emit('hide')));}, s.Litepicker.prototype.getDate = function () {return this.getStartDate();}, s.Litepicker.prototype.getStartDate = function () {return this.options.startDate ? this.options.startDate.clone() : null;}, s.Litepicker.prototype.getEndDate = function () {return this.options.endDate ? this.options.endDate.clone() : null;}, s.Litepicker.prototype.setDate = function (t, e) { 986 void 0 === e && (e = !1); 987 var i = new o.DateTime(t, this.options.format, this.options.lang); 988 r.dateIsLocked(i, this.options, [i]) && !e ? this.emit('error:date', i) : (this.setStartDate(t), this.options.inlineMode && this.render(), this.emit('selected', this.getDate())); 989 }, s.Litepicker.prototype.setStartDate = function (t) {t && (this.options.startDate = new o.DateTime(t, this.options.format, this.options.lang), this.updateInput());}, s.Litepicker.prototype.setEndDate = function (t) {t && (this.options.endDate = new o.DateTime(t, this.options.format, this.options.lang), this.options.startDate.getTime() > this.options.endDate.getTime() && (this.options.endDate = this.options.startDate.clone(), this.options.startDate = new o.DateTime(t, this.options.format, this.options.lang)), this.updateInput());}, s.Litepicker.prototype.setDateRange = function (t, e, i) { 990 void 0 === i && (i = !1), this.triggerElement = void 0; 991 var n = new o.DateTime(t, this.options.format, this.options.lang), 992 s = new o.DateTime(e, this.options.format, this.options.lang); 993 (this.options.disallowLockDaysInRange ? r.rangeIsLocked([n, s], this.options) : r.dateIsLocked(n, this.options, [n, s]) || r.dateIsLocked(s, this.options, [n, s])) && !i ? this.emit
993('error:range', [n, s]) : (this.setStartDate(n), this.setEndDate(s), this.options.inlineMode && this.render(), this.updateInput(), this.emit('selected', this.getStartDate(), this.getEndDate())); 994 }, s.Litepicker.prototype.gotoDate = function (t, e) { 995 void 0 === e && (e = 0); 996 var i = new o.DateTime(t); 997 i.setDate(1), this.calendars[e] = i.clone(), this.render(); 998 }, s.Litepicker.prototype.setLockDays = function (t) {this.options.lockDays = o.DateTime.convertArray(t, this.options.lockDaysFormat), this.render();}, s.Litepicker.prototype.setHighlightedDays = function (t) {this.options.highlightedDays = o.DateTime.convertArray(t, this.options.highlightedDaysFormat), this.render();}, s.Litepicker.prototype.setOptions = function (t) { 999 delete t.element, delete t.elementEnd, delete t.parentEl, t.startDate && (t.startDate = new o.DateTime(t.startDate, this.options.format, this.options.lang)), t.endDate && (t.endDate = new o.DateTime(t.endDate, this.options.format, this.options.lang)); 1000 var e = n(n({}, this.options.dropdowns), t.dropdowns), i = n(n({}, this.options.buttonText), t.buttonText), 1001 s = n(n({}, this.options.tooltipText), t.tooltipText); 1002 this.options = n(n({}, this.options), t), this.options.dropdowns = n({}, e), this.options.buttonText = n({}, i), this.options.tooltipText = n({}, s), !this.options.singleMode || this.options.startDate instanceof o.DateTime || (this.options.startDate = null, this.options.endDate = null), this.options.singleMode || this.options.startDate instanceof o.DateTime && this.options.endDate instanceof o.DateTime || (this.options.startDate = null, this.options.endDate = null); 1003 for (var r = 0; r < this.options.numberOfMonths; r += 1) { 1004 var a = this.options.startDate ? this.options.startDate.clone() : new o.DateTime; 1005 a.setDate(1), a.setMonth(a.getMonth() + r), this.calendars[r] = a; 1006 } 1007 this.options.lockDays.length && (this.options.lockDays = o.DateTime.convertArray(this.options.lockDays, this.options.lockDaysFormat)), this.options.highlightedDays.length && (this.options.highlightedDays = o.DateTime.convertArray(this.options.highlightedDays, this.options.highlightedDaysFormat)), this.render(), this.options.inlineMode && this.show(), this.updateInput(); 1008 }, s.Litepicker.prototype.clearSelection = function () {this.options.startDate = null, this.options.endDate = null, this.datePicked.length = 0, this.updateInput(), this.isShowning() && this.render(), this.emit('clear:selection');}, s.Litepicker.prototype.destroy = function () {this.ui && this.ui.parentNode && (this.ui.parentNode.removeChild(this.ui), this.ui = null), this.emit('destroy');}; 1009}]).Litepicker; 1010 1011/** 1012 * JavaScript for plugin events2_search and events2_management 1013 * 1014 * Initialize Events2 in general 1015 * 1016 * @param $element 1017 * @constructor 1018 */ 1019let Events2 = function ($element) { 1020 let me = this; 1021 1022 me.$element = $element; 1023 me.selectorCreatePlugin = '.tx-events2-create'; 1024 me.selectorSearchPlugin = '.tx-events2-search'; 1025 me.selectorPluginVariables = '.events2DataElement'; 1026 me.selectorRemainingChars = '.remainingChars'; 1027 me.selectorAutoCompleteLocation = '#autoCompleteLocation'; 1028 me.selectorAutoCompleteLocationHelper = '.autoCompleteLocationHelper'; 1029 me.selectorSearchMainCategory = '.searchMainCategory'; 1030 me.dateFormat = 'DD.MM.YYYY'; 1031 1032 /** 1033 * Check type of Plugin. Event, Create or Search 1034 * 1035 * @returns {string} 1036 */ 1037 me.getPluginType = function ($element) { 1038 if ($element.classList.contains('tx-events2-create')) { 1039 return 'create'; 1040 } else if ($element.classList.contains('tx-events2-search')) { 1041 return 'search'; 1042 } else { 1043 return 'event'; 1044 } 1045 }; 1046 1047 /** 1048 * Test, if element is of Type "Event Plugin" 1049 * 1050 * @returns {boolean} 1051 */ 1052 me.isEventPlugin = function ($element) { 1053 return me.getPluginType($element) === 'event'; 1054 }; 1055 1056 /** 1057 * Test, if element is of Type "Create Plugin" 1058 * 1059 * @returns {boolean} 1060 */ 1061 me.isCreatePlugin = function ($element) { 1062 return me.getPluginType($element) === 'create'; 1063 }; 1064 1065 /** 1066 * Test, if element is of Type "Search Plugin" 1067 * 1068 * @returns {boolean} 1069 */ 1070 me.isSearchPlugin = function ($element) { 1071 return me.getPluginType($element) === 'search'; 1072 }; 1073 1074 /** 1075 * Test, if there are some textareas in form with remaining chars feature 1076 * 1077 * @returns {boolean} 1078 */ 1079 me.hasRemainingCharsContainer = function () { 1080 return me.$remainingCharsContainer !== null; 1081 }; 1082 1083 /** 1084 * Test, if there is an AutoComplete for location available in template 1085 * 1086 * @returns {boolean} 1087 */ 1088 me.hasAutoCompleteLocation = function () { 1089 return me.$autoCompleteLocation !== null; 1090 }; 1091 1092 /** 1093 * Test, if localization of pluginVariables is initialized 1094 * 1095 * @returns {boolean} 1096 */ 1097 me.isLocalizationInitialized = function () { 1098 return me.pluginVariables.hasOwnProperty('localization'); 1099 }; 1100 1101 /** 1102 * Test, if settings of pluginVariables are initialized 1103 * 1104 * @returns {boolean} 1105 */ 1106 me.isSettingsInitialized = function () { 1107 return me.pluginVariables.hasOwnProperty('settings'); 1108 }; 1109 1110 /** 1111 * Test, if main category is available in search template 1112 * 1113 * @returns {boolean} 1114 */ 1115 me.hasSearchMainCategory = function () { 1116 return me.$searchMainCategory !== null; 1117 }; 1118 1119 /** 1120 * Initialize possible organizer selectbox in events2 list view 1121 */ 1122 me.initializeOrganizerFilters = function () { 1123 let $organizerForm = document.querySelector('form#eventFilter'); 1124 if ($organizerForm !== null) { 1125 let $organizerSelectBox = $organizerForm.querySelector('select#organizer'); 1126 if ($organizerSelectBox !== null) { 1127 $organizerSelectBox.addEventListener('change', event => { 1128 event.preventDefault(); 1129 if (event.target.value === '') { 1130 window.location.href = $organizerForm.getAttribute('action'); 1131 } else { 1132 window.location.href = event.target.value; 1133 } 1134 }); 1135 } 1136 } 1137 }; 1138 1139 /** 1140 * Initialize DatePicker for input elements with class: addDatePicker 1141 */ 1142 me.initializeDatePicker = function () { 1143 document.querySelectorAll('.addDatePicker').forEach($inputWithDatePicker => { 1144 new Litepicker({ 1145 element: $inputWithDatePicker, 1146 format: me.dateFormat, 1147 singleMode: true, 1148 resetButton: true 1149 }); 1150 }); 1151 }; 1152 1153 /** 1154 * Initialize remaining letters for teaser in create form 1155 */ 1156 me.initializeRemainingLetters = function () { 1157 if (me.hasRemainingCharsContainer()) { 1158 if (!me.isLocalizationInitialized()) { 1159 console.log('Variable localization of pluginVariables is not available. Please check your templates'); 1160 } else if (!me.isSettingsInitialized()) { 1161 console.log('Variable settings of pluginVariables is not available. Please check your templates'); 1162 } else { 1163 me.$remainingCharsContainer.forEach($remainingCharsContainer => { 1164 let $textarea = document.querySelector('#' + $remainingCharsContainer.getAttribute('data-id')); 1165 $remainingCharsContainer.innerText = me.pluginVariables.localization.remainingText + ': ' + me.pluginVariables.settings.remainingLetters; 1166 1167 $textarea.addEventListener('keyup', () => { 1168 let value = $textarea.value; 1169 let len = value.length; 1170 let maxLength = me.pluginVariables.settings.remainingLetters; 1171 1172 $textarea.value = value.substring(0, maxLength); 1173 $remainingCharsContainer.innerText = me.pluginVariables.localization.remainingText + ': ' + (maxLength - len); 1174 }); 1175 }); 1176 } 1177 } 1178 }; 1179 1180 /** 1181 * Initialize AutoComplete for location 1182 */ 1183 me.initializeAutoCompleteForLocation = function () { 1184 if (me.hasAutoCompleteLocation()) { 1185 let siteUrl = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : ''); 1186 1187 /* Yes, the constructor was written in lower case */ 1188 const autoCompleteJS = new autoComplete({ 1189 selector: me.selectorAutoCompleteLocation, 1190 placeHolder: 'Search for Locations...', 1191 data: { 1192 src: async () => { 1193 try { 1194 // Loading placeholder text 1195 me.$autoCompleteLocation.setAttribute('placeholder', 'Loading...'); 1196 // Fetch External Data Source 1197 const source = await fetch( 1198 siteUrl + '?events2SearchLocation=' + autoCompleteJS.input.value, { 1199 headers: { 1200 'Content-Type': 'application/json', 1201 'ext-events2': 'getLocations' 1202 } 1203 }); 1204 const locations = await source.json(); 1205 // Post Loading placeholder text 1206 me.$autoCompleteLocation.setAttribute('placeholder', autoCompleteJS.placeHolder); 1207 // Returns Fetched data 1208 return locations; 1209 } catch (error) { 1210 return error; 1211 } 1212 }, 1213 keys: ['uid', 'label'], 1214 cache: false, 1215 resultsList: { 1216 noResults: false, 1217 maxResults: 15, 1218 tabSelect: true 1219 }, 1220 resultItem: { 1221 highlight: { 1222 render: true 1223 } 1224 }, 1225 events: { 1226 input: { 1227 focus: () => { 1228 if (autoCompleteJS.input.value.length) { 1229 autoCompleteJS.start(); 1230 } 1231 } 1232 } 1233 } 1234 } 1235 }); 1236 1237 autoCompleteJS.input.addEventListener('selection', (event) => { 1238 const feedback = event.detail; 1239 autoCompleteJS.input.blur(); 1240 autoCompleteJS.input.value = feedback.selection.value[feedback.selection.key]; 1241 me.$autoCompleteLocationHelper.value = feedback.selection.value['uid']; 1242 }); 1243 } 1244 }; 1245 1246 /** 1247 * Initialize sub-categories of search plugin 1248 */ 1249 me.initializeSubCategoriesForSearch = function () { 1250 if (me.hasSearchMainCategory()) { 1251 me.$searchMainCategory.addEventListener('change', () => {
1252 me.renderSubCategory(); 1253 }); 1254 me.renderSubCategory(); 1255 } 1256 }; 1257 1258 /** 1259 * Search for sub-categories, if a main category was selected 1260 */ 1261 me.renderSubCategory = function () { 1262 if (document.querySelector('#searchSubCategory').value === '') { 1263 document.querySelector('#searchSubCategory').setAttribute('disabled', 'disabled'); 1264 } 1265 1266 if (me.$searchMainCategory.value !== '0') { 1267 let siteUrl = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : ''); 1268 fetch(siteUrl + '?events2Category=' + me.$searchMainCategory.value, { 1269 headers: { 1270 'Content-Type': 'application/json', 1271 'ext-events2': 'getSubCategories' 1272 } 1273 }).then(response => { 1274 if (response.ok && response.status === 200) { 1275 return response.json(); 1276 } 1277 return Promise.reject(response); 1278 }).then(categories => { 1279 me.fillSubCategories(categories); 1280 }).catch(error => { 1281 console.warn('Request error', error); 1282 }); 1283 } 1284 }; 1285 1286 /** 1287 * Use categories to fill selector for sub-categories 1288 * 1289 * @param categories 1290 */ 1291 me.fillSubCategories = function (categories) {
1292 let count = 0; 1293 let option = false; 1294 let selected = ''; 1295 let $searchSubCategory = document.querySelector('#searchSubCategory'); 1296 let firstOption = document.createElement('option'); 1297 1298 firstOption.setAttribute('value', '0'); 1299 $searchSubCategory.appendChild(firstOption); 1300 1301 for (let i = 0; i < categories.length; i++) { 1302 count++; 1303 option = document.createElement('option'); 1304 if ( 1305 me.pluginVariables.search.subCategory !== null 1306 && me.pluginVariables.search.subCategory.uid === parseInt(categories[i].uid) 1307 ) { 1308 option.setAttribute('selected', 'selected'); 1309 } 1310 option.setAttribute('value', categories[i].uid); 1311 option.innerText = categories[i].label; 1312 $searchSubCategory.appendChild(option); 1313 } 1314 1315 if (count) { 1316 $searchSubCategory.removeAttribute('disabled'); 1317 } 1318 }; 1319 1320 me.pluginVariables = JSON.parse( 1321 $element.querySelector(me.selectorPluginVariables).getAttribute('data-variables') 1322 ); 1323 1324 me.initializeOrganizerFilters(); 1325 if (me.isCreatePlugin($element)) { 1326 me.$remainingCharsContainer = $element.querySelectorAll(me.selectorRemainingChars); 1327 me.$autoCompleteLocation = $element.querySelector(me.selectorAutoCompleteLocation); 1328 me.$autoCompleteLocationHelper = $element.querySelector(me.selectorAutoCompleteLocationHelper); 1329 me.initializeRemainingLetters(); 1330 me.initializeDatePicker(); 1331 me.initializeAutoCompleteForLocation(); 1332 } else if (me.isSearchPlugin($element)) { 1333 me.$searchMainCategory = $element.querySelector(me.selectorSearchMainCategory); 1334 me.initializeDatePicker(); 1335 me.initializeSubCategoriesForSearch(); 1336 } 1337}; 1338 1339document.querySelectorAll('.tx-events2').forEach($element => { 1340 let events2 = new Events2($element); 1341}); 1342 1343/** 1344 * JavaScript for plugin events2_calendar 1345 * 1346 * Initialize Events2 Calendar 1347 * 1348 * @param $element 1349 * @param environment contains settings, current PageId, extConf and current tt_content record 1350 * @constructor 1351 */ 1352function Events2Calendar ($element, environment) { 1353 let me = this; 1354 1355 // 2016-10-24 will be 23.10.2016T22:00:00Z. getDate() returns: 24 1356 me.currentDate = new Date(environment.year + '-' + environment.month + '-' + environment.day + 'T00:00:00'); 1357 me.environment = environment; 1358 me.allDays = []; 1359 me.highlightedDays = []; 1360 1361 /** 1362 * Get current URL with additional parameters 1363 * 1364 * @param {string} additionalParameters 1365 * @return string 1366 */ 1367 me.getCurrentUrlWithAdditionalParameters = function (additionalParameters) { 1368 if (window.location.origin) { 1369 return window.location.origin + window.location.pathname + '?' + additionalParameters; 1370 } else { 1371 return window.location.protocol + '//' + window.location.host + window.location.pathname + '?' + additionalParameters; 1372 } 1373 }; 1374 1375 /** 1376 * get days for month 1377 * this starts an ajax call to the server and make them globally available 1378 * 1379 * @param {object} picker 1380 * @param {int} month 1381 * @param {int} year 1382 * @param {string} storagePages 1383 * @param {string} categories 1384 * @return void 1385 */ 1386 me.fillPickerWithDaysOfMonth = function (picker, month, year, storagePages, categories) { 1387 let additionalParameters = [ 1388 'month=' + (month + 1), 1389 'year=' + year, 1390 'categories=' + categories, 1391 'storagePages=' + storagePages 1392 ]; 1393 1394 fetch(me.getCurrentUrlWithAdditionalParameters(additionalParameters.join('&')), { 1395 headers: { 1396 'Content-Type': 'application/json', 1397 'ext-events2': 'getDaysForMonth' 1398 } 1399 }).then(response => { 1400 if (response.ok && response.status === 200) { 1401 return response.json(); 1402 } 1403 return Promise.reject(response); 1404 }).then(days => { 1405 // make global available. Needed for event render:day 1406 me.allDays = days; 1407 me.highlightedDays = Array.from(me.allDays, (day) => day.dayOfMonth); 1408 picker.setHighlightedDays(me.getHighlightedDays(days, month, year)); 1409 }).catch(error => { 1410 console.warn('Request error', error); 1411 }); 1412 }; 1413 1414 /** 1415 * Get highlighted days which will be clickable for detailed list-view. 1416 * No holidays will be added 1417 * 1418 * @param {object} days 1419 * @param {int} month 1420 * @param {int} year 1421 * @returns array 1422 */ 1423 me.getHighlightedDays = function (days, month, year) { 1424 let highlightedDays = []; 1425 1426 days.forEach(day => { 1427 if (!day.isHoliday) { 1428 highlightedDays.push(new Date(year, month, day.dayOfMonth, 0, 0, 0)); 1429 } 1430 }); 1431 1432 return highlightedDays; 1433 }; 1434 1435 me.initializeDatePicker = function ($element) { 1436 let startDate = new Date( 1437 parseInt(me.environment.year), 1438 parseInt(me.environment.month) - 1, 1439 parseInt(me.environment.day), 0, 0, 0 1440 ); 1441 1442 let picker = new Litepicker({ 1443 element: $element, 1444 inlineMode: true, 1445 startDate: startDate, 1446 lang: 'de-DE', 1447 format: 'DD.MM.YYYY' 1448 }); 1449 1450 picker.on('change:month', (date, calendarIdx) => { 1451 me.fillPickerWithDaysOfMonth( 1452 picker, 1453 date.getMonth(), 1454 date.getFullYear(), 1455 me.environment.storagePids, 1456 me.environment.settings.categories 1457 ); 1458 }); 1459 1460 picker.on('before:show', (el) => { 1461 me.fillPickerWithDaysOfMonth( 1462 picker, 1463 me.currentDate.getMonth(), 1464 me.currentDate.getFullYear(), 1465 me.environment.storagePids, 1466 me.environment.settings.categories 1467 ); 1468 }); 1469 1470 picker.on('preselect', (date1, date2) => { 1471 me.getUriForDayAndRedirect(date1); 1472 }); 1473 1474 picker.on('render:day', (dayElement, date) => { 1475 if (me.allDays !== []) { 1476 me.allDays.forEach(day => { 1477 if (day.dayOfMonth === parseInt(dayElement.innerHTML)) {
1478 day.additionalClasses.forEach(className => { 1479 dayElement.classList.add(className); 1480 }); 1481 } 1482 }); 1483 } 1484 }); 1485 1486 // In case of showInline either "show" nor "render" event will be called. Initialize them manually 1487 picker.hide(); 1488 picker.show(); 1489 }; 1490 1491 me.isInHighlightedDays = function (date) { 1492 let checkDay = date.getDate(); 1493 return me.highlightedDays.includes(checkDay); 1494 } 1495 1496 me.getUriForDayAndRedirect = function (date) { 1497 if (me.isInHighlightedDays(date)) { 1498 let additionalParameters = [ 1499 'day=' + date.getDate(), 1500 'month=' + (date.getMonth() + 1), 1501 'year=' + date.getFullYear(), 1502 'pidOfListPage=' + me.environment.pidOfListPage 1503 ]; 1504 1505 fetch(me.getCurrentUrlWithAdditionalParameters(additionalParameters.join('&')), { 1506 headers: { 1507 'Content-Type': 'application/json', 1508 'ext-events2': 'getUriForDay' 1509 } 1510 }).then(response => { 1511 if (response.ok && response.status === 200) { 1512 return response.json(); 1513 } 1514 return Promise.reject(response); 1515 }).then(data => { 1516 if (data.uri !== '') { 1517 console.log('Redirect to: ' + data.uri); 1518 window.location.href = data.uri; 1519 } 1520 }).catch(error => { 1521 console.warn('Request error', error); 1522 }); 1523 } 1524 }; 1525 1526 me.initializeDatePicker($element); 1527} 1528 1529Array.from(document.querySelectorAll('div.events2calendar')).forEac
1529h($element => { 1530 new Events2Calendar( 1531 $element, 1532 JSON.parse($element.getAttribute('data-environment')) 1533 ); 1534});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.