{"version":3,"file":"vendors-a4590e3f.4e202c72d209411713eb.bundle.js","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://frontend/./node_modules/litepicker/dist/litepicker.umd.js","webpack://frontend/./node_modules/lezer/dist/index.es.js"],"sourcesContent":["/*!\n * \n * litepicker.umd.js\n * Litepicker v2.0.12 (https://github.com/wakirin/Litepicker)\n * Package: litepicker (https://www.npmjs.com/package/litepicker)\n * License: MIT (https://github.com/wakirin/Litepicker/blob/master/LICENCE.md)\n * Copyright 2019-2021 Rinat G.\n * \n * Hash: 504eef9c08cb42543660\n * \n */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(\"Litepicker\",[],e):\"object\"==typeof exports?exports.Litepicker=e():t.Litepicker=e()}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},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){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,\"a\",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p=\"\",i(i.s=4)}([function(t,e,i){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){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}return t.parseDateTime=function(e,i,n){if(void 0===i&&(i=\"YYYY-MM-DD\"),void 0===n&&(n=\"en-US\"),!e)return new Date(NaN);if(e instanceof Date)return new Date(e);if(e instanceof t)return e.clone().toJSDate();if(/^-?\\d{10,}$/.test(e))return t.getDateZeroTime(new Date(Number(e)));if(\"string\"==typeof e){for(var o=[],s=null;null!=(s=t.regex.exec(i));)\"\\\\\"!==s[1]&&o.push(s);if(o.length){var r={year:null,month:null,shortMonth:null,longMonth:null,day:null,value:\"\"};o[0].index>0&&(r.value+=\".*?\");for(var a=0,l=Object.entries(o);at.getTime()&&this.timestamp()=t.getTime()&&this.timestamp()t.getTime()&&this.timestamp()<=e.getTime();case\"[]\":return this.timestamp()>=t.getTime()&&this.timestamp()<=e.getTime()}},t.prototype.isBefore=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":return t.getTime()>this.getTime();case\"day\":case\"days\":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case\"month\":case\"months\":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case\"year\":case\"years\":return t.getFullYear()>this.getFullYear()}throw new Error(\"isBefore: Invalid unit!\")},t.prototype.isSameOrBefore=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":return t.getTime()>=this.getTime();case\"day\":case\"days\":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case\"month\":case\"months\":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error(\"isSameOrBefore: Invalid unit!\")},t.prototype.isAfter=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":return this.getTime()>t.getTime();case\"day\":case\"days\":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case\"month\":case\"months\":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(t.getFullYear(),t.getMonth(),1).getTime();case\"year\":case\"years\":return this.getFullYear()>t.getFullYear()}throw new Error(\"isAfter: Invalid unit!\")},t.prototype.isSameOrAfter=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":return this.getTime()>=t.getTime();case\"day\":case\"days\":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case\"month\":case\"months\":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error(\"isSameOrAfter: Invalid unit!\")},t.prototype.isSame=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":return this.getTime()===t.getTime();case\"day\":case\"days\":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case\"month\":case\"months\":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error(\"isSame: Invalid unit!\")},t.prototype.add=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":this.setSeconds(this.getSeconds()+t);break;case\"day\":case\"days\":this.setDate(this.getDate()+t);break;case\"month\":case\"months\":this.setMonth(this.getMonth()+t)}return this},t.prototype.subtract=function(t,e){switch(void 0===e&&(e=\"seconds\"),e){case\"second\":case\"seconds\":this.setSeconds(this.getSeconds()-t);break;case\"day\":case\"days\":this.setDate(this.getDate()-t);break;case\"month\":case\"months\":this.setMonth(this.getMonth()-t)}return this},t.prototype.diff=function(t,e){void 0===e&&(e=\"seconds\");switch(e){default:case\"second\":case\"seconds\":return this.getTime()-t.getTime();case\"day\":case\"days\":return Math.round((this.timestamp()-t.getTime())/864e5);case\"month\":case\"months\":}},t.prototype.format=function(e,i){if(void 0===i&&(i=\"en-US\"),\"object\"==typeof e)return e.output(this.clone().toJSDate());for(var n=\"\",o=[],s=null;null!=(s=t.regex.exec(e));)\"\\\\\"!==s[1]&&o.push(s);if(o.length){o[0].index>0&&(n+=e.substring(0,o[0].index));for(var r=0,a=Object.entries(o);r1&&i.isAfter(e)&&i.setMonth(i.getMonth()-(this.options.numberOfMonths-1)),this.calendars[0]=i.clone()):(e.setDate(1),this.calendars[0]=e.clone())}},e.prototype.bindEvents=function(){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()},e.prototype.updateInput=function(){if(this.options.element instanceof HTMLInputElement){var t=this.options.startDate,e=this.options.endDate;if(this.options.singleMode&&t)this.options.element.value=t.format(this.options.format,this.options.lang);else if(!this.options.singleMode&&t&&e){var i=t.format(this.options.format,this.options.lang),n=e.format(this.options.format,this.options.lang);this.options.elementEnd instanceof HTMLInputElement?(this.options.element.value=i,this.options.elementEnd.value=n):this.options.element.value=\"\"+i+this.options.delimiter+n}t||e||(this.options.element.value=\"\",this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.value=\"\"))}},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){var e=t.target;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()){if(this.isSamePicker(e))if(this.emit(\"before:click\",e),this.preventClick)this.preventClick=!1;else{if(e.classList.contains(l.dayItem)){if(t.preventDefault(),e.classList.contains(l.isLocked))return;if(this.shouldResetDatePicked()&&(this.datePicked.length=0),this.datePicked[this.datePicked.length]=new a.DateTime(e.dataset.time),this.shouldSwapDatePicked()){var i=this.datePicked[1].clone();this.datePicked[1]=this.datePicked[0].clone(),this.datePicked[0]=i.clone()}if(this.shouldCheckLockDays())c.rangeIsLocked(this.datePicked,this.options)&&(this.emit(\"error:range\",this.datePicked),this.datePicked.length=0);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())))}if(e.classList.contains(l.buttonPreviousMonth)){t.preventDefault();var n=0,o=this.options.switchingMonths||this.options.numberOfMonths;if(this.options.splitView){var r=e.closest(\".\"+l.monthItem);n=c.findNestedMonthItem(r),o=1}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)}if(e.classList.contains(l.buttonNextMonth)){t.preventDefault();n=0,o=this.options.switchingMonths||this.options.numberOfMonths;if(this.options.splitView){r=e.closest(\".\"+l.monthItem);n=c.findNestedMonthItem(r),o=1}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)}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))}}else this.hide()},e.prototype.showTooltip=function(t,e){var i=this.ui.querySelector(\".\"+l.containerTooltip);i.style.visibility=\"visible\",i.innerHTML=e;var n=this.ui.getBoundingClientRect(),o=i.getBoundingClientRect(),s=t.getBoundingClientRect(),r=s.top,a=s.left;if(this.options.inlineMode&&this.options.parentEl){var c=this.ui.parentNode.getBoundingClientRect();r-=c.top,a-=c.left}else r-=n.top,a-=n.left;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)},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){var e=this,i=t.target;if(this.isDayItem(i)&&this.shouldAllowMouseEnter(i)){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;var n=this.ui.querySelector(\".\"+l.dayItem+'[data-time=\"'+this.datePicked[0].getTime()+'\"]'),o=this.datePicked[0].clone(),s=new a.DateTime(i.dataset.time),r=!1;if(o.getTime()>s.getTime()){var c=o.clone();o=s.clone(),s=c.clone(),r=!0}if(Array.prototype.slice.call(this.ui.querySelectorAll(\".\"+l.dayItem)).forEach((function(t){var i=new a.DateTime(t.dataset.time),n=e.renderDay(i);i.isBetween(o,s)&&n.classList.add(l.isInRange),t.className=n.className})),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){var h=s.diff(o,\"day\")+1;if(\"function\"==typeof this.options.tooltipNumber&&(h=this.options.tooltipNumber.call(this,h)),h>0){var p=this.pluralSelector(h),d=h+\" \"+(this.options.tooltipText[p]?this.options.tooltipText[p]:\"[\"+p+\"]\");this.showTooltip(i,d);var u=window.navigator.userAgent,m=/(iphone|ipad)/i.test(u),f=/OS 1([0-2])/i.test(u);m&&f&&i.dispatchEvent(new Event(\"click\"))}else this.hideTooltip()}}},e.prototype.onMouseLeave=function(t){t.target;this.options.allowRepick&&(!this.options.allowRepick||this.options.startDate||this.options.endDate)&&(this.datePicked.length=0,this.render())},e.prototype.onInput=function(t){var e=this.parseInput(),i=e[0],n=e[1],o=this.options.format;if(this.options.elementEnd?i instanceof a.DateTime&&n instanceof a.DateTime&&i.format(o)===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){if(n&&i.getTime()>n.getTime()){var s=i.clone();i=n.clone(),n=s.clone()}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();var r=i.clone(),l=0;(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)}},e}(r.Calendar);e.Litepicker=h},function(t,e,i){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.findNestedMonthItem=function(t){for(var e=t.parentNode.childNodes,i=0;iy)(u=document.createElement(\"option\")).value=String(t.getFullYear()),u.text=String(t.getFullYear()),u.selected=!0,u.disabled=!0,g.appendChild(u);for(d=y;d>=v;d-=1){var u=document.createElement(\"option\"),b=new r.DateTime(new Date(d,0,1,0,0,0));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)}if(t.getFullYear()W\");for(var _=1;_<=7;_+=1){var T=3+this.options.firstDay+_,L=document.createElement(\"div\");L.innerHTML=this.weekdayName(T),L.title=this.weekdayName(T,\"long\"),M.appendChild(L)}var E=document.createElement(\"div\");E.className=a.containerDays;var S=this.calcSkipDays(n);this.options.showWeekNumbers&&S&&E.appendChild(this.renderWeekNumber(n));for(var I=0;I1&&1===this.datePicked.length){var o=this.options.minDays-1,s=this.datePicked[0].clone().subtract(o,\"day\"),c=this.datePicked[0].clone().add(o,\"day\");t.isBetween(s,this.datePicked[0],\"(]\")&&e.classList.add(a.isLocked),t.isBetween(this.datePicked[0],c,\"[)\")&&e.classList.add(a.isLocked)}if(this.options.maxDays&&1===this.datePicked.length){var h=this.options.maxDays;s=this.datePicked[0].clone().subtract(h,\"day\"),c=this.datePicked[0].clone().add(h,\"day\");t.isSameOrBefore(s)&&e.classList.add(a.isLocked),t.isSameOrAfter(c)&&e.classList.add(a.isLocked)}(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));return e.tabIndex=e.classList.contains(\"is-locked\")?-1:0,this.emit(\"render:day\",e,t),e},e.prototype.renderFooter=function(){var t=document.createElement(\"div\");if(t.className=a.containerFooter,this.options.footerHTML?t.innerHTML=this.options.footerHTML:t.innerHTML='\\n \\n \\n \\n \",this.options.singleMode){if(1===this.datePicked.length){var e=this.datePicked[0].format(this.options.format,this.options.lang);t.querySelector(\".\"+a.previewDateRange).innerHTML=e}}else if(1===this.datePicked.length&&t.querySelector(\".\"+a.buttonApply).setAttribute(\"disabled\",\"\"),2===this.datePicked.length){e=this.datePicked[0].format(this.options.format,this.options.lang);var i=this.datePicked[1].format(this.options.format,this.options.lang);t.querySelector(\".\"+a.previewDateRange).innerHTML=\"\"+e+this.options.delimiter+i}return this.emit(\"render:footer\",t),t},e.prototype.renderWeekNumber=function(t){var e=document.createElement(\"div\"),i=t.getWeek(this.options.firstDay);return e.className=a.weekNumber,e.innerHTML=53===i&&0===t.getMonth()?\"53 / 1\":i,e},e.prototype.renderTooltip=function(){var t=document.createElement(\"div\");return t.className=a.containerTooltip,t},e.prototype.weekdayName=function(t,e){return void 0===e&&(e=\"short\"),new Date(1970,0,t,12,0,0,0).toLocaleString(this.options.lang,{weekday:e})},e.prototype.calcSkipDays=function(t){var e=t.getDay()-this.options.firstDay;return e<0&&(e+=7),e},e}(s.LPCore);e.Calendar=c},function(t,e,i){\"use strict\";var n,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){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,i=1,n=arguments.length;i',nextMonth:'',reset:'\\n \\n \\n '},tooltipText:{one:\"day\",other:\"days\"}},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])}));var n=s(s({},i.options.dropdowns),e.dropdowns),o=s(s({},i.options.buttonText),e.buttonText),r=s(s({},i.options.tooltipText),e.tooltipText);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));var l=i.parseInput(),c=l[0],h=l[1];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);for(var p=0;pwindow.innerHeight,c=e.top+s-i.height>=i.height;l&&c&&(r=e.top+s-i.height)}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{a=e.left+o;l=e.left+i.width>window.innerWidth;var h=e.right+o-i.width>=0;l&&h&&(a=e.right+o-i.width)}return{left:a,top:r}},e}(r.EventEmitter);e.LPCore=c},function(t,e,i){\"use strict\";var n,o=\"object\"==typeof Reflect?Reflect:null,s=o&&\"function\"==typeof o.apply?o.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};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)};var r=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,i,n){var o,s,r,a;if(\"function\"!=typeof i)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof i);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){r.warned=!0;var l=new Error(\"Possible EventEmitter memory leak detected. \"+r.length+\" \"+String(e)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");l.name=\"MaxListenersExceededWarning\",l.emitter=t,l.type=e,l.count=r.length,a=l,console&&console.warn&&console.warn(a)}return t}function p(){for(var t=[],e=0;e0&&(r=e[0]),r instanceof Error)throw r;var a=new Error(\"Unhandled error.\"+(r?\" (\"+r.message+\")\":\"\"));throw a.context=r,a}var l=o[t];if(void 0===l)return!1;if(\"function\"==typeof l)s(l,this,e);else{var c=l.length,h=f(l,c);for(i=0;i=0;s--)if(i[s]===e||i[s].listener===e){r=i[s].listener,o=s;break}if(o<0)return this;0===o?i.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},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):[]}},function(t,e,i){(e=i(9)(!1)).push([t.i,':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',\"\"]),e.locals={showWeekNumbers:\"show-week-numbers\",litepicker:\"litepicker\",containerMain:\"container__main\",containerMonths:\"container__months\",columns2:\"columns-2\",columns3:\"columns-3\",columns4:\"columns-4\",splitView:\"split-view\",monthItemHeader:\"month-item-header\",buttonPreviousMonth:\"button-previous-month\",buttonNextMonth:\"button-next-month\",monthItem:\"month-item\",monthItemName:\"month-item-name\",monthItemYear:\"month-item-year\",resetButton:\"reset-button\",monthItemWeekdaysRow:\"month-item-weekdays-row\",noPreviousMonth:\"no-previous-month\",noNextMonth:\"no-next-month\",containerDays:\"container__days\",dayItem:\"day-item\",isToday:\"is-today\",isLocked:\"is-locked\",isInRange:\"is-in-range\",isStartDate:\"is-start-date\",isFlipped:\"is-flipped\",isEndDate:\"is-end-date\",isHighlighted:\"is-highlighted\",weekNumber:\"week-number\",containerFooter:\"container__footer\",previewDateRange:\"preview-date-range\",buttonCancel:\"button-cancel\",buttonApply:\"button-apply\",containerTooltip:\"container__tooltip\"},t.exports=e},function(t,e,i){\"use strict\";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=function(t,e){var i=t[1]||\"\",n=t[3];if(!n)return i;if(e&&\"function\"==typeof btoa){var o=(r=n,a=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),l=\"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(a),\"/*# \".concat(l,\" */\")),s=n.sources.map((function(t){return\"/*# sourceURL=\".concat(n.sourceRoot||\"\").concat(t,\" */\")}));return[i].concat(s).concat([o]).join(\"\\n\")}var r,a,l;return[i].join(\"\\n\")}(e,t);return e[2]?\"@media \".concat(e[2],\" {\").concat(i,\"}\"):i})).join(\"\")},e.i=function(t,i,n){\"string\"==typeof t&&(t=[[null,t,\"\"]]);var o={};if(n)for(var s=0;sthis.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){void 0===i&&(i=!1),this.triggerElement=void 0;var n=new o.DateTime(t,this.options.format,this.options.lang),s=new o.DateTime(e,this.options.format,this.options.lang);(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(\"error:range\",[n,s]):(this.setStartDate(n),this.setEndDate(s),this.options.inlineMode&&this.render(),this.updateInput(),this.emit(\"selected\",this.getStartDate(),this.getEndDate()))},s.Litepicker.prototype.gotoDate=function(t,e){void 0===e&&(e=0);var i=new o.DateTime(t);i.setDate(1),this.calendars[e]=i.clone(),this.render()},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){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));var e=n(n({},this.options.dropdowns),t.dropdowns),i=n(n({},this.options.buttonText),t.buttonText),s=n(n({},this.options.tooltipText),t.tooltipText);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);for(var r=0;r i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? \"!\" + this.score : \"\"}`;\n }\n // Start an empty stack\n /// @internal\n static start(p, state, pos = 0) {\n let cx = p.parser.context;\n return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, null);\n }\n /// The stack's current [context](#lezer.ContextTracker) value, if\n /// any. Its type will depend on the context tracker's type\n /// parameter, or it will be `null` if there is no context\n /// tracker.\n get context() { return this.curContext ? this.curContext.context : null; }\n // Push a state onto the stack, tracking its start position as well\n // as the buffer base at that point.\n /// @internal\n pushState(state, start) {\n this.stack.push(this.state, start, this.bufferBase + this.buffer.length);\n this.state = state;\n }\n // Apply a reduce action\n /// @internal\n reduce(action) {\n let depth = action >> 19 /* ReduceDepthShift */, type = action & 65535 /* ValueMask */;\n let { parser } = this.p;\n let dPrec = parser.dynamicPrecedence(type);\n if (dPrec)\n this.score += dPrec;\n if (depth == 0) {\n // Zero-depth reductions are a special case—they add stuff to\n // the stack without popping anything off.\n if (type < parser.minRepeatTerm)\n this.storeNode(type, this.reducePos, this.reducePos, 4, true);\n this.pushState(parser.getGoto(this.state, type, true), this.reducePos);\n this.reduceContext(type);\n return;\n }\n // Find the base index into `this.stack`, content after which will\n // be dropped. Note that with `StayFlag` reductions we need to\n // consume two extra frames (the dummy parent node for the skipped\n // expression and the state that we'll be staying in, which should\n // be moved to `this.state`).\n let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* StayFlag */ ? 6 : 0);\n let start = this.stack[base - 2];\n let bufferBase = this.stack[base - 1], count = this.bufferBase + this.buffer.length - bufferBase;\n // Store normal terms or `R -> R R` repeat reductions\n if (type < parser.minRepeatTerm || (action & 131072 /* RepeatFlag */)) {\n let pos = parser.stateFlag(this.state, 1 /* Skipped */) ? this.pos : this.reducePos;\n this.storeNode(type, start, pos, count + 4, true);\n }\n if (action & 262144 /* StayFlag */) {\n this.state = this.stack[base];\n }\n else {\n let baseStateID = this.stack[base - 3];\n this.state = parser.getGoto(baseStateID, type, true);\n }\n while (this.stack.length > base)\n this.stack.pop();\n this.reduceContext(type);\n }\n // Shift a value into the buffer\n /// @internal\n storeNode(term, start, end, size = 4, isReduce = false) {\n if (term == 0 /* Err */) { // Try to omit/merge adjacent error nodes\n let cur = this, top = this.buffer.length;\n if (top == 0 && cur.parent) {\n top = cur.bufferBase - cur.parent.bufferBase;\n cur = cur.parent;\n }\n if (top > 0 && cur.buffer[top - 4] == 0 /* Err */ && cur.buffer[top - 1] > -1) {\n if (start == end)\n return;\n if (cur.buffer[top - 2] >= start) {\n cur.buffer[top - 2] = end;\n return;\n }\n }\n }\n if (!isReduce || this.pos == end) { // Simple case, just append\n this.buffer.push(term, start, end, size);\n }\n else { // There may be skipped nodes that have to be moved forward\n let index = this.buffer.length;\n if (index > 0 && this.buffer[index - 4] != 0 /* Err */)\n while (index > 0 && this.buffer[index - 2] > end) {\n // Move this record forward\n this.buffer[index] = this.buffer[index - 4];\n this.buffer[index + 1] = this.buffer[index - 3];\n this.buffer[index + 2] = this.buffer[index - 2];\n this.buffer[index + 3] = this.buffer[index - 1];\n index -= 4;\n if (size > 4)\n size -= 4;\n }\n this.buffer[index] = term;\n this.buffer[index + 1] = start;\n this.buffer[index + 2] = end;\n this.buffer[index + 3] = size;\n }\n }\n // Apply a shift action\n /// @internal\n shift(action, next, nextEnd) {\n if (action & 131072 /* GotoFlag */) {\n this.pushState(action & 65535 /* ValueMask */, this.pos);\n }\n else if ((action & 262144 /* StayFlag */) == 0) { // Regular shift\n let start = this.pos, nextState = action, { parser } = this.p;\n if (nextEnd > this.pos || next <= parser.maxNode) {\n this.pos = nextEnd;\n if (!parser.stateFlag(nextState, 1 /* Skipped */))\n this.reducePos = nextEnd;\n }\n this.pushState(nextState, start);\n if (next <= parser.maxNode)\n this.buffer.push(next, start, nextEnd, 4);\n this.shiftContext(next);\n }\n else { // Shift-and-stay, which means this is a skipped token\n if (next <= this.p.parser.maxNode)\n this.buffer.push(next, this.pos, nextEnd, 4);\n this.pos = nextEnd;\n }\n }\n // Apply an action\n /// @internal\n apply(action, next, nextEnd) {\n if (action & 65536 /* ReduceFlag */)\n this.reduce(action);\n else\n this.shift(action, next, nextEnd);\n }\n // Add a prebuilt node into the buffer. This may be a reused node or\n // the result of running a nested parser.\n /// @internal\n useNode(value, next) {\n let index = this.p.reused.length - 1;\n if (index < 0 || this.p.reused[index] != value) {\n this.p.reused.push(value);\n index++;\n }\n let start = this.pos;\n this.reducePos = this.pos = start + value.length;\n this.pushState(next, start);\n this.buffer.push(index, start, this.reducePos, -1 /* size < 0 means this is a reused value */);\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this.p.input, this));\n }\n // Split the stack. Due to the buffer sharing and the fact\n // that `this.stack` tends to stay quite shallow, this isn't very\n // expensive.\n /// @internal\n split() {\n let parent = this;\n let off = parent.buffer.length;\n // Because the top of the buffer (after this.pos) may be mutated\n // to reorder reductions and skipped tokens, and shared buffers\n // should be immutable, this copies any outstanding skipped tokens\n // to the new buffer, and puts the base pointer before them.\n while (off > 0 && parent.buffer[off - 2] > parent.reducePos)\n off -= 4;\n let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;\n // Make sure parent points to an actual parent with content, if there is such a parent.\n while (parent && base == parent.bufferBase)\n parent = parent.parent;\n return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, parent);\n }\n // Try to recover from an error by 'deleting' (ignoring) one token.\n /// @internal\n recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode;\n if (isNode)\n this.storeNode(next, this.pos, nextEnd);\n this.storeNode(0 /* Err */, this.pos, nextEnd, isNode ? 8 : 4);\n this.pos = this.reducePos = nextEnd;\n this.score -= 200 /* Token */;\n }\n /// Check if the given term would be able to be shifted (optionally\n /// after some reductions) on this stack. This can be useful for\n /// external tokenizers that want to make sure they only provide a\n /// given token when it applies.\n canShift(term) {\n for (let sim = new SimulatedStack(this);;) {\n let action = this.p.parser.stateSlot(sim.top, 4 /* DefaultReduce */) || this.p.parser.hasAction(sim.top, term);\n if ((action & 65536 /* ReduceFlag */) == 0)\n return true;\n if (action == 0)\n return false;\n sim.reduce(action);\n }\n }\n /// Find the start position of the rule that is currently being parsed.\n get ruleStart() {\n for (let state = this.state, base = this.stack.length;;) {\n let force = this.p.parser.stateSlot(state, 5 /* ForcedReduce */);\n if (!(force & 65536 /* ReduceFlag */))\n return 0;\n base -= 3 * (force >> 19 /* ReduceDepthShift */);\n if ((force & 65535 /* ValueMask */) < this.p.parser.minRepeatTerm)\n return this.stack[base + 1];\n state = this.stack[base];\n }\n }\n /// Find the start position of an instance of any of the given term\n /// types, or return `null` when none of them are found.\n ///\n /// **Note:** this is only reliable when there is at least some\n /// state that unambiguously matches the given rule on the stack.\n /// I.e. if you have a grammar like this, where the difference\n /// between `a` and `b` is only apparent at the third token:\n ///\n /// a { b | c }\n /// b { \"x\" \"y\" \"x\" }\n /// c { \"x\" \"y\" \"z\" }\n ///\n /// Then a parse state after `\"x\"` will not reliably tell you that\n /// `b` is on the stack. You _can_ pass `[b, c]` to reliably check\n /// for either of those two rules (assuming that `a` isn't part of\n /// some rule that includes other things starting with `\"x\"`).\n ///\n /// When `before` is given, this keeps scanning up the stack until\n /// it finds a match that starts before that position.\n ///\n /// Note that you have to be careful when using this in tokenizers,\n /// since it's relatively easy to introduce data dependencies that\n /// break incremental parsing by using this method.\n startOf(types, before) {\n let state = this.state, frame = this.stack.length, { parser } = this.p;\n for (;;) {\n let force = parser.stateSlot(state, 5 /* ForcedReduce */);\n let depth = force >> 19 /* ReduceDepthShift */, term = force & 65535 /* ValueMask */;\n if (types.indexOf(term) > -1) {\n let base = frame - (3 * (force >> 19 /* ReduceDepthShift */)), pos = this.stack[base + 1];\n if (before == null || before > pos)\n return pos;\n }\n if (frame == 0)\n return null;\n if (depth == 0) {\n frame -= 3;\n state = this.stack[frame];\n }\n else {\n frame -= 3 * (depth - 1);\n state = parser.getGoto(this.stack[frame - 3], term, true);\n }\n }\n }\n // Apply up to Recover.MaxNext recovery actions that conceptually\n // inserts some missing token or rule.\n /// @internal\n recoverByInsert(next) {\n if (this.stack.length >= 300 /* MaxInsertStackDepth */)\n return [];\n let nextStates = this.p.parser.nextStates(this.state);\n if (nextStates.length > 4 /* MaxNext */ << 1 || this.stack.length >= 120 /* DampenInsertStackDepth */) {\n let best = [];\n for (let i = 0, s; i < nextStates.length; i += 2) {\n if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))\n best.push(nextStates[i], s);\n }\n if (this.stack.length < 120 /* DampenInsertStackDepth */)\n for (let i = 0; best.length < 4 /* MaxNext */ << 1 && i < nextStates.length; i += 2) {\n let s = nextStates[i + 1];\n if (!best.some((v, i) => (i & 1) && v == s))\n best.push(nextStates[i], s);\n }\n nextStates = best;\n }\n let result = [];\n for (let i = 0; i < nextStates.length && result.length < 4 /* MaxNext */; i += 2) {\n let s = nextStates[i + 1];\n if (s == this.state)\n continue;\n let stack = this.split();\n stack.storeNode(0 /* Err */, stack.pos, stack.pos, 4, true);\n stack.pushState(s, this.pos);\n stack.shiftContext(nextStates[i]);\n stack.score -= 200 /* Token */;\n result.push(stack);\n }\n return result;\n }\n // Force a reduce, if possible. Return false if that can't\n // be done.\n /// @internal\n forceReduce() {\n let reduce = this.p.parser.stateSlot(this.state, 5 /* ForcedReduce */);\n if ((reduce & 65536 /* ReduceFlag */) == 0)\n return false;\n if (!this.p.parser.validAction(this.state, reduce)) {\n this.storeNode(0 /* Err */, this.reducePos, this.reducePos, 4, true);\n this.score -= 100 /* Reduce */;\n }\n this.reduce(reduce);\n return true;\n }\n /// @internal\n forceAll() {\n while (!this.p.parser.stateFlag(this.state, 2 /* Accepting */) && this.forceReduce()) { }\n return this;\n }\n /// Check whether this state has no further actions (assumed to be a direct descendant of the\n /// top state, since any other states must be able to continue\n /// somehow). @internal\n get deadEnd() {\n if (this.stack.length != 3)\n return false;\n let { parser } = this.p;\n return parser.data[parser.stateSlot(this.state, 1 /* Actions */)] == 65535 /* End */ &&\n !parser.stateSlot(this.state, 4 /* DefaultReduce */);\n }\n /// Restart the stack (put it back in its start state). Only safe\n /// when this.stack.length == 3 (state is directly below the top\n /// state). @internal\n restart() {\n this.state = this.stack[0];\n this.stack.length = 0;\n }\n /// @internal\n sameState(other) {\n if (this.state != other.state || this.stack.length != other.stack.length)\n return false;\n for (let i = 0; i < this.stack.length; i += 3)\n if (this.stack[i] != other.stack[i])\n return false;\n return true;\n }\n /// Get the parser used by this stack.\n get parser() { return this.p.parser; }\n /// Test whether a given dialect (by numeric ID, as exported from\n /// the terms file) is enabled.\n dialectEnabled(dialectID) { return this.p.parser.dialect.flags[dialectID]; }\n shiftContext(term) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this.p.input, this));\n }\n reduceContext(term) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this.p.input, this));\n }\n /// @internal\n emitContext() {\n let cx = this.curContext;\n if (!cx.tracker.strict)\n return;\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -2)\n this.buffer.push(cx.hash, this.reducePos, this.reducePos, -2);\n }\n updateContext(context) {\n if (context != this.curContext.context) {\n let newCx = new StackContext(this.curContext.tracker, context);\n if (newCx.hash != this.curContext.hash)\n this.emitContext();\n this.curContext = newCx;\n }\n }\n}\nclass StackContext {\n constructor(tracker, context) {\n this.tracker = tracker;\n this.context = context;\n this.hash = tracker.hash(context);\n }\n}\nvar Recover;\n(function (Recover) {\n Recover[Recover[\"Token\"] = 200] = \"Token\";\n Recover[Recover[\"Reduce\"] = 100] = \"Reduce\";\n Recover[Recover[\"MaxNext\"] = 4] = \"MaxNext\";\n Recover[Recover[\"MaxInsertStackDepth\"] = 300] = \"MaxInsertStackDepth\";\n Recover[Recover[\"DampenInsertStackDepth\"] = 120] = \"DampenInsertStackDepth\";\n})(Recover || (Recover = {}));\n// Used to cheaply run some reductions to scan ahead without mutating\n// an entire stack\nclass SimulatedStack {\n constructor(stack) {\n this.stack = stack;\n this.top = stack.state;\n this.rest = stack.stack;\n this.offset = this.rest.length;\n }\n reduce(action) {\n let term = action & 65535 /* ValueMask */, depth = action >> 19 /* ReduceDepthShift */;\n if (depth == 0) {\n if (this.rest == this.stack.stack)\n this.rest = this.rest.slice();\n this.rest.push(this.top, 0, 0);\n this.offset += 3;\n }\n else {\n this.offset -= (depth - 1) * 3;\n }\n let goto = this.stack.p.parser.getGoto(this.rest[this.offset - 3], term, true);\n this.top = goto;\n }\n}\n// This is given to `Tree.build` to build a buffer, and encapsulates\n// the parent-stack-walking necessary to read the nodes.\nclass StackBufferCursor {\n constructor(stack, pos, index) {\n this.stack = stack;\n this.pos = pos;\n this.index = index;\n this.buffer = stack.buffer;\n if (this.index == 0)\n this.maybeNext();\n }\n static create(stack) {\n return new StackBufferCursor(stack, stack.bufferBase + stack.buffer.length, stack.buffer.length);\n }\n maybeNext() {\n let next = this.stack.parent;\n if (next != null) {\n this.index = this.stack.bufferBase - next.bufferBase;\n this.stack = next;\n this.buffer = next.buffer;\n }\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n next() {\n this.index -= 4;\n this.pos -= 4;\n if (this.index == 0)\n this.maybeNext();\n }\n fork() {\n return new StackBufferCursor(this.stack, this.pos, this.index);\n }\n}\n\n/// Tokenizers write the tokens they read into instances of this class.\nclass Token {\n constructor() {\n /// The start of the token. This is set by the parser, and should not\n /// be mutated by the tokenizer.\n this.start = -1;\n /// This starts at -1, and should be updated to a term id when a\n /// matching token is found.\n this.value = -1;\n /// When setting `.value`, you should also set `.end` to the end\n /// position of the token. (You'll usually want to use the `accept`\n /// method.)\n this.end = -1;\n }\n /// Accept a token, setting `value` and `end` to the given values.\n accept(value, end) {\n this.value = value;\n this.end = end;\n }\n}\n/// @internal\nclass TokenGroup {\n constructor(data, id) {\n this.data = data;\n this.id = id;\n }\n token(input, token, stack) { readToken(this.data, input, token, stack, this.id); }\n}\nTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n/// Exports that are used for `@external tokens` in the grammar should\n/// export an instance of this class.\nclass ExternalTokenizer {\n /// Create a tokenizer. The first argument is the function that,\n /// given an input stream and a token object,\n /// [fills](#lezer.Token.accept) the token object if it recognizes a\n /// token. `token.start` should be used as the start position to\n /// scan from.\n constructor(\n /// @internal\n token, options = {}) {\n this.token = token;\n this.contextual = !!options.contextual;\n this.fallback = !!options.fallback;\n this.extend = !!options.extend;\n }\n}\n// Tokenizer data is stored a big uint16 array containing, for each\n// state:\n//\n// - A group bitmask, indicating what token groups are reachable from\n// this state, so that paths that can only lead to tokens not in\n// any of the current groups can be cut off early.\n//\n// - The position of the end of the state's sequence of accepting\n// tokens\n//\n// - The number of outgoing edges for the state\n//\n// - The accepting tokens, as (token id, group mask) pairs\n//\n// - The outgoing edges, as (start character, end character, state\n// index) triples, with end character being exclusive\n//\n// This function interprets that data, running through a stream as\n// long as new states with the a matching group mask can be reached,\n// and updating `token` when it matches a token.\nfunction readToken(data, input, token, stack, group) {\n let state = 0, groupMask = 1 << group, dialect = stack.p.parser.dialect;\n scan: for (let pos = token.start;;) {\n if ((groupMask & data[state]) == 0)\n break;\n let accEnd = data[state + 1];\n // Check whether this state can lead to a token in the current group\n // Accept tokens in this state, possibly overwriting\n // lower-precedence / shorter tokens\n for (let i = state + 3; i < accEnd; i += 2)\n if ((data[i + 1] & groupMask) > 0) {\n let term = data[i];\n if (dialect.allows(term) &&\n (token.value == -1 || token.value == term || stack.p.parser.overrides(term, token.value))) {\n token.accept(term, pos);\n break;\n }\n }\n let next = input.get(pos++);\n // Do a binary search on the state's edges\n for (let low = 0, high = data[state + 2]; low < high;) {\n let mid = (low + high) >> 1;\n let index = accEnd + mid + (mid << 1);\n let from = data[index], to = data[index + 1];\n if (next < from)\n high = mid;\n else if (next >= to)\n low = mid + 1;\n else {\n state = data[index + 2];\n continue scan;\n }\n }\n break;\n }\n}\n\n// See lezer-generator/src/encode.ts for comments about the encoding\n// used here\nfunction decodeArray(input, Type = Uint16Array) {\n if (typeof input != \"string\")\n return input;\n let array = null;\n for (let pos = 0, out = 0; pos < input.length;) {\n let value = 0;\n for (;;) {\n let next = input.charCodeAt(pos++), stop = false;\n if (next == 126 /* BigValCode */) {\n value = 65535 /* BigVal */;\n break;\n }\n if (next >= 92 /* Gap2 */)\n next--;\n if (next >= 34 /* Gap1 */)\n next--;\n let digit = next - 32 /* Start */;\n if (digit >= 46 /* Base */) {\n digit -= 46 /* Base */;\n stop = true;\n }\n value += digit;\n if (stop)\n break;\n value *= 46 /* Base */;\n }\n if (array)\n array[out++] = value;\n else\n array = new Type(value);\n }\n return array;\n}\n\n// FIXME find some way to reduce recovery work done when the input\n// doesn't match the grammar at all.\n// Environment variable used to control console output\nconst verbose = typeof process != \"undefined\" && /\\bparse\\b/.test(process.env.LOG);\nlet stackIDs = null;\nfunction cutAt(tree, pos, side) {\n let cursor = tree.cursor(pos);\n for (;;) {\n if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))\n for (;;) {\n if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)\n return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 5)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 5));\n if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())\n break;\n if (!cursor.parent())\n return side < 0 ? 0 : tree.length;\n }\n }\n}\nclass FragmentCursor {\n constructor(fragments) {\n this.fragments = fragments;\n this.i = 0;\n this.fragment = null;\n this.safeFrom = -1;\n this.safeTo = -1;\n this.trees = [];\n this.start = [];\n this.index = [];\n this.nextFragment();\n }\n nextFragment() {\n let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];\n if (fr) {\n this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;\n this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;\n while (this.trees.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n }\n this.trees.push(fr.tree);\n this.start.push(-fr.offset);\n this.index.push(0);\n this.nextStart = this.safeFrom;\n }\n else {\n this.nextStart = 1e9;\n }\n }\n // `pos` must be >= any previously given `pos` for this cursor\n nodeAt(pos) {\n if (pos < this.nextStart)\n return null;\n while (this.fragment && this.safeTo <= pos)\n this.nextFragment();\n if (!this.fragment)\n return null;\n for (;;) {\n let last = this.trees.length - 1;\n if (last < 0) { // End of tree\n this.nextFragment();\n return null;\n }\n let top = this.trees[last], index = this.index[last];\n if (index == top.children.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n continue;\n }\n let next = top.children[index];\n let start = this.start[last] + top.positions[index];\n if (start > pos) {\n this.nextStart = start;\n return null;\n }\n else if (start == pos && start + next.length <= this.safeTo) {\n return start == pos && start >= this.safeFrom ? next : null;\n }\n if (next instanceof TreeBuffer) {\n this.index[last]++;\n this.nextStart = start + next.length;\n }\n else {\n this.index[last]++;\n if (start + next.length >= pos) { // Enter this node\n this.trees.push(next);\n this.start.push(start);\n this.index.push(0);\n }\n }\n }\n }\n}\nclass CachedToken extends Token {\n constructor() {\n super(...arguments);\n this.extended = -1;\n this.mask = 0;\n this.context = 0;\n }\n clear(start) {\n this.start = start;\n this.value = this.extended = -1;\n }\n}\nconst dummyToken = new Token;\nclass TokenCache {\n constructor(parser) {\n this.tokens = [];\n this.mainToken = dummyToken;\n this.actions = [];\n this.tokens = parser.tokenizers.map(_ => new CachedToken);\n }\n getActions(stack, input) {\n let actionIndex = 0;\n let main = null;\n let { parser } = stack.p, { tokenizers } = parser;\n let mask = parser.stateSlot(stack.state, 3 /* TokenizerMask */);\n let context = stack.curContext ? stack.curContext.hash : 0;\n for (let i = 0; i < tokenizers.length; i++) {\n if (((1 << i) & mask) == 0)\n continue;\n let tokenizer = tokenizers[i], token = this.tokens[i];\n if (main && !tokenizer.fallback)\n continue;\n if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {\n this.updateCachedToken(token, tokenizer, stack, input);\n token.mask = mask;\n token.context = context;\n }\n if (token.value != 0 /* Err */) {\n let startIndex = actionIndex;\n if (token.extended > -1)\n actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);\n actionIndex = this.addActions(stack, token.value, token.end, actionIndex);\n if (!tokenizer.extend) {\n main = token;\n if (actionIndex > startIndex)\n break;\n }\n }\n }\n while (this.actions.length > actionIndex)\n this.actions.pop();\n if (!main) {\n main = dummyToken;\n main.start = stack.pos;\n if (stack.pos == input.length)\n main.accept(stack.p.parser.eofTerm, stack.pos);\n else\n main.accept(0 /* Err */, stack.pos + 1);\n }\n this.mainToken = main;\n return this.actions;\n }\n updateCachedToken(token, tokenizer, stack, input) {\n token.clear(stack.pos);\n tokenizer.token(input, token, stack);\n if (token.value > -1) {\n let { parser } = stack.p;\n for (let i = 0; i < parser.specialized.length; i++)\n if (parser.specialized[i] == token.value) {\n let result = parser.specializers[i](input.read(token.start, token.end), stack);\n if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {\n if ((result & 1) == 0 /* Specialize */)\n token.value = result >> 1;\n else\n token.extended = result >> 1;\n break;\n }\n }\n }\n else if (stack.pos == input.length) {\n token.accept(stack.p.parser.eofTerm, stack.pos);\n }\n else {\n token.accept(0 /* Err */, stack.pos + 1);\n }\n }\n putAction(action, token, end, index) {\n // Don't add duplicate actions\n for (let i = 0; i < index; i += 3)\n if (this.actions[i] == action)\n return index;\n this.actions[index++] = action;\n this.actions[index++] = token;\n this.actions[index++] = end;\n return index;\n }\n addActions(stack, token, end, index) {\n let { state } = stack, { parser } = stack.p, { data } = parser;\n for (let set = 0; set < 2; set++) {\n for (let i = parser.stateSlot(state, set ? 2 /* Skip */ : 1 /* Actions */);; i += 3) {\n if (data[i] == 65535 /* End */) {\n if (data[i + 1] == 1 /* Next */) {\n i = pair(data, i + 2);\n }\n else {\n if (index == 0 && data[i + 1] == 2 /* Other */)\n index = this.putAction(pair(data, i + 1), token, end, index);\n break;\n }\n }\n if (data[i] == token)\n index = this.putAction(pair(data, i + 1), token, end, index);\n }\n }\n return index;\n }\n}\nvar Rec;\n(function (Rec) {\n Rec[Rec[\"Distance\"] = 5] = \"Distance\";\n Rec[Rec[\"MaxRemainingPerStep\"] = 3] = \"MaxRemainingPerStep\";\n Rec[Rec[\"MinBufferLengthPrune\"] = 200] = \"MinBufferLengthPrune\";\n Rec[Rec[\"ForceReduceLimit\"] = 10] = \"ForceReduceLimit\";\n})(Rec || (Rec = {}));\n/// A parse context can be used for step-by-step parsing. After\n/// creating it, you repeatedly call `.advance()` until it returns a\n/// tree to indicate it has reached the end of the parse.\nclass Parse {\n constructor(parser, input, startPos, context) {\n this.parser = parser;\n this.input = input;\n this.startPos = startPos;\n this.context = context;\n // The position to which the parse has advanced.\n this.pos = 0;\n this.recovering = 0;\n this.nextStackID = 0x2654;\n this.nested = null;\n this.nestEnd = 0;\n this.nestWrap = null;\n this.reused = [];\n this.tokens = new TokenCache(parser);\n this.topTerm = parser.top[1];\n this.stacks = [Stack.start(this, parser.top[0], this.startPos)];\n let fragments = context === null || context === void 0 ? void 0 : context.fragments;\n this.fragments = fragments && fragments.length ? new FragmentCursor(fragments) : null;\n }\n // Move the parser forward. This will process all parse stacks at\n // `this.pos` and try to advance them to a further position. If no\n // stack for such a position is found, it'll start error-recovery.\n //\n // When the parse is finished, this will return a syntax tree. When\n // not, it returns `null`.\n advance() {\n if (this.nested) {\n let result = this.nested.advance();\n this.pos = this.nested.pos;\n if (result) {\n this.finishNested(this.stacks[0], result);\n this.nested = null;\n }\n return null;\n }\n let stacks = this.stacks, pos = this.pos;\n // This will hold stacks beyond `pos`.\n let newStacks = this.stacks = [];\n let stopped, stoppedTokens;\n let maybeNest;\n // Keep advancing any stacks at `pos` until they either move\n // forward or can't be advanced. Gather stacks that can't be\n // advanced further in `stopped`.\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i], nest;\n for (;;) {\n if (stack.pos > pos) {\n newStacks.push(stack);\n }\n else if (nest = this.checkNest(stack)) {\n if (!maybeNest || maybeNest.stack.score < stack.score)\n maybeNest = nest;\n }\n else if (this.advanceStack(stack, newStacks, stacks)) {\n continue;\n }\n else {\n if (!stopped) {\n stopped = [];\n stoppedTokens = [];\n }\n stopped.push(stack);\n let tok = this.tokens.mainToken;\n stoppedTokens.push(tok.value, tok.end);\n }\n break;\n }\n }\n if (maybeNest) {\n this.startNested(maybeNest);\n return null;\n }\n if (!newStacks.length) {\n let finished = stopped && findFinished(stopped);\n if (finished)\n return this.stackToTree(finished);\n if (this.parser.strict) {\n if (verbose && stopped)\n console.log(\"Stuck with token \" + this.parser.getName(this.tokens.mainToken.value));\n throw new SyntaxError(\"No parse at \" + pos);\n }\n if (!this.recovering)\n this.recovering = 5 /* Distance */;\n }\n if (this.recovering && stopped) {\n let finished = this.runRecovery(stopped, stoppedTokens, newStacks);\n if (finished)\n return this.stackToTree(finished.forceAll());\n }\n if (this.recovering) {\n let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3 /* MaxRemainingPerStep */;\n if (newStacks.length > maxRemaining) {\n newStacks.sort((a, b) => b.score - a.score);\n while (newStacks.length > maxRemaining)\n newStacks.pop();\n }\n if (newStacks.some(s => s.reducePos > pos))\n this.recovering--;\n }\n else if (newStacks.length > 1) {\n // Prune stacks that are in the same state, or that have been\n // running without splitting for a while, to avoid getting stuck\n // with multiple successful stacks running endlessly on.\n outer: for (let i = 0; i < newStacks.length - 1; i++) {\n let stack = newStacks[i];\n for (let j = i + 1; j < newStacks.length; j++) {\n let other = newStacks[j];\n if (stack.sameState(other) ||\n stack.buffer.length > 200 /* MinBufferLengthPrune */ && other.buffer.length > 200 /* MinBufferLengthPrune */) {\n if (((stack.score - other.score) || (stack.buffer.length - other.buffer.length)) > 0) {\n newStacks.splice(j--, 1);\n }\n else {\n newStacks.splice(i--, 1);\n continue outer;\n }\n }\n }\n }\n }\n this.pos = newStacks[0].pos;\n for (let i = 1; i < newStacks.length; i++)\n if (newStacks[i].pos < this.pos)\n this.pos = newStacks[i].pos;\n return null;\n }\n // Returns an updated version of the given stack, or null if the\n // stack can't advance normally. When `split` and `stacks` are\n // given, stacks split off by ambiguous operations will be pushed to\n // `split`, or added to `stacks` if they move `pos` forward.\n advanceStack(stack, stacks, split) {\n let start = stack.pos, { input, parser } = this;\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (this.fragments) {\n let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;\n for (let cached = this.fragments.nodeAt(start); cached;) {\n let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;\n if (match > -1 && cached.length && (!strictCx || (cached.contextHash || 0) == cxHash)) {\n stack.useNode(cached, match);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);\n return true;\n }\n if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)\n break;\n let inner = cached.children[0];\n if (inner instanceof Tree)\n cached = inner;\n else\n break;\n }\n }\n let defaultReduce = parser.stateSlot(stack.state, 4 /* DefaultReduce */);\n if (defaultReduce > 0) {\n stack.reduce(defaultReduce);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(defaultReduce & 65535 /* ValueMask */)})`);\n return true;\n }\n let actions = this.tokens.getActions(stack, input);\n for (let i = 0; i < actions.length;) {\n let action = actions[i++], term = actions[i++], end = actions[i++];\n let last = i == actions.length || !split;\n let localStack = last ? stack : stack.split();\n localStack.apply(action, term, end);\n if (verbose)\n console.log(base + this.stackID(localStack) + ` (via ${(action & 65536 /* ReduceFlag */) == 0 ? \"shift\"\n : `reduce of ${parser.getName(action & 65535 /* ValueMask */)}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? \"\" : \", split\"})`);\n if (last)\n return true;\n else if (localStack.pos > start)\n stacks.push(localStack);\n else\n split.push(localStack);\n }\n return false;\n }\n // Advance a given stack forward as far as it will go. Returns the\n // (possibly updated) stack if it got stuck, or null if it moved\n // forward and was given to `pushStackDedup`.\n advanceFully(stack, newStacks) {\n let pos = stack.pos;\n for (;;) {\n let nest = this.checkNest(stack);\n if (nest)\n return nest;\n if (!this.advanceStack(stack, null, null))\n return false;\n if (stack.pos > pos) {\n pushStackDedup(stack, newStacks);\n return true;\n }\n }\n }\n runRecovery(stacks, tokens, newStacks) {\n let finished = null, restarted = false;\n let maybeNest;\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (stack.deadEnd) {\n if (restarted)\n continue;\n restarted = true;\n stack.restart();\n if (verbose)\n console.log(base + this.stackID(stack) + \" (restarted)\");\n let done = this.advanceFully(stack, newStacks);\n if (done) {\n if (done !== true)\n maybeNest = done;\n continue;\n }\n }\n let force = stack.split(), forceBase = base;\n for (let j = 0; force.forceReduce() && j < 10 /* ForceReduceLimit */; j++) {\n if (verbose)\n console.log(forceBase + this.stackID(force) + \" (via force-reduce)\");\n let done = this.advanceFully(force, newStacks);\n if (done) {\n if (done !== true)\n maybeNest = done;\n break;\n }\n if (verbose)\n forceBase = this.stackID(force) + \" -> \";\n }\n for (let insert of stack.recoverByInsert(token)) {\n if (verbose)\n console.log(base + this.stackID(insert) + \" (via recover-insert)\");\n this.advanceFully(insert, newStacks);\n }\n if (this.input.length > stack.pos) {\n if (tokenEnd == stack.pos) {\n tokenEnd++;\n token = 0 /* Err */;\n }\n stack.recoverByDelete(token, tokenEnd);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);\n pushStackDedup(stack, newStacks);\n }\n else if (!finished || finished.score < stack.score) {\n finished = stack;\n }\n }\n if (finished)\n return finished;\n if (maybeNest)\n for (let s of this.stacks)\n if (s.score > maybeNest.stack.score) {\n maybeNest = undefined;\n break;\n }\n if (maybeNest)\n this.startNested(maybeNest);\n return null;\n }\n forceFinish() {\n let stack = this.stacks[0].split();\n if (this.nested)\n this.finishNested(stack, this.nested.forceFinish());\n return this.stackToTree(stack.forceAll());\n }\n // Convert the stack's buffer to a syntax tree.\n stackToTree(stack, pos = stack.pos) {\n if (this.parser.context)\n stack.emitContext();\n return Tree.build({ buffer: StackBufferCursor.create(stack),\n nodeSet: this.parser.nodeSet,\n topID: this.topTerm,\n maxBufferLength: this.parser.bufferLength,\n reused: this.reused,\n start: this.startPos,\n length: pos - this.startPos,\n minRepeatType: this.parser.minRepeatTerm });\n }\n checkNest(stack) {\n let info = this.parser.findNested(stack.state);\n if (!info)\n return null;\n let spec = info.value;\n if (typeof spec == \"function\")\n spec = spec(this.input, stack);\n return spec ? { stack, info, spec } : null;\n }\n startNested(nest) {\n let { stack, info, spec } = nest;\n this.stacks = [stack];\n this.nestEnd = this.scanForNestEnd(stack, info.end, spec.filterEnd);\n this.nestWrap = typeof spec.wrapType == \"number\" ? this.parser.nodeSet.types[spec.wrapType] : spec.wrapType || null;\n if (spec.startParse) {\n this.nested = spec.startParse(this.input.clip(this.nestEnd), stack.pos, this.context);\n }\n else {\n this.finishNested(stack);\n }\n }\n scanForNestEnd(stack, endToken, filter) {\n for (let pos = stack.pos; pos < this.input.length; pos++) {\n dummyToken.start = pos;\n dummyToken.value = -1;\n endToken.token(this.input, dummyToken, stack);\n if (dummyToken.value > -1 && (!filter || filter(this.input.read(pos, dummyToken.end))))\n return pos;\n }\n return this.input.length;\n }\n finishNested(stack, tree) {\n if (this.nestWrap)\n tree = new Tree(this.nestWrap, tree ? [tree] : [], tree ? [0] : [], this.nestEnd - stack.pos);\n else if (!tree)\n tree = new Tree(NodeType.none, [], [], this.nestEnd - stack.pos);\n let info = this.parser.findNested(stack.state);\n stack.useNode(tree, this.parser.getGoto(stack.state, info.placeholder, true));\n if (verbose)\n console.log(this.stackID(stack) + ` (via unnest)`);\n }\n stackID(stack) {\n let id = (stackIDs || (stackIDs = new WeakMap)).get(stack);\n if (!id)\n stackIDs.set(stack, id = String.fromCodePoint(this.nextStackID++));\n return id + stack;\n }\n}\nfunction pushStackDedup(stack, newStacks) {\n for (let i = 0; i < newStacks.length; i++) {\n let other = newStacks[i];\n if (other.pos == stack.pos && other.sameState(stack)) {\n if (newStacks[i].score < stack.score)\n newStacks[i] = stack;\n return;\n }\n }\n newStacks.push(stack);\n}\nclass Dialect {\n constructor(source, flags, disabled) {\n this.source = source;\n this.flags = flags;\n this.disabled = disabled;\n }\n allows(term) { return !this.disabled || this.disabled[term] == 0; }\n}\nconst id = x => x;\n/// Context trackers are used to track stateful context (such as\n/// indentation in the Python grammar, or parent elements in the XML\n/// grammar) needed by external tokenizers. You declare them in a\n/// grammar file as `@context exportName from \"module\"`.\n///\n/// Context values should be immutable, and can be updated (replaced)\n/// on shift or reduce actions.\nclass ContextTracker {\n /// The export used in a `@context` declaration should be of this\n /// type.\n constructor(spec) {\n this.start = spec.start;\n this.shift = spec.shift || id;\n this.reduce = spec.reduce || id;\n this.reuse = spec.reuse || id;\n this.hash = spec.hash;\n this.strict = spec.strict !== false;\n }\n}\n/// A parser holds the parse tables for a given grammar, as generated\n/// by `lezer-generator`.\nclass Parser {\n /// @internal\n constructor(spec) {\n /// @internal\n this.bufferLength = DefaultBufferLength;\n /// @internal\n this.strict = false;\n this.cachedDialect = null;\n if (spec.version != 13 /* Version */)\n throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${13 /* Version */})`);\n let tokenArray = decodeArray(spec.tokenData);\n let nodeNames = spec.nodeNames.split(\" \");\n this.minRepeatTerm = nodeNames.length;\n this.context = spec.context;\n for (let i = 0; i < spec.repeatNodeCount; i++)\n nodeNames.push(\"\");\n let nodeProps = [];\n for (let i = 0; i < nodeNames.length; i++)\n nodeProps.push([]);\n function setProp(nodeID, prop, value) {\n nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);\n }\n if (spec.nodeProps)\n for (let propSpec of spec.nodeProps) {\n let prop = propSpec[0];\n for (let i = 1; i < propSpec.length;) {\n let next = propSpec[i++];\n if (next >= 0) {\n setProp(next, prop, propSpec[i++]);\n }\n else {\n let value = propSpec[i + -next];\n for (let j = -next; j > 0; j--)\n setProp(propSpec[i++], prop, value);\n i++;\n }\n }\n }\n this.specialized = new Uint16Array(spec.specialized ? spec.specialized.length : 0);\n this.specializers = [];\n if (spec.specialized)\n for (let i = 0; i < spec.specialized.length; i++) {\n this.specialized[i] = spec.specialized[i].term;\n this.specializers[i] = spec.specialized[i].get;\n }\n this.states = decodeArray(spec.states, Uint32Array);\n this.data = decodeArray(spec.stateData);\n this.goto = decodeArray(spec.goto);\n let topTerms = Object.keys(spec.topRules).map(r => spec.topRules[r][1]);\n this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({\n name: i >= this.minRepeatTerm ? undefined : name,\n id: i,\n props: nodeProps[i],\n top: topTerms.indexOf(i) > -1,\n error: i == 0,\n skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1\n })));\n this.maxTerm = spec.maxTerm;\n this.tokenizers = spec.tokenizers.map(value => typeof value == \"number\" ? new TokenGroup(tokenArray, value) : value);\n this.topRules = spec.topRules;\n this.nested = (spec.nested || []).map(([name, value, endToken, placeholder]) => {\n return { name, value, end: new TokenGroup(decodeArray(endToken), 0), placeholder };\n });\n this.dialects = spec.dialects || {};\n this.dynamicPrecedences = spec.dynamicPrecedences || null;\n this.tokenPrecTable = spec.tokenPrec;\n this.termNames = spec.termNames || null;\n this.maxNode = this.nodeSet.types.length - 1;\n this.dialect = this.parseDialect();\n this.top = this.topRules[Object.keys(this.topRules)[0]];\n }\n /// Parse a given string or stream.\n parse(input, startPos = 0, context = {}) {\n if (typeof input == \"string\")\n input = stringInput(input);\n let cx = new Parse(this, input, startPos, context);\n for (;;) {\n let done = cx.advance();\n if (done)\n return done;\n }\n }\n /// Start an incremental parse.\n startParse(input, startPos = 0, context = {}) {\n if (typeof input == \"string\")\n input = stringInput(input);\n return new Parse(this, input, startPos, context);\n }\n /// Get a goto table entry @internal\n getGoto(state, term, loose = false) {\n let table = this.goto;\n if (term >= table[0])\n return -1;\n for (let pos = table[term + 1];;) {\n let groupTag = table[pos++], last = groupTag & 1;\n let target = table[pos++];\n if (last && loose)\n return target;\n for (let end = pos + (groupTag >> 1); pos < end; pos++)\n if (table[pos] == state)\n return target;\n if (last)\n return -1;\n }\n }\n /// Check if this state has an action for a given terminal @internal\n hasAction(state, terminal) {\n let data = this.data;\n for (let set = 0; set < 2; set++) {\n for (let i = this.stateSlot(state, set ? 2 /* Skip */ : 1 /* Actions */), next;; i += 3) {\n if ((next = data[i]) == 65535 /* End */) {\n if (data[i + 1] == 1 /* Next */)\n next = data[i = pair(data, i + 2)];\n else if (data[i + 1] == 2 /* Other */)\n return pair(data, i + 2);\n else\n break;\n }\n if (next == terminal || next == 0 /* Err */)\n return pair(data, i + 1);\n }\n }\n return 0;\n }\n /// @internal\n stateSlot(state, slot) {\n return this.states[(state * 6 /* Size */) + slot];\n }\n /// @internal\n stateFlag(state, flag) {\n return (this.stateSlot(state, 0 /* Flags */) & flag) > 0;\n }\n /// @internal\n findNested(state) {\n let flags = this.stateSlot(state, 0 /* Flags */);\n return flags & 4 /* StartNest */ ? this.nested[flags >> 10 /* NestShift */] : null;\n }\n /// @internal\n validAction(state, action) {\n if (action == this.stateSlot(state, 4 /* DefaultReduce */))\n return true;\n for (let i = this.stateSlot(state, 1 /* Actions */);; i += 3) {\n if (this.data[i] == 65535 /* End */) {\n if (this.data[i + 1] == 1 /* Next */)\n i = pair(this.data, i + 2);\n else\n return false;\n }\n if (action == pair(this.data, i + 1))\n return true;\n }\n }\n /// Get the states that can follow this one through shift actions or\n /// goto jumps. @internal\n nextStates(state) {\n let result = [];\n for (let i = this.stateSlot(state, 1 /* Actions */);; i += 3) {\n if (this.data[i] == 65535 /* End */) {\n if (this.data[i + 1] == 1 /* Next */)\n i = pair(this.data, i + 2);\n else\n break;\n }\n if ((this.data[i + 2] & (65536 /* ReduceFlag */ >> 16)) == 0) {\n let value = this.data[i + 1];\n if (!result.some((v, i) => (i & 1) && v == value))\n result.push(this.data[i], value);\n }\n }\n return result;\n }\n /// @internal\n overrides(token, prev) {\n let iPrev = findOffset(this.data, this.tokenPrecTable, prev);\n return iPrev < 0 || findOffset(this.data, this.tokenPrecTable, token) < iPrev;\n }\n /// Configure the parser. Returns a new parser instance that has the\n /// given settings modified. Settings not provided in `config` are\n /// kept from the original parser.\n configure(config) {\n // Hideous reflection-based kludge to make it easy to create a\n // slightly modified copy of a parser.\n let copy = Object.assign(Object.create(Parser.prototype), this);\n if (config.props)\n copy.nodeSet = this.nodeSet.extend(...config.props);\n if (config.top) {\n let info = this.topRules[config.top];\n if (!info)\n throw new RangeError(`Invalid top rule name ${config.top}`);\n copy.top = info;\n }\n if (config.tokenizers)\n copy.tokenizers = this.tokenizers.map(t => {\n let found = config.tokenizers.find(r => r.from == t);\n return found ? found.to : t;\n });\n if (config.dialect)\n copy.dialect = this.parseDialect(config.dialect);\n if (config.nested)\n copy.nested = this.nested.map(obj => {\n if (!Object.prototype.hasOwnProperty.call(config.nested, obj.name))\n return obj;\n return { name: obj.name, value: config.nested[obj.name], end: obj.end, placeholder: obj.placeholder };\n });\n if (config.strict != null)\n copy.strict = config.strict;\n if (config.bufferLength != null)\n copy.bufferLength = config.bufferLength;\n return copy;\n }\n /// Returns the name associated with a given term. This will only\n /// work for all terms when the parser was generated with the\n /// `--names` option. By default, only the names of tagged terms are\n /// stored.\n getName(term) {\n return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);\n }\n /// The eof term id is always allocated directly after the node\n /// types. @internal\n get eofTerm() { return this.maxNode + 1; }\n /// Tells you whether this grammar has any nested grammars.\n get hasNested() { return this.nested.length > 0; }\n /// The type of top node produced by the parser.\n get topNode() { return this.nodeSet.types[this.top[1]]; }\n /// @internal\n dynamicPrecedence(term) {\n let prec = this.dynamicPrecedences;\n return prec == null ? 0 : prec[term] || 0;\n }\n /// @internal\n parseDialect(dialect) {\n if (this.cachedDialect && this.cachedDialect.source == dialect)\n return this.cachedDialect;\n let values = Object.keys(this.dialects), flags = values.map(() => false);\n if (dialect)\n for (let part of dialect.split(\" \")) {\n let id = values.indexOf(part);\n if (id >= 0)\n flags[id] = true;\n }\n let disabled = null;\n for (let i = 0; i < values.length; i++)\n if (!flags[i]) {\n for (let j = this.dialects[values[i]], id; (id = this.data[j++]) != 65535 /* End */;)\n (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id] = 1;\n }\n return this.cachedDialect = new Dialect(dialect, flags, disabled);\n }\n /// (used by the output of the parser generator) @internal\n static deserialize(spec) {\n return new Parser(spec);\n }\n}\nfunction pair(data, off) { return data[off] | (data[off + 1] << 16); }\nfunction findOffset(data, start, term) {\n for (let i = start, next; (next = data[i]) != 65535 /* End */; i++)\n if (next == term)\n return i - start;\n return -1;\n}\nfunction findFinished(stacks) {\n let best = null;\n for (let stack of stacks) {\n if (stack.pos == stack.p.input.length &&\n stack.p.parser.stateFlag(stack.state, 2 /* Accepting */) &&\n (!best || best.score < stack.score))\n best = stack;\n }\n return best;\n}\n\nexport { ContextTracker, ExternalTokenizer, Parser, Stack, Token };\n//# sourceMappingURL=index.es.js.map\n"],"names":[],"sourceRoot":""}