var TheDatepicker;(h=>{let i;var t;(t=i=h.ClassNameType||(h.ClassNameType={}))[t.Container=0]="Container",t[t.ContainerOver=1]="ContainerOver",t[t.ContainerLeft=2]="ContainerLeft",t[t.ContainerResponsive=3]="ContainerResponsive",t[t.Main=4]="Main",t[t.Body=5]="Body",t[t.BodySwipeable=6]="BodySwipeable",t[t.Tables=7]="Tables",t[t.Header=8]="Header",t[t.HeaderTop=9]="HeaderTop",t[t.HeaderControl=10]="HeaderControl",t[t.HeaderNavigation=11]="HeaderNavigation",t[t.HeaderState=12]="HeaderState",t[t.HeaderMonth=13]="HeaderMonth",t[t.HeaderYear=14]="HeaderYear",t[t.HeaderMonthYear=15]="HeaderMonthYear",t[t.HeaderYearsToggle=16]="HeaderYearsToggle",t[t.Button=17]="Button",t[t.ButtonContent=18]="ButtonContent",t[t.SelectInput=19]="SelectInput",t[t.Deselect=20]="Deselect",t[t.DeselectButton=21]="DeselectButton",t[t.HeaderTitle=22]="HeaderTitle",t[t.HeaderTitleContent=23]="HeaderTitleContent",t[t.Reset=24]="Reset",t[t.Close=25]="Close",t[t.Go=26]="Go",t[t.GoNext=27]="GoNext",t[t.GoPrevious=28]="GoPrevious",t[t.Table=29]="Table",t[t.TableRow=30]="TableRow",t[t.TableCell=31]="TableCell",t[t.TableCellUnavailable=32]="TableCellUnavailable",t[t.TableCellHighlighted=33]="TableCellHighlighted",t[t.TableCellSelected=34]="TableCellSelected",t[t.CalendarTable=35]="CalendarTable",t[t.CalendarTableHeader=36]="CalendarTableHeader",t[t.CalendarTableHeaderCell=37]="CalendarTableHeaderCell",t[t.CalendarTableBody=38]="CalendarTableBody",t[t.YearsTable=39]="YearsTable",t[t.YearsTableBody=40]="YearsTableBody",t[t.WeekDayWeekend=41]="WeekDayWeekend",t[t.Day=42]="Day",t[t.DayToday=43]="DayToday",t[t.DayPast=44]="DayPast",t[t.DayWeekend=45]="DayWeekend",t[t.DayUnavailable=46]="DayUnavailable",t[t.DayOutside=47]="DayOutside",t[t.DayHighlighted=48]="DayHighlighted",t[t.DaySelected=49]="DaySelected",t[t.DayButton=50]="DayButton",t[t.DayButtonContent=51]="DayButtonContent",t[t.YearCellButton=52]="YearCellButton",t[t.YearCellButtonContent=53]="YearCellButtonContent",t[t.Animated=54]="Animated",t[t.AnimateFadeOutLeft=55]="AnimateFadeOutLeft",t[t.AnimateFadeInRight=56]="AnimateFadeInRight",t[t.AnimateFadeOutUp=57]="AnimateFadeOutUp",t[t.AnimateFadeInDown=58]="AnimateFadeInDown",t[t.AnimateFadeOutRight=59]="AnimateFadeOutRight",t[t.AnimateFadeInLeft=60]="AnimateFadeInLeft",t[t.AnimateFadeOutDown=61]="AnimateFadeOutDown",t[t.AnimateFadeInUp=62]="AnimateFadeInUp",t[t.ContainerDarkMode=63]="ContainerDarkMode",t[t.MainDarkMode=64]="MainDarkMode",t[t.CalendarTableHeaderWeekNumber=65]="CalendarTableHeaderWeekNumber",t[t.WeekNumber=66]="WeekNumber",t[t.TableRowEmpty=67]="TableRowEmpty",h.ClassNames=class s{constructor(){this.t=[["container"],["container--over"],["container--left"],["container--responsive"],["main"],["body"],["body--swipeable"],["tables"],["header"],["top"],["control"],["navigation"],["state"],["month"],["year"],["month-year"],["year-button"],["button"],["button-content"],["select"],["deselect"],["deselect-button"],["title"],["title-content"],["reset"],["close"],["go"],["go-next"],["go-previous"],["table"],["row"],["cell"],["cell--unavailable"],["cell--highlighted"],["cell--selected"],["calendar"],["calendar-header"],["week-day"],["calendar-body"],["years"],["years-body"],["week-day--weekend"],["day"],["day--today"],["day--past"],["day--weekend"],["day--unavailable"],["day--outside"],["day--highlighted"],["day--selected"],["day--button"],["day-content"],["year-cell-button"],["year-cell-content"],["animated"],["fade-out-left"],["fade-in-right"],["fade-out-up"],["fade-in-down"],["fade-out-right"],["fade-in-left"],["fade-out-down"],["fade-in-up"],["container--darkmode"],["main--darkmode"],["week-number-header"],["week-number"],["row--empty"]]}clone(){var t=new s;let e;for(e=0;e<this.t.length;e++)t.t=this.t.slice(0);return t}setClassName(t,e){t===i.ContainerDarkMode&&(h.h.i("ClassNameType.ContainerDarkMode",["ClassNameType.MainDarkMode"]),this.setClassName(i.MainDarkMode,e)),this.t[this.l(t)]=this.o(e)}addClassName(t,e){this.t[this.l(t)].concat(this.o(e))}getClassName(t){return this.t[t].slice(0)}l(t){return h.h.u("Class name type",t,0,this.t.length-1)}o(e){var i="Class name",s=("object"==typeof e&&e.constructor===Array||(e=h.h.v(i,e).split(/\s+/)),[]);for(let t=0;t<e.length;t++){var r=h.h.v(i,e[t]);r&&s.push(r)}return s}}})(TheDatepicker=TheDatepicker||{}),(t=>{class o{}t.CannotParseDateException=o;class e{constructor(){this.day=null,this.month=null,this.year=null}createDate(){if(null===this.day||null===this.month||null===this.year)throw new o;let t=new Date(this.year,this.month-1,this.day);if(isNaN(t.getTime()))throw new o;for(;t.getDate()!==this.day||t.getMonth()!==this.month-1||t.getFullYear()!==this.year;){if(!(28<this.day))throw new o;this.day--,t=new Date(this.year,this.month-1,this.day)}return t}}class u{static p(e,i,s=null){if(!e)return null;s=s||i.getInputFormat();let r=!1,h="";for(let t=0;t<s.length;t++){var n,a=s.substring(t,t+1);r?(h+=a,r=!1):a===u.m?r=!0:(n=u.g(a),h+=n?n.call(null,e,i):a)}return h}static D(i,t){if(""===i.trim())return null;var s=t.getInputFormat(),r=new e;let h=!1,n=0;for(let e=0;e<s.length;e++){var a=s.substring(e,e+1);if(h)h=!1;else{if(a===u.m){h=!0;continue}var l=u._(a);if(l){try{n+=l.call(null,i.substring(n),r,t)}catch(t){if(!(t instanceof o))throw t;if(" "!==i.substring(n,n+1))throw t;n++,e--;continue}continue}}l=i.substring(n,n+1);if(l!==a){if(" "!==a){if(" "!==l)throw new o;n++,e--}}else n++}return r.createDate()}static C(e,i){if(""===e||/[0-9-]/.test(e))return!0;var s=i.getInputFormat();let r=!1;for(let t=0;t<s.length;t++){var h=s.substring(t,t+1);if(r)r=!1;else{if(h===u.m){r=!0;continue}var n=u.T(h,i);if(n){var a=e.toLowerCase();for(let t=0;t<n.length;t++)if(-1<n[t].toLowerCase().indexOf(a))return!0;continue}}if(e===h)return!0}return!1}static g(t){switch(t){case"j":return u.M;case"d":return u.k;case"D":return u.O;case"l":return u.S;case"n":return u.A;case"m":return u.B;case"F":return u.R;case"M":return u.Y;case"Y":return u.F;case"y":return u.I;default:return null}}static M(t){return t.getDate()+""}static k(t){return("0"+t.getDate()).slice(-2)}static O(t,e){return e.translator.translateDayOfWeek(t.getDay())}static S(t,e){return e.translator.translateDayOfWeekFull(t.getDay())}static A(t){return t.getMonth()+1+""}static B(t){return("0"+(t.getMonth()+1)).slice(-2)}static R(t,e){return e.translator.translateMonth(t.getMonth())}static Y(t,e){return e.translator.translateMonthShort(t.getMonth())}static F(t){return t.getFullYear()+""}static I(t){t=t.getFullYear()+"";return t.substring(t.length-2)}static _(t){switch(t){case"j":case"d":return u.H;case"D":return u.L;case"l":return u.W;case"n":case"m":return u.N;case"F":return u.P;case"M":return u.G;case"Y":return u.j;case"y":return u.V;default:return null}}static H(t,e){let i=0;for(;"0"===t.substring(0,1);)t=t.substring(1),i++;let s=t.substring(0,2);if(/[12][0-9]|3[01]/.test(s)||(s=s.substring(0,1),/[1-9]/.test(s)))return e.day=parseInt(s,10),i+s.length;throw new o}static L(t,e,i){return u.J(t,t=>i.translator.translateDayOfWeek(t))}static W(t,e,i){return u.J(t,t=>i.translator.translateDayOfWeekFull(t))}static J(e,i){let s=0,r=0;for(let t=0;t<7;t++){var h=i(t);s=Math.max(s,h.length),e.substring(0,h.length).toLowerCase()===h.toLowerCase()&&h.length>r&&(r=h.length)}if(0<r)return r;let t=0;for(;/[a-zA-Z]/.test(e.substring(0,1))&&(e=e.substring(1),++t!==s););return t}static N(t,e){let i=0;for(;"0"===t.substring(0,1);)t=t.substring(1),i++;let s=t.substring(0,2);if("10"===s||"11"===s||"12"===s||(s=s.substring(0,1),/[1-9]/.test(s)))return e.month=parseInt(s,10),i+s.length;throw new o}static P(t,e,i){return u.U(t,e,t=>i.translator.translateMonth(t))}static G(t,e,i){return u.U(t,e,t=>i.translator.translateMonthShort(t))}static U(e,t,i){let s=null,r=0;for(let t=1;t<=12;t++){var h=i(t-1);e.substring(0,h.length).toLowerCase()===h.toLowerCase()&&h.length>r&&(s=t,r=h.length)}if(null===s)throw new o;return t.month=s,r}static j(t,e,i){let s=!1;"-"===t.substring(0,1)&&(s=!0,t=t.substring(1));var r=i.K(),i=i.Z(),h=0<i.getFullYear()?(i.getFullYear()+"").length:0,n=r.getFullYear()<0?(-r.getFullYear()+"").length:0;let a=0;for(;/[0-9]/.test(t.substring(a,a+1))&&!(s&&a+1>n||!s&&a+1>h);)a++;if(0===a)throw new o;let l=parseInt(t.substring(0,a),10);return s&&(l=-l),e.year=l,a+(s?1:0)}static V(t,e,i){t=t.substring(0,2);if(/[0-9]{2}/.test(t))return i=(i=i.getToday().getFullYear()+"").substring(0,i.length-2),e.year=parseInt(i+t,10),2;throw new o}static T(t,e){switch(t){case"j":case"d":case"n":case"m":case"Y":case"y":return[];case"D":return e.translator.q;case"l":return e.translator.X;case"F":return e.translator.$;case"M":return e.translator.tt;default:return null}}}u.m="\\",t.et=u})(TheDatepicker=TheDatepicker||{}),(d=>{let s;var t;(t=s=s||{})[t.Untouched=0]="Untouched",t[t.Waiting=1]="Waiting",t[t.Ready=2]="Ready",t[t.Initialized=3]="Initialized",t[t.Destroyed=4]="Destroyed";class w{constructor(t,e=null,i=null){if(this.it=null,this.st=null,this.rt=s.Untouched,this.ht=null,this.nt=[],this.lt=null,this.ot=null,!(this instanceof w))throw new Error('Creation must be performed by "new" keyword.');if(t&&!d.h.ut(t))throw new Error("Input was expected to be null or an HTMLElement.");if(e&&!d.h.ut(e))throw new Error("Container was expected to be null or an HTMLElement.");if(!t&&!e)throw new Error("At least one of input or container is mandatory.");if(i&&!(i instanceof d.Options))throw new Error("Options was expected to be an instance of Options");w.ct=document,this.options=i?i.clone():new d.Options;i="There is already a datepicker present on ";if(this.ft=!!e,e){if(e.datepicker)throw new Error(i+"container.")}else e=this.dt(),t&&t.parentNode.insertBefore(e,t.nextSibling);if(e.setAttribute("data-credits","TheDatepicker - Pure JavaScript Datepicker by Slevomat.cz"),e.setAttribute("data-url","https://thedatepicker.github.io/thedatepicker/"),t){if(t.datepicker)throw new Error(i+"input.");t.datepicker=this,t&&"undefined"!=typeof HTMLInputElement&&t instanceof HTMLInputElement&&"text"===(this.it=t).type&&((this.st=t).autocomplete="off")}(e.datepicker=this).input=t,this.container=e,this.wt=new d.vt(this.options,this),this.gt(t),this.gt(e)}render(){switch(this.rt){case s.Ready:return this.Dt(),this.rt=s.Initialized,void this.render();case s.Waiting:return(this.bt(),this.options.isHiddenOnBlur())?void(this.wt.yt()||this._t()):void this.open();case s.Untouched:return(this.Ct(),this.bt(),this.wt.Tt(null)||this._t(),this.it&&this.options.isHiddenOnBlur())?this.it===w.ct.activeElement?(this.rt=s.Ready,this.render(),void this.open()):(this.ht=d.h.Mt(this.it,d.kt.Focus,t=>{this.open(t)}),void(this.rt=s.Waiting)):(this.rt=s.Ready,void this.render());default:return void this.wt.Ot()}}open(t=null){return this.rt===s.Untouched&&this.render(),this.rt===s.Waiting&&(this.rt=s.Ready,this.render(),w.St=!0),!!w.At(t,this)&&(this.it&&this.it.focus(),!0)}isOpened(){return this.wt.Et()}close(t=null){if(this.wt.Et()){if(!w.At(t,null))return!1;this.it&&this.it.blur()}return!0}reset(t=null){return this.wt.Bt(t)}destroy(){if(this.rt!==s.Destroyed){for(let t=0;t<this.nt.length;t++)this.nt[t]();this.nt=[],this.ft?this.container.innerHTML="":this.container.parentNode.removeChild(this.container),delete this.container.datepicker,this.input&&(this.st&&(this.st.autocomplete="",this.st.readOnly=!1),delete this.input.datepicker,this.Rt(),this.input=null),this.lt&&(this.lt.parentNode.removeChild(this.lt),this.lt=null),this.rt=s.Destroyed}}isDestroyed(){return this.rt===s.Destroyed}selectDate(t,e=!0,i=null){return this.wt.Yt(i,d.h.Ft("Date",t,!0,this.options),!!e)}getSelectedDate(){return this.wt.It?new Date(this.wt.It.getTime()):null}getSelectedDateFormatted(t=null){return d.et.p(this.wt.It,this.options,d.h.v("Format",t))}getCurrentMonth(){return new Date(this.wt.Ht().getTime())}goToMonth(t,e=null){return this.wt.xt(e,d.h.Ft("Month",t,!1,this.options))}parseRawInput(){return this.st?d.et.D(this.st.value,this.options):null}getHtmlInput(){return this.it}getDay(t){return this.wt.Lt(d.h.Ft("Date",t,!1,this.options))}Wt(t){return!(this.st&&!this.options.isAllowedInputAnyChar())||d.et.C(t,this.options)}Nt(t=null){if(this.st)try{var e=this.parseRawInput();if(e?this.wt.Pt(t,e):this.wt.Gt(t))return this.jt(),!0}catch(t){if(!(t instanceof d.CannotParseDateException))throw t}return!1}_t(){this.st&&this.st!==w.ct.activeElement&&(this.st.value=d.et.p(this.wt.It,this.options)||"",this.jt())}static onDatepickerReady(t,e=null){if(!d.h.ut(t))throw new Error("Element was expected to be an HTMLElement.");e=d.h.Vt("Callback",e);let i=null,s=null;return"undefined"!=typeof Promise&&(i=new Promise(t=>{s=t})),t.datepicker&&t.datepicker instanceof w?(t.datepicker.Jt(e,t),s&&s(t.datepicker)):w.Ut.push({promiseResolve:s,element:t,callback:e}),i}dt(){return d.Kt.zt(d.ClassNameType.Container,this.options)}bt(){if(!this.st||!this.options.isDeselectButtonShown()||this.lt)return null;let e=d.Kt.Zt(t=>{e.focus(),this.wt.Gt(t)},this.options,d.ClassNameType.DeselectButton);e.innerHTML=this.options.getDeselectHtml();var t=this.options.translator.translateTitle(d.TitleName.Deselect),t=(""!==t&&(e.title=t),d.Kt.qt());d.Kt.Qt(t,d.ClassNameType.Deselect,this.options),t.appendChild(e),this.st.parentNode.insertBefore(t,this.st.nextSibling),this.lt=t,this.ot=e}jt(){var t;this.lt&&(t=this.options.isDeselectButtonShown()&&this.wt.It,this.lt.style.visibility=t?"visible":"hidden")}Ct(){if(this.st)try{var t=this.parseRawInput();t&&this.options.setInitialDate(t)}catch(t){if(!(t instanceof d.CannotParseDateException))throw t}}Dt(){var t;w.Xt||(t=t=>{w.St?w.St=!1:w.At(t,null)},d.h.Mt(w.ct,d.kt.MouseDown,t),d.h.Mt(w.ct,d.kt.FocusIn,t),d.h.Mt(w.ct,d.kt.KeyDown,t=>{w.$t&&w.$t.te(t)}),w.Xt=!0),this.Rt();let e=t=>{w.At(t,this),w.St=!0};this.nt.push(d.h.Mt(this.container,d.kt.MouseDown,e)),this.nt.push(d.h.Mt(this.container,d.kt.FocusIn,e)),this.ot&&(this.nt.push(d.h.Mt(this.ot,d.kt.MouseDown,t=t=>{this.wt.Et()&&e(t)})),this.nt.push(d.h.Mt(this.ot,d.kt.Focus,t))),this.it&&(this.nt.push(d.h.Mt(this.it,d.kt.MouseDown,e)),this.nt.push(d.h.Mt(this.it,d.kt.Focus,e)),this.nt.push(d.h.Mt(this.it,d.kt.Blur,()=>{this._t()}))),this.st&&(this.nt.push(d.h.Mt(this.st,d.kt.KeyDown,t=>{d.h.ee(t),t.keyCode===d.ie.Esc&&this.options.isClosedOnEscPress()&&this.close(t)})),this.nt.push(d.h.Mt(this.st,d.kt.KeyUp,t=>{this.Nt(t)})),this.nt.push(d.h.Mt(this.st,d.kt.KeyPress,t=>{var e=t.charCode||t.keyCode;e&&!this.Wt(String.fromCharCode(e))&&d.h.se(t)})))}Rt(){this.ht&&(this.ht(),this.ht=null)}gt(e){for(let t=w.Ut.length-1;0<=t;t--){var i=w.Ut[t];i.element===e&&(this.Jt(i.callback,e),i.promiseResolve&&i.promiseResolve(this),w.Ut.splice(t,1))}}Jt(t,e){t&&t.call(e,this,e)}re(){this.rt!==s.Destroyed&&(this.he(),this.st)&&(this.st.readOnly=!this.options.isKeyboardOnMobile()&&d.h.ne())}he(){if(!this.ft&&(this.container.className="",d.Kt.Qt(this.container,d.ClassNameType.Container,this.options),this.options.isDarkModeEnabled()&&d.Kt.Qt(this.container,d.ClassNameType.ContainerDarkMode,this.options),this.options.isFullScreenOnMobile()&&d.Kt.Qt(this.container,d.ClassNameType.ContainerResponsive,this.options),0!==this.container.childNodes.length)){var i=this.options.getPosition();let t=i===d.Position.TopRight||i===d.Position.TopLeft,e=i===d.Position.BottomLeft||i===d.Position.TopLeft;var s,r,h,n,a,l,i=this.container.childNodes[0],o=(i.style.position="",i.style.top="",i.style.left="",this.input.offsetWidth),u=this.input.offsetHeight,c=this.container.offsetWidth,f=this.container.offsetHeight;this.options.isPositionFixingEnabled()&&(a=w.ct,h=window.scrollY||window.pageYOffset||a.documentElement.scrollTop||a.body.scrollTop||0,l=window.scrollX||window.pageXOffset||a.documentElement.scrollLeft||a.body.scrollLeft||0,s="CSS1Compat"===a.compatMode,n=h+(window.innerHeight||(s?a.documentElement:a.body).clientHeight||0),s=l+(window.innerWidth||(s?a.documentElement:a.body).clientWidth||0),h=f<(r=(a=this.input.getBoundingClientRect()).top+h)-h,n=f<n-(r+u),a=c-o<(r=a.left+l)-l,l=c-o<s-(r+o),t=t&&(h||!n)||h&&!n,e=e&&(a||!l)||a&&!l),i.style.position=t||e?"absolute":"",t&&(d.Kt.Qt(this.container,d.ClassNameType.ContainerOver,this.options),i.style.top="-"+(u+f)+"px"),e&&(d.Kt.Qt(this.container,d.ClassNameType.ContainerLeft,this.options),i.style.left="-"+(c-o)+"px")}}static ae(t){var e="the-datepicker-page",i=w.ct.body,s=i.className,r=-1<s.indexOf(e);if(!r&&t)i.className+=(0<s.length?" ":"")+e;else if(r&&!t){let t=e;-1<s.indexOf(" "+e)?t=" "+e:-1<s.indexOf(e+" ")&&(t=e+" "),i.className=s.replace(t,"")}}static At(t,e){var i=e?e.wt:null,s=w.$t;if(s!==i){if(s&&!s.le(t,!1))return!1;if(w.$t===s){if(!i)return w.ae(!1),!(w.$t=null);if(!i.le(t,!0))return!1;w.$t===s&&(e.re(),w.ae(!e.ft&&e.options.isFullScreenOnMobile()),w.$t=i)}}return!0}}w.Ut=[],w.Xt=!1,w.$t=null,w.St=!1,d.Datepicker=w,d.onDatepickerReady=w.onDatepickerReady})(TheDatepicker=TheDatepicker||{}),(s=>{s.Day=class e{constructor(t,e,i){this.isToday=!1,this.isPast=!1,this.isAvailable=!0,this.isInValidity=!0,this.isVisible=!1,this.isInCurrentMonth=!1,this.isSelected=!1,this.isHighlighted=!1,this.isFocused=!1,this.dayNumber=t.getDate(),this.month=t.getMonth()+1,this.year=t.getFullYear(),this.dayOfWeek=t.getDay(),this.isWeekend=this.dayOfWeek===s.DayOfWeek.Saturday||this.dayOfWeek===s.DayOfWeek.Sunday,this.Lt=e,this.p=i}getDate(){return new Date(this.year,this.month-1,this.dayNumber,0,0,0,0)}getFormatted(){return this.year+"-"+("0"+this.month).slice(-2)+"-"+("0"+this.dayNumber).slice(-2)}getInputFormatted(t=null){return this.p(this.getDate(),s.h.v("Format",t))}isEqualToDate(t){return s.h.oe(t)&&this.dayNumber===t.getDate()&&this.month===t.getMonth()+1&&this.year===t.getFullYear()}isEqualToDay(t){return t instanceof e&&this.dayNumber===t.dayNumber&&this.month===t.month&&this.year===t.year}getSibling(t=1){var e=this.getDate();return e.setDate(e.getDate()+s.h.u("Shift",t)),this.Lt(e)}}})(TheDatepicker=TheDatepicker||{}),(u=>{var t;(t=u.DayOfWeek||(u.DayOfWeek={}))[t.Monday=1]="Monday",t[t.Tuesday=2]="Tuesday",t[t.Wednesday=3]="Wednesday",t[t.Thursday=4]="Thursday",t[t.Friday=5]="Friday",t[t.Saturday=6]="Saturday",t[t.Sunday=0]="Sunday",(t=u.Month||(u.Month={}))[t.January=0]="January",t[t.February=1]="February",t[t.March=2]="March",t[t.April=3]="April",t[t.May=4]="May",t[t.June=5]="June",t[t.July=6]="July",t[t.August=7]="August",t[t.September=8]="September",t[t.October=9]="October",t[t.November=10]="November",t[t.December=11]="December",(t=u.Align||(u.Align={}))[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Center=3]="Center",(t=u.Position||(u.Position={}))[t.BottomRight=1]="BottomRight",t[t.BottomLeft=2]="BottomLeft",t[t.TopRight=3]="TopRight",t[t.TopLeft=4]="TopLeft",(t=u.ie||(u.ie={}))[t.Enter=13]="Enter",t[t.Space=32]="Space",t[t.Left=37]="Left",t[t.Up=38]="Up",t[t.Right=39]="Right",t[t.Down=40]="Down",t[t.Esc=27]="Esc";let i;(t=i=u.kt||(u.kt={})).MouseDown="mousedown",t.Focus="focus",t.FocusIn="focusin",t.Blur="blur",t.KeyDown="keydown",t.KeyUp="keyup",t.KeyPress="keypress",t.TouchStart="touchstart",t.TouchMove="touchmove",t.AnimationEnd="animationend";class c{static ue(t){return t?(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t):null}static ce(t,e){t=new Date(t.getFullYear(),t.getMonth(),t.getDate()),e=(t.getDay()-e+7)%7,t.setDate(t.getDate()-e+3),e=new Date(t.getFullYear(),0,1),t=Math.round((t.getTime()-e.getTime())/864e5);return Math.floor(t/7)+1}static Ft(t,s,e,r){if(!s){if(e)return null;throw new Error(t+" cannot be empty.")}if(s instanceof u.Day)return s.getDate();if("string"==typeof s){if("today"===(s=s.trim())||"now"===s)return r.getToday();if("tomorrow"===s)return(o=r.getToday()).setDate(o.getDate()+1),o;if("yesterday"===s)return(o=r.getToday()).setDate(o.getDate()-1),o;let e=r.getToday(),i=s;var h=s.match(new RegExp("^\\s*([0-9]+).?\\s*("+c.fe.join("|")+")\\s*","i"));if(h){var n=parseInt(h[1],10);let t;for(t=0;t<c.fe.length;t++)if(h[2].toLowerCase()===c.fe[t]){e.setMonth(t),e.setDate(n);break}i=i.substring(h[0].length)}let t=!0;for(;i;){var a=i.match(/^\s*([+-]?)\s*([0-9]+)\s*(day|week|month|year)s?\s*/i);if(!a)break;switch(a[1]){case"+":t=!0;break;case"-":t=!1}var l=parseInt(a[2],10)*(t?1:-1);switch(a[3].toLowerCase()){case"day":case"days":e.setDate(e.getDate()+l);break;case"week":case"weeks":e.setDate(e.getDate()+7*l);break;case"month":case"months":e.setMonth(e.getMonth()+l);break;case"year":case"years":e.setFullYear(e.getFullYear()+l)}if(!(i=i.substring(a[0].length)))return e}if(e=c.ue(new Date(s)),!isNaN(e.getTime()))return e}else if(c.oe(s)){var o=c.ue(new Date(s.getTime()));if(!isNaN(o.getTime()))return o}throw new Error(t+" was expected to be a valid Date string or valid Date or TheDatepicker.Day"+(e?" or null.":"."))}static ut(t){return"object"==typeof t&&1===t.nodeType&&"object"==typeof t.style&&"object"==typeof t.ownerDocument}static oe(t){return"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t.getTime())}static de(e,i){for(let t=0;t<e.length;t++)if(e[t]===i)return!0;return!1}static Mt(e,i,s,r=!1){if(e.addEventListener){let t;return r&&c.we()&&(t={passive:!0}),e.addEventListener(i,s,t),()=>{e.removeEventListener(i,s)}}let t="on"+i,h=e[t]||null;return e[t]=t=>{t=t||window.event,h&&h.call(e,t),s(t)},()=>{e[t]=h}}static se(t){t.preventDefault?t.preventDefault():t.returnValue=!1}static ee(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}static v(t,e,i=!1){if(!i&&!e)return"";if("string"!=typeof e||i&&""===e)throw new Error(t+" was expected to be a"+(i?" non empty":"")+" string.");return e}static u(t,e,i=null,s=null){if("number"!=typeof(e="string"==typeof e?parseInt(e,10):e)||isNaN(e)||null!==i&&e<i||null!==s&&s<e)throw new Error(t+" was expected to be a valid number"+(null!==i?" from "+i:"")+(null!==s?" to "+s:"")+".");return e}static Vt(t,e,i=!0){if(i&&!e)return null;if("function"!=typeof e)throw new Error(t+" was expected to be a function"+(i?" or null":"")+".");return e}static i(e,t){if(window.console){for(let t=0;t<c.ve.length;t++)if(e===c.ve[0])return;window.console.warn("TheDatepicker: "+e+" is deprecated, use "+t.join(" or ")),c.ve.push(e)}}static pe(e,r){let h=null,n;c.Mt(e,i.TouchStart,t=>{h={x:t.touches[0].clientX,y:t.touches[0].clientY},n={x:e.offsetWidth/5,y:e.offsetHeight/5}},!0),c.Mt(e,i.TouchMove,e=>{if(h){var i=e.touches[0].clientX-h.x,s=e.touches[0].clientY-h.y;let t=null;Math.abs(i)>n.x?t=0<i?u.me.Right:u.me.Left:Math.abs(s)>n.x&&(t=0<s?u.me.Down:u.me.Up),t&&(r(e,t),h=null)}},!0)}static ge(){var t;return null===c.De&&(t=document.createElement("div"),c.De=""===t.style.animationName),c.De}static we(){if(null===c.be){let t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){return!(t=!0)}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}c.be=t}return c.be}static ne(){var t=window.matchMedia||window.msMatchMedia;return!!t&&!!(t=t("only all and (max-width: 37.5em)"))&&!!t.matches}}c.fe=["january","february","march","april","may","june","july","august","september","october","november","december"],c.ve=[],c.De=null,c.be=null,u.h=c})(TheDatepicker=TheDatepicker||{}),(r=>{class h{static zt(t,e){var i=document.createElement("div");return h.Qt(i,t,e),i}static Zt(e,t,i=r.ClassNameType.Button){var s=document.createElement("a");return h.Qt(s,i,t),s.href="#",s.onclick=t=>{t=t||window.event,r.h.se(t),e(t)},s.onkeydown=t=>{t=t||window.event,r.h.de([r.ie.Enter,r.ie.Space],t.keyCode)&&(r.h.se(t),e(t))},s}static qt(){return document.createElement("span")}static ye(t,e,i,s){var r=document.createElement("table");return h.Qt(r,i,s),t&&r.appendChild(t),r.appendChild(e),r}static _e(e,t,i){var s=document.createElement("thead"),r=(h.Qt(s,t,i),document.createElement("tr"));for(let t=0;t<e.length;t++)r.appendChild(e[t]);return s.appendChild(r),s}static Ce(t,e){var i=document.createElement("th");return i.scope="col",h.Qt(i,t,e),i}static Te(e,t,i){var s=document.createElement("tbody");h.Qt(s,t,i);for(let t=0;t<e.length;t++)s.appendChild(e[t]);return s}static Me(e,t){var i=document.createElement("tr");h.Qt(i,r.ClassNameType.TableRow,t);for(let t=0;t<e.length;t++)i.appendChild(e[t]);return i}static ke(){return document.createElement("td")}static Oe(e,i,t){let s=document.createElement("select");h.Qt(s,r.ClassNameType.SelectInput,t);for(let t=0;t<e.length;t++)s.appendChild(h.Se(e[t].value,e[t].label));return s.onchange=t=>{i(t||window.event,s.value)},s.onkeydown=t=>{t=t||window.event,r.h.ee(t)},s}static Se(t,e){var i=document.createElement("option");return i.value=t,i.innerText=e,i}static Qt(t,e,i){var s=i.classNames.getClassName(e);if(0!==s.length){let e=" "+t.className+" ";for(let t=0;t<s.length;t++){var r=i.Ae(s[t]);-1===e.indexOf(" "+r+" ")&&(e+=r+" ")}t.className=e.trim()}}static Ee(t,e,i){var s=i.classNames.getClassName(e);if(0!==s.length){let e=" "+t.className+" ";for(let t=0;t<s.length;t++)e=e.split(" "+i.Ae(s[t])+" ").join(" ");t.className=e.trim()}}static Be(t,e){e&&t.appendChild(e)}}r.Kt=h})(TheDatepicker=TheDatepicker||{}),(r=>{let e;var t;(t=e=r.Re||(r.Re={})).BeforeSelect="beforeSelect",t.Select="select",t.BeforeOpen="beforeOpen",t.Open="open",t.BeforeClose="beforeClose",t.Close="close",t.BeforeMonthChange="beforeMonthChange",t.MonthChange="monthChange",t.Focus="focus",t.BeforeFocus="beforeFocus";class i{}r.AvailableDateNotFoundException=i,r.Options=class s{constructor(t=null,e=null){this.Ye=!0,this.Fe=!0,this.Ie=null,this.He=null,this.xe=null,this.Le=null,this.We=!0,this.Ne=r.DayOfWeek.Monday,this.Pe=[],this.Ge=null,this.je=null,this.Ve=null,this.Je=null,this.Ue=[],this.ze=[],this.Ke="j. n. Y",this.Ze=!1,this.qe=!1,this.Qe=!1,this.Xe=!1,this.$e=!0,this.ti=!0,this.ei=!1,this.ii=!1,this.si=!0,this.ri=!0,this.hi=!1,this.ni=!0,this.ai=6,this.li=null,this.oi=!0,this.ui=!0,this.ci=!0,this.fi=!1,this.di=!0,this.wi=!0,this.vi="the-datepicker__",this.pi=!1,this.mi=!0,this.gi=!0,this.Di="",this.bi=200,this.yi=!0,this._i="&lt;",this.Ci="&gt;",this.Ti="&times;",this.Mi="&olarr;",this.ki="&times;",this.Oi=r.Position.BottomRight,this.Si=!0,this.Ai=!0,this.Ei=!1,this.Bi=!0,this.Ri=null,this.Yi={beforeSelect:[],select:[],beforeOpen:[],open:[],beforeClose:[],close:[],beforeMonthChange:[],monthChange:[],beforeFocus:[],focus:[]},this.translator=t||new r.Translator,this.classNames=e||new r.ClassNames}clone(){var t=new s(this.translator.clone(),this.classNames.clone());return t.Ye=this.Ye,t.Fe=this.Fe,t.Ie=this.Ie,t.He=this.He,t.xe=this.xe,t.Le=this.Le,t.We=this.We,t.Ne=this.Ne,t.Pe=this.Pe.slice(0),t.Ge=this.Ge,t.je=this.je,t.Ve=this.Ve,t.Je=this.Je,t.Ue=this.Ue.slice(0),t.ze=this.ze.slice(0),t.Ke=this.Ke,t.Ze=this.Ze,t.qe=this.qe,t.Qe=this.Qe,t.Xe=this.Xe,t.$e=this.$e,t.ti=this.ti,t.ei=this.ei,t.ii=this.ii,t.si=this.si,t.ri=this.ri,t.hi=this.hi,t.ni=this.ni,t.ai=this.ai,t.li=this.li,t.oi=this.oi,t.ci=this.ci,t.fi=this.fi,t.di=this.di,t.wi=this.wi,t.vi=this.vi,t.pi=this.pi,t.mi=this.mi,t.gi=this.gi,t.Di=this.Di,t.bi=this.bi,t.yi=this.yi,t._i=this._i,t.Ci=this.Ci,t.Ti=this.Ti,t.Mi=this.Mi,t.ki=this.ki,t.Oi=this.Oi,t.Si=this.Si,t.Ai=this.Ai,t.Ei=this.Ei,t.Bi=this.Bi,t.Yi.beforeSelect=this.Yi.beforeSelect.slice(0),t.Yi.select=this.Yi.select.slice(0),t.Yi.beforeOpen=this.Yi.beforeOpen.slice(0),t.Yi.open=this.Yi.open.slice(0),t.Yi.beforeClose=this.Yi.beforeClose.slice(0),t.Yi.close=this.Yi.close.slice(0),t.Yi.beforeMonthChange=this.Yi.beforeMonthChange.slice(0),t.Yi.monthChange=this.Yi.monthChange.slice(0),t.Yi.beforeFocus=this.Yi.beforeFocus.slice(0),t.Yi.focus=this.Yi.focus.slice(0),t}setHideOnBlur(t){this.Ye=!!t}setHideOnSelect(t){this.Fe=!!t}setMinDate(t){t=r.h.Ft("Min date",t,!0,this),this.Fi(t,this.He),this.Ie=t}setMaxDate(t){t=r.h.Ft("Max date",t,!0,this),this.Fi(this.Ie,t),this.He=t}setInitialMonth(t){this.Le=r.h.Ft("Initial month",t,!0,this)}setInitialDate(t){this.xe=r.h.Ft("Initial date",t,!0,this)}setInitialDatePriority(t){this.We=!!t}setFirstDayOfWeek(t){this.Ne=r.h.u("First day of week",t,0,6)}setDateAvailabilityResolver(t){r.h.i("setDateAvailabilityResolver",["addDateAvailabilityResolver"]),this.removeDateAvailabilityResolver(),t&&this.addDateAvailabilityResolver(t)}addDateAvailabilityResolver(t){this.Pe.push(r.h.Vt("Resolver",t,!1))}removeDateAvailabilityResolver(t=null){this.Ii(this.Pe,"Resolver",t)}setCellContentResolver(t){this.Ge=r.h.Vt("Resolver",t)}setCellContentStructureResolver(t,e=null){t=r.h.Vt("Resolver (init)",t),e=r.h.Vt("Resolver (update)",e),this.je=t?{init:t,update:e}:null}setHeaderStructureResolver(t){this.Ve=r.h.Vt("Resolver",t)}setFooterStructureResolver(t){this.Je=r.h.Vt("Resolver",t)}addCellClassesResolver(t){this.Ue.push(r.h.Vt("Resolver",t,!1))}removeCellClassesResolver(t=null){this.Ii(this.Ue,"Resolver",t)}addDayModifier(t){this.ze.push(r.h.Vt("Modifier",t,!1))}removeDayModifier(t=null){this.Ii(this.ze,"Modifier",t)}setInputFormat(t){this.Ke=r.h.v("Input format",t,!0)}setAllowInputAnyChar(t){this.Ze=!!t}setDaysOutOfMonthVisible(t){this.qe=!!t}setFixedRowsCount(t){this.Qe=!!t}setToggleSelection(t){this.Xe=!!t}setShowDeselectButton(t){this.ti=!!t}setAllowEmpty(t){this.$e=!!t}setShowResetButton(t){this.ei=!!t}setShowWeekNumbers(t){this.ii=!!t}setMonthAsDropdown(t){this.si=!!t}setYearAsDropdown(t){this.ri=!!t}setBindSelectedDateWithMonth(t){this.hi=!!t}setYearSelectedFromTableOfYears(t){this.ni=!!t}setTableOfYearsRowsCount(t){this.ai=r.h.u("Rows count",t,1)}setTableOfYearsAlign(t){this.li=t?r.h.u("Align",t,1,3):null}setTableOfYearsOnSwipeDown(t){this.oi=!!t}setYearsOutOfTableOfYearsVisible(t){this.ui=!!t}setMonthAndYearSeparated(t){this.ci=!!t}setMonthShort(t){this.fi=!!t}setChangeMonthOnSwipe(t){this.di=!!t}setAnimateMonthChange(t){r.h.i("setAnimateMonthChange",["setSlideAnimation"]),this.setSlideAnimation(t)}setSlideAnimation(t){this.wi=!!t}setClassesPrefix(t){this.vi=r.h.v("Prefix",t)}setDarkMode(t){this.pi=!!t}setShowCloseButton(t){this.mi=!!t}setCloseOnEscPress(t){this.gi=!!t}setTitle(t){this.Di=r.h.v("Title",t)}setDropdownItemsLimit(t){this.bi=r.h.u("Items limit",t,1)}setHideDropdownWithOneItem(t){this.yi=!!t}setGoBackHtml(t){this._i=r.h.v("Html",t)}setGoForwardHtml(t){this.Ci=r.h.v("Html",t)}setCloseHtml(t){this.Ti=r.h.v("Html",t)}setResetHtml(t){this.Mi=r.h.v("Html",t)}setDeselectHtml(t){this.ki=r.h.v("Html",t)}setPosition(t){this.Oi=r.h.u("Position",t,1,4)}setPositionFixing(t){this.Si=!!t}setFullScreenOnMobile(t){this.Ai=!!t}setKeyboardOnMobile(t){this.Ei=!!t}setIncludeAria(t){this.Bi=!!t}setToday(t){this.Ri=r.h.Ft("Today",t,!0,this)}onBeforeSelect(t){this.Hi(e.BeforeSelect,t)}offBeforeSelect(t=null){this.xi(e.BeforeSelect,t)}onSelect(t){this.Hi(e.Select,t)}offSelect(t=null){this.xi(e.Select,t)}onBeforeOpen(t){this.Hi(e.BeforeOpen,t)}offBeforeOpen(t=null){this.xi(e.BeforeOpen,t)}onOpen(t){this.Hi(e.Open,t)}offOpen(t=null){this.xi(e.Open,t)}onBeforeClose(t){this.Hi(e.BeforeClose,t)}offBeforeClose(t=null){this.xi(e.BeforeClose,t)}onClose(t){this.Hi(e.Close,t)}offClose(t=null){this.xi(e.Close,t)}onBeforeOpenAndClose(t){r.h.i("onBeforeOpenAndClose",["onBeforeOpen","onBeforeClose"]),this.onBeforeOpen(t),this.onBeforeClose(t)}offBeforeOpenAndClose(t=null){r.h.i("offBeforeOpenAndClose",["offBeforeOpen","offBeforeClose"]),this.offBeforeOpen(t),this.offBeforeClose(t)}onOpenAndClose(t){r.h.i("onOpenAndClose",["onOpen","onClose"]),this.onOpen(t),this.onClose(t)}offOpenAndClose(t=null){r.h.i("offOpenAndClose",["offOpen","offClose"]),this.offOpen(t),this.offClose(t)}onBeforeMonthChange(t){this.Hi(e.BeforeMonthChange,t)}offBeforeMonthChange(t=null){this.xi(e.BeforeMonthChange,t)}onMonthChange(t){this.Hi(e.MonthChange,t)}offMonthChange(t=null){this.xi(e.MonthChange,t)}onBeforeFocus(t){this.Hi(e.BeforeFocus,t)}offBeforeFocus(t=null){this.xi(e.BeforeFocus,t)}onFocus(t){this.Hi(e.Focus,t)}offFocus(t=null){this.xi(e.Focus,t)}getInitialMonth(){var t=this.We?this.xe:this.Le,e=this.We?this.Le:this.xe;return(t=t?new Date(t.getTime()):e?new Date(e.getTime()):this.getToday()).setDate(1),this.correctMonth(t)}isMonthInValidity(t){return!this.Li(t)}correctMonth(t){return this.Li(t)||t}getInitialDate(){return this.findPossibleAvailableDate(this.xe)}findPossibleAvailableDate(t){if(this.isAllowedEmpty())return t&&this.isDateInValidity(t)&&this.isDateAvailable(t)?new Date(t.getTime()):null;if(t=t?new Date(t.getTime()):this.getToday(),t=this.findNearestAvailableDate(t))return t;throw new i}findNearestAvailableDate(t){return this.Wi(t)}Wi(t,e=null,i=null){t=this.Ni(t);var s=this.K().getTime(),r=this.Z().getTime(),h=e?Math.max(s,e.getTime()):s,n=i?Math.min(r,i.getTime()):r;if(this.isDateAvailable(t))return h<=(e=t.getTime())&&e<=n?t:null;let a=1e3,l=t,o=new Date(t.getTime());do{if(l)if(l.setDate(l.getDate()+1),l.getTime()>n)l=null;else if(this.isDateAvailable(l))return l;if(o)if(o.setDate(o.getDate()-1),o.getTime()<h)o=null;else if(this.isDateAvailable(o))return o}while(a--,(l||o)&&0<a);return null}isDateInValidity(t){return!this.Pi(t)}Ni(t){return this.Pi(t)||t}getFirstDayOfWeek(){return this.Ne}areDaysOutOfMonthVisible(){return this.qe}hasFixedRowsCount(){return this.Qe}hasToggleSelection(){return this.$e&&this.Xe}isAllowedEmpty(){return this.$e}isDeselectButtonShown(){return this.$e&&this.ti}isResetButtonShown(){return this.ei}areWeekNumbersShown(){return this.ii}isMonthAsDropdown(){return this.si}isYearAsDropdown(){return this.ri}isYearSelectedFromTableOfYears(){return this.ri&&this.ni}isSelectedDateBoundWithMonth(){return this.hi}getTableOfYearsRowsCount(){return this.ai}getTableOfYearsColumnsCount(){return 4}getTableOfYearsAlign(){return this.li}isTableOfYearsOnSwipeDownEnabled(){return this.oi}areYearsOutOfTableOfYearsVisible(){return this.ui}isMonthAndYearSeparated(){return this.isYearSelectedFromTableOfYears()||this.ci}isMonthShort(){return this.fi}isMonthChangeOnSwipeEnabled(){return this.di}isMonthChangeAnimated(){return r.h.i("isMonthChangeAnimated",["isSlideAnimationEnabled"]),this.isSlideAnimationEnabled()}isSlideAnimationEnabled(){return this.wi}getClassesPrefix(){return this.vi}isDarkModeEnabled(){return this.pi}isCloseButtonShown(){return this.Ye&&this.mi}isClosedOnEscPress(){return this.Ye&&this.gi}getTitle(){return this.Di}getMinDate(){return this.Ie?new Date(this.Ie.getTime()):null}getMaxDate(){return this.He?new Date(this.He.getTime()):null}K(){var t=this.getMinDate();return t||new Date(-271821,4,1)}Z(){var t=this.getMaxDate();return t||new Date(275760,7,31)}getMinMonth(){var t;return this.Ie?((t=new Date(this.Ie.getTime())).setDate(1),t):null}getMaxMonth(){var t;return this.He?((t=new Date(this.He.getTime())).setDate(1),t):null}Gi(){let t=this.getMinMonth();return t=t||this.K()}ji(){let t=this.getMaxMonth();return t||(t=this.Z()).setDate(1),t}isDropdownWithOneItemHidden(){return this.yi}getDropdownItemsLimit(){return this.bi}isDateAvailable(e){var i=this.Pe.slice(0);for(let t=0;t<i.length;t++)if(!i[t](new Date(e.getTime())))return!1;return!0}getCellContent(t){return this.Ge?this.Ge(t):t.dayNumber+""}Ae(t){return this.vi+t}Vi(){return this.je?this.je.init():r.Kt.qt()}Ji(t,e){this.je?this.je.update(t,e):t.innerText=this.getCellContent(e)}Ui(){return this.Ve?this.Ve():null}zi(){return this.Je?this.Je():null}getCellClasses(e){let i=[];var s=this.Ue.slice(0);for(let t=0;t<s.length;t++){var r=s[t](e);"string"==typeof r?i.push(r):"object"==typeof r&&r.constructor===Array&&(i=i.concat(r))}return i}modifyDay(e){var i=this.ze.slice(0);for(let t=0;t<i.length;t++)i[t](e)}getGoBackHtml(){return this._i}getGoForwardHtml(){return this.Ci}getCloseHtml(){return this.Ti}getResetHtml(){return this.Mi}getDeselectHtml(){return this.ki}isHiddenOnBlur(){return this.Ye}isHiddenOnSelect(){return this.Ye&&this.Fe}getInputFormat(){return this.Ke}isAllowedInputAnyChar(){return this.Ze}getPosition(){return this.Oi}isPositionFixingEnabled(){return this.Ye&&this.Si}isFullScreenOnMobile(){return this.Ye&&this.Ai}isKeyboardOnMobile(){return this.Ei}isAriaIncluded(){return this.Bi}getToday(){return this.Ri?new Date(this.Ri.getTime()):r.h.ue(new Date)}getDateAvailabilityResolver(){return r.h.i("getDateAvailabilityResolver",["getDateAvailabilityResolvers"]),0<this.Pe.length?this.Pe[0]:null}getDateAvailabilityResolvers(){return this.Pe.slice(0)}getCellContentResolver(){return this.Ge}getCellContentStructureResolver(){return this.je}getHeaderStructureResolver(){return this.Ve}getFooterStructureResolver(){return this.Je}getCellClassesResolvers(){return this.Ue.slice(0)}getDayModifiers(){return this.ze.slice(0)}getBeforeSelectListeners(){return this.Yi.beforeSelect.slice(0)}getSelectListeners(){return this.Yi.select.slice(0)}getBeforeOpenListeners(){return this.Yi.beforeOpen.slice(0)}getOpenListeners(){return this.Yi.open.slice(0)}getBeforeCloseListeners(){return this.Yi.beforeClose.slice(0)}getCloseListeners(){return this.Yi.close.slice(0)}getBeforeOpenAndCloseListeners(){return r.h.i("getBeforeOpenAndCloseListeners",["getBeforeOpenListeners","getBeforeCloseListeners"]),this.Yi.beforeOpen.concat(this.Yi.beforeClose)}getOpenAndCloseListeners(){return r.h.i("getOpenAndCloseListeners",["getOpenListeners","getCloseListeners"]),this.Yi.open.concat(this.Yi.close)}getBeforeMonthChangeListeners(){return this.Yi.beforeMonthChange.slice(0)}getMonthChangeListeners(){return this.Yi.monthChange.slice(0)}getBeforeFocusListeners(){return this.Yi.beforeFocus.slice(0)}getFocusListeners(){return this.Yi.focus.slice(0)}Fi(t,e){if(t&&e&&t.getTime()>e.getTime())throw new Error("Min date cannot be higher then max date.")}Li(t){var e=this.Gi();return t.getTime()<e.getTime()||(e=this.ji(),t.getTime()>e.getTime())?e:null}Pi(t){var e=this.K();return t.getTime()<e.getTime()||(e=this.Z(),t.getTime()>e.getTime())?e:null}Ii(e,t,i){if(i=r.h.Vt(t,i)){var s=e.slice(0);for(let t=s.length-1;0<=t;t--)s[t]===i&&e.splice(t,1)}else e.splice(0,e.length)}Hi(t,e){this.Yi[t].push(r.h.Vt("Event listener",e,!1))}xi(e,i){if(i=r.h.Vt("Event listener",i)){var s=[];for(let t=0;t<this.Yi[e].length;t++)this.Yi[e][t]!==i&&s.push(this.Yi[e][t]);this.Yi[e]=s}else this.Yi[e]=[]}Ki(t,e){var i=this.Yi[t].slice(0);for(let t=0;t<i.length;t++)if(!1===e(i[t]))return!1;return!0}}})(TheDatepicker=TheDatepicker||{}),(o=>{o.Zi=class{constructor(t){this.yearNumber=t,this.isAvailable=!0,this.isSelected=!1,this.isHighlighted=!1,this.isFocused=!1}},o.qi=class{constructor(t,e,i){this.Qi=t,this.Xi=e,this.$i=i,this.ts=null,this.es=null,this.ss=null,this.rs=null,this.hs=null,this.ns=null,this.ls=null,this.os=null,this.us=null,this.cs=null,this.fs=null,this.ds=null,this.ws=null,this.vs=null,this.ps=null,this.gs=null,this.Ds=null,this.bs=null,this.ys=null,this._s=null,this.Cs=[],this.Ts=[],this.Ms=[],this.ks=[],this.Os=[],this.Ss=[],this.As=[],this.Es=[],this.Bs=null}Ot(t){if(!this.ts){if(this.$i&&this.Qi.isHiddenOnBlur()&&!t.Et())return;this.Xi.innerHTML="",this.Xi.appendChild(this.Rs(t))}this.Ys(t),this.Fs(t),this.Is(t),this.Hs(t),this.xs(t),this.Ls(t),this.Ws(t,!1),this.Ws(t,!0),this.Ns(t),this.Ps(t),this.Gs(t),this.js(t),this.Vs(t)}Rs(t){var e=o.Kt.zt(o.ClassNameType.Main,this.Qi);return o.Kt.Be(e,this.Qi.Ui()),e.appendChild(this.Js(t)),e.appendChild(this.Us(t)),o.Kt.Be(e,this.Qi.zi()),this.ts=e}Ys(t){this.ts.style.display=this.$i&&!t.Et()&&this.Qi.isHiddenOnBlur()?"none":"",this.ts.className="",o.Kt.Qt(this.ts,o.ClassNameType.Main,this.Qi),this.Qi.isDarkModeEnabled()&&o.Kt.Qt(this.ts,o.ClassNameType.MainDarkMode,this.Qi)}Fs(t){this.rs.style.display=t.zs?"none":"",this.hs&&(this.hs.style.display=t.zs?"":"none")}Us(r){var t=o.Kt.zt(o.ClassNameType.Body,this.Qi),e=o.Kt.zt(o.ClassNameType.Tables,this.Qi),i=(t.appendChild(e),(this.Qi.isMonthChangeOnSwipeEnabled()||this.Qi.isTableOfYearsOnSwipeDownEnabled())&&(o.Kt.Qt(t,o.ClassNameType.BodySwipeable,this.Qi),o.h.pe(t,(t,e)=>{let i=!1,s=null;switch(e){case o.me.Down:i=!0;case o.me.Up:this.hs&&this.Qi.isTableOfYearsOnSwipeDownEnabled()&&r.Ks(i)&&(s=()=>{r.Zs(i)});break;case o.me.Left:i=!0;case o.me.Right:this.Qi.isMonthChangeOnSwipeEnabled()&&r.qs(i)&&(s=()=>{r.Qs(t,i)})}s&&this.Xs(r,e,s)})),this.$s(r));return e.appendChild(i),this.rs=i,this.Qi.isYearSelectedFromTableOfYears()&&(i=this.tr(r),e.appendChild(i),this.hs=i),this.es=t,this.ss=e,t}Js(t){var e=o.Kt.zt(o.ClassNameType.Header,this.Qi),i=o.Kt.zt(o.ClassNameType.HeaderTop,this.Qi),s=(e.appendChild(i),i.appendChild(this.er(t)),o.Kt.zt(o.ClassNameType.HeaderControl,this.Qi)),i=(i.appendChild(s),s.appendChild(this.ir(t)),s.appendChild(this.sr(t)),o.Kt.zt(o.ClassNameType.HeaderNavigation,this.Qi)),r=(e.appendChild(i),i.appendChild(this.rr(t,!1)),o.Kt.zt(o.ClassNameType.HeaderState,this.Qi));return i.appendChild(r),this.Qi.isMonthAndYearSeparated()?(r.appendChild(this.hr(t)),r.appendChild(this.nr(t))):r.appendChild(this.ar(t)),i.appendChild(this.rr(t,!0)),this.ns=s,e}Is(t){var e=""!==this.Qi.getTitle()||this.Qi.isResetButtonShown()||this.$i&&this.Qi.isCloseButtonShown();this.ns.style.display=e?"":"none",this.us.style.display=e?"":"none"}er(t){var e=o.Kt.zt(o.ClassNameType.HeaderTitle,this.Qi),i=o.Kt.qt();return e.appendChild(i),o.Kt.Qt(i,o.ClassNameType.HeaderTitleContent,this.Qi),this.us=e,this.cs=i,e}Hs(t){var e=this.Qi.getTitle();this.cs.style.display=""!==e?"":"none",this.cs.innerText=e}ir(e){var t=o.Kt.zt(o.ClassNameType.Reset,this.Qi),i=o.Kt.Zt(t=>{e.Bt(t)},this.Qi);return i.innerHTML=this.Qi.getResetHtml(),t.appendChild(i),this.ds=i,this.fs=t}Ls(t){this.fs.style.display=this.Qi.isResetButtonShown()?"":"none",this.lr(this.ds,o.TitleName.Reset)}sr(e){var t=o.Kt.zt(o.ClassNameType.Close,this.Qi),i=o.Kt.Zt(t=>{e.ur(t)},this.Qi);return i.innerHTML=this.Qi.getCloseHtml(),t.appendChild(i),this.vs=i,this.ws=t}xs(t){this.ws.style.display=this.$i&&this.Qi.isCloseButtonShown()?"":"none",this.lr(this.vs,o.TitleName.Close)}rr(i,s){var t=o.Kt.zt(o.ClassNameType.Go,this.Qi),e=(o.Kt.Qt(t,s?o.ClassNameType.GoNext:o.ClassNameType.GoPrevious,this.Qi),o.Kt.Zt(t=>{var e=s?o.me.Left:o.me.Right;i.qs(s)&&this.Xs(i,e,()=>{i.Qs(t,s)})},this.Qi));return e.innerHTML=s?this.Qi.getGoForwardHtml():this.Qi.getGoBackHtml(),t.appendChild(e),s?this.os=e:this.ls=e,t}Ws(t,e){var i=e?this.os:this.ls;i.style.visibility=t.qs(e)?"visible":"hidden",this.lr(i,t.zs?e?o.TitleName.GoForwardTableOfYears:o.TitleName.GoBackTableOfYears:e?o.TitleName.GoForward:o.TitleName.GoBack)}hr(r){var e=[];for(let t=0;t<12;t++)e.push({value:t+"",label:this.cr(t)});var t=o.Kt.Oe(e,(t,e)=>{var i=r.Ht(),s=new Date(i.getTime());s.setMonth(parseInt(e,10)),r.xt(t,s)||(this.ps.value=i.getMonth()+"")},this.Qi),i=o.Kt.zt(o.ClassNameType.HeaderMonth,this.Qi),s=o.Kt.qt();return i.appendChild(t),i.appendChild(s),this.gs=s,this.ps=t,i}Ns(i){if(this.gs){var t=i.Ht().getMonth();if(this.gs.innerText=this.cr(t),this.lr(this.ps,o.TitleName.Month),this.Qi.isMonthAsDropdown()){let e=0;for(let t=0;t<12;t++){var s=new Date(i.Ht().getTime()),r=(s.setMonth(t),this.ps.getElementsByTagName("option")[t]),s=i.dr(s);r.disabled=!s,r.style.display=s?"":"none",e+=s?1:0}this.ps.value=t+"";t=!this.Qi.isDropdownWithOneItemHidden()||1<e;this.ps.style.display=t?"":"none",this.gs.style.display=t?"none":""}else this.ps.style.display="none",this.gs.style.display=""}}nr(h){var t=o.Kt.zt(o.ClassNameType.HeaderYear,this.Qi);let e;this.Qi.isYearSelectedFromTableOfYears()?(e=o.Kt.Zt(()=>{this.Xs(h,h.zs?o.me.Up:o.me.Down,()=>{h.Zs(!h.zs)})},this.Qi),o.Kt.Qt(e,o.ClassNameType.HeaderYearsToggle,this.Qi)):e=o.Kt.Oe([],(t,e)=>{var i=h.Ht();let s=new Date(i.getTime());s.setFullYear(parseInt(e,10));var e=this.Qi.Gi(),r=this.Qi.ji();(s=s.getTime()<e.getTime()?e:s).getTime()>r.getTime()&&(s=r),h.xt(t,s)||(this.Ds.value=i.getFullYear()+"")},this.Qi);var i=o.Kt.qt();return t.appendChild(e),t.appendChild(i),this.bs=i,this.Ds=e,t}Ps(t){if(this.bs){var e=t.Ht().getFullYear(),i=(this.bs.innerText=e+"",this.lr(this.Ds,o.TitleName.Year),this.Qi.K().getFullYear()),s=this.Qi.Z().getFullYear();if(this.hs)this.Ds.innerText=e+"",t.wr&&(this.Ds.focus(),t.wr=!1);else{if(!this.Qi.isYearAsDropdown())return this.Ds.style.display="none",void(this.bs.style.display="");var t=this.vr(e,i,s),r=this.Ds.getElementsByTagName("option"),h=this.pr(r,t,t=>parseInt(t,10));for(let t=0;t<h.remove.length;t++)this.Ds.removeChild(h.remove[t]);for(let t=h.prepend.length-1;0<=t;t--)this.Ds.insertBefore(o.Kt.Se(h.prepend[t]+"",h.prepend[t]+""),this.Ds.firstChild);for(let t=0;t<h.append.length;t++)this.Ds.appendChild(o.Kt.Se(h.append[t]+"",h.append[t]+""));this.Ds.value=e+""}r=!this.Qi.isDropdownWithOneItemHidden()||i!==s;this.Ds.style.display=r?"":"none",this.bs.style.display=r?"none":""}}ar(r){var t=o.Kt.zt(o.ClassNameType.HeaderMonthYear,this.Qi),e=o.Kt.Oe([],(t,e)=>{var i=r.Ht(),s=new Date(i.getTime()),e=this.mr(e);s.setFullYear(e.year),s.setMonth(e.month),r.xt(t,s)||(this.ys.value=this.gr({month:i.getMonth(),year:i.getFullYear()}))},this.Qi),i=o.Kt.qt();return this._s=i,this.ys=e,t.appendChild(i),t.appendChild(e),t}Gs(t){if(this._s){var t=t.Ht(),t={month:t.getMonth(),year:t.getFullYear()},e=this.Dr(t);if(this._s.innerText=this.br(t),this.Qi.isYearAsDropdown()&&this.Qi.isMonthAsDropdown()){var i=this.Qi.K(),s=this.Qi.Z(),i=12*i.getFullYear()+i.getMonth(),s=12*s.getFullYear()+s.getMonth(),e=this.vr(e,i,s),i=this.ys.getElementsByTagName("option"),r=this.pr(i,e,t=>this.Dr(this.mr(t)));for(let t=0;t<r.remove.length;t++)this.ys.removeChild(r.remove[t]);for(let t=r.prepend.length-1;0<=t;t--){var h=this.yr(r.prepend[t]);this.ys.insertBefore(o.Kt.Se(this.gr(h),this.br(h)),this.ys.firstChild)}for(let t=0;t<r.append.length;t++){var n=this.yr(r.append[t]);this.ys.appendChild(o.Kt.Se(this.gr(n),this.br(n)))}this.ys.value=this.gr(t);s=!this.Qi.isDropdownWithOneItemHidden()||e.from<e.to;this.ys.style.display=s?"":"none",this._s.style.display=s?"none":""}else this.ys.style.display="none",this._s.style.display=""}}br(t){return this.cr(t.month)+" "+t.year}Dr(t){return 12*t.year+t.month}yr(t){return{year:Math.floor(t/12),month:t%12}}gr(t){return t.year+"-"+t.month}mr(t){t=t.split("-");return{month:parseInt(t[1],10),year:parseInt(t[0],10)}}vr(t,e,i){var s=this.Qi.getDropdownItemsLimit()-1,r=Math.ceil(s/2);let h=t-(s-r),n=t+r;return h<e?((n+=e-h)>i&&(n=i),h=e):n>i&&((h-=n-i)<e&&(h=e),n=i),{from:h,to:n}}pr(e,i,s){var r=0<e.length?s(e[0].value):null,h=0<e.length?s(e[e.length-1].value):null,n=[],a=[],l=[];for(let t=i.from;t<=i.to;t++)null===r||t<r?n.push(t):t>h&&a.push(t);for(let t=0;t<e.length;t++){var o=s(e[t].value);(o<i.from||o>i.to)&&l.push(e[t])}return{prepend:n,append:a,remove:l}}$s(t){var e=this._r(t),t=this.Cr(t),e=o.Kt.ye(e,t,o.ClassNameType.CalendarTable,this.Qi);return o.Kt.Qt(e,o.ClassNameType.Table,this.Qi),e}_r(e){var i=e.Tr(),s=[];this.Qi.areWeekNumbersShown()&&s.push(this.Mr());for(let t=0;t<i.length;t++){var r=i[t];s.push(this.kr(e,r))}return o.Kt._e(s,o.ClassNameType.CalendarTableHeader,this.Qi)}Mr(){var t=o.Kt.Ce(o.ClassNameType.CalendarTableHeaderWeekNumber,this.Qi);return t.innerText=this.Qi.translator.translateWeekNumber(),t}kr(t,e){var i=o.Kt.Ce(o.ClassNameType.CalendarTableHeaderCell,this.Qi);return e!==o.DayOfWeek.Saturday&&e!==o.DayOfWeek.Sunday||o.Kt.Qt(i,o.ClassNameType.WeekDayWeekend,this.Qi),i.innerText=this.Qi.translator.translateDayOfWeek(e),i}Cr(e){this.Ms=[],this.ks=[],this.Os=[],this.Ts=[];var i=[];for(let t=0;t<6;t++)i.push(this.Or(e));return this.Cs=i,o.Kt.Te(i,o.ClassNameType.CalendarTableBody,this.Qi)}js(s){if(!s.zs){var t=s.Sr();for(let i=0;i<this.Cs.length;i++){var r=this.Cs[i],h=t.length>i?t[i]:null;r.style.display=h?"":"none";let e=!1;if(h)for(let t=0;t<h.length;t++)if(h[t].isVisible){e=!0;break}if(e?o.Kt.Ee(r,o.ClassNameType.TableRowEmpty,this.Qi):o.Kt.Qt(r,o.ClassNameType.TableRowEmpty,this.Qi),h){this.Qi.areWeekNumbersShown()&&this.Ts.length>i&&(r=o.h.ce(h[0].getDate(),this.Qi.getFirstDayOfWeek()),this.Ts[i].innerText=e?String(r):"");for(let t=0;t<this.Ms[i].length;t++)this.Ar(s,this.Ms[i][t],this.ks[i][t],this.Os[i][t],h[t])}}}}Or(e){var i=[],s=[],r=[];for(let t=0;t<7;t++){var h=o.Kt.ke(),n=this.Er(e),a=this.Br(e);i.push(h),s.push(n),r.push(a),h.appendChild(n),n.appendChild(a)}this.Ms.push(i),this.ks.push(s),this.Os.push(r);var t,l=i.slice(0);return this.Qi.areWeekNumbersShown()&&(t=o.Kt.ke(),o.Kt.Qt(t,o.ClassNameType.WeekNumber,this.Qi),this.Ts.push(t),l.unshift(t)),o.Kt.Me(l,this.Qi)}Ar(t,e,i,s,r){if(i.day=r,e.setAttribute("data-date",r.getFormatted()),e.className="",o.Kt.Qt(e,o.ClassNameType.TableCell,this.Qi),this.Qi.Ji(s,r),r.isVisible){o.Kt.Qt(e,o.ClassNameType.Day,this.Qi),r.isToday&&o.Kt.Qt(e,o.ClassNameType.DayToday,this.Qi),r.isPast&&o.Kt.Qt(e,o.ClassNameType.DayPast,this.Qi),r.isWeekend&&o.Kt.Qt(e,o.ClassNameType.DayWeekend,this.Qi),r.isAvailable||(o.Kt.Qt(e,o.ClassNameType.TableCellUnavailable,this.Qi),o.Kt.Qt(e,o.ClassNameType.DayUnavailable,this.Qi)),r.isInCurrentMonth||o.Kt.Qt(e,o.ClassNameType.DayOutside,this.Qi),r.isHighlighted&&(o.Kt.Qt(e,o.ClassNameType.TableCellHighlighted,this.Qi),o.Kt.Qt(e,o.ClassNameType.DayHighlighted,this.Qi)),r.isSelected&&(o.Kt.Qt(e,o.ClassNameType.TableCellSelected,this.Qi),o.Kt.Qt(e,o.ClassNameType.DaySelected,this.Qi));var h=this.Qi.getCellClasses(r);for(let t=0;t<h.length;t++)e.className+=" "+h[t];i.style.visibility="visible",r.isAvailable?i.href="#":i.removeAttribute("href"),r.isFocused&&i.focus()}else i.removeAttribute("href"),i.style.visibility="hidden"}Er(s){let r=o.Kt.Zt(t=>{var e=s.It,i=s.Yt(t,r.day,!1,!0,!0);this.Qi.isHiddenOnSelect()&&(i||e&&r.day.isEqualToDate(e))&&s.ur(t)},this.Qi);return o.Kt.Qt(r,o.ClassNameType.DayButton,this.Qi),r.onfocus=t=>{s.Rr(t||window.event,r.day)},r.onmouseenter=t=>{0<this.Qi.getBeforeFocusListeners().length||0<this.Qi.getFocusListeners().length?s.Rr(t||window.event,r.day,!1,!1):s.Yr(t||window.event)},r.onmouseleave=t=>{s.Yr(t||window.event)},r}Br(t){var e=this.Qi.Vi();return o.Kt.Qt(e,o.ClassNameType.ButtonContent,this.Qi),o.Kt.Qt(e,o.ClassNameType.DayButtonContent,this.Qi),e}tr(t){t=this.Fr(t),t=o.Kt.ye(null,t,o.ClassNameType.YearsTable,this.Qi);return o.Kt.Qt(t,o.ClassNameType.Table,this.Qi),t}Fr(e){this.Ss=[],this.As=[],this.Es=[];var i=[];for(let t=0;t<this.Qi.getTableOfYearsRowsCount();t++)i.push(this.Ir(e));return o.Kt.Te(i,o.ClassNameType.YearsTableBody,this.Qi)}Vs(i){if(i.zs){var t=i.Hr();for(let e=0;e<this.Ss.length;e++){var s=t.length>e?t[e]:null;if(s)for(let t=0;t<this.Ss[e].length;t++)this.Lr(i,this.Ss[e][t],this.As[e][t],this.Es[e][t],s[t])}}}Lr(t,e,i,s,r){if(i.yearCellData=r,e.setAttribute("data-year",r.yearNumber+""),e.className="",o.Kt.Qt(e,o.ClassNameType.TableCell,this.Qi),s.innerText=r.yearNumber+"",r.isAvailable)i.href="#";else{if(i.removeAttribute("href"),!this.Qi.areYearsOutOfTableOfYearsVisible())return void(i.style.visibility="hidden");o.Kt.Qt(e,o.ClassNameType.TableCellUnavailable,this.Qi)}r.isHighlighted&&o.Kt.Qt(e,o.ClassNameType.TableCellHighlighted,this.Qi),r.isSelected&&o.Kt.Qt(e,o.ClassNameType.TableCellSelected,this.Qi),i.style.visibility="visible",r.isFocused&&i.focus()}Ir(e){var i=[],s=[],r=[];for(let t=0;t<this.Qi.getTableOfYearsColumnsCount();t++){var h=o.Kt.ke(),n=this.Wr(e),a=this.Nr(e);i.push(h),s.push(n),r.push(a),h.appendChild(n),n.appendChild(a)}return this.Ss.push(i),this.As.push(s),this.Es.push(r),o.Kt.Me(i,this.Qi)}Wr(s){let r=o.Kt.Zt(t=>{var e=new Date(r.yearCellData.yearNumber,s.Ht().getMonth(),1),i=this.Qi.correctMonth(e);i.getFullYear()===e.getFullYear()&&(s.xt(t,i),s.wr=!0,this.Xs(s,o.me.Up,()=>{s.Zs(!1)}))},this.Qi);return o.Kt.Qt(r,o.ClassNameType.YearCellButton,this.Qi),r.onfocus=()=>{s.Pr(r.yearCellData.yearNumber)},r.onmouseenter=()=>{s.Gr()},r.onmouseleave=()=>{s.Gr()},r}Nr(t){var e=o.Kt.qt();return o.Kt.Qt(e,o.ClassNameType.ButtonContent,this.Qi),o.Kt.Qt(e,o.ClassNameType.YearCellButtonContent,this.Qi),e}Xs(t,a,l){var e;this.Qi.isSlideAnimationEnabled()&&o.h.ge()?(e=()=>{let t,e;switch(a){case o.me.Left:t=o.ClassNameType.AnimateFadeOutLeft,e=o.ClassNameType.AnimateFadeInRight;break;case o.me.Up:t=o.ClassNameType.AnimateFadeOutUp,e=o.ClassNameType.AnimateFadeInDown;break;case o.me.Right:t=o.ClassNameType.AnimateFadeOutRight,e=o.ClassNameType.AnimateFadeInLeft;break;case o.me.Down:t=o.ClassNameType.AnimateFadeOutDown,e=o.ClassNameType.AnimateFadeInUp}let i=this.ss.className,s=t=>{o.Kt.Qt(this.ss,o.ClassNameType.Animated,this.Qi),o.Kt.Qt(this.ss,t,this.Qi)},r=()=>{0<this.Bs.length?this.Bs.shift()():this.Bs=null},h,n=window.setTimeout(()=>{h(),l(),r()},150);h=o.h.Mt(this.ss,o.kt.AnimationEnd,()=>{window.clearTimeout(n),l(),h(),this.ss.className=i,s(e),h=o.h.Mt(this.ss,o.kt.AnimationEnd,()=>{h(),this.ss.className=i,r()})}),s(t)},this.Bs?this.Bs.push(e):(this.Bs=[],e())):l()}cr(t){return this.Qi.isMonthShort()?this.Qi.translator.translateMonthShort(t):this.Qi.translator.translateMonth(t)}lr(t,e){e=this.Qi.translator.translateTitle(e);""!==e?(t.title=e,this.Qi.isAriaIncluded()&&t.setAttribute("aria-label",e)):(t.removeAttribute("title"),t.removeAttribute("aria-label"))}}})(TheDatepicker=TheDatepicker||{}),(i=>{var t;(t=i.TitleName||(i.TitleName={}))[t.GoBack=0]="GoBack",t[t.GoForward=1]="GoForward",t[t.Close=2]="Close",t[t.Reset=3]="Reset",t[t.Deselect=4]="Deselect",t[t.Month=5]="Month",t[t.Year=6]="Year",t[t.GoBackTableOfYears=7]="GoBackTableOfYears",t[t.GoForwardTableOfYears=8]="GoForwardTableOfYears",i.Translator=class s{constructor(){this.X=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.q=["Su","Mo","Tu","We","Th","Fr","Sa"],this.$=["January","February","March","April","May","June","July","August","September","October","November","December"],this.tt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.jr="Wk",this.Vr=["Go to previous month","Go to next month","Close calendar","Reset calendar","Deselect date","Month selection","Year selection","Show earlier years","Show later years"]}clone(){var t=new s;let e;for(e=0;e<this.X.length;e++)t.X=this.X.slice(0);for(e=0;e<this.q.length;e++)t.q=this.q.slice(0);for(e=0;e<this.$.length;e++)t.$=this.$.slice(0);for(e=0;e<this.tt.length;e++)t.tt=this.tt.slice(0);for(e=0;e<this.Vr.length;e++)t.Vr=this.Vr.slice(0);return t.jr=this.jr,t}setDayOfWeekTranslation(t,e){this.q[i.h.u("Day of week",t,0,6)]=i.h.v("Translation",e,!0)}setDayOfWeekFullTranslation(t,e){this.X[i.h.u("Day of week",t,0,6)]=i.h.v("Translation",e,!0)}setMonthTranslation(t,e){this.$[i.h.u("Month",t,0,11)]=i.h.v("Translation",e,!0)}setMonthShortTranslation(t,e){this.tt[i.h.u("Month",t,0,11)]=i.h.v("Translation",e,!0)}setTitleTranslation(t,e){this.Vr[i.h.u("Title",t,0,this.Vr.length-1)]=i.h.v("Translation",e)}setWeekNumberTranslation(t){this.jr=i.h.v("Translation",t)}translateDayOfWeek(t){return this.q[t]}translateDayOfWeekFull(t){return this.X[t]}translateMonth(t){return this.$[t]}translateMonthShort(t){return this.tt[t]}translateTitle(t){return this.Vr[t]}translateWeekNumber(){return this.jr}}})(TheDatepicker=TheDatepicker||{}),(u=>{let n;var t;(t=n=u.me||(u.me={}))[t.Left=1]="Left",t[t.Up=2]="Up",t[t.Right=3]="Right",t[t.Down=4]="Down";class c{constructor(t,e,i,s){this.cellsCount=t,this.lowestYear=e,this.maxPage=i,this.page=s,this.highlightedYear=null,this.isHighlightedYearFocused=!1,this.initialPage=s}getPage(){return this.page}canShiftPage(t){t=this.page+t;return 0<=t&&t<=this.maxPage}shiftPage(t){return!!this.canShiftPage(t)&&(this.page+=t,!0)}getFirstYear(){return this.lowestYear+this.page*this.cellsCount}getLastYear(){return this.lowestYear+this.page*this.cellsCount+this.cellsCount-1}highlightYear(t,e=!0){return!(!this||t===this.highlightedYear||(this.highlightedYear=t,e&&(this.isHighlightedYearFocused=!0),t<this.getFirstYear()&&this.shiftPage(-1),t>this.getLastYear()&&this.shiftPage(1),0))}cancelHighlight(){return!!this.highlightedYear&&!(this.highlightedYear=null)}}u.vt=class{constructor(t,e){this.Qi=t,this.Jr=e,this.It=null,this.zs=null,this.wr=!1,this.Ur=null,this.Le=null,this.zr=null,this.Kr=null,this.Zr=null,this.qr=!1,this.Qr=!1,this.Xr=new u.qi(this.Qi,e.container,!!e.input)}Ot(){var t;this.Jr.isDestroyed()||this.yt()||(t=this.Qi.correctMonth(this.Ht()),this.xt(null,t))||(this.Ur||(this.Ur={rowsCount:this.Qi.getTableOfYearsRowsCount(),columnsCount:this.Qi.getTableOfYearsColumnsCount()}),this.Xr.Ot(this),this.Jr._t())}le(t,e){if(this.Qr!==e){if(e&&!this.$r(t)||!e&&!this.th(t))return!1;(!(this.Qr=e)&&!this.Zs(!1)||e)&&this.Qi.isHiddenOnBlur()&&this.Ot(),e?this.eh(t):this.ih(t)}return!0}Et(){return this.Qr}ur(t){return this.Jr.close(t)}Ht(){return this.zr||this.sh(this.rh()),this.zr}qs(t){var e,t=t?1:-1;return this.zs?this.zs.canShiftPage(t):((e=new Date(this.Ht().getTime())).setMonth(e.getMonth()+t),this.dr(e))}dr(t){return!!u.h.oe(t)&&this.Qi.isMonthInValidity(t)}Qs(t,e){var i,e=e?1:-1;if(!this.zs)return(i=new Date(this.Ht().getTime())).setMonth(i.getMonth()+e),this.xt(t,i);this.zs.shiftPage(e)&&this.Ot()}xt(t,e,i=!0){return(e=u.h.ue(new Date(e.getTime()))).setDate(1),!(e.getTime()===this.Ht().getTime()||!this.dr(e)||!this.hh(t,e,this.zr)||(this.sh(e),i&&this.Yr(t)||this.Ot(),this.nh(t,e,this.zr),this.It&&this.Qi.isSelectedDateBoundWithMonth()&&(i=new Date(e.getFullYear(),e.getMonth()+1,0),e=this.Qi.Wi(new Date(e.getFullYear(),e.getMonth(),Math.min(this.It.getDate(),i.getDate())),e,i))&&this.Yt(t,e),0))}Bt(t){this.Le=null;var e=this.xt(t,this.rh()),t=this.Tt(t);return e||t}Yt(t,e,i=!0,s=!1,r=!1){if(!e)return this.Gt(t);let h;return e instanceof u.Day?e=(h=e).getDate():h=this.Lt(e),!!h.isAvailable&&(h.isEqualToDate(this.It)?!(!r||!this.Qi.hasToggleSelection())&&this.Gt(t):(r=this.It?this.Lt(this.It):null,!!this.ah(t,h,r)&&(this.It=h.getDate(),s&&this.Rr(t,h),(i=i||this.Qi.isSelectedDateBoundWithMonth())&&this.xt(t,e)||this.Ot(),this.lh(t,h,r),!0)))}Ks(t){return!!this.zs!==t&&(!t||this.Qi.K().getFullYear()!==this.Qi.Z().getFullYear())}Zs(t){return!!this.Ks(t)&&(this.zs=t?this.oh():null,this.Ot(),!0)}Pt(t,e){return this.Yt(t,this.Qi.findNearestAvailableDate(e))}yt(){try{return this.Yt(null,this.Qi.findPossibleAvailableDate(this.It),!1)}catch(t){if(t instanceof u.AvailableDateNotFoundException)return this.Gt(null,!0);throw t}}Tt(t){try{return this.Yt(t,this.Qi.getInitialDate(),!1)}catch(t){if(t instanceof u.AvailableDateNotFoundException)return this.Gt(null,!0);throw t}}Rr(t,e,i=!1,s=!0){if(!e.isAvailable)return!1;if(e.isEqualToDay(this.Zr))return!1;var r=this.Zr;if(!this.uh(t,e,r))return!1;this.Zr=e,s&&(this.qr=!0);s=e.getDate();return i&&this.xt(t,s,!1)||this.Ot(),this.fh(t,e,r),!0}dh(t){var e=this.Qi.Z();let i=this.Lt(new Date(this.Ht().getTime()));for(;!i.isAvailable;){var s=i.getSibling();if(1===s.dayNumber)break;if(s.getDate().getTime()>e.getTime())break;i=s}return this.Rr(t,i)}wh(t,e,i){let s;switch(i){case n.Left:s=-1;break;case n.Up:s=-7;break;case n.Right:s=1;break;case n.Down:s=7}let r=e,h=1e3;for(;(r=r.getSibling(s)).isInValidity&&(h--,!r.isAvailable)&&0<h;);return this.Rr(t,r,!0)}Gt(t,e=!1){return!(!this.Qi.isAllowedEmpty()&&!e||!this.It||(e=this.Lt(this.It),!this.ah(t,null,e))||(this.It=null,this.Ot(),this.lh(t,null,e),0))}Yr(t){var e;return!!this.Zr&&(e=this.Zr,!!this.uh(t,null,e))&&(this.Zr=null,this.Ot(),this.fh(t,null,e),!0)}Pr(t,e=!0){return!(!this.zs||!this.zs.highlightYear(t,e)||(this.Ot(),0))}ph(t,e){let i;switch(e){case n.Left:i=-1;break;case n.Up:i=-this.Ur.columnsCount;break;case n.Right:i=1;break;case n.Down:i=this.Ur.columnsCount}e=t+i;if(!(e<this.Qi.K().getFullYear()||e>this.Qi.Z().getFullYear()))return this.Pr(e,!0)}Gr(){return this.zs&&this.zs.cancelHighlight()&&this.Ot(),!0}Tr(){var e=[];for(let t=0;t<7;t++)e.push((this.Qi.getFirstDayOfWeek()+t)%7);return e}Sr(){var e=[],i=this.Ht(),s=this.mh();for(let t=0;t<s.prepend.length;t++){var r=this.Lt(s.prepend[t]);e.push(r)}var h=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();for(let t=1;t<=h;t++)e.push(this.Lt(new Date(i.getFullYear(),i.getMonth(),t)));for(let t=0;t<s.append.length;t++){var n=this.Lt(s.append[t]);e.push(n)}var a=[];for(let t=0;t<e.length;t+=7)a.push(e.slice(t,t+7));return this.qr=!1,a}Hr(){if(!this.zs)return[];var e=[],i=this.Qi.K().getFullYear(),s=this.Qi.Z().getFullYear(),r=this.Ht().getFullYear(),h=this.zs.getFirstYear();for(let t=h;t<=h+this.zs.cellsCount;t++){var n=new u.Zi(t);t>s||t<i?n.isAvailable=!1:(t===r&&(n.isSelected=!0),t===this.zs.highlightedYear&&(n.isHighlighted=!0,this.zs.isHighlightedYearFocused)&&(n.isFocused=!0)),e.push(n)}var a=[];for(let t=0;t<e.length;t+=this.Ur.columnsCount)a.push(e.slice(t,t+this.Ur.columnsCount));return this.zs.isHighlightedYearFocused,a}oh(){let t=this.Qi.getTableOfYearsAlign();var e=this.Qi.getMinDate(),i=this.Qi.getMaxDate(),s=this.rh().getFullYear();t=(t=t===u.Align.Left&&null===e||t===u.Align.Right&&null===i?null:t)||(e&&i?(o=s-e.getFullYear(),i.getFullYear()-s<o?u.Align.Right:u.Align.Left):e?u.Align.Left:i?u.Align.Right:u.Align.Center);let r;var h=this.Ur.rowsCount*this.Ur.columnsCount,n=this.Qi.K().getFullYear(),a=this.Qi.Z().getFullYear();switch(t){case u.Align.Left:r=n;break;case u.Align.Right:r=n-(h-(a-n)%h-1);break;case u.Align.Center:var l=Math.floor(this.Ur.rowsCount/2)*this.Ur.columnsCount+Math.floor(this.Ur.columnsCount/2);r=n-(h-(s+l-n)%h-1);break;default:throw new Error("Invalid align: "+t)}var o=this.Ht().getFullYear(),e=Math.floor((o-r)/h);return new c(h,r,Math.floor((a-r)/h),e)}te(t){var e;u.h.de([u.ie.Left,u.ie.Up,u.ie.Right,u.ie.Down],t.keyCode)?(u.h.se(t),e=this.gh(t.keyCode),this.zs?this.zs.highlightedYear?this.ph(this.zs.highlightedYear,e):this.zs.getPage()===this.zs.initialPage?this.ph(this.Ht().getFullYear(),e):this.Pr(0===this.zs.getPage()?this.zs.lowestYear:this.zs.getFirstYear()):this.Zr?this.wh(t,this.Zr,e):this.It&&this.It.getFullYear()===this.Ht().getFullYear()&&this.It.getMonth()===this.Ht().getMonth()?this.wh(t,this.Lt(this.It),e):this.dh(t)):t.keyCode===u.ie.Esc&&this.Qi.isClosedOnEscPress()&&(this.zs?(this.wr=!0,this.Zs(!1)):this.Jr.close(t))}Lt(e){e=u.h.ue(new Date(e.getTime()));var t=this.Qi.getToday(),i=this.Ht(),s=new u.Day(e,t=>this.Lt(t),(t,e=null)=>u.et.p(t,this.Qi,e));if(s.isToday=e.getTime()===t.getTime(),s.isPast=e.getTime()<t.getTime(),s.isInValidity=this.Qi.isDateInValidity(e),s.isAvailable=s.isInValidity&&this.Qi.isDateAvailable(e),s.isInCurrentMonth=e.getMonth()===i.getMonth(),s.isInCurrentMonth)s.isVisible=!0;else if(this.Qi.areDaysOutOfMonthVisible()){var t=this.mh(),r=t.prepend.concat(t.append);for(let t=0;t<r.length;t++)if(e.getTime()===r[t].getTime()){s.isVisible=!0;break}}return s.isAvailable&&(s.isEqualToDate(this.It)&&(s.isSelected=!0),s.isEqualToDay(this.Zr))&&(s.isHighlighted=!0,this.qr)&&(s.isFocused=!0),this.Qi.modifyDay(s),s}ah(e,i,s){return this.Qi.Ki(u.Re.BeforeSelect,t=>t.call(this.Jr,e,i,s))}lh(e,i,s){this.Qi.Ki(u.Re.Select,t=>t.call(this.Jr,e,i,s))}$r(e){return this.Qi.Ki(u.Re.BeforeOpen,t=>t.call(this.Jr,e,!0))}eh(e){this.Qi.Ki(u.Re.Open,t=>t.call(this.Jr,e,!0))}th(e){return this.Qi.Ki(u.Re.BeforeClose,t=>t.call(this.Jr,e,!1))}ih(e){this.Qi.Ki(u.Re.Close,t=>t.call(this.Jr,e,!1))}hh(e,i,s){return this.Qi.Ki(u.Re.BeforeMonthChange,t=>t.call(this.Jr,e,i,s))}nh(e,i,s){this.Qi.Ki(u.Re.MonthChange,t=>t.call(this.Jr,e,i,s))}uh(e,i,s){return this.Qi.Ki(u.Re.BeforeFocus,t=>t.call(this.Jr,e,i,s))}fh(e,i,s){this.Qi.Ki(u.Re.Focus,t=>t.call(this.Jr,e,i,s))}sh(t){this.zr=t,this.Kr=null}mh(){if(!this.Kr){var e=this.Ht(),t=this.Qi.getFirstDayOfWeek(),i=new Date(e.getFullYear(),e.getMonth(),1),s=new Date(e.getFullYear(),e.getMonth(),0).getDate(),r=(i.getDay()-t+7)%7,h=[];for(let t=s-r+1;t<=s;t++)h.push(new Date(e.getFullYear(),e.getMonth()-1,t));var i=new Date(e.getFullYear(),e.getMonth()+1,0),n=6-(i.getDay()-t+7)%7,a=[];for(let t=1;t<=n;t++)a.push(new Date(e.getFullYear(),e.getMonth()+1,t));if(this.Qi.hasFixedRowsCount()){var l=i.getDate();for(let t=1+n;r+l+a.length<42;t++)a.push(new Date(e.getFullYear(),e.getMonth()+1,t))}this.Kr={prepend:h,append:a}}return this.Kr}rh(){return this.Le||(this.Le=this.Qi.getInitialMonth()),this.Le}gh(t){switch(t){case u.ie.Left:return n.Left;case u.ie.Up:return n.Up;case u.ie.Right:return n.Right;case u.ie.Down:return n.Down;default:throw new Error("Invalid key code: "+t)}}}})(TheDatepicker=TheDatepicker||{});