@progress/kendo-dateinputs-common 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoDateinputsCommon=e():t.KendoDateinputsCommon=e()}(self,(()=>(()=>{"use strict";var t={644:(t,e,n)=>{n.r(e),n.d(e,{Day:()=>y,Direction:()=>r,MS_PER_DAY:()=>v,MS_PER_HOUR:()=>m,MS_PER_MINUTE:()=>g,ZonedDate:()=>ht,abbrTimezone:()=>J,addCenturies:()=>d,addDays:()=>o,addDecades:()=>p,addMonths:()=>u,addWeeks:()=>f,addYears:()=>c,adjustDST:()=>a,cloneDate:()=>i,createDate:()=>s,dayOfWeek:()=>D,durationInCenturies:()=>P,durationInDecades:()=>M,durationInMonths:()=>w,durationInYears:()=>_,firstDayInWeek:()=>O,firstDayOfMonth:()=>x,firstDecadeOfCentury:()=>E,firstMonthOfYear:()=>T,firstYearOfDecade:()=>S,getDate:()=>C,isEqual:()=>F,isEqualDate:()=>j,lastDayOfMonth:()=>l,lastDecadeOfCentury:()=>V,lastMonthOfYear:()=>k,lastYearOfDecade:()=>A,loadTimezone:()=>$,nextDayOfWeek:()=>N,offset:()=>Q,prevDayOfWeek:()=>U,timezoneGroupNames:()=>X,timezoneNames:()=>tt,timezoneTitle:()=>et,toLocalDate:()=>nt,weekInYear:()=>pt,zonesPerGroup:()=>ct});var r,i=function(t){return t?new Date(t.getTime()):null},a=function(t,e){var n=i(t);return 0===e&&23===n.getHours()&&n.setHours(n.getHours()+2),n},o=function(t,e){var n=i(t);return n.setDate(n.getDate()+e),a(n,t.getHours())},s=function(t,e,n,r,i,o,s){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0);var l=new Date(t,e,n,r,i,o,s);return t>-1&&t<100&&l.setFullYear(l.getFullYear()-1900),a(l,r)},l=function(t){var e=s(t.getFullYear(),t.getMonth()+1,1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return o(e,-1)},u=function(t,e){var n=i(t),r=(12+(n.getMonth()+e)%12)%12;return n.setMonth(n.getMonth()+e),function(t,e){return t.getMonth()!==e?l(u(t,-1)):t}(a(n,t.getHours()),r)},h=function(t,e){var n=t.getMonth(),r=s(e,n,t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getMonth()===n?r:l(u(r,-1))},c=function(t,e){return a(h(t,t.getFullYear()+e),t.getHours())},d=function(t,e){return c(t,100*e)},p=function(t,e){return c(t,10*e)},f=function(t,e){return o(t,7*e)},g=6e4,m=36e5,v=864e5;!function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"}(r||(r={}));var y,D=function(t,e,n){void 0===n&&(n=r.Forward);var o=i(t),s=(e-o.getDay()+7*n)%7;return o.setDate(o.getDate()+s),a(o,t.getHours())};!function(t){t[t.Sunday=0]="Sunday",t[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"}(y||(y={}));var b=function(t,e){return h(t,e(t.getFullYear()))},E=function(t){return b(t,(function(t){return t-t%100}))},P=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},S=function(t){return b(t,(function(t){return t-t%10}))},M=function(t,e){return(S(e).getFullYear()-S(t).getFullYear())/10},w=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},_=function(t,e){return e.getFullYear()-t.getFullYear()},O=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},x=function(t){return s(t.getFullYear(),t.getMonth(),1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},I=function(t,e){var n=t.getDate(),r=s(t.getFullYear(),e,n,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getDate()===n?r:l(u(r,-1))},T=function(t){return I(t,0)},C=function(t){return s(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0)},F=function(t,e){return!t&&!e||t&&e&&t.getTime()===e.getTime()},j=function(t,e){return!t&&!e||t&&e&&F(C(t),C(e))},V=function(t){return b(t,(function(t){return t-t%100+90}))},k=function(t){return I(t,11)},A=function(t){return b(t,(function(t){return t-t%10+9}))},N=function(t,e){return D(t,e,r.Forward)},U=function(t,e){return D(t,e,r.Backward)},L={rules:{},titles:{},zones:{}},Y={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},H={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},K=function(t,e,n){var r,i=e[3],a=e[4],o=e[5],s="u"===o[3]?6e4*-n:0;if(isNaN(a))if(0===a.indexOf("last")){r=new Date(Date.UTC(t,Y[i]+1,1,o[0]-24,o[1],o[2])+s);var l=H[a.substr(4,3)],u=r.getUTCDay();r.setUTCDate(r.getUTCDate()+l-u-(l>u?7:0))}else a.indexOf(">=")>=0&&(r=new Date(Date.UTC(t,Y[i],a.substr(5),o[0],o[1],o[2],0)+s),l=H[a.substr(0,3)],u=r.getUTCDay(),r.setUTCDate(r.getUTCDate()+l-u+(l<u?7:0)));else r=new Date(Date.UTC(t,Y[i],a,o[0],o[1],o[2])+s);return r},R=(new Date).getTime(),W=function(t,e,n){void 0===e&&(e=R),void 0===n&&(n=0);var r=L.rules[t];if(!r){var i=t.split(":"),a=0;return i.length>1&&(a=60*i[0]+Number(i[1])),[-1e6,"max","-","Jan",1,[0,0,0],a,"-"]}var o=new Date(e).getUTCFullYear();(r=r.filter((function(t){var e=t[0],n=t[1];return e<=o&&(n>=o||e===o&&"only"===n||"max"===n)}))).push(e),r.sort((function(t,e){return"number"!=typeof t&&(t=Number(K(o,t,n))),"number"!=typeof e&&(e=Number(K(o,e,n))),t-e}));var s=r[r.indexOf(e)-1]||r[r.length-1];return isNaN(s)?s:null},z="The required {0} timezone information is not provided!",B=/\{(\d+)}?\}/g,Z=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e.reduce((function(t,e){return t.concat(e)}),[]);return t.replace(B,(function(t,e){return r[parseInt(e,10)]}))},G=function(t,e){var n=e.getTime(),r=function(t,e){if(void 0===e&&(e=(new Date).getTime()),"Etc/UTC"===t||"Etc/GMT"===t)return[0,"-","UTC",null];for(var n=function(t){var e=L.zones;if(!e)throw new Error(Z(z,t));var n=e[t],r="string"==typeof n?e[n]:n;if(!r)throw new Error(Z(z,t));return r}(t),r=n.length-1;r>=0;r--){var i=n[r][3];if(i&&e>i)break}var a=n[r+1];if(!a)throw new Error(Z(z,t));return a}(t,n);return{rule:W(r[1],n,r[0]),zone:r}},q=function(t,e){return void 0===e&&(e=2),(t<0?"-":"")+new Array(e).concat([Math.abs(t)]).join("0").slice(-e)},J=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t)return"UTC";if("Etc/GMT"===t)return"GMT";if(""===t)return"";var n=G(t,e),r=n.zone,i=n.rule,a=r[2];if(a.indexOf("/")>=0)return a.split("/")[i&&+i[6]?1:0];if(a.indexOf("%s")>=0)return a.replace("%s",i&&"-"!==i[7]?i[7]:"");if(a.indexOf("%z")>=0){var o=-1*Math.trunc(r[0]/60),s=q(o,2),l=o>0?"+":"",u=Math.abs(Math.trunc(r[0]%60)),h=0===u?"":q(u,2);return a.replace("%z",""+l+s+h)}return a},$=function(t){if(!t)throw new Error(Z(z,""));var e=t.rules,n=t.titles,r=t.zones;if(void 0===e||void 0===r)throw new Error("The provided timezone information has invalid stucture!");Object.assign(L.rules,e),Object.assign(L.titles,n||{}),Object.assign(L.zones,r)},Q=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t||"Etc/GMT"===t)return 0;if(""===t)return e.getTimezoneOffset();var n=G(t,e),r=n.rule,i=n.zone;return parseFloat(r?i[0]-r[6]:i[0])},X=function(){var t=Object.keys(L.titles).reduce((function(t,e){var n=L.titles[e].group;return t[n]=n,t}),{});return Object.keys(t)},tt=function(){return Object.keys(L.zones)},et=function(t){return(L.titles[t]||{}).long||t};function nt(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}var rt=function(t,e){return new Date(t.getTime()+e*g)},it=function(t,e){return new Date(t.getTime()+e*m)},at=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ot=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function st(t,e){var n=Q(e,t),r=it(t,-1);return n<Q(e,r)}function lt(t,e){var n=st(t,e)?1:0;return it(t,n)}function ut(t,e,n){if(e===n)return t;var r=Q(e,t),i=Q(n,t),a=r-i,o=rt(t,a),s=Q(n,o);return rt(t,a+(i-s))}var ht=function(){function t(t,e){this._utcDate=i(t),this.timezone=e;var n=Q(e,t);this.timezoneOffset=n;var r=lt(t,e);this._localDate=ut(r,e,"Etc/UTC")}return Object.defineProperty(t.prototype,"cachedLocalDate",{get:function(){return this._localDate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cachedUTCDate",{get:function(){return this._utcDate},enumerable:!0,configurable:!0}),t.fromLocalDate=function(e,n){void 0===n&&(n="");var r=ut(e,"Etc/UTC",n),i=st(r,n),a=Q(n,r),o=0;i&&(o=a>0?-1:1);var s=it(r,o);return t.fromUTCDate(s,n)},t.fromUTCDate=function(e,n){return void 0===n&&(n=""),new t(e,n)},t.prototype.toLocalDate=function(){return i(this._localDate)},t.prototype.toUTCDate=function(){return i(this._utcDate)},t.prototype.toTimezone=function(e){if(this.timezone===e)return this.clone();var n=Q(this.timezone,this._utcDate),r=rt(this._utcDate,n);return t.fromLocalDate(r,e)},t.prototype.clone=function(){return t.fromUTCDate(this._utcDate,this.timezone)},t.prototype.addDays=function(e){var n=new Date(this._utcDate.getTime());return n.setUTCDate(n.getUTCDate()+e),t.fromUTCDate(n,this.timezone)},t.prototype.addTime=function(e){var n=lt(new Date(this._utcDate.getTime()),this.timezone);n.setTime(n.getTime()+e);var r=lt(n,this.timezone);return t.fromUTCDate(r,this.timezone)},t.prototype.stripTime=function(){var e=this._utcDate,n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0);return t.fromUTCDate(new Date(n),this.timezone)},t.prototype.getTime=function(){return this._localDate.getTime()},t.prototype.getTimezoneOffset=function(){return this.timezoneOffset},t.prototype.getFullYear=function(){return this._utcDate.getUTCFullYear()},t.prototype.getMonth=function(){return this._utcDate.getUTCMonth()},t.prototype.getDate=function(){return this._utcDate.getUTCDate()},t.prototype.getDay=function(){return this._utcDate.getUTCDay()},t.prototype.getHours=function(){return this._utcDate.getUTCHours()},t.prototype.getMinutes=function(){return this._utcDate.getUTCMinutes()},t.prototype.getSeconds=function(){return this._utcDate.getUTCSeconds()},t.prototype.getMilliseconds=function(){return this._utcDate.getUTCMilliseconds()},t.prototype.getUTCDate=function(){return this._localDate.getUTCDate()},t.prototype.getUTCDay=function(){return this._localDate.getUTCDay()},t.prototype.getUTCFullYear=function(){return this._localDate.getUTCFullYear()},t.prototype.getUTCHours=function(){return this._localDate.getUTCHours()},t.prototype.getUTCMilliseconds=function(){return this._localDate.getUTCMilliseconds()},t.prototype.getUTCMinutes=function(){return this._localDate.getUTCMinutes()},t.prototype.getUTCMonth=function(){return this._localDate.getUTCMonth()},t.prototype.getUTCSeconds=function(){return this._localDate.getUTCSeconds()},t.prototype.setTime=function(t){throw new Error("Method not implemented.")},t.prototype.setMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setUTCHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setDate=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCDate=function(t){throw new Error("Method not implemented.")},t.prototype.setMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.toISOString=function(){return this._localDate.toISOString()},t.prototype.toJSON=function(){return this._localDate.toJSON()},t.prototype.toString=function(){var t,e=(t=this._utcDate,at[t.getUTCDay()]+" "+ot[t.getUTCMonth()]),n=this.toTimeString();return e+" "+this.getDate()+" "+this.getFullYear()+" "+n},t.prototype.toDateString=function(){return nt(this._utcDate).toDateString()},t.prototype.toTimeString=function(){var t=q(this.getHours())+":"+q(this.getMinutes())+":"+q(this.getSeconds()),e=function(t){var e=t<=0?"+":"-",n=Math.abs(t);return"GMT"+e+q(Math.floor(n/60))+q(n%60)}(this.timezoneOffset),n=J(this.timezone,this._utcDate);return n&&(n=" ("+n+")"),t+" "+e+n},t.prototype.toLocaleString=function(t,e){return this._localDate.toLocaleString(t,e)},t.prototype.toLocaleDateString=function(t,e){return this._localDate.toLocaleDateString(t,e)},t.prototype.toLocaleTimeString=function(t,e){return this._localDate.toLocaleTimeString(t,e)},t.prototype.toUTCString=function(){return this.toTimezone("Etc/UTC").toString()},t.prototype[Symbol.toPrimitive]=function(t){return"string"===t||"default"===t?this.toString():this._localDate.getTime()},t.prototype.valueOf=function(){return this.getTime()},t.prototype.getVarDate=function(){throw new Error("Not implemented.")},t.prototype.format=function(t){throw new Error("Not implemented.")},t.prototype.formatUTC=function(t){throw new Error("Not implemented.")},t}(),ct=function(t){var e=L.titles;return Object.keys(e).reduce((function(n,r){return(e[r]||{}).group===t?n.concat(r.split(" ")):n}),[])},dt=function(t,e){var n=s(t.getFullYear(),0,1,-6),r=function(t,e){return e!==y.Monday?o(U(t,e),4):o(t,4-(t.getDay()||7))}(t,e),i=r.getTime()-n.getTime(),a=Math.floor(i/v);return 1+Math.floor(a/7)},pt=function(t,e){void 0===e&&(e=y.Monday),t=C(t);var n=o(t,-7),r=o(t,7),i=dt(t,e);return 0===i?dt(n,e)+1:53===i&&dt(r,e)>1?1:i}},761:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},953:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateObject=void 0;var r=n(644),i=n(930),a=n(506),o=n(849),s=n(761),l=/d|M|H|h|m|s/,u=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,a=t.cycleTime,o=void 0!==a&&a,l=t.twoDigitYearMax,u=void 0===l?s.Constants.twoDigitYearMax:l,h=t.value,c=void 0===h?null:h,d=t.autoCorrectParts,p=void 0===d||d,f=t.toggleDayPeriod,g=void 0!==f&&f,m=t.autoSwitchParts,v=void 0===m||m;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.dayperiod=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=this.getDefaultDate(),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.setOptions({intlService:e,formatPlaceholder:n,format:i,cycleTime:o,twoDigitYearMax:u,value:c,autoCorrectParts:p,toggleDayPeriod:g,autoSwitchParts:v}),c)this._value=(0,r.cloneDate)(c);else{this._value=this.getDefaultDate();for(var y=this.dateFormatString(this.value,this.format).symbols,D=0;D<y.length;D++)this.setExisting(y[D],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=s.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var r=e[n],i=this.intl.cldr[r];if(i.name&&i.calendar&&i.numbers&&i.name!==s.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(t){this.intl=t.intlService,this.formatPlaceholder=t.formatPlaceholder||"wide",this.format=t.format,this.cycleTime=t.cycleTime,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=t.twoDigitYearMax,this.autoCorrectParts=t.autoCorrectParts,this.toggleDayPeriod=t.toggleDayPeriod,this.autoSwitchParts=t.autoSwitchParts},t.prototype.setValue=function(t){t?(0,r.isEqual)(t,this._value)?(0,r.isEqual)(t,this._value)&&this.dayPeriods&&this.setExisting("a",!0):(this._value=(0,r.cloneDate)(t),this.modifyExisting(!0)):(this._value=this.getDefaultDate(),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,n){return e||"literal"!==n.type&&"dayperiod"!==n.type&&t.getExisting(n.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return(0,r.cloneDate)(this.value)},t.prototype.createDefaultDate=function(){return(0,r.createDate)(2e3,0,31)},t.prototype.getDefaultDate=function(){return(0,r.getDate)(this.createDefaultDate())},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,n=this.intl.formatDate(this.value,e,this.localeId),r=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),u=0;u<s.length;u++){var h=r.symbols[u];if("literal"===r.partMap[u].type)i+=n[u];else if(this.getInvalidDatePartValue(h)){var c=this.getPartsForSegment(r,u);if("M"===h){var d=((0,o.parseToInt)(this.getInvalidDatePartValue(h))+1).toString();c.length>2?i+=l[h][u]:this.getInvalidDatePartValue(h)?(i+=(0,a.padZero)(c.length-d.length)+d,u+=c.length-1):i+=l[h][u]}else this.getInvalidDatePartValue(h)?(d=this.getInvalidDatePartValue(h).toString(),i+=(0,a.padZero)(c.length-d.length)+d,u+=c.length-1):i+=l[h][u]}else i+=n[u]}n=i}return this.merge(n,r)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,r={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var i=e.getInvalidDatePart(t).date;if(i){var a=e.intl.formatDate(i,n,e.localeId);r[t]=a}})),r},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"t":case"a":return this.dayperiod;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"t":case"a":this.dayperiod=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if((0,o.isPresent)(t)&&(0,o.isPresent)(e)&&0!==e){var n,i=(0,r.cloneDate)(this.value),a=!1,s="M"===t,l="d"===t||"E"===t,u=this.getExisting(t);if(this.autoCorrectParts||!l&&!s){var h=i.getHours();switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=(0,r.addMonths)(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":this.toggleDayPeriod?i.setHours(h>=12?h-12:h+12):i.setHours(i.getHours()+12*e),a=!0}}else{var c=this._partiallyInvalidDate.invalidDateParts||{},d=this.getInvalidDatePartValue(t),p=c.y.value||i.getFullYear(),f=c.M.value||i.getMonth(),g=c.d.value||c.E.value||i.getDate(),m=c.h.value||c.H.value||i.getHours(),v=c.m.value||i.getMinutes(),y=c.s.value||i.getSeconds(),D=c.S.value||i.getMilliseconds();switch(t){case"y":p+=e;break;case"M":f+=e;break;case"d":case"E":g+=e}if("M"===t){if((f<0||f>11)&&u)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!u){if(f<0)f=(0,o.clamp)(f%11+1+11,0,11);else{var b=(0,o.isPresent)(d)?f:(e-1)%12;f=(0,o.clamp)(b,0,11)}f=(0,o.clamp)(f,0,11)}f=(0,o.clamp)(f,0,11)}else if("d"===t)if(u){if(g<=0||g>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!u){if((0,o.isPresent)(d)&&(g<=0||g>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=(0,o.isPresent)(d)?g:31-Math.abs(e%31)+1;g=(0,o.clamp)(E,1,31)}else E=(0,o.isPresent)(d)?g:e%31,g=(0,o.clamp)(E,1,31);g=(0,o.clamp)(g,1,31)}var P=(0,r.createDate)(p,f,g,m,v,y,D),S=s||l?this.modifyDateSymbolWithValue(i,t,s?f:g):null,M=(0,o.areDatePartsEqualTo)(P,p,f,g,m,v,y,D);this.getValue()&&(0,o.areDatePartsEqualTo)(P,p,f,g,m,v,y,D)?(i=(0,r.cloneDate)(P),this.markDatePartsAsExisting()):s&&S?S.getMonth()===f?this.getExisting("d")?M?(i=(0,r.cloneDate)(P),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:f,date:(0,r.cloneDate)(S),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(this.resetInvalidDateSymbol(t),i=(0,r.cloneDate)(P),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=(0,r.cloneDate)(S)):(n=!0,this.setInvalidDatePart(t,{value:f,date:(0,r.cloneDate)(S),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===g?this.getExisting("M")?M?(i=(0,r.cloneDate)(P),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:g,date:(0,r.cloneDate)(S),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(i=(0,r.cloneDate)(P),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=(0,r.cloneDate)(S)):(n=!0,this.setInvalidDatePart(t,{value:g,date:(0,r.cloneDate)(this.value),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),a&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,l=t.rawTextValue,u=t.isDeleting,h=t.originalFormat,c=!s,d=this.dateFormatString(this.value,this.format),p=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),f=d.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),g=0;g<p.length;g++){for(var m=p[g],v=0;v<m.pattern.length;v++)p[g+v]&&(p[g+v].literal=m.pattern[v]);g+=m.pattern.length-1}for(g=0;g<f.length;g++){for(m=f[g],v=0;v<m.pattern.length;v++)f[g+v]&&(f[g+v].text=m.pattern[v]);g+=m.pattern.length-1}var y={value:null,switchToNext:!1,resetPart:c&&"M"===e&&d.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!n){if(!c)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,o.extend)(y,{value:null,switchToNext:!1});for(g=0;g<p.length;g++){var D=p[g].literal,b=l.startsWith(D),E=l.endsWith(D),P=l.indexOf(D+D)>=0;if(b||E||P)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,o.extend)(y,{value:null,switchToNext:!1})}}var S=this.intl.formatDate(this.value,this.format,this.localeId),M=d.symbols,w=!1,_="",O="",x="",I="",T="",C="",F="";for(g=0;g<f.length;g++)F+=f[g].text;var j=this.format===M||this.format===F||this.format===h||this.format.length===h.length,V=(j?F:h).indexOf(e),k=(j?F:h).lastIndexOf(e)-V+1,A=h.length-l.length;if(c||!c&&!this.autoCorrectParts){var N=0;for(g=0;g<S.length;g++)if(M[g]===e){var U=this.getExisting(e);if("y"===e)if(!this.hasInvalidDatePart()&&this.getExisting("y"))O+=S[g];else{var L=this.getInvalidDatePartValue(e);(0,o.isPresent)(L)?(O+=(L||"").toString()[N]||"",N++):O+=U?S[g]:"0"}else O+=U?S[g]:"0";A>0?x.length+A<k&&(x+=l[g]||""):x+=l[g]||"",w=!0}else w?(C+=S[g],T+=S[g]):(_+=S[g],I+=S[g]);if(j&&(F.length<l.length?x+=n:!u&&(h.length,l.length),x.length>k))return(0,o.extend)(y,{value:null,switchToNext:!1});if(!j||j&&!this.autoCorrectParts){O="",x="",_="",C="",w=!1;var Y=0;for(g=0;g<h.length;g++)h[g]===e?(U=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?O+=S[g]:(L=this.getInvalidDatePartValue(e),(0,o.isPresent)(L)?(O+=(L||"").toString()[Y]||"",Y++):O+=U?S[g]:"0"):O+=U?S[g]||"":"0",A>0?x.length+A<k&&(x+=l[g]||""):x+=l[g]||"",w=!0):w?C+=l[g-A]||"":_+=l[g]||"";h.length<l.length&&(x+=n)}}if(!c)if(this.autoCorrectParts)for(O="",x="",_="",C="",w=!1,g=0;g<S.length;g++)M[g]===e?(O+=(U=this.getExisting(e))?S[g]:"0",w=!0):w?C+=S[g]:_+=S[g];else O=i?x:O;var H=null,K=this.matchMonth(n),R=this.matchDayPeriod(n,e),W="0"===n,z=this.leadingZero||{};W?("0"===x&&(x=O),0!==(0,o.parseToInt)(i?n:(c?x:O)+n)||this.isAbbrMonth(d.partMap,e)||"a"===e||this.incrementLeadingZero(e)):this.resetLeadingZero();var B=this.partPattern(d.partMap,e),Z=B?B.pattern:null,G=this.patternLength(Z)||Z.length;if(c&&u&&!x)return this.setExisting(e,!1),(0,o.extend)(y,{value:null,switchToNext:!1});var q=O.length-3,J=!0,$=c?x:O;for(g=Math.max(0,q);g<=O.length&&J;g++){$=i?n:c?x:O.substring(g)+n,this.autoSwitchParts&&"h"===e&&"12"===O.substring(g)&&($=$.replace("12","0")),!c&&this.autoCorrectParts||(J=!1,$=(0,a.unpadZero)($),$=(0,a.padZero)(G-$.length)+$);var Q=parseInt($,10),X=_+$+C;(H=this.intl.parseDate(X,this.format,this.localeId))&&this.value&&d.partMap.every((function(t){return"year"!==t.type&&"month"!==t.type&&"day"!=t.type}))&&(H.setFullYear(this.value.getFullYear()),H.setMonth(this.value.getMonth()),H.setDate(this.value.getDate()));var tt=!1;c&&!(0,o.isValidDate)(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(I+$+T,this.format,this.localeId),tt=!0);var et=!isNaN(parseInt(n,10))||c&&u&&""===n;if(!H&&!isNaN(Q)&&et&&this.autoCorrectParts){if("M"===e&&!K){var nt=Q-1;nt>-1&&nt<12&&((H=(0,r.cloneDate)(this.value)).setMonth(nt),H.getMonth()!==nt&&(H=(0,r.lastDayOfMonth)((0,r.addMonths)(H,-1))))}"y"===e&&(H=(0,r.createDate)(parseInt($,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(c&&(0,o.isValidDate)(H)||!c&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=(0,r.lastDayOfMonth)((0,r.addMonths)(H,-1))))}if(c&&(0,o.isValidDate)(H)||!c&&H){var rt=this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:tt,middle:$,patternValue:Z,basePrefix:I,baseSuffix:T,prefix:_,suffix:C,symbol:e,patternLength:G,leadingZero:z}),it=rt.switchToNext;return this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),"H"===e&&H.getHours()>=12&&this.setExisting("a",!0),this._value=H,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e?this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")):"y"===e&&this.markDatePartsAsExisting(),this.hasInvalidDatePart()||(this.markDatePartsAsExisting(),rt.peekedDate||!rt.switchToNext||this.autoCorrectParts||"M"===e||"d"===e&&30===rt.parsedPeekedValue&&1===this.value.getMonth()&&(it=!1))),(0,o.extend)(y,{value:this.value,switchToNext:it})}}if(K&&(H=this.intl.parseDate(_+K+C,this.format,this.localeId)))return this._value=H,this.setExisting(e,!0),(0,o.extend)(y,{value:this.value,switchToNext:!1});if(R&&(H=this.intl.parseDate(_+R+C,this.format)||this.intl.parseDate(I+R+T,this.format)))return this._value=H,this.setExisting(e,!0),(0,o.extend)(y,{value:this.value,switchToNext:!0});if(W&&"a"!==e&&this.setExisting(e,!1),!this.autoCorrectParts){var at=void 0,ot=c?x:$,st=(0,o.parseToInt)(ot);if((0,o.isNumber)(st)&&(0,o.isParseableToInt)(ot)){if("d"===e&&(st<=0||st>31)||"M"===e&&(st<=0||st>11)){if(c)return(0,o.extend)(y,{value:null,switchToNext:!1});ot=n,st=(0,o.parseToInt)(ot)}if(!(0,o.isNumber)(st)||!(0,o.isParseableToInt)(ot))return(0,o.extend)(y,{value:null,switchToNext:!1});at="M"===e?st-1:st;var lt="y"===e,ut="M"===e,ht="d"===e,ct=(0,r.cloneDate)(this._value),dt=this._partiallyInvalidDate.invalidDateParts||{},pt=lt?at:dt.y.value||ct.getFullYear(),ft=ut?at:dt.M.value||ct.getMonth(),gt=ht?at:dt.d.value||dt.E.value||ct.getDate(),mt=dt.h.value||dt.H.value||ct.getHours(),vt=dt.m.value||ct.getMinutes(),yt=dt.s.value||ct.getSeconds(),Dt=dt.S.value||ct.getMilliseconds(),bt=(0,r.createDate)(pt,ft,gt,mt,vt,yt,Dt),Et=(0,o.areDatePartsEqualTo)(bt,pt,ft,gt,mt,vt,yt,Dt),Pt=lt||ut||ht?this.modifyDateSymbolWithValue(ct,e,lt?pt:ut?ft:gt):null,St=!1;if(ut&&Pt?Pt.getMonth()===ft?this.getExisting("d")?Et?(ct=(0,r.cloneDate)(bt),this.resetInvalidDateSymbol(e)):(St=!0,this.setInvalidDatePart(e,{value:ft,date:(0,r.cloneDate)(Pt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):Et?(this.resetInvalidDateSymbol(e),ct=(0,r.cloneDate)(bt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),ct=(0,r.cloneDate)(Pt)):(St=!0,this.setInvalidDatePart(e,{value:ft,date:(0,r.cloneDate)(Pt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):ht&&Pt?Pt.getDate()===gt?this.getExisting("M")?Et?(ct=(0,r.cloneDate)(bt),this.resetInvalidDateSymbol(e)):(St=!0,this.setInvalidDatePart(e,{value:gt,date:(0,r.cloneDate)(Pt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):Et?(ct=(0,r.cloneDate)(bt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),ct=(0,r.cloneDate)(Pt)):(St=!0,this.setInvalidDatePart(e,{value:gt,date:(0,r.cloneDate)(this.value),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):lt&&Pt&&(Pt.getFullYear()===pt?this.getExisting("d")&&this.getExisting("M")?Et?(ct=(0,r.cloneDate)(bt),this.resetInvalidDateSymbol(e)):(St=!0,this.setInvalidDatePart(e,{value:pt,date:(0,r.cloneDate)(Pt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):Et?(this.resetInvalidDateSymbol(e),ct=(0,r.cloneDate)(bt),this.getExisting("M")&&this.getExisting("d")&&(this.setExisting("y",!0),this.resetInvalidDateSymbol("y"))):(this.resetInvalidDateSymbol(e),ct=(0,r.cloneDate)(Pt)):(St=!0,this.setInvalidDatePart(e,{value:pt,date:(0,r.cloneDate)(Pt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1))),!St){if(this.setExisting(e,!0),c&&!(0,o.isValidDate)(H)){var Mt=this.intl.parseDate(I+$+T,this.format,this.localeId);(0,o.isValidDate)(Mt)&&(this._value=Mt)}else this._value=ct;this.getValue()&&this.resetInvalidDate()}return it=!1,it="M"===e?st>=2||ot.length>=2:j?this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:!this.autoCorrectParts,middle:$,patternValue:Z,basePrefix:I,baseSuffix:T,prefix:_,suffix:C,symbol:e,patternLength:G,leadingZero:z}).switchToNext:ot.length>k,(0,o.extend)(y,{value:null,switchToNext:it,hasInvalidDatePart:St})}}return(0,o.extend)(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(a.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.getLeadingZero=function(){return this.leadingZero||{}},t.prototype.normalizeCentury=function(t){if(!(0,o.isPresent)(t))return t;var e=(0,o.cropTwoDigitYear)(t),n=this.getNormalizedCenturyBase(e);return(0,o.setYears)(t,n+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var n=this.partPattern(t,e);return"month"===n.type&&n.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var n=t.replace(/^0*/,"")+"0";return(0,a.padZero)(e.length-n.length)+n},t.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(n>=1&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},t.prototype.matchDayPeriod=function(t,e){var n=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(n))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(n))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:l.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),r=[],a=[],o=0;o<n.length;o++)for(var l=this.intl.formatDate(t,{pattern:n[o].pattern},this.localeId).length;l>0;)r.push(this.symbols[n[o].pattern[0]]||s.Constants.formatSeparator),a.push(n[o]),l--;var u=new i.Mask;return u.symbols=r.join(""),u.partMap=a,u},t.prototype.merge=function(t,e){for(var n="",r="",i=e.symbols,s=!1,l=0,u=this.getFormattedInvalidDates(i),h=i.length-1;h>=0;h--){var c=this.getPartsForSegment(e,h);if(-1===this.knownParts.indexOf(i[h])||this.getExisting(i[h]))this.autoCorrectParts?n=t[h]+n:t.length!==i.length?s?n=t[h]+n:l>0?(n=t[h]+n,--l<=0&&(s=!0)):n=(t[h+t.length-i.length]||"")+n:n=t[h]+n,r=i[h]+r;else{var d=i[h],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;h>=0&&d===i[h];)h--;h++}if(this.leadingZero&&this.leadingZero[d])n="0"+n;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(d)){var f=this.getInvalidDatePartValue(d).toString();"M"===d?(f=((0,o.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),c.length>2?n=u[d][h]+n:(f=((0,o.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),n=(0,a.padZero)(c.length-f.length)+f+n,p=c.length-1,l=f.length-c.length)):(n=(0,a.padZero)(c.length-f.length)+f+n,p=c.length-1,l=f.length-c.length)}else n=this.dateFieldName(e.partMap[h])+n;for(;r.length<n.length;)r=i[h]+r;0!==p&&(h=h-p+(t.length-i.length))}}return{text:n,format:r}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var n=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,o.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)})),n&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var n=e.value,r=void 0===n?null:n,i=e.date,a=void 0===i?null:i,o=e.startDateOffset,s=void 0===o?0:o,l=e.startDate,u=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=r,this._partiallyInvalidDate.invalidDateParts[t].date=a,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=u)},t.prototype.hasInvalidDatePart=function(){var t=this,e=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(n){t._partiallyInvalidDate.invalidDateParts[n]&&(0,o.isPresent)(t._partiallyInvalidDate.invalidDateParts[n].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=(0,r.cloneDate)(t),a=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=(0,r.addMonths)(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),a=!0;break;case"m":i.setMinutes(i.getMinutes()+n),a=!0;break;case"s":i.setSeconds(i.getSeconds()+n),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),a=!0}return{date:i,timeModified:a}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=(0,r.cloneDate)(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=(0,r.addMonths)(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":case"a":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n)}return i},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],r=[],i=e;i<t.partMap.length;i++){var a=t.partMap[i];if(n.type!==a.type||n.pattern!==a.pattern)break;r.push(a)}for(i=e-1;i>=0&&(a=t.partMap[i],n.type===a.type&&n.pattern===a.pattern);i--)r.unshift(a);return r},t.prototype.isPeekDateOverflowingDatePart=function(t){var e=t.useBasePrefixAndSuffix,n=t.middle,r=t.patternValue,i=t.basePrefix,s=t.baseSuffix,l=t.prefix,u=t.suffix,h=t.symbol,c=t.patternLength,d=t.leadingZero,p=this.peek(n,r),f=e?"".concat(i).concat(p).concat(s):"".concat(l).concat(p).concat(u),g=this.intl.parseDate(f,this.format,this.localeId),m=((this.leadingZero||{})[h]||0)+(0,a.unpadZero)(n).length>=c;return{peekedDate:g,peekedDateString:f,peekedValue:p,parsedPeekedValue:(0,o.parseToInt)(p),switchToNext:null===g||(d[h]?r.length<=n.length:m)}},t}();e.DateObject=u},503:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},874:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=void 0,e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0;e.Mask=function(){this.symbols="",this.partMap=[]}},179:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var r=n(849),i={events:{}},a=function(){function t(t){this.options=(0,r.extend)({},i,t)}return t.prototype.destroy=function(){this.options={}},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!(0,r.isFunction)(this.options.events[t])&&(this.options.events[t]((0,r.extend)(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=a},849:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.isValidDate=e.areDatePartsEqualTo=e.millisecondStepFor=e.millisecondDigitsInFormat=e.setYears=e.cropTwoDigitYear=e.isFunction=e.noop=e.deepExtend=e.extend=e.clamp=e.isParseableToInt=e.parseToInt=e.isNumber=e.isDocumentAvailable=e.isPresent=void 0;var r=n(635),i=n(644),a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return(0,e.isPresent)(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.isParseableToInt=function(t){return(0,e.isNumber)((0,e.parseToInt)(t))&&/^[0-9]+$/.test(t)},e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,i,o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];if(!o.length)return t;var l=o.shift();if(a(t)&&a(l))for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&"__proto__"!==u&&"constructor"!==u&&"prototype"!==u&&(l[u]instanceof HTMLElement?t[u]=l[u]:!a(l[u])||l[u]instanceof Date?(0,e.extend)(t,((i={})[u]=l[u],i)):(t[u]&&a(t[u])||(0,e.extend)(t,((n={})[u]={},n)),(0,e.deepExtend)(t[u],l[u])));return e.deepExtend.apply(void 0,r.__spreadArray([t],o,!1))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!(0,e.isPresent)(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=function(t,e){var n=(0,i.cloneDate)(t);return n.setFullYear(e),n},e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,n,r,i,a,o,s){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==r||t.getHours()!==i||t.getMinutes()!==a||t.getSeconds()!==o||t.getMilliseconds()!==s)},e.isValidDate=function(t){return(0,e.isPresent)(t)&&t.getTime&&(0,e.isNumber)(t.getTime())},e.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Macintosh/i.test(navigator.userAgent)}},415:(t,e,n)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInput=void 0;var i=n(635),a=n(953),o=n(506),s=n(874),l=n(503),u=n(849),h=n(179),c=n(655),d=n(644),p=n(761),f="dragStart",g="drop",m="touchstart",v="mousedown",y="mouseup",D="click",b="input",E="keydown",P="focus",S="blur",M="paste",w="DOMMouseScroll",_="mousewheel",O="valueChange",x="inputEnd",I="blurEnd",T="focusEnd",C="change",F={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(r={},r[O]=null,r[b]=null,r[x]=null,r[P]=null,r[T]=null,r[S]=null,r[I]=null,r[E]=null,r[_]=null,r[C]=null,r),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1,toggleDayPeriod:!1},j=function(t){function e(e,n){var r=t.call(this,n)||this;return r.dateObject=null,r.currentText="",r.currentFormat="",r.interactionMode=c.DateInputInteractionMode.None,r.previousElementSelection={start:0,end:0},r.init(e,n),r}return i.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!1,configurable:!0}),e.prototype.init=function(t,e){var n=(0,u.isValidDate)(this.options.value)?(0,d.cloneDate)(this.options.value):new Date(e.formattedValue);(0,u.isValidDate)(n)||(n=null),this.element=t,this.options=(0,u.extend)({},F,e,{steps:i.__assign(i.__assign({},F.steps),e.steps)}),this.intl=this.options.intlService,this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener(f,this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener(g,this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener(D,this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener(v,this.onElementMouseDown),this.element.addEventListener(m,this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener(y,this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener(b,this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener(E,this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener(P,this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener(S,this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener(C,this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener(M,this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener(w,this.onElementMouseWheel),this.element.addEventListener(_,this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener(f,this.onElementDragStart),this.element.removeEventListener(g,this.onElementDrop),this.element.removeEventListener(m,this.onElementMouseDown),this.element.removeEventListener(v,this.onElementMouseDown),this.element.removeEventListener(y,this.onElementMouseUp),this.element.removeEventListener(D,this.onElementClick),this.element.removeEventListener(b,this.onElementInput),this.element.removeEventListener(E,this.onElementKeyDown),this.element.removeEventListener(P,this.onElementFocus),this.element.removeEventListener(S,this.onElementBlur),this.element.removeEventListener(C,this.onElementChange),this.element.removeEventListener(M,this.onElementPaste),this.element.removeEventListener(w,this.onElementMouseWheel),this.element.removeEventListener(_,this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=(0,u.extend)({},this.options,t,{steps:i.__assign(i.__assign({},F.steps),t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.setDateObjectOptions=function(){if(this.dateObject){var t=this.getDateObjectOptions();this.dateObject.setOptions(t)}},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var n=this.element.selectionStart!==this.element.selectionEnd,r=(0,u.isPresent)(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,i=!n&&r?0:this.caret()[0];this.selectNearestSegment(i)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.elementValue;if(this.element&&this.dateObject){var n=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var r=this.keyDownEvent||{},i=r.keyCode===s.KeyCode.BACKSPACE||r.key===l.Key.BACKSPACE,a=r.keyCode===s.KeyCode.DELETE||r.key===l.Key.DELETE,h=this.interactionMode;!this.options.allowCaretMode||h===c.DateInputInteractionMode.Caret||a||i||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var f=this.isInCaretMode();if(f&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var g=this.dateObject&&this.dateObject.getValue(),m=this.dateObject?this.dateObject.value:null,v=this.dateObject.getTextAndFormat(),y=v.text,D=v.format;this.currentFormat=D;var b;b=f&&(i||a||h===c.DateInputInteractionMode.Caret)?this.previousElementValue:y;var E=this.elementValue,P=(0,o.approximateStringMatching)({oldText:b,newText:E,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:f,keyEvent:this.keyDownEvent});if(P&&P.length&&P[0]&&P[0][1]!==p.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!f||P&&0!==P.length){if(f&&1===P.length){if(!P[0]||!P[0][0])return void this.restorePreviousInputEventState();if(f&&P[0]&&(P[0][0]===p.Constants.formatSeparator||P[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var S=1===P.length&&P[0][1]===p.Constants.formatSeparator,M=[],w=!1,_=null;if(!S)for(var O=0;O<P.length;O++){var x=this.dateObject.parsePart({symbol:P[O][0],currentChar:P[O][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:i||a,originalFormat:this.currentFormat});M.push(x),x.value||(_={type:"parse"}),w=x.switchToNext}this.options.autoSwitchParts||(w=!1),this.resetSegmentValue=!1;var I,T=this.options.format===this.currentFormat||(0,u.isPresent)(this.options.format)&&this.options.format.length>1,C=M[M.length-1],F=C&&!(0,u.isPresent)(C.value),j=f&&(i||a)&&F,V=!!C&&C.resetPart,k=this.dateObject.getValue(),A=!(0,d.isEqual)(g,k),N=this.dateObject.value,U=this.selection;if(f){var L=P&&P.length>0?P[0][0]:null,Y=this.dateObject.getLeadingZero()[L];P.length&&P[0][0]!==p.Constants.formatSeparator?w?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):V?(I=this.currentFormat[U.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(I))):this.restorePreviousInputEventState():j?(this.forceUpdate(),P.length&&P[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(P[0][0]))):F?"0"===t.data&&Y||((0,u.isPresent)(g)&&!(0,u.isPresent)(k)?this.restorePreviousInputEventState():!(0,u.isPresent)(g)&&(0,u.isPresent)(k)?this.forceUpdateWithSelection():(0,u.isPresent)(g)&&(0,u.isPresent)(k)?A?this.forceUpdateWithSelection():this.restorePreviousInputEventState():(0,u.isPresent)(g)||(0,u.isPresent)(k)?m!==N||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):F||T||this.forceUpdateWithSelection():(this.options.autoSwitchParts||P[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(P[0][0]))}else f||(this.forceUpdate(),P.length&&P[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(P[0][0])),this.options.autoSwitchParts?S?(this.resetSegmentValue=!0,n||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):w&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):C&&C.switchToNext?this.resetSegmentValue=!0:S&&(this.resetSegmentValue=!0,n||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),i&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1));this.tryTriggerValueChange({oldValue:g,event:t}),this.triggerInputEnd({event:t,error:_,oldElementValue:e,newElementValue:this.elementValue}),f&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,n=e.start,r=e.end,i=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:n,end:r},this.keyEventMatchesAutoSwitchKeys(t)){var a=t.keyCode===s.KeyCode.TAB;if(!a)return t.preventDefault(),void this.switchDateSegment(1);var o=this.selection,l=o.start,u=o.end;if(t.shiftKey&&a?this.switchDateSegment(-1):this.switchDateSegment(1),l!==this.selection.start||u!==this.selection.end)return void t.preventDefault()}var h=this.currentFormat[this.selection.start],c=this.getStepFromSymbol(h),d=!1,p=this.elementValue;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(c,h,i),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-c,h,i),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ENTER:break;case s.KeyCode.HOME:this.selectNearestSegment(0),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;case s.KeyCode.END:this.selectNearestSegment(this.elementValue.length),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;default:return}d&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){var e=this.elementValue;if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var n=t;n.shiftKey?this.switchDateSegment((n.wheelDelta||-n.detail)>0?-1:1):this.modifyDateSegmentValue((n.wheelDelta||-n.detail)>0?1:-1),n.returnValue=!1,n.preventDefault&&n.preventDefault(),e!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:e})}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;(0,u.isPresent)(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var n=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),(0,u.isDocumentAvailable)()&&(0,u.isIOS)()&&this.element.scrollIntoView({block:"nearest",inline:"nearest"}),t.start!==t.end&&(this.interactionMode=c.DateInputInteractionMode.Selection))},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,r=t-1;n<this.currentFormat.length||r>=0;n++,r--){if(n<this.currentFormat.length&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(r>=0&&this.currentFormat[r]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[r]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,r=this.currentFormat[n-1],i="",a="";if(t<0){for(var o=n+t;o>=0;o--)if((a=this.currentFormat[o])!==p.Constants.formatSeparator&&a!==r){n=o,i=a;break}}else for(o=n+t;o<this.currentFormat.length;o++)if((a=this.currentFormat[o])!==p.Constants.formatSeparator&&a!==r){n=o,i=a;break}if(i)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(i)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}this.interactionMode=c.DateInputInteractionMode.None;var s=this.selection,l=s.start,u=s.end;if(l<u&&this.currentFormat[l]!==this.currentFormat[u-1])return this.setSelection(this.selectionByIndex(t>0?l:u-1)),this.resetSegmentValue=!0,void(this.interactionMode=c.DateInputInteractionMode.None);for(var h=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===h||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var f=d;f>=0&&f<this.currentFormat.length&&this.currentFormat[f]===this.currentFormat[d];)f+=t;d>f&&(f+1!==l||d+1!==u)?(this.setSelection({start:f+1,end:d+1}),this.resetSegmentValue=!0):d<f&&(d!==l||f!==u)&&(this.setSelection({start:d,end:f}),this.resetSegmentValue=!0),this.interactionMode=c.DateInputInteractionMode.None}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&!this.options.readonly){var r=this.value,i=1,a=this.caret();if("S"===(e=e||this.currentFormat[a[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var o=(0,u.millisecondDigitsInFormat)(this.inputFormat);i=(0,u.millisecondStepFor)(o)}this.dateObject.modifyPart(e,i*t),this.tryTriggerValueChange({oldValue:r,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!(0,d.isEqual)(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger(O,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger(b,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null,oldElementValue:"",newElementValue:""}),this.trigger(x,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger(P,(0,u.extend)({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(T,(0,u.extend)({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger(S,(0,u.extend)({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(I,(0,u.extend)({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger(C,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger(E,(0,u.extend)({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger(_,(0,u.extend)({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,n=t.end,r=this.elementValue.length;this.forceUpdate();var i=this.elementValue.length-r;this.setSelection({start:e+i,end:n+i})},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,n=t.format;this.currentFormat=n,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,n=t.end;this.setSelection({start:e||0,end:n||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!(0,u.isValidDate)(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(e),r=n.text,i=n.format;this.currentFormat=i,this.currentText=r;var a=this.options.hasPlaceholder||(0,u.isPresent)(this.options.placeholder),o=!this.isActive&&a&&!this.dateObject.hasValue();a&&(0,u.isPresent)(this.options.placeholder)&&(t.placeholder=this.options.placeholder);var s=o?"":r;this.previousElementValue=this.elementValue,this.setElementValue(s)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,r=[t,t],i=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==i.selectionStart&&(n&&((0,u.isDocumentAvailable)()&&document.activeElement!==i&&i.focus(),i.setSelectionRange(t,e)),r=[i.selectionStart,i.selectionEnd])}catch(t){r=[]}return r}},e.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||n>=0;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(n>=0&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},e.prototype.selectDateSegment=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero;this.options.value=t;var n=this.createDateObject();return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new a.DateObject((0,u.extend)({},t))},e.prototype.getDateObjectOptions=function(){return{intlService:this.options.intlService,formatPlaceholder:this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value,toggleDayPeriod:this.options.toggleDayPeriod,autoSwitchParts:this.options.autoSwitchParts}},e.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));return e.indexOf(t.keyCode.toString())>=0||e.indexOf(t.keyCode)>=0||e.indexOf(t.key.toLowerCase().trim())>=0},e.prototype.autoFill=function(){var t,e,n,r,i,a,o=this.dateObject,s=new Date;(o.date||o.month||o.year||o.hours||o.minutes||o.seconds)&&(n=o.year?o.value.getFullYear():s.getFullYear(),e=o.month?o.value.getMonth():s.getMonth(),t=o.date?o.value.getDate():s.getDate(),r=o.hours?o.value.getHours():s.getHours(),i=o.minutes?o.value.getMinutes():s.getMinutes(),a=o.seconds?o.value.getSeconds():s.getSeconds(),o.setValue(new Date(n,e,t,r,i,a)),this.refreshElementValue(),this.triggerValueChange())},e}(h.Observable);e.DateInput=j},655:(t,e)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInputInteractionMode=void 0,function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(n||(e.DateInputInteractionMode=n={}))},506:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInRange=e.dateSymbolMap=e.approximateStringMatching=e.unpadZero=e.padZero=void 0;var r=n(761),i=n(503);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,a=t.formatPattern,o=t.selectionStart,s=t.isInCaretMode,l=t.keyEvent,u=o+e.length-n.length,h=e[u],c=e.substring(0,u),d=n.substring(0,o),p=[];if(c===d&&o>0)return p.push([a[o-1],d[o-1]]),p;if(0===c.indexOf(d)&&s&&(l.key===i.Key.DELETE||l.key===i.Key.BACKSPACE)||0===c.indexOf(d)&&!s&&(0===d.length||a[d.length-1]!==a[d.length])){var f="";s||1!==d.length||p.push([a[0],d[0]]);for(var g=d.length;g<c.length;g++)a[g]!==f&&a[g]!==r.Constants.formatSeparator&&(f=a[g],p.push([f,""]));return p}if(s&&(0===d.indexOf(c)||a[o-1]===r.Constants.formatSeparator)||!s&&(0===d.indexOf(c)||a[o-1]===r.Constants.formatSeparator)){var m=a[0];for(g=Math.max(0,c.length-1);g<a.length;g++)if(a[g]!==r.Constants.formatSeparator){m=a[g];break}return[[m,d[o-1]]]}return" "===d[d.length-1]||d[d.length-1]===h&&"_"===a[u]?[[a[o-1],r.Constants.formatSeparator]]:[[a[o-1],d[o-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&e>t||n&&n<t)}},635:(t,e,n)=>{n.r(e),n.d(e,{__addDisposableResource:()=>k,__assign:()=>a,__asyncDelegator:()=>w,__asyncGenerator:()=>M,__asyncValues:()=>_,__await:()=>S,__awaiter:()=>f,__classPrivateFieldGet:()=>F,__classPrivateFieldIn:()=>V,__classPrivateFieldSet:()=>j,__createBinding:()=>m,__decorate:()=>s,__disposeResources:()=>N,__esDecorate:()=>u,__exportStar:()=>v,__extends:()=>i,__generator:()=>g,__importDefault:()=>C,__importStar:()=>T,__makeTemplateObject:()=>O,__metadata:()=>p,__param:()=>l,__propKey:()=>c,__read:()=>D,__rest:()=>o,__rewriteRelativeImportExtension:()=>U,__runInitializers:()=>h,__setFunctionName:()=>d,__spread:()=>b,__spreadArray:()=>P,__spreadArrays:()=>E,__values:()=>y,default:()=>L});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},a.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function l(t,e){return function(n,r){e(n,r,t)}}function u(t,e,n,r,i,a){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,u="getter"===l?"get":"setter"===l?"set":"value",h=!e&&t?r.static?t:t.prototype:null,c=e||(h?Object.getOwnPropertyDescriptor(h,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var g in r)f[g]="access"===g?{}:r[g];for(var g in r.access)f.access[g]=r.access[g];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(t||null))};var m=(0,n[p])("accessor"===l?{get:c.get,set:c.set}:c[u],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=o(m.get))&&(c.get=s),(s=o(m.set))&&(c.set=s),(s=o(m.init))&&i.unshift(s)}else(s=o(m))&&("field"===l?i.unshift(s):c[u]=s)}h&&Object.defineProperty(h,r.name,c),d=!0}function h(t,e,n){for(var r=arguments.length>2,i=0;i<e.length;i++)n=r?e[i].call(t,n):e[i].call(t);return r?n:void 0}function c(t){return"symbol"==typeof t?t:"".concat(t)}function d(t,e,n){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function p(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((r=r.apply(t,e||[])).next())}))}function g(t,e){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var m=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function v(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||m(e,t,n)}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function b(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(D(arguments[e]));return t}function E(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function P(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function S(t){return this instanceof S?(this.v=t,this):new S(t)}function M(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(t){return function(e){return Promise.resolve(e).then(t,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(t,e){i[t]&&(r[t]=function(e){return new Promise((function(n,r){a.push([t,e,n,r])>1||s(t,e)}))},e&&(r[t]=e(r[t])))}function s(t,e){try{(n=i[t](e)).value instanceof S?Promise.resolve(n.value.v).then(l,u):h(a[0][2],n)}catch(t){h(a[0][3],t)}var n}function l(t){s("next",t)}function u(t){s("throw",t)}function h(t,e){t(e),a.shift(),a.length&&s(a[0][0],a[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:S(t[r](e)),done:!1}:i?i(e):e}:i}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=y(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function O(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var x=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},I=function(t){return I=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[e.length]=n);return e},I(t)};function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n=I(t),r=0;r<n.length;r++)"default"!==n[r]&&m(e,t,n[r]);return x(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function F(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function j(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function V(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function k(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var A="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function N(t){function e(e){t.error=t.hasError?new A(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var n,r=0;return function i(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(i);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(i,(function(t){return e(t),i()}))}else r|=1}catch(t){e(t)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}function U(t,e){return"string"==typeof t&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(t,n,r,i,a){return n?e?".jsx":".js":!r||i&&a?r+i+"."+a.toLowerCase()+"js":t})):t}const L={__extends:i,__assign:a,__rest:o,__decorate:s,__param:l,__esDecorate:u,__runInitializers:h,__propKey:c,__setFunctionName:d,__metadata:p,__awaiter:f,__generator:g,__createBinding:m,__exportStar:v,__values:y,__read:D,__spread:b,__spreadArrays:E,__spreadArray:P,__await:S,__asyncGenerator:M,__asyncDelegator:w,__asyncValues:_,__makeTemplateObject:O,__importStar:T,__importDefault:C,__classPrivateFieldGet:F,__classPrivateFieldSet:j,__classPrivateFieldIn:V,__addDisposableResource:k,__disposeResources:N,__rewriteRelativeImportExtension:U}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0;var e=n(415);Object.defineProperty(t,"DateInput",{enumerable:!0,get:function(){return e.DateInput}})})(),r})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoDateinputsCommon=e():t.KendoDateinputsCommon=e()}(self,(()=>(()=>{"use strict";var t={644:(t,e,n)=>{n.r(e),n.d(e,{Day:()=>y,Direction:()=>r,MS_PER_DAY:()=>v,MS_PER_HOUR:()=>g,MS_PER_MINUTE:()=>m,ZonedDate:()=>ht,abbrTimezone:()=>J,addCenturies:()=>d,addDays:()=>o,addDecades:()=>p,addMonths:()=>u,addWeeks:()=>f,addYears:()=>c,adjustDST:()=>a,cloneDate:()=>i,createDate:()=>s,dayOfWeek:()=>D,durationInCenturies:()=>P,durationInDecades:()=>M,durationInMonths:()=>w,durationInYears:()=>_,firstDayInWeek:()=>O,firstDayOfMonth:()=>I,firstDecadeOfCentury:()=>E,firstMonthOfYear:()=>T,firstYearOfDecade:()=>S,getDate:()=>C,isEqual:()=>F,isEqualDate:()=>j,lastDayOfMonth:()=>l,lastDecadeOfCentury:()=>V,lastMonthOfYear:()=>k,lastYearOfDecade:()=>N,loadTimezone:()=>$,nextDayOfWeek:()=>A,offset:()=>Q,prevDayOfWeek:()=>U,timezoneGroupNames:()=>X,timezoneNames:()=>tt,timezoneTitle:()=>et,toLocalDate:()=>nt,weekInYear:()=>pt,zonesPerGroup:()=>ct});var r,i=function(t){return t?new Date(t.getTime()):null},a=function(t,e){var n=i(t);return 0===e&&23===n.getHours()&&n.setHours(n.getHours()+2),n},o=function(t,e){var n=i(t);return n.setDate(n.getDate()+e),a(n,t.getHours())},s=function(t,e,n,r,i,o,s){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0);var l=new Date(t,e,n,r,i,o,s);return t>-1&&t<100&&l.setFullYear(l.getFullYear()-1900),a(l,r)},l=function(t){var e=s(t.getFullYear(),t.getMonth()+1,1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return o(e,-1)},u=function(t,e){var n=i(t),r=(12+(n.getMonth()+e)%12)%12;return n.setMonth(n.getMonth()+e),function(t,e){return t.getMonth()!==e?l(u(t,-1)):t}(a(n,t.getHours()),r)},h=function(t,e){var n=t.getMonth(),r=s(e,n,t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getMonth()===n?r:l(u(r,-1))},c=function(t,e){return a(h(t,t.getFullYear()+e),t.getHours())},d=function(t,e){return c(t,100*e)},p=function(t,e){return c(t,10*e)},f=function(t,e){return o(t,7*e)},m=6e4,g=36e5,v=864e5;!function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"}(r||(r={}));var y,D=function(t,e,n){void 0===n&&(n=r.Forward);var o=i(t),s=(e-o.getDay()+7*n)%7;return o.setDate(o.getDate()+s),a(o,t.getHours())};!function(t){t[t.Sunday=0]="Sunday",t[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"}(y||(y={}));var b=function(t,e){return h(t,e(t.getFullYear()))},E=function(t){return b(t,(function(t){return t-t%100}))},P=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},S=function(t){return b(t,(function(t){return t-t%10}))},M=function(t,e){return(S(e).getFullYear()-S(t).getFullYear())/10},w=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},_=function(t,e){return e.getFullYear()-t.getFullYear()},O=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},I=function(t){return s(t.getFullYear(),t.getMonth(),1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},x=function(t,e){var n=t.getDate(),r=s(t.getFullYear(),e,n,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getDate()===n?r:l(u(r,-1))},T=function(t){return x(t,0)},C=function(t){return s(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0)},F=function(t,e){return!t&&!e||t&&e&&t.getTime()===e.getTime()},j=function(t,e){return!t&&!e||t&&e&&F(C(t),C(e))},V=function(t){return b(t,(function(t){return t-t%100+90}))},k=function(t){return x(t,11)},N=function(t){return b(t,(function(t){return t-t%10+9}))},A=function(t,e){return D(t,e,r.Forward)},U=function(t,e){return D(t,e,r.Backward)},L={rules:{},titles:{},zones:{}},Y={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},H={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},K=function(t,e,n){var r,i=e[3],a=e[4],o=e[5],s="u"===o[3]?6e4*-n:0;if(isNaN(a))if(0===a.indexOf("last")){r=new Date(Date.UTC(t,Y[i]+1,1,o[0]-24,o[1],o[2])+s);var l=H[a.substr(4,3)],u=r.getUTCDay();r.setUTCDate(r.getUTCDate()+l-u-(l>u?7:0))}else a.indexOf(">=")>=0&&(r=new Date(Date.UTC(t,Y[i],a.substr(5),o[0],o[1],o[2],0)+s),l=H[a.substr(0,3)],u=r.getUTCDay(),r.setUTCDate(r.getUTCDate()+l-u+(l<u?7:0)));else r=new Date(Date.UTC(t,Y[i],a,o[0],o[1],o[2])+s);return r},W=(new Date).getTime(),R=function(t,e,n){void 0===e&&(e=W),void 0===n&&(n=0);var r=L.rules[t];if(!r){var i=t.split(":"),a=0;return i.length>1&&(a=60*i[0]+Number(i[1])),[-1e6,"max","-","Jan",1,[0,0,0],a,"-"]}var o=new Date(e).getUTCFullYear();(r=r.filter((function(t){var e=t[0],n=t[1];return e<=o&&(n>=o||e===o&&"only"===n||"max"===n)}))).push(e),r.sort((function(t,e){return"number"!=typeof t&&(t=Number(K(o,t,n))),"number"!=typeof e&&(e=Number(K(o,e,n))),t-e}));var s=r[r.indexOf(e)-1]||r[r.length-1];return isNaN(s)?s:null},z="The required {0} timezone information is not provided!",B=/\{(\d+)}?\}/g,Z=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e.reduce((function(t,e){return t.concat(e)}),[]);return t.replace(B,(function(t,e){return r[parseInt(e,10)]}))},G=function(t,e){var n=e.getTime(),r=function(t,e){if(void 0===e&&(e=(new Date).getTime()),"Etc/UTC"===t||"Etc/GMT"===t)return[0,"-","UTC",null];for(var n=function(t){var e=L.zones;if(!e)throw new Error(Z(z,t));var n=e[t],r="string"==typeof n?e[n]:n;if(!r)throw new Error(Z(z,t));return r}(t),r=n.length-1;r>=0;r--){var i=n[r][3];if(i&&e>i)break}var a=n[r+1];if(!a)throw new Error(Z(z,t));return a}(t,n);return{rule:R(r[1],n,r[0]),zone:r}},q=function(t,e){return void 0===e&&(e=2),(t<0?"-":"")+new Array(e).concat([Math.abs(t)]).join("0").slice(-e)},J=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t)return"UTC";if("Etc/GMT"===t)return"GMT";if(""===t)return"";var n=G(t,e),r=n.zone,i=n.rule,a=r[2];if(a.indexOf("/")>=0)return a.split("/")[i&&+i[6]?1:0];if(a.indexOf("%s")>=0)return a.replace("%s",i&&"-"!==i[7]?i[7]:"");if(a.indexOf("%z")>=0){var o=-1*Math.trunc(r[0]/60),s=q(o,2),l=o>0?"+":"",u=Math.abs(Math.trunc(r[0]%60)),h=0===u?"":q(u,2);return a.replace("%z",""+l+s+h)}return a},$=function(t){if(!t)throw new Error(Z(z,""));var e=t.rules,n=t.titles,r=t.zones;if(void 0===e||void 0===r)throw new Error("The provided timezone information has invalid stucture!");Object.assign(L.rules,e),Object.assign(L.titles,n||{}),Object.assign(L.zones,r)},Q=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t||"Etc/GMT"===t)return 0;if(""===t)return e.getTimezoneOffset();var n=G(t,e),r=n.rule,i=n.zone;return parseFloat(r?i[0]-r[6]:i[0])},X=function(){var t=Object.keys(L.titles).reduce((function(t,e){var n=L.titles[e].group;return t[n]=n,t}),{});return Object.keys(t)},tt=function(){return Object.keys(L.zones)},et=function(t){return(L.titles[t]||{}).long||t};function nt(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}var rt=function(t,e){return new Date(t.getTime()+e*m)},it=function(t,e){return new Date(t.getTime()+e*g)},at=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ot=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function st(t,e){var n=Q(e,t),r=it(t,-1);return n<Q(e,r)}function lt(t,e){var n=st(t,e)?1:0;return it(t,n)}function ut(t,e,n){if(e===n)return t;var r=Q(e,t),i=Q(n,t),a=r-i,o=rt(t,a),s=Q(n,o);return rt(t,a+(i-s))}var ht=function(){function t(t,e){this._utcDate=i(t),this.timezone=e;var n=Q(e,t);this.timezoneOffset=n;var r=lt(t,e);this._localDate=ut(r,e,"Etc/UTC")}return Object.defineProperty(t.prototype,"cachedLocalDate",{get:function(){return this._localDate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cachedUTCDate",{get:function(){return this._utcDate},enumerable:!0,configurable:!0}),t.fromLocalDate=function(e,n){void 0===n&&(n="");var r=ut(e,"Etc/UTC",n),i=st(r,n),a=Q(n,r),o=0;i&&(o=a>0?-1:1);var s=it(r,o);return t.fromUTCDate(s,n)},t.fromUTCDate=function(e,n){return void 0===n&&(n=""),new t(e,n)},t.prototype.toLocalDate=function(){return i(this._localDate)},t.prototype.toUTCDate=function(){return i(this._utcDate)},t.prototype.toTimezone=function(e){if(this.timezone===e)return this.clone();var n=Q(this.timezone,this._utcDate),r=rt(this._utcDate,n);return t.fromLocalDate(r,e)},t.prototype.clone=function(){return t.fromUTCDate(this._utcDate,this.timezone)},t.prototype.addDays=function(e){var n=new Date(this._utcDate.getTime());return n.setUTCDate(n.getUTCDate()+e),t.fromUTCDate(n,this.timezone)},t.prototype.addTime=function(e){var n=lt(new Date(this._utcDate.getTime()),this.timezone);n.setTime(n.getTime()+e);var r=lt(n,this.timezone);return t.fromUTCDate(r,this.timezone)},t.prototype.stripTime=function(){var e=this._utcDate,n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0);return t.fromUTCDate(new Date(n),this.timezone)},t.prototype.getTime=function(){return this._localDate.getTime()},t.prototype.getTimezoneOffset=function(){return this.timezoneOffset},t.prototype.getFullYear=function(){return this._utcDate.getUTCFullYear()},t.prototype.getMonth=function(){return this._utcDate.getUTCMonth()},t.prototype.getDate=function(){return this._utcDate.getUTCDate()},t.prototype.getDay=function(){return this._utcDate.getUTCDay()},t.prototype.getHours=function(){return this._utcDate.getUTCHours()},t.prototype.getMinutes=function(){return this._utcDate.getUTCMinutes()},t.prototype.getSeconds=function(){return this._utcDate.getUTCSeconds()},t.prototype.getMilliseconds=function(){return this._utcDate.getUTCMilliseconds()},t.prototype.getUTCDate=function(){return this._localDate.getUTCDate()},t.prototype.getUTCDay=function(){return this._localDate.getUTCDay()},t.prototype.getUTCFullYear=function(){return this._localDate.getUTCFullYear()},t.prototype.getUTCHours=function(){return this._localDate.getUTCHours()},t.prototype.getUTCMilliseconds=function(){return this._localDate.getUTCMilliseconds()},t.prototype.getUTCMinutes=function(){return this._localDate.getUTCMinutes()},t.prototype.getUTCMonth=function(){return this._localDate.getUTCMonth()},t.prototype.getUTCSeconds=function(){return this._localDate.getUTCSeconds()},t.prototype.setTime=function(t){throw new Error("Method not implemented.")},t.prototype.setMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setUTCHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setDate=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCDate=function(t){throw new Error("Method not implemented.")},t.prototype.setMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.toISOString=function(){return this._localDate.toISOString()},t.prototype.toJSON=function(){return this._localDate.toJSON()},t.prototype.toString=function(){var t,e=(t=this._utcDate,at[t.getUTCDay()]+" "+ot[t.getUTCMonth()]),n=this.toTimeString();return e+" "+this.getDate()+" "+this.getFullYear()+" "+n},t.prototype.toDateString=function(){return nt(this._utcDate).toDateString()},t.prototype.toTimeString=function(){var t=q(this.getHours())+":"+q(this.getMinutes())+":"+q(this.getSeconds()),e=function(t){var e=t<=0?"+":"-",n=Math.abs(t);return"GMT"+e+q(Math.floor(n/60))+q(n%60)}(this.timezoneOffset),n=J(this.timezone,this._utcDate);return n&&(n=" ("+n+")"),t+" "+e+n},t.prototype.toLocaleString=function(t,e){return this._localDate.toLocaleString(t,e)},t.prototype.toLocaleDateString=function(t,e){return this._localDate.toLocaleDateString(t,e)},t.prototype.toLocaleTimeString=function(t,e){return this._localDate.toLocaleTimeString(t,e)},t.prototype.toUTCString=function(){return this.toTimezone("Etc/UTC").toString()},t.prototype[Symbol.toPrimitive]=function(t){return"string"===t||"default"===t?this.toString():this._localDate.getTime()},t.prototype.valueOf=function(){return this.getTime()},t.prototype.getVarDate=function(){throw new Error("Not implemented.")},t.prototype.format=function(t){throw new Error("Not implemented.")},t.prototype.formatUTC=function(t){throw new Error("Not implemented.")},t}(),ct=function(t){var e=L.titles;return Object.keys(e).reduce((function(n,r){return(e[r]||{}).group===t?n.concat(r.split(" ")):n}),[])},dt=function(t,e){var n=s(t.getFullYear(),0,1,-6),r=function(t,e){return e!==y.Monday?o(U(t,e),4):o(t,4-(t.getDay()||7))}(t,e),i=r.getTime()-n.getTime(),a=Math.floor(i/v);return 1+Math.floor(a/7)},pt=function(t,e){void 0===e&&(e=y.Monday),t=C(t);var n=o(t,-7),r=o(t,7),i=dt(t,e);return 0===i?dt(n,e)+1:53===i&&dt(r,e)>1?1:i}},761:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},953:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateObject=void 0;var r=n(644),i=n(930),a=n(506),o=n(849),s=n(761),l=/d|M|H|h|m|s/,u=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,a=t.cycleTime,o=void 0!==a&&a,l=t.twoDigitYearMax,u=void 0===l?s.Constants.twoDigitYearMax:l,h=t.value,c=void 0===h?null:h,d=t.autoCorrectParts,p=void 0===d||d,f=t.toggleDayPeriod,m=void 0!==f&&f,g=t.autoSwitchParts,v=void 0===g||g;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.dayperiod=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=this.getDefaultDate(),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.setOptions({intlService:e,formatPlaceholder:n,format:i,cycleTime:o,twoDigitYearMax:u,value:c,autoCorrectParts:p,toggleDayPeriod:m,autoSwitchParts:v}),c)this._value=(0,r.cloneDate)(c);else{this._value=this.getDefaultDate();for(var y=this.dateFormatString(this.value,this.format).symbols,D=0;D<y.length;D++)this.setExisting(y[D],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=s.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var r=e[n],i=this.intl.cldr[r];if(i.name&&i.calendar&&i.numbers&&i.name!==s.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(t){this.intl=t.intlService,this.formatPlaceholder=t.formatPlaceholder||"wide",this.format=t.format,this.cycleTime=t.cycleTime,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=t.twoDigitYearMax,this.autoCorrectParts=t.autoCorrectParts,this.toggleDayPeriod=t.toggleDayPeriod,this.autoSwitchParts=t.autoSwitchParts},t.prototype.setValue=function(t){t?(0,r.isEqual)(t,this._value)?(0,r.isEqual)(t,this._value)&&this.dayPeriods&&this.setExisting("a",!0):(this._value=(0,r.cloneDate)(t),this.modifyExisting(!0)):(this._value=this.getDefaultDate(),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,n){return e||"literal"!==n.type&&"dayperiod"!==n.type&&t.getExisting(n.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return(0,r.cloneDate)(this.value)},t.prototype.createDefaultDate=function(){return(0,r.createDate)(2e3,0,31)},t.prototype.getDefaultDate=function(){return(0,r.getDate)(this.createDefaultDate())},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,n=this.intl.formatDate(this.value,e,this.localeId),r=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),u=0;u<s.length;u++){var h=r.symbols[u];if("literal"===r.partMap[u].type)i+=n[u];else if(this.getInvalidDatePartValue(h)){var c=this.getPartsForSegment(r,u);if("M"===h){var d=((0,o.parseToInt)(this.getInvalidDatePartValue(h))+1).toString();c.length>2?i+=l[h][u]:this.getInvalidDatePartValue(h)?(i+=(0,a.padZero)(c.length-d.length)+d,u+=c.length-1):i+=l[h][u]}else this.getInvalidDatePartValue(h)?(d=this.getInvalidDatePartValue(h).toString(),i+=(0,a.padZero)(c.length-d.length)+d,u+=c.length-1):i+=l[h][u]}else i+=n[u]}n=i}return this.merge(n,r)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,r={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var i=e.getInvalidDatePart(t).date;if(i){var a=e.intl.formatDate(i,n,e.localeId);r[t]=a}})),r},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"t":case"a":return this.dayperiod;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"t":case"a":this.dayperiod=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if((0,o.isPresent)(t)&&(0,o.isPresent)(e)&&0!==e){var n,i=(0,r.cloneDate)(this.value),a=!1,s="M"===t,l="d"===t||"E"===t,u=this.getExisting(t);if(this.autoCorrectParts||!l&&!s){var h=i.getHours();switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=(0,r.addMonths)(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":this.toggleDayPeriod?i.setHours(h>=12?h-12:h+12):i.setHours(i.getHours()+12*e),a=!0}}else{var c=this._partiallyInvalidDate.invalidDateParts||{},d=this.getInvalidDatePartValue(t),p=c.y.value||i.getFullYear(),f=c.M.value||i.getMonth(),m=c.d.value||c.E.value||i.getDate(),g=c.h.value||c.H.value||i.getHours(),v=c.m.value||i.getMinutes(),y=c.s.value||i.getSeconds(),D=c.S.value||i.getMilliseconds();switch(t){case"y":p+=e;break;case"M":f+=e;break;case"d":case"E":m+=e}if("M"===t){if((f<0||f>11)&&u)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!u){if(f<0)f=(0,o.clamp)(f%11+1+11,0,11);else{var b=(0,o.isPresent)(d)?f:(e-1)%12;f=(0,o.clamp)(b,0,11)}f=(0,o.clamp)(f,0,11)}f=(0,o.clamp)(f,0,11)}else if("d"===t)if(u){if(m<=0||m>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!u){if((0,o.isPresent)(d)&&(m<=0||m>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=(0,o.isPresent)(d)?m:31-Math.abs(e%31)+1;m=(0,o.clamp)(E,1,31)}else E=(0,o.isPresent)(d)?m:e%31,m=(0,o.clamp)(E,1,31);m=(0,o.clamp)(m,1,31)}var P=(0,r.createDate)(p,f,m,g,v,y,D),S=s||l?this.modifyDateSymbolWithValue(i,t,s?f:m):null,M=(0,o.areDatePartsEqualTo)(P,p,f,m,g,v,y,D);this.getValue()&&(0,o.areDatePartsEqualTo)(P,p,f,m,g,v,y,D)?(i=(0,r.cloneDate)(P),this.markDatePartsAsExisting()):s&&S?S.getMonth()===f?this.getExisting("d")?M?(i=(0,r.cloneDate)(P),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:f,date:(0,r.cloneDate)(S),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(this.resetInvalidDateSymbol(t),i=(0,r.cloneDate)(P),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=(0,r.cloneDate)(S)):(n=!0,this.setInvalidDatePart(t,{value:f,date:(0,r.cloneDate)(S),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===m?this.getExisting("M")?M?(i=(0,r.cloneDate)(P),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:m,date:(0,r.cloneDate)(S),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(i=(0,r.cloneDate)(P),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=(0,r.cloneDate)(S)):(n=!0,this.setInvalidDatePart(t,{value:m,date:(0,r.cloneDate)(this.value),startDateOffset:e,startDate:(0,r.cloneDate)(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),a&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,l=t.rawTextValue,u=t.isDeleting,h=t.originalFormat,c=!s,d=this.dateFormatString(this.value,this.format),p=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),f=d.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),m=0;m<p.length;m++){for(var g=p[m],v=0;v<g.pattern.length;v++)p[m+v]&&(p[m+v].literal=g.pattern[v]);m+=g.pattern.length-1}for(m=0;m<f.length;m++){for(g=f[m],v=0;v<g.pattern.length;v++)f[m+v]&&(f[m+v].text=g.pattern[v]);m+=g.pattern.length-1}var y={value:null,switchToNext:!1,resetPart:c&&"M"===e&&d.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!n){if(!c)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,o.extend)(y,{value:null,switchToNext:!1});for(m=0;m<p.length;m++){var D=p[m].literal,b=l.startsWith(D),E=l.endsWith(D),P=l.indexOf(D+D)>=0;if(b||E||P)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,o.extend)(y,{value:null,switchToNext:!1})}}var S=this.intl.formatDate(this.value,this.format,this.localeId),M=d.symbols,w=!1,_="",O="",I="",x="",T="",C="",F="";for(m=0;m<f.length;m++)F+=f[m].text;var j=this.format===M||this.format===F||this.format===h||this.format.length===h.length,V=(j?F:h).indexOf(e),k=(j?F:h).lastIndexOf(e)-V+1,N=h.length-l.length;if(c||!c&&!this.autoCorrectParts){var A=0;for(m=0;m<S.length;m++)if(M[m]===e){var U=this.getExisting(e);if("y"===e)if(!this.hasInvalidDatePart()&&this.getExisting("y"))O+=S[m];else{var L=this.getInvalidDatePartValue(e);(0,o.isPresent)(L)?(O+=(L||"").toString()[A]||"",A++):O+=U?S[m]:"0"}else O+=U?S[m]:"0";N>0?I.length+N<k&&(I+=l[m]||""):I+=l[m]||"",w=!0}else w?(C+=S[m],T+=S[m]):(_+=S[m],x+=S[m]);if(j&&(F.length<l.length?I+=n:!u&&(h.length,l.length),I.length>k))return(0,o.extend)(y,{value:null,switchToNext:!1});if(!j||j&&!this.autoCorrectParts){O="",I="",_="",C="",w=!1;var Y=0;for(m=0;m<h.length;m++)h[m]===e?(U=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?O+=S[m]:(L=this.getInvalidDatePartValue(e),(0,o.isPresent)(L)?(O+=(L||"").toString()[Y]||"",Y++):O+=U?S[m]:"0"):O+=U?S[m]||"":"0",N>0?I.length+N<k&&(I+=l[m]||""):I+=l[m]||"",w=!0):w?C+=l[m-N]||"":_+=l[m]||"";h.length<l.length&&(I+=n)}}if(!c)if(this.autoCorrectParts)for(O="",I="",_="",C="",w=!1,m=0;m<S.length;m++)M[m]===e?(O+=(U=this.getExisting(e))?S[m]:"0",w=!0):w?C+=S[m]:_+=S[m];else O=i?I:O;var H=null,K=this.matchMonth(n),W=K.monthName,R=K.matchesCount,z=this.matchDayPeriod(n,e),B="0"===n,Z=this.leadingZero||{};B?("0"===I&&(I=O),0!==(0,o.parseToInt)(i?n:(c?I:O)+n)||this.isAbbrMonth(d.partMap,e)||"a"===e||this.incrementLeadingZero(e)):this.resetLeadingZero();var G=this.partPattern(d.partMap,e),q=G?G.pattern:null,J=this.patternLength(q)||q.length;if(c&&u&&!I)return this.setExisting(e,!1),(0,o.extend)(y,{value:null,switchToNext:!1});var $=O.length-3,Q=!0,X=c?I:O;for(m=Math.max(0,$);m<=O.length&&Q;m++){X=i?n:c?I:O.substring(m)+n,this.autoSwitchParts&&"h"===e&&"12"===O.substring(m)&&(X=X.replace("12","0")),!c&&this.autoCorrectParts||(Q=!1,X=(0,a.unpadZero)(X),X=(0,a.padZero)(J-X.length)+X);var tt=parseInt(X,10),et=_+X+C;(H=this.intl.parseDate(et,this.format,this.localeId))&&this.value&&d.partMap.every((function(t){return"year"!==t.type&&"month"!==t.type&&"day"!=t.type}))&&(H.setFullYear(this.value.getFullYear()),H.setMonth(this.value.getMonth()),H.setDate(this.value.getDate()));var nt=!1;c&&!(0,o.isValidDate)(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(x+X+T,this.format,this.localeId),nt=!0);var rt=!isNaN(parseInt(n,10))||c&&u&&""===n;if(!H&&!isNaN(tt)&&rt&&this.autoCorrectParts){if("M"===e&&!W){var it=tt-1;it>-1&&it<12&&((H=(0,r.cloneDate)(this.value)).setMonth(it),H.getMonth()!==it&&(H=(0,r.lastDayOfMonth)((0,r.addMonths)(H,-1))))}"y"===e&&(H=(0,r.createDate)(parseInt(X,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(c&&(0,o.isValidDate)(H)||!c&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=(0,r.lastDayOfMonth)((0,r.addMonths)(H,-1))))}if(c&&(0,o.isValidDate)(H)||!c&&H){var at=this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:nt,middle:X,patternValue:q,basePrefix:x,baseSuffix:T,prefix:_,suffix:C,symbol:e,patternLength:J,leadingZero:Z}),ot=at.switchToNext;return this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),"H"===e&&H.getHours()>=12&&this.setExisting("a",!0),this._value=H,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e?this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")):"y"===e&&this.markDatePartsAsExisting(),this.hasInvalidDatePart()||(this.markDatePartsAsExisting(),at.peekedDate||!at.switchToNext||this.autoCorrectParts||"M"===e||"d"===e&&30===at.parsedPeekedValue&&1===this.value.getMonth()&&(ot=!1))),(0,o.extend)(y,{value:this.value,switchToNext:ot})}}if(W&&(H=this.intl.parseDate(_+W+C,this.format,this.localeId)))return this._value=H,this.setExisting(e,!0),(0,o.extend)(y,{value:this.value,switchToNext:1===R});if(z&&(H=this.intl.parseDate(_+z+C,this.format)||this.intl.parseDate(x+z+T,this.format)))return this._value=H,this.setExisting(e,!0),(0,o.extend)(y,{value:this.value,switchToNext:!0});if(B&&"a"!==e&&this.setExisting(e,!1),!this.autoCorrectParts){var st=void 0,lt=c?I:X,ut=(0,o.parseToInt)(lt);if((0,o.isNumber)(ut)&&(0,o.isParseableToInt)(lt)){if("d"===e&&(ut<=0||ut>31)||"M"===e&&(ut<=0||ut>11)){if(c)return(0,o.extend)(y,{value:null,switchToNext:!1});lt=n,ut=(0,o.parseToInt)(lt)}if(!(0,o.isNumber)(ut)||!(0,o.isParseableToInt)(lt))return(0,o.extend)(y,{value:null,switchToNext:!1});st="M"===e?ut-1:ut;var ht="y"===e,ct="M"===e,dt="d"===e,pt=(0,r.cloneDate)(this._value),ft=this._partiallyInvalidDate.invalidDateParts||{},mt=ht?st:ft.y.value||pt.getFullYear(),gt=ct?st:ft.M.value||pt.getMonth(),vt=dt?st:ft.d.value||ft.E.value||pt.getDate(),yt=ft.h.value||ft.H.value||pt.getHours(),Dt=ft.m.value||pt.getMinutes(),bt=ft.s.value||pt.getSeconds(),Et=ft.S.value||pt.getMilliseconds(),Pt=(0,r.createDate)(mt,gt,vt,yt,Dt,bt,Et),St=(0,o.areDatePartsEqualTo)(Pt,mt,gt,vt,yt,Dt,bt,Et),Mt=ht||ct||dt?this.modifyDateSymbolWithValue(pt,e,ht?mt:ct?gt:vt):null,wt=!1;if(ct&&Mt?Mt.getMonth()===gt?this.getExisting("d")?St?(pt=(0,r.cloneDate)(Pt),this.resetInvalidDateSymbol(e)):(wt=!0,this.setInvalidDatePart(e,{value:gt,date:(0,r.cloneDate)(Mt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):St?(this.resetInvalidDateSymbol(e),pt=(0,r.cloneDate)(Pt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),pt=(0,r.cloneDate)(Mt)):(wt=!0,this.setInvalidDatePart(e,{value:gt,date:(0,r.cloneDate)(Mt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):dt&&Mt?Mt.getDate()===vt?this.getExisting("M")?St?(pt=(0,r.cloneDate)(Pt),this.resetInvalidDateSymbol(e)):(wt=!0,this.setInvalidDatePart(e,{value:vt,date:(0,r.cloneDate)(Mt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):St?(pt=(0,r.cloneDate)(Pt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),pt=(0,r.cloneDate)(Mt)):(wt=!0,this.setInvalidDatePart(e,{value:vt,date:(0,r.cloneDate)(this.value),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):ht&&Mt&&(Mt.getFullYear()===mt?this.getExisting("d")&&this.getExisting("M")?St?(pt=(0,r.cloneDate)(Pt),this.resetInvalidDateSymbol(e)):(wt=!0,this.setInvalidDatePart(e,{value:mt,date:(0,r.cloneDate)(Mt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1)):St?(this.resetInvalidDateSymbol(e),pt=(0,r.cloneDate)(Pt),this.getExisting("M")&&this.getExisting("d")&&(this.setExisting("y",!0),this.resetInvalidDateSymbol("y"))):(this.resetInvalidDateSymbol(e),pt=(0,r.cloneDate)(Mt)):(wt=!0,this.setInvalidDatePart(e,{value:mt,date:(0,r.cloneDate)(Mt),startDate:(0,r.cloneDate)(this.value)}),this.setExisting(e,!1))),!wt){if(this.setExisting(e,!0),c&&!(0,o.isValidDate)(H)){var _t=this.intl.parseDate(x+X+T,this.format,this.localeId);(0,o.isValidDate)(_t)&&(this._value=_t)}else this._value=pt;this.getValue()&&this.resetInvalidDate()}return ot=!1,ot="M"===e?ut>=2||lt.length>=2:j?this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:!this.autoCorrectParts,middle:X,patternValue:q,basePrefix:x,baseSuffix:T,prefix:_,suffix:C,symbol:e,patternLength:J,leadingZero:Z}).switchToNext:lt.length>k,(0,o.extend)(y,{value:null,switchToNext:ot,hasInvalidDatePart:wt})}}return(0,o.extend)(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(a.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.getLeadingZero=function(){return this.leadingZero||{}},t.prototype.normalizeCentury=function(t){if(!(0,o.isPresent)(t))return t;var e=(0,o.cropTwoDigitYear)(t),n=this.getNormalizedCenturyBase(e);return(0,o.setYears)(t,n+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var n=this.partPattern(t,e);return"month"===n.type&&n.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var n=t.replace(/^0*/,"")+"0";return(0,a.padZero)(e.length-n.length)+n},t.prototype.matchMonth=function(t){var e=this;if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return{monthName:"",matchesCount:0};for(;this.typedMonthPart.length>0;){for(var n=[],r=0;r<this.monthNames.length;r++)this.monthNames[r].toLowerCase().startsWith(this.typedMonthPart)&&n.push(this.monthNames[r]);if(n.length>0)return{monthName:n[0],matchesCount:n.length};var i=parseInt(this.typedMonthPart,10);if(i>=1&&i<=12&&i.toString().startsWith(this.typedMonthPart)){var a=[1,2,3,4,5,6,7,8,9,10,11,12].reduce((function(t,n){return n.toString().startsWith(e.typedMonthPart)?t+1:t}),0);return{monthName:this.monthNames[i-1],matchesCount:a}}this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return{monthName:"",matchesCount:0}},t.prototype.matchDayPeriod=function(t,e){var n=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(n))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(n))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:l.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),r=[],a=[],o=0;o<n.length;o++)for(var l=this.intl.formatDate(t,{pattern:n[o].pattern},this.localeId).length;l>0;)r.push(this.symbols[n[o].pattern[0]]||s.Constants.formatSeparator),a.push(n[o]),l--;var u=new i.Mask;return u.symbols=r.join(""),u.partMap=a,u},t.prototype.merge=function(t,e){for(var n="",r="",i=e.symbols,s=!1,l=0,u=this.getFormattedInvalidDates(i),h=i.length-1;h>=0;h--){var c=this.getPartsForSegment(e,h);if(-1===this.knownParts.indexOf(i[h])||this.getExisting(i[h]))this.autoCorrectParts?n=t[h]+n:t.length!==i.length?s?n=t[h]+n:l>0?(n=t[h]+n,--l<=0&&(s=!0)):n=(t[h+t.length-i.length]||"")+n:n=t[h]+n,r=i[h]+r;else{var d=i[h],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;h>=0&&d===i[h];)h--;h++}if(this.leadingZero&&this.leadingZero[d])n="0"+n;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(d)){var f=this.getInvalidDatePartValue(d).toString();"M"===d?(f=((0,o.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),c.length>2?n=u[d][h]+n:(f=((0,o.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),n=(0,a.padZero)(c.length-f.length)+f+n,p=c.length-1,l=f.length-c.length)):(n=(0,a.padZero)(c.length-f.length)+f+n,p=c.length-1,l=f.length-c.length)}else n=this.dateFieldName(e.partMap[h])+n;for(;r.length<n.length;)r=i[h]+r;0!==p&&(h=h-p+(t.length-i.length))}}return{text:n,format:r}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var n=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,o.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)})),n&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var n=e.value,r=void 0===n?null:n,i=e.date,a=void 0===i?null:i,o=e.startDateOffset,s=void 0===o?0:o,l=e.startDate,u=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=r,this._partiallyInvalidDate.invalidDateParts[t].date=a,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=u)},t.prototype.hasInvalidDatePart=function(){var t=this,e=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(n){t._partiallyInvalidDate.invalidDateParts[n]&&(0,o.isPresent)(t._partiallyInvalidDate.invalidDateParts[n].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=(0,r.cloneDate)(t),a=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=(0,r.addMonths)(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),a=!0;break;case"m":i.setMinutes(i.getMinutes()+n),a=!0;break;case"s":i.setSeconds(i.getSeconds()+n),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),a=!0}return{date:i,timeModified:a}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=(0,r.cloneDate)(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=(0,r.addMonths)(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":case"a":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n)}return i},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],r=[],i=e;i<t.partMap.length;i++){var a=t.partMap[i];if(n.type!==a.type||n.pattern!==a.pattern)break;r.push(a)}for(i=e-1;i>=0&&(a=t.partMap[i],n.type===a.type&&n.pattern===a.pattern);i--)r.unshift(a);return r},t.prototype.isPeekDateOverflowingDatePart=function(t){var e=t.useBasePrefixAndSuffix,n=t.middle,r=t.patternValue,i=t.basePrefix,s=t.baseSuffix,l=t.prefix,u=t.suffix,h=t.symbol,c=t.patternLength,d=t.leadingZero,p=this.peek(n,r),f=e?"".concat(i).concat(p).concat(s):"".concat(l).concat(p).concat(u),m=this.intl.parseDate(f,this.format,this.localeId),g=((this.leadingZero||{})[h]||0)+(0,a.unpadZero)(n).length>=c;return{peekedDate:m,peekedDateString:f,peekedValue:p,parsedPeekedValue:(0,o.parseToInt)(p),switchToNext:null===m||(d[h]?r.length<=n.length:g)}},t}();e.DateObject=u},503:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},874:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=void 0,e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0;e.Mask=function(){this.symbols="",this.partMap=[]}},179:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var r=n(849),i={events:{}},a=function(){function t(t){this.options=(0,r.extend)({},i,t)}return t.prototype.destroy=function(){this.options={}},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!(0,r.isFunction)(this.options.events[t])&&(this.options.events[t]((0,r.extend)(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=a},849:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.isValidDate=e.areDatePartsEqualTo=e.millisecondStepFor=e.millisecondDigitsInFormat=e.setYears=e.cropTwoDigitYear=e.isFunction=e.noop=e.deepExtend=e.extend=e.clamp=e.isParseableToInt=e.parseToInt=e.isNumber=e.isDocumentAvailable=e.isPresent=void 0;var r=n(635),i=n(644),a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return(0,e.isPresent)(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.isParseableToInt=function(t){return(0,e.isNumber)((0,e.parseToInt)(t))&&/^[0-9]+$/.test(t)},e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,i,o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];if(!o.length)return t;var l=o.shift();if(a(t)&&a(l))for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&"__proto__"!==u&&"constructor"!==u&&"prototype"!==u&&(l[u]instanceof HTMLElement?t[u]=l[u]:!a(l[u])||l[u]instanceof Date?(0,e.extend)(t,((i={})[u]=l[u],i)):(t[u]&&a(t[u])||(0,e.extend)(t,((n={})[u]={},n)),(0,e.deepExtend)(t[u],l[u])));return e.deepExtend.apply(void 0,r.__spreadArray([t],o,!1))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!(0,e.isPresent)(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=function(t,e){var n=(0,i.cloneDate)(t);return n.setFullYear(e),n},e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,n,r,i,a,o,s){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==r||t.getHours()!==i||t.getMinutes()!==a||t.getSeconds()!==o||t.getMilliseconds()!==s)},e.isValidDate=function(t){return(0,e.isPresent)(t)&&t.getTime&&(0,e.isNumber)(t.getTime())},e.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Macintosh/i.test(navigator.userAgent)}},415:(t,e,n)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInput=void 0;var i=n(635),a=n(953),o=n(506),s=n(874),l=n(503),u=n(849),h=n(179),c=n(655),d=n(644),p=n(761),f="dragStart",m="drop",g="touchstart",v="mousedown",y="mouseup",D="click",b="input",E="keydown",P="focus",S="blur",M="paste",w="DOMMouseScroll",_="mousewheel",O="valueChange",I="inputEnd",x="blurEnd",T="focusEnd",C="change",F={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(r={},r[O]=null,r[b]=null,r[I]=null,r[P]=null,r[T]=null,r[S]=null,r[x]=null,r[E]=null,r[_]=null,r[C]=null,r),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1,toggleDayPeriod:!1},j=function(t){function e(e,n){var r=t.call(this,n)||this;return r.dateObject=null,r.currentText="",r.currentFormat="",r.interactionMode=c.DateInputInteractionMode.None,r.previousElementSelection={start:0,end:0},r.init(e,n),r}return i.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!1,configurable:!0}),e.prototype.init=function(t,e){var n=(0,u.isValidDate)(this.options.value)?(0,d.cloneDate)(this.options.value):new Date(e.formattedValue);(0,u.isValidDate)(n)||(n=null),this.element=t,this.options=(0,u.extend)({},F,e,{steps:i.__assign(i.__assign({},F.steps),e.steps)}),this.intl=this.options.intlService,this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener(f,this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener(m,this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener(D,this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener(v,this.onElementMouseDown),this.element.addEventListener(g,this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener(y,this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener(b,this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener(E,this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener(P,this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener(S,this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener(C,this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener(M,this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener(w,this.onElementMouseWheel),this.element.addEventListener(_,this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener(f,this.onElementDragStart),this.element.removeEventListener(m,this.onElementDrop),this.element.removeEventListener(g,this.onElementMouseDown),this.element.removeEventListener(v,this.onElementMouseDown),this.element.removeEventListener(y,this.onElementMouseUp),this.element.removeEventListener(D,this.onElementClick),this.element.removeEventListener(b,this.onElementInput),this.element.removeEventListener(E,this.onElementKeyDown),this.element.removeEventListener(P,this.onElementFocus),this.element.removeEventListener(S,this.onElementBlur),this.element.removeEventListener(C,this.onElementChange),this.element.removeEventListener(M,this.onElementPaste),this.element.removeEventListener(w,this.onElementMouseWheel),this.element.removeEventListener(_,this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=(0,u.extend)({},this.options,t,{steps:i.__assign(i.__assign({},F.steps),t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.setDateObjectOptions=function(){if(this.dateObject){var t=this.getDateObjectOptions();this.dateObject.setOptions(t)}},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var n=this.element.selectionStart!==this.element.selectionEnd,r=(0,u.isPresent)(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,i=!n&&r?0:this.caret()[0];this.selectNearestSegment(i)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.elementValue;if(this.element&&this.dateObject){var n=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var r=this.keyDownEvent||{},i=r.keyCode===s.KeyCode.BACKSPACE||r.key===l.Key.BACKSPACE,a=r.keyCode===s.KeyCode.DELETE||r.key===l.Key.DELETE,h=this.interactionMode;!this.options.allowCaretMode||h===c.DateInputInteractionMode.Caret||a||i||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var f=this.isInCaretMode();if(f&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var m=this.dateObject&&this.dateObject.getValue(),g=this.dateObject?this.dateObject.value:null,v=this.dateObject.getTextAndFormat(),y=v.text,D=v.format;this.currentFormat=D;var b;b=f&&(i||a||h===c.DateInputInteractionMode.Caret)?this.previousElementValue:y;var E=this.elementValue,P=(0,o.approximateStringMatching)({oldText:b,newText:E,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:f,keyEvent:this.keyDownEvent});if(P&&P.length&&P[0]&&P[0][1]!==p.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!f||P&&0!==P.length){if(f&&1===P.length){if(!P[0]||!P[0][0])return void this.restorePreviousInputEventState();if(f&&P[0]&&(P[0][0]===p.Constants.formatSeparator||P[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var S=1===P.length&&P[0][1]===p.Constants.formatSeparator,M=[],w=!1,_=null;if(!S)for(var O=0;O<P.length;O++){var I=this.dateObject.parsePart({symbol:P[O][0],currentChar:P[O][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:i||a,originalFormat:this.currentFormat});M.push(I),I.value||(_={type:"parse"}),w=I.switchToNext}this.options.autoSwitchParts||(w=!1),this.resetSegmentValue=!1;var x,T=this.options.format===this.currentFormat||(0,u.isPresent)(this.options.format)&&this.options.format.length>1,C=M[M.length-1],F=C&&!(0,u.isPresent)(C.value),j=f&&(i||a)&&F,V=!!C&&C.resetPart,k=this.dateObject.getValue(),N=!(0,d.isEqual)(m,k),A=this.dateObject.value,U=this.selection;if(f){var L=P&&P.length>0?P[0][0]:null,Y=this.dateObject.getLeadingZero()[L];P.length&&P[0][0]!==p.Constants.formatSeparator?w?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):V?(x=this.currentFormat[U.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(x))):this.restorePreviousInputEventState():j?(this.forceUpdate(),P.length&&P[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(P[0][0]))):F?"0"===t.data&&Y||((0,u.isPresent)(m)&&!(0,u.isPresent)(k)?this.restorePreviousInputEventState():!(0,u.isPresent)(m)&&(0,u.isPresent)(k)?this.forceUpdateWithSelection():(0,u.isPresent)(m)&&(0,u.isPresent)(k)?N?this.forceUpdateWithSelection():this.restorePreviousInputEventState():(0,u.isPresent)(m)||(0,u.isPresent)(k)?g!==A||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):F||T||this.forceUpdateWithSelection():(this.options.autoSwitchParts||P[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(P[0][0]))}else f||(this.forceUpdate(),P.length&&P[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(P[0][0])),this.options.autoSwitchParts?S?(this.resetSegmentValue=!0,n||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):w&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):C&&C.switchToNext?this.resetSegmentValue=!0:S&&(this.resetSegmentValue=!0,n||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),i&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1));this.tryTriggerValueChange({oldValue:m,event:t}),this.triggerInputEnd({event:t,error:_,oldElementValue:e,newElementValue:this.elementValue}),f&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,n=e.start,r=e.end,i=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:n,end:r},this.keyEventMatchesAutoSwitchKeys(t)){var a=t.keyCode===s.KeyCode.TAB;if(!a)return t.preventDefault(),void this.switchDateSegment(1);var o=this.selection,l=o.start,u=o.end;if(t.shiftKey&&a?this.switchDateSegment(-1):this.switchDateSegment(1),l!==this.selection.start||u!==this.selection.end)return void t.preventDefault()}var h=this.currentFormat[this.selection.start],c=this.getStepFromSymbol(h),d=!1,p=this.elementValue;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(c,h,i),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-c,h,i),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ENTER:break;case s.KeyCode.HOME:this.selectNearestSegment(0),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;case s.KeyCode.END:this.selectNearestSegment(this.elementValue.length),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;default:return}d&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){var e=this.elementValue;if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var n=t;n.shiftKey?this.switchDateSegment((n.wheelDelta||-n.detail)>0?-1:1):this.modifyDateSegmentValue((n.wheelDelta||-n.detail)>0?1:-1),n.returnValue=!1,n.preventDefault&&n.preventDefault(),e!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:e})}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;(0,u.isPresent)(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var n=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),(0,u.isDocumentAvailable)()&&(0,u.isIOS)()&&this.element.scrollIntoView({block:"nearest",inline:"nearest"}),t.start!==t.end&&(this.interactionMode=c.DateInputInteractionMode.Selection))},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,r=t-1;n<this.currentFormat.length||r>=0;n++,r--){if(n<this.currentFormat.length&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(r>=0&&this.currentFormat[r]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[r]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,r=this.currentFormat[n-1],i="",a="";if(t<0){for(var o=n+t;o>=0;o--)if((a=this.currentFormat[o])!==p.Constants.formatSeparator&&a!==r){n=o,i=a;break}}else for(o=n+t;o<this.currentFormat.length;o++)if((a=this.currentFormat[o])!==p.Constants.formatSeparator&&a!==r){n=o,i=a;break}if(i)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(i)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}this.interactionMode=c.DateInputInteractionMode.None;var s=this.selection,l=s.start,u=s.end;if(l<u&&this.currentFormat[l]!==this.currentFormat[u-1])return this.setSelection(this.selectionByIndex(t>0?l:u-1)),this.resetSegmentValue=!0,void(this.interactionMode=c.DateInputInteractionMode.None);for(var h=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===h||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var f=d;f>=0&&f<this.currentFormat.length&&this.currentFormat[f]===this.currentFormat[d];)f+=t;d>f&&(f+1!==l||d+1!==u)?(this.setSelection({start:f+1,end:d+1}),this.resetSegmentValue=!0):d<f&&(d!==l||f!==u)&&(this.setSelection({start:d,end:f}),this.resetSegmentValue=!0),this.interactionMode=c.DateInputInteractionMode.None}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&!this.options.readonly){var r=this.value,i=1,a=this.caret();if("S"===(e=e||this.currentFormat[a[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var o=(0,u.millisecondDigitsInFormat)(this.inputFormat);i=(0,u.millisecondStepFor)(o)}this.dateObject.modifyPart(e,i*t),this.tryTriggerValueChange({oldValue:r,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!(0,d.isEqual)(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger(O,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger(b,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null,oldElementValue:"",newElementValue:""}),this.trigger(I,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger(P,(0,u.extend)({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(T,(0,u.extend)({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger(S,(0,u.extend)({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(x,(0,u.extend)({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger(C,(0,u.extend)(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger(E,(0,u.extend)({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger(_,(0,u.extend)({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,n=t.end,r=this.elementValue.length;this.forceUpdate();var i=this.elementValue.length-r;this.setSelection({start:e+i,end:n+i})},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,n=t.format;this.currentFormat=n,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,n=t.end;this.setSelection({start:e||0,end:n||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!(0,u.isValidDate)(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(e),r=n.text,i=n.format;this.currentFormat=i,this.currentText=r;var a=this.options.hasPlaceholder||(0,u.isPresent)(this.options.placeholder),o=!this.isActive&&a&&!this.dateObject.hasValue();a&&(0,u.isPresent)(this.options.placeholder)&&(t.placeholder=this.options.placeholder);var s=o?"":r;this.previousElementValue=this.elementValue,this.setElementValue(s)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,r=[t,t],i=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==i.selectionStart&&(n&&((0,u.isDocumentAvailable)()&&document.activeElement!==i&&i.focus(),i.setSelectionRange(t,e)),r=[i.selectionStart,i.selectionEnd])}catch(t){r=[]}return r}},e.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||n>=0;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(n>=0&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},e.prototype.selectDateSegment=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero;this.options.value=t;var n=this.createDateObject();return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new a.DateObject((0,u.extend)({},t))},e.prototype.getDateObjectOptions=function(){return{intlService:this.options.intlService,formatPlaceholder:this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value,toggleDayPeriod:this.options.toggleDayPeriod,autoSwitchParts:this.options.autoSwitchParts}},e.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));return e.indexOf(t.keyCode.toString())>=0||e.indexOf(t.keyCode)>=0||e.indexOf(t.key.toLowerCase().trim())>=0},e.prototype.autoFill=function(){var t,e,n,r,i,a,o=this.dateObject,s=new Date;(o.date||o.month||o.year||o.hours||o.minutes||o.seconds)&&(n=o.year?o.value.getFullYear():s.getFullYear(),e=o.month?o.value.getMonth():s.getMonth(),t=o.date?o.value.getDate():s.getDate(),r=o.hours?o.value.getHours():s.getHours(),i=o.minutes?o.value.getMinutes():s.getMinutes(),a=o.seconds?o.value.getSeconds():s.getSeconds(),o.setValue(new Date(n,e,t,r,i,a)),this.refreshElementValue(),this.triggerValueChange())},e}(h.Observable);e.DateInput=j},655:(t,e)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInputInteractionMode=void 0,function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(n||(e.DateInputInteractionMode=n={}))},506:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInRange=e.dateSymbolMap=e.approximateStringMatching=e.unpadZero=e.padZero=void 0;var r=n(761),i=n(503);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,a=t.formatPattern,o=t.selectionStart,s=t.isInCaretMode,l=t.keyEvent,u=o+e.length-n.length,h=e[u],c=e.substring(0,u),d=n.substring(0,o),p=[];if(c===d&&o>0)return p.push([a[o-1],d[o-1]]),p;if(0===c.indexOf(d)&&s&&(l.key===i.Key.DELETE||l.key===i.Key.BACKSPACE)||0===c.indexOf(d)&&!s&&(0===d.length||a[d.length-1]!==a[d.length])){var f="";s||1!==d.length||p.push([a[0],d[0]]);for(var m=d.length;m<c.length;m++)a[m]!==f&&a[m]!==r.Constants.formatSeparator&&(f=a[m],p.push([f,""]));return p}if(s&&(0===d.indexOf(c)||a[o-1]===r.Constants.formatSeparator)||!s&&(0===d.indexOf(c)||a[o-1]===r.Constants.formatSeparator)){var g=a[0];for(m=Math.max(0,c.length-1);m<a.length;m++)if(a[m]!==r.Constants.formatSeparator){g=a[m];break}return[[g,d[o-1]]]}return" "===d[d.length-1]||d[d.length-1]===h&&"_"===a[u]?[[a[o-1],r.Constants.formatSeparator]]:[[a[o-1],d[o-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&e>t||n&&n<t)}},635:(t,e,n)=>{n.r(e),n.d(e,{__addDisposableResource:()=>k,__assign:()=>a,__asyncDelegator:()=>w,__asyncGenerator:()=>M,__asyncValues:()=>_,__await:()=>S,__awaiter:()=>f,__classPrivateFieldGet:()=>F,__classPrivateFieldIn:()=>V,__classPrivateFieldSet:()=>j,__createBinding:()=>g,__decorate:()=>s,__disposeResources:()=>A,__esDecorate:()=>u,__exportStar:()=>v,__extends:()=>i,__generator:()=>m,__importDefault:()=>C,__importStar:()=>T,__makeTemplateObject:()=>O,__metadata:()=>p,__param:()=>l,__propKey:()=>c,__read:()=>D,__rest:()=>o,__rewriteRelativeImportExtension:()=>U,__runInitializers:()=>h,__setFunctionName:()=>d,__spread:()=>b,__spreadArray:()=>P,__spreadArrays:()=>E,__values:()=>y,default:()=>L});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},a.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function l(t,e){return function(n,r){e(n,r,t)}}function u(t,e,n,r,i,a){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,u="getter"===l?"get":"setter"===l?"set":"value",h=!e&&t?r.static?t:t.prototype:null,c=e||(h?Object.getOwnPropertyDescriptor(h,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(t||null))};var g=(0,n[p])("accessor"===l?{get:c.get,set:c.set}:c[u],f);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=o(g.get))&&(c.get=s),(s=o(g.set))&&(c.set=s),(s=o(g.init))&&i.unshift(s)}else(s=o(g))&&("field"===l?i.unshift(s):c[u]=s)}h&&Object.defineProperty(h,r.name,c),d=!0}function h(t,e,n){for(var r=arguments.length>2,i=0;i<e.length;i++)n=r?e[i].call(t,n):e[i].call(t);return r?n:void 0}function c(t){return"symbol"==typeof t?t:"".concat(t)}function d(t,e,n){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function p(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((r=r.apply(t,e||[])).next())}))}function m(t,e){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var g=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function v(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||g(e,t,n)}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function b(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(D(arguments[e]));return t}function E(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function P(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function S(t){return this instanceof S?(this.v=t,this):new S(t)}function M(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(t){return function(e){return Promise.resolve(e).then(t,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(t,e){i[t]&&(r[t]=function(e){return new Promise((function(n,r){a.push([t,e,n,r])>1||s(t,e)}))},e&&(r[t]=e(r[t])))}function s(t,e){try{(n=i[t](e)).value instanceof S?Promise.resolve(n.value.v).then(l,u):h(a[0][2],n)}catch(t){h(a[0][3],t)}var n}function l(t){s("next",t)}function u(t){s("throw",t)}function h(t,e){t(e),a.shift(),a.length&&s(a[0][0],a[0][1])}}function w(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:S(t[r](e)),done:!1}:i?i(e):e}:i}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=y(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function O(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var I=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},x=function(t){return x=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[e.length]=n);return e},x(t)};function T(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n=x(t),r=0;r<n.length;r++)"default"!==n[r]&&g(e,t,n[r]);return I(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function F(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function j(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function V(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function k(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var N="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function A(t){function e(e){t.error=t.hasError?new N(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var n,r=0;return function i(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(i);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(i,(function(t){return e(t),i()}))}else r|=1}catch(t){e(t)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}function U(t,e){return"string"==typeof t&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(t,n,r,i,a){return n?e?".jsx":".js":!r||i&&a?r+i+"."+a.toLowerCase()+"js":t})):t}const L={__extends:i,__assign:a,__rest:o,__decorate:s,__param:l,__esDecorate:u,__runInitializers:h,__propKey:c,__setFunctionName:d,__metadata:p,__awaiter:f,__generator:m,__createBinding:g,__exportStar:v,__values:y,__read:D,__spread:b,__spreadArrays:E,__spreadArray:P,__await:S,__asyncGenerator:M,__asyncDelegator:w,__asyncValues:_,__makeTemplateObject:O,__importStar:T,__importDefault:C,__classPrivateFieldGet:F,__classPrivateFieldSet:j,__classPrivateFieldIn:V,__addDisposableResource:k,__disposeResources:A,__rewriteRelativeImportExtension:U}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0;var e=n(415);Object.defineProperty(t,"DateInput",{enumerable:!0,get:function(){return e.DateInput}})})(),r})()));
package/dist/cdn/main.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@progress/kendo-date-math"),require("tslib")):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.KendoDateinputsCommon=e(require("@progress/kendo-date-math"),require("tslib")):t.KendoDateinputsCommon=e(t.KendoDateMath,t.self)}(self,((t,e)=>(()=>{"use strict";var i={761:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},953:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateObject=void 0;var n=i(231),a=i(930),s=i(506),r=i(849),o=i(761),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,i=t.formatPlaceholder,a=t.format,s=t.cycleTime,r=void 0!==s&&s,l=t.twoDigitYearMax,h=void 0===l?o.Constants.twoDigitYearMax:l,u=t.value,c=void 0===u?null:u,d=t.autoCorrectParts,p=void 0===d||d,m=t.toggleDayPeriod,v=void 0!==m&&m,g=t.autoSwitchParts,f=void 0===g||g;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.dayperiod=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=this.getDefaultDate(),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.setOptions({intlService:e,formatPlaceholder:i,format:a,cycleTime:r,twoDigitYearMax:h,value:c,autoCorrectParts:p,toggleDayPeriod:v,autoSwitchParts:f}),c)this._value=(0,n.cloneDate)(c);else{this._value=this.getDefaultDate();for(var y=this.dateFormatString(this.value,this.format).symbols,D=0;D<y.length;D++)this.setExisting(y[D],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=o.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),i=0;i<e.length;i++){var n=e[i],a=this.intl.cldr[n];if(a.name&&a.calendar&&a.numbers&&a.name!==o.Constants.defaultLocaleId){t=a.name;break}}return t},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(t){this.intl=t.intlService,this.formatPlaceholder=t.formatPlaceholder||"wide",this.format=t.format,this.cycleTime=t.cycleTime,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=t.twoDigitYearMax,this.autoCorrectParts=t.autoCorrectParts,this.toggleDayPeriod=t.toggleDayPeriod,this.autoSwitchParts=t.autoSwitchParts},t.prototype.setValue=function(t){t?(0,n.isEqual)(t,this._value)?(0,n.isEqual)(t,this._value)&&this.dayPeriods&&this.setExisting("a",!0):(this._value=(0,n.cloneDate)(t),this.modifyExisting(!0)):(this._value=this.getDefaultDate(),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,i){return e||"literal"!==i.type&&"dayperiod"!==i.type&&t.getExisting(i.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return(0,n.cloneDate)(this.value)},t.prototype.createDefaultDate=function(){return(0,n.createDate)(2e3,0,31)},t.prototype.getDefaultDate=function(){return(0,n.getDate)(this.createDefaultDate())},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,i=this.intl.formatDate(this.value,e,this.localeId),n=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var a="",o=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),h=0;h<o.length;h++){var u=n.symbols[h];if("literal"===n.partMap[h].type)a+=i[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(n,h);if("M"===u){var d=((0,r.parseToInt)(this.getInvalidDatePartValue(u))+1).toString();c.length>2?a+=l[u][h]:this.getInvalidDatePartValue(u)?(a+=(0,s.padZero)(c.length-d.length)+d,h+=c.length-1):a+=l[u][h]}else this.getInvalidDatePartValue(u)?(d=this.getInvalidDatePartValue(u).toString(),a+=(0,s.padZero)(c.length-d.length)+d,h+=c.length-1):a+=l[u][h]}else a+=i[h]}i=a}return this.merge(i,n)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var i=t||this.format,n={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var a=e.getInvalidDatePart(t).date;if(a){var s=e.intl.formatDate(a,i,e.localeId);n[t]=s}})),n},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,i=0;i<e.length;i++)this.setExisting(e[i],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"t":case"a":return this.dayperiod;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"t":case"a":this.dayperiod=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if((0,r.isPresent)(t)&&(0,r.isPresent)(e)&&0!==e){var i,a=(0,n.cloneDate)(this.value),s=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o){var u=a.getHours();switch(t){case"y":a.setFullYear(a.getFullYear()+e);break;case"M":a=(0,n.addMonths)(this.value,e);break;case"d":case"E":a.setDate(a.getDate()+e);break;case"h":case"H":a.setHours(a.getHours()+e),s=!0;break;case"m":a.setMinutes(a.getMinutes()+e),s=!0;break;case"s":a.setSeconds(a.getSeconds()+e),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+e);break;case"a":this.toggleDayPeriod?a.setHours(u>=12?u-12:u+12):a.setHours(a.getHours()+12*e),s=!0}}else{var c=this._partiallyInvalidDate.invalidDateParts||{},d=this.getInvalidDatePartValue(t),p=c.y.value||a.getFullYear(),m=c.M.value||a.getMonth(),v=c.d.value||c.E.value||a.getDate(),g=c.h.value||c.H.value||a.getHours(),f=c.m.value||a.getMinutes(),y=c.s.value||a.getSeconds(),D=c.S.value||a.getMilliseconds();switch(t){case"y":p+=e;break;case"M":m+=e;break;case"d":case"E":v+=e}if("M"===t){if((m<0||m>11)&&h)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!h){if(m<0)m=(0,r.clamp)(m%11+1+11,0,11);else{var E=(0,r.isPresent)(d)?m:(e-1)%12;m=(0,r.clamp)(E,0,11)}m=(0,r.clamp)(m,0,11)}m=(0,r.clamp)(m,0,11)}else if("d"===t)if(h){if(v<=0||v>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!h){if((0,r.isPresent)(d)&&(v<=0||v>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var P=(0,r.isPresent)(d)?v:31-Math.abs(e%31)+1;v=(0,r.clamp)(P,1,31)}else P=(0,r.isPresent)(d)?v:e%31,v=(0,r.clamp)(P,1,31);v=(0,r.clamp)(v,1,31)}var b=(0,n.createDate)(p,m,v,g,f,y,D),S=o||l?this.modifyDateSymbolWithValue(a,t,o?m:v):null,M=(0,r.areDatePartsEqualTo)(b,p,m,v,g,f,y,D);this.getValue()&&(0,r.areDatePartsEqualTo)(b,p,m,v,g,f,y,D)?(a=(0,n.cloneDate)(b),this.markDatePartsAsExisting()):o&&S?S.getMonth()===m?this.getExisting("d")?M?(a=(0,n.cloneDate)(b),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:m,date:(0,n.cloneDate)(S),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(this.resetInvalidDateSymbol(t),a=(0,n.cloneDate)(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),a=(0,n.cloneDate)(S)):(i=!0,this.setInvalidDatePart(t,{value:m,date:(0,n.cloneDate)(S),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===v?this.getExisting("M")?M?(a=(0,n.cloneDate)(b),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:v,date:(0,n.cloneDate)(S),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(a=(0,n.cloneDate)(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),a=(0,n.cloneDate)(S)):(i=!0,this.setInvalidDatePart(t,{value:v,date:(0,n.cloneDate)(this.value),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(a=this.normalizeCentury(a)),s&&!this.cycleTime&&(a.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=a,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,a=t.resetSegmentValue,o=t.cycleSegmentValue,l=t.rawTextValue,h=t.isDeleting,u=t.originalFormat,c=!o,d=this.dateFormatString(this.value,this.format),p=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),m=d.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),v=0;v<p.length;v++){for(var g=p[v],f=0;f<g.pattern.length;f++)p[v+f]&&(p[v+f].literal=g.pattern[f]);v+=g.pattern.length-1}for(v=0;v<m.length;v++){for(g=m[v],f=0;f<g.pattern.length;f++)m[v+f]&&(m[v+f].text=g.pattern[f]);v+=g.pattern.length-1}var y={value:null,switchToNext:!1,resetPart:c&&"M"===e&&d.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!i){if(!c)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,r.extend)(y,{value:null,switchToNext:!1});for(v=0;v<p.length;v++){var D=p[v].literal,E=l.startsWith(D),P=l.endsWith(D),b=l.indexOf(D+D)>=0;if(E||P||b)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,r.extend)(y,{value:null,switchToNext:!1})}}var S=this.intl.formatDate(this.value,this.format,this.localeId),M=d.symbols,I=!1,x="",O="",w="",C="",F="",V="",k="";for(v=0;v<m.length;v++)k+=m[v].text;var T=this.format===M||this.format===k||this.format===u||this.format.length===u.length,_=(T?k:u).indexOf(e),A=(T?k:u).lastIndexOf(e)-_+1,N=u.length-l.length;if(c||!c&&!this.autoCorrectParts){var j=0;for(v=0;v<S.length;v++)if(M[v]===e){var L=this.getExisting(e);if("y"===e)if(!this.hasInvalidDatePart()&&this.getExisting("y"))O+=S[v];else{var K=this.getInvalidDatePartValue(e);(0,r.isPresent)(K)?(O+=(K||"").toString()[j]||"",j++):O+=L?S[v]:"0"}else O+=L?S[v]:"0";N>0?w.length+N<A&&(w+=l[v]||""):w+=l[v]||"",I=!0}else I?(V+=S[v],F+=S[v]):(x+=S[v],C+=S[v]);if(T&&(k.length<l.length?w+=i:!h&&(u.length,l.length),w.length>A))return(0,r.extend)(y,{value:null,switchToNext:!1});if(!T||T&&!this.autoCorrectParts){O="",w="",x="",V="",I=!1;var W=0;for(v=0;v<u.length;v++)u[v]===e?(L=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?O+=S[v]:(K=this.getInvalidDatePartValue(e),(0,r.isPresent)(K)?(O+=(K||"").toString()[W]||"",W++):O+=L?S[v]:"0"):O+=L?S[v]||"":"0",N>0?w.length+N<A&&(w+=l[v]||""):w+=l[v]||"",I=!0):I?V+=l[v-N]||"":x+=l[v]||"";u.length<l.length&&(w+=i)}}if(!c)if(this.autoCorrectParts)for(O="",w="",x="",V="",I=!1,v=0;v<S.length;v++)M[v]===e?(O+=(L=this.getExisting(e))?S[v]:"0",I=!0):I?V+=S[v]:x+=S[v];else O=a?w:O;var H=null,B=this.matchMonth(i),Z=this.matchDayPeriod(i,e),R="0"===i,Y=this.leadingZero||{};R?("0"===w&&(w=O),0!==(0,r.parseToInt)(a?i:(c?w:O)+i)||this.isAbbrMonth(d.partMap,e)||"a"===e||this.incrementLeadingZero(e)):this.resetLeadingZero();var U=this.partPattern(d.partMap,e),q=U?U.pattern:null,z=this.patternLength(q)||q.length;if(c&&h&&!w)return this.setExisting(e,!1),(0,r.extend)(y,{value:null,switchToNext:!1});var G=O.length-3,J=!0,$=c?w:O;for(v=Math.max(0,G);v<=O.length&&J;v++){$=a?i:c?w:O.substring(v)+i,this.autoSwitchParts&&"h"===e&&"12"===O.substring(v)&&($=$.replace("12","0")),!c&&this.autoCorrectParts||(J=!1,$=(0,s.unpadZero)($),$=(0,s.padZero)(z-$.length)+$);var Q=parseInt($,10),X=x+$+V;(H=this.intl.parseDate(X,this.format,this.localeId))&&this.value&&d.partMap.every((function(t){return"year"!==t.type&&"month"!==t.type&&"day"!=t.type}))&&(H.setFullYear(this.value.getFullYear()),H.setMonth(this.value.getMonth()),H.setDate(this.value.getDate()));var tt=!1;c&&!(0,r.isValidDate)(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(C+$+F,this.format,this.localeId),tt=!0);var et=!isNaN(parseInt(i,10))||c&&h&&""===i;if(!H&&!isNaN(Q)&&et&&this.autoCorrectParts){if("M"===e&&!B){var it=Q-1;it>-1&&it<12&&((H=(0,n.cloneDate)(this.value)).setMonth(it),H.getMonth()!==it&&(H=(0,n.lastDayOfMonth)((0,n.addMonths)(H,-1))))}"y"===e&&(H=(0,n.createDate)(parseInt($,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(c&&(0,r.isValidDate)(H)||!c&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=(0,n.lastDayOfMonth)((0,n.addMonths)(H,-1))))}if(c&&(0,r.isValidDate)(H)||!c&&H){var nt=this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:tt,middle:$,patternValue:q,basePrefix:C,baseSuffix:F,prefix:x,suffix:V,symbol:e,patternLength:z,leadingZero:Y}),at=nt.switchToNext;return this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),"H"===e&&H.getHours()>=12&&this.setExisting("a",!0),this._value=H,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e?this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")):"y"===e&&this.markDatePartsAsExisting(),this.hasInvalidDatePart()||(this.markDatePartsAsExisting(),nt.peekedDate||!nt.switchToNext||this.autoCorrectParts||"M"===e||"d"===e&&30===nt.parsedPeekedValue&&1===this.value.getMonth()&&(at=!1))),(0,r.extend)(y,{value:this.value,switchToNext:at})}}if(B&&(H=this.intl.parseDate(x+B+V,this.format,this.localeId)))return this._value=H,this.setExisting(e,!0),(0,r.extend)(y,{value:this.value,switchToNext:!1});if(Z&&(H=this.intl.parseDate(x+Z+V,this.format)||this.intl.parseDate(C+Z+F,this.format)))return this._value=H,this.setExisting(e,!0),(0,r.extend)(y,{value:this.value,switchToNext:!0});if(R&&"a"!==e&&this.setExisting(e,!1),!this.autoCorrectParts){var st=void 0,rt=c?w:$,ot=(0,r.parseToInt)(rt);if((0,r.isNumber)(ot)&&(0,r.isParseableToInt)(rt)){if("d"===e&&(ot<=0||ot>31)||"M"===e&&(ot<=0||ot>11)){if(c)return(0,r.extend)(y,{value:null,switchToNext:!1});rt=i,ot=(0,r.parseToInt)(rt)}if(!(0,r.isNumber)(ot)||!(0,r.isParseableToInt)(rt))return(0,r.extend)(y,{value:null,switchToNext:!1});st="M"===e?ot-1:ot;var lt="y"===e,ht="M"===e,ut="d"===e,ct=(0,n.cloneDate)(this._value),dt=this._partiallyInvalidDate.invalidDateParts||{},pt=lt?st:dt.y.value||ct.getFullYear(),mt=ht?st:dt.M.value||ct.getMonth(),vt=ut?st:dt.d.value||dt.E.value||ct.getDate(),gt=dt.h.value||dt.H.value||ct.getHours(),ft=dt.m.value||ct.getMinutes(),yt=dt.s.value||ct.getSeconds(),Dt=dt.S.value||ct.getMilliseconds(),Et=(0,n.createDate)(pt,mt,vt,gt,ft,yt,Dt),Pt=(0,r.areDatePartsEqualTo)(Et,pt,mt,vt,gt,ft,yt,Dt),bt=lt||ht||ut?this.modifyDateSymbolWithValue(ct,e,lt?pt:ht?mt:vt):null,St=!1;if(ht&&bt?bt.getMonth()===mt?this.getExisting("d")?Pt?(ct=(0,n.cloneDate)(Et),this.resetInvalidDateSymbol(e)):(St=!0,this.setInvalidDatePart(e,{value:mt,date:(0,n.cloneDate)(bt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):Pt?(this.resetInvalidDateSymbol(e),ct=(0,n.cloneDate)(Et),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),ct=(0,n.cloneDate)(bt)):(St=!0,this.setInvalidDatePart(e,{value:mt,date:(0,n.cloneDate)(bt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):ut&&bt?bt.getDate()===vt?this.getExisting("M")?Pt?(ct=(0,n.cloneDate)(Et),this.resetInvalidDateSymbol(e)):(St=!0,this.setInvalidDatePart(e,{value:vt,date:(0,n.cloneDate)(bt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):Pt?(ct=(0,n.cloneDate)(Et),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),ct=(0,n.cloneDate)(bt)):(St=!0,this.setInvalidDatePart(e,{value:vt,date:(0,n.cloneDate)(this.value),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):lt&&bt&&(bt.getFullYear()===pt?this.getExisting("d")&&this.getExisting("M")?Pt?(ct=(0,n.cloneDate)(Et),this.resetInvalidDateSymbol(e)):(St=!0,this.setInvalidDatePart(e,{value:pt,date:(0,n.cloneDate)(bt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):Pt?(this.resetInvalidDateSymbol(e),ct=(0,n.cloneDate)(Et),this.getExisting("M")&&this.getExisting("d")&&(this.setExisting("y",!0),this.resetInvalidDateSymbol("y"))):(this.resetInvalidDateSymbol(e),ct=(0,n.cloneDate)(bt)):(St=!0,this.setInvalidDatePart(e,{value:pt,date:(0,n.cloneDate)(bt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1))),!St){if(this.setExisting(e,!0),c&&!(0,r.isValidDate)(H)){var Mt=this.intl.parseDate(C+$+F,this.format,this.localeId);(0,r.isValidDate)(Mt)&&(this._value=Mt)}else this._value=ct;this.getValue()&&this.resetInvalidDate()}return at=!1,at="M"===e?ot>=2||rt.length>=2:T?this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:!this.autoCorrectParts,middle:$,patternValue:q,basePrefix:C,baseSuffix:F,prefix:x,suffix:V,symbol:e,patternLength:z,leadingZero:Y}).switchToNext:rt.length>A,(0,r.extend)(y,{value:null,switchToNext:at,hasInvalidDatePart:St})}}return(0,r.extend)(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(s.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.getLeadingZero=function(){return this.leadingZero||{}},t.prototype.normalizeCentury=function(t){if(!(0,r.isPresent)(t))return t;var e=(0,r.cropTwoDigitYear)(t),i=this.getNormalizedCenturyBase(e);return(0,r.setYears)(t,i+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var i=this.partPattern(t,e);return"month"===i.type&&i.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var i=t.replace(/^0*/,"")+"0";return(0,s.padZero)(e.length-i.length)+i},t.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var i=parseInt(this.typedMonthPart,10);if(i>=1&&i<=12&&i.toString()===this.typedMonthPart)return this.monthNames[i-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},t.prototype.matchDayPeriod=function(t,e){var i=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(i))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(i))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),i=0;i<e.length;i++)if("month"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),i=0;i<e.length;i++)if("dayperiod"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:l.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var i=this.intl.splitDateFormat(e,this.localeId),n=[],s=[],r=0;r<i.length;r++)for(var l=this.intl.formatDate(t,{pattern:i[r].pattern},this.localeId).length;l>0;)n.push(this.symbols[i[r].pattern[0]]||o.Constants.formatSeparator),s.push(i[r]),l--;var h=new a.Mask;return h.symbols=n.join(""),h.partMap=s,h},t.prototype.merge=function(t,e){for(var i="",n="",a=e.symbols,o=!1,l=0,h=this.getFormattedInvalidDates(a),u=a.length-1;u>=0;u--){var c=this.getPartsForSegment(e,u);if(-1===this.knownParts.indexOf(a[u])||this.getExisting(a[u]))this.autoCorrectParts?i=t[u]+i:t.length!==a.length?o?i=t[u]+i:l>0?(i=t[u]+i,--l<=0&&(o=!0)):i=(t[u+t.length-a.length]||"")+i:i=t[u]+i,n=a[u]+n;else{var d=a[u],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;u>=0&&d===a[u];)u--;u++}if(this.leadingZero&&this.leadingZero[d])i="0"+i;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(d)){var m=this.getInvalidDatePartValue(d).toString();"M"===d?(m=((0,r.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),c.length>2?i=h[d][u]+i:(m=((0,r.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),i=(0,s.padZero)(c.length-m.length)+m+i,p=c.length-1,l=m.length-c.length)):(i=(0,s.padZero)(c.length-m.length)+m+i,p=c.length-1,l=m.length-c.length)}else i=this.dateFieldName(e.partMap[u])+i;for(;n.length<i.length;)n=a[u]+n;0!==p&&(u=u-p+(t.length-a.length))}}return{text:i,format:n}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var i=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,r.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!1)})),i&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var i=e.value,n=void 0===i?null:i,a=e.date,s=void 0===a?null:a,r=e.startDateOffset,o=void 0===r?0:r,l=e.startDate,h=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=n,this._partiallyInvalidDate.invalidDateParts[t].date=s,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=o,this._partiallyInvalidDate.startDate=h)},t.prototype.hasInvalidDatePart=function(){var t=this,e=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(i){t._partiallyInvalidDate.invalidDateParts[i]&&(0,r.isPresent)(t._partiallyInvalidDate.invalidDateParts[i].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,i){var a=(0,n.cloneDate)(t),s=!1;switch(e){case"y":a.setFullYear(a.getFullYear()+i);break;case"M":a=(0,n.addMonths)(this.value,i);break;case"d":case"E":a.setDate(a.getDate()+i);break;case"h":case"H":a.setHours(a.getHours()+i),s=!0;break;case"m":a.setMinutes(a.getMinutes()+i),s=!0;break;case"s":a.setSeconds(a.getSeconds()+i),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+i);break;case"a":a.setHours(a.getHours()+12*i),s=!0}return{date:a,timeModified:s}},t.prototype.modifyDateSymbolWithValue=function(t,e,i){var a=(0,n.cloneDate)(t);switch(e){case"y":a.setFullYear(i);break;case"M":a=(0,n.addMonths)(t,i-t.getMonth());break;case"d":case"E":a.setDate(i);break;case"h":case"H":case"a":a.setHours(i);break;case"m":a.setMinutes(i);break;case"s":a.setSeconds(i);break;case"S":a.setMilliseconds(i)}return a},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var i=t.partMap[e],n=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(i.type!==s.type||i.pattern!==s.pattern)break;n.push(s)}for(a=e-1;a>=0&&(s=t.partMap[a],i.type===s.type&&i.pattern===s.pattern);a--)n.unshift(s);return n},t.prototype.isPeekDateOverflowingDatePart=function(t){var e=t.useBasePrefixAndSuffix,i=t.middle,n=t.patternValue,a=t.basePrefix,o=t.baseSuffix,l=t.prefix,h=t.suffix,u=t.symbol,c=t.patternLength,d=t.leadingZero,p=this.peek(i,n),m=e?"".concat(a).concat(p).concat(o):"".concat(l).concat(p).concat(h),v=this.intl.parseDate(m,this.format,this.localeId),g=((this.leadingZero||{})[u]||0)+(0,s.unpadZero)(i).length>=c;return{peekedDate:v,peekedDateString:m,peekedValue:p,parsedPeekedValue:(0,r.parseToInt)(p),switchToNext:null===v||(d[u]?n.length<=i.length:g)}},t}();e.DateObject=h},503:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},874:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=void 0,e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0;e.Mask=function(){this.symbols="",this.partMap=[]}},179:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var n=i(849),a={events:{}},s=function(){function t(t){this.options=(0,n.extend)({},a,t)}return t.prototype.destroy=function(){this.options={}},t.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!(0,n.isFunction)(this.options.events[t])&&(this.options.events[t]((0,n.extend)(i,e,{sender:this})),i.defaultPrevented)},t}();e.Observable=s},849:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.isValidDate=e.areDatePartsEqualTo=e.millisecondStepFor=e.millisecondDigitsInFormat=e.setYears=e.cropTwoDigitYear=e.isFunction=e.noop=e.deepExtend=e.extend=e.clamp=e.isParseableToInt=e.parseToInt=e.isNumber=e.isDocumentAvailable=e.isPresent=void 0;var n=i(426),a=i(231),s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return(0,e.isPresent)(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.isParseableToInt=function(t){return(0,e.isNumber)((0,e.parseToInt)(t))&&/^[0-9]+$/.test(t)},e.clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var i,a,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return t;var l=r.shift();if(s(t)&&s(l))for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&"__proto__"!==h&&"constructor"!==h&&"prototype"!==h&&(l[h]instanceof HTMLElement?t[h]=l[h]:!s(l[h])||l[h]instanceof Date?(0,e.extend)(t,((a={})[h]=l[h],a)):(t[h]&&s(t[h])||(0,e.extend)(t,((i={})[h]={},i)),(0,e.deepExtend)(t[h],l[h])));return e.deepExtend.apply(void 0,n.__spreadArray([t],r,!1))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!(0,e.isPresent)(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=function(t,e){var i=(0,a.cloneDate)(t);return i.setFullYear(e),i},e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,i,n,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==i||t.getDate()!==n||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},e.isValidDate=function(t){return(0,e.isPresent)(t)&&t.getTime&&(0,e.isNumber)(t.getTime())},e.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Macintosh/i.test(navigator.userAgent)}},415:(t,e,i)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInput=void 0;var a=i(426),s=i(953),r=i(506),o=i(874),l=i(503),h=i(849),u=i(179),c=i(655),d=i(231),p=i(761),m="dragStart",v="drop",g="touchstart",f="mousedown",y="mouseup",D="click",E="input",P="keydown",b="focus",S="blur",M="paste",I="DOMMouseScroll",x="mousewheel",O="valueChange",w="inputEnd",C="blurEnd",F="focusEnd",V="change",k={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(n={},n[O]=null,n[E]=null,n[w]=null,n[b]=null,n[F]=null,n[S]=null,n[C]=null,n[P]=null,n[x]=null,n[V]=null,n),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1,toggleDayPeriod:!1},T=function(t){function e(e,i){var n=t.call(this,i)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=c.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(e,i),n}return a.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!1,configurable:!0}),e.prototype.init=function(t,e){var i=(0,h.isValidDate)(this.options.value)?(0,d.cloneDate)(this.options.value):new Date(e.formattedValue);(0,h.isValidDate)(i)||(i=null),this.element=t,this.options=(0,h.extend)({},k,e,{steps:a.__assign(a.__assign({},k.steps),e.steps)}),this.intl=this.options.intlService,this.dateObject=this.createDateObject(),this.dateObject.setValue(i),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener(m,this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener(v,this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener(D,this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener(f,this.onElementMouseDown),this.element.addEventListener(g,this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener(y,this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener(E,this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener(P,this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener(b,this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener(S,this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener(V,this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener(M,this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener(I,this.onElementMouseWheel),this.element.addEventListener(x,this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener(m,this.onElementDragStart),this.element.removeEventListener(v,this.onElementDrop),this.element.removeEventListener(g,this.onElementMouseDown),this.element.removeEventListener(f,this.onElementMouseDown),this.element.removeEventListener(y,this.onElementMouseUp),this.element.removeEventListener(D,this.onElementClick),this.element.removeEventListener(E,this.onElementInput),this.element.removeEventListener(P,this.onElementKeyDown),this.element.removeEventListener(b,this.onElementFocus),this.element.removeEventListener(S,this.onElementBlur),this.element.removeEventListener(V,this.onElementChange),this.element.removeEventListener(M,this.onElementPaste),this.element.removeEventListener(I,this.onElementMouseWheel),this.element.removeEventListener(x,this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=(0,h.extend)({},this.options,t,{steps:a.__assign(a.__assign({},k.steps),t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.setDateObjectOptions=function(){if(this.dateObject){var t=this.getDateObjectOptions();this.dateObject.setOptions(t)}},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var i=this.element.selectionStart!==this.element.selectionEnd,n=(0,h.isPresent)(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,a=!i&&n?0:this.caret()[0];this.selectNearestSegment(a)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.elementValue;if(this.element&&this.dateObject){var i=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var n=this.keyDownEvent||{},a=n.keyCode===o.KeyCode.BACKSPACE||n.key===l.Key.BACKSPACE,s=n.keyCode===o.KeyCode.DELETE||n.key===l.Key.DELETE,u=this.interactionMode;!this.options.allowCaretMode||u===c.DateInputInteractionMode.Caret||s||a||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var m=this.isInCaretMode();if(m&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var v=this.dateObject&&this.dateObject.getValue(),g=this.dateObject?this.dateObject.value:null,f=this.dateObject.getTextAndFormat(),y=f.text,D=f.format;this.currentFormat=D;var E;E=m&&(a||s||u===c.DateInputInteractionMode.Caret)?this.previousElementValue:y;var P=this.elementValue,b=(0,r.approximateStringMatching)({oldText:E,newText:P,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:m,keyEvent:this.keyDownEvent});if(b&&b.length&&b[0]&&b[0][1]!==p.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!m||b&&0!==b.length){if(m&&1===b.length){if(!b[0]||!b[0][0])return void this.restorePreviousInputEventState();if(m&&b[0]&&(b[0][0]===p.Constants.formatSeparator||b[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var S=1===b.length&&b[0][1]===p.Constants.formatSeparator,M=[],I=!1,x=null;if(!S)for(var O=0;O<b.length;O++){var w=this.dateObject.parsePart({symbol:b[O][0],currentChar:b[O][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:a||s,originalFormat:this.currentFormat});M.push(w),w.value||(x={type:"parse"}),I=w.switchToNext}this.options.autoSwitchParts||(I=!1),this.resetSegmentValue=!1;var C,F=this.options.format===this.currentFormat||(0,h.isPresent)(this.options.format)&&this.options.format.length>1,V=M[M.length-1],k=V&&!(0,h.isPresent)(V.value),T=m&&(a||s)&&k,_=!!V&&V.resetPart,A=this.dateObject.getValue(),N=!(0,d.isEqual)(v,A),j=this.dateObject.value,L=this.selection;if(m){var K=b&&b.length>0?b[0][0]:null,W=this.dateObject.getLeadingZero()[K];b.length&&b[0][0]!==p.Constants.formatSeparator?I?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):_?(C=this.currentFormat[L.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(C))):this.restorePreviousInputEventState():T?(this.forceUpdate(),b.length&&b[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(b[0][0]))):k?"0"===t.data&&W||((0,h.isPresent)(v)&&!(0,h.isPresent)(A)?this.restorePreviousInputEventState():!(0,h.isPresent)(v)&&(0,h.isPresent)(A)?this.forceUpdateWithSelection():(0,h.isPresent)(v)&&(0,h.isPresent)(A)?N?this.forceUpdateWithSelection():this.restorePreviousInputEventState():(0,h.isPresent)(v)||(0,h.isPresent)(A)?g!==j||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):k||F||this.forceUpdateWithSelection():(this.options.autoSwitchParts||b[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(b[0][0]))}else m||(this.forceUpdate(),b.length&&b[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(b[0][0])),this.options.autoSwitchParts?S?(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):I&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):V&&V.switchToNext?this.resetSegmentValue=!0:S&&(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),a&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1));this.tryTriggerValueChange({oldValue:v,event:t}),this.triggerInputEnd({event:t,error:x,oldElementValue:e,newElementValue:this.elementValue}),m&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,i=e.start,n=e.end,a=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:n},this.keyEventMatchesAutoSwitchKeys(t)){var s=t.keyCode===o.KeyCode.TAB;if(!s)return t.preventDefault(),void this.switchDateSegment(1);var r=this.selection,l=r.start,h=r.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),l!==this.selection.start||h!==this.selection.end)return void t.preventDefault()}var u=this.currentFormat[this.selection.start],c=this.getStepFromSymbol(u),d=!1,p=this.elementValue;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(c,u,a),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-c,u,a),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ENTER:break;case o.KeyCode.HOME:this.selectNearestSegment(0),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;case o.KeyCode.END:this.selectNearestSegment(this.elementValue.length),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;default:return}d&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){var e=this.elementValue;if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var i=t;i.shiftKey?this.switchDateSegment((i.wheelDelta||-i.detail)>0?-1:1):this.modifyDateSegmentValue((i.wheelDelta||-i.detail)>0?1:-1),i.returnValue=!1,i.preventDefault&&i.preventDefault(),e!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:e})}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;(0,h.isPresent)(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var i=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:i,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),(0,h.isDocumentAvailable)()&&(0,h.isIOS)()&&this.element.scrollIntoView({block:"nearest",inline:"nearest"}),t.start!==t.end&&(this.interactionMode=c.DateInputInteractionMode.Selection))},e.prototype.selectionBySymbol=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e&&(e=n));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?i+=this.currentText.length-this.currentFormat.length:i=Math.max(0,i-(this.currentFormat.length-this.currentText.length))),{start:e,end:i}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},i=t,n=t-1;i<this.currentFormat.length||n>=0;i++,n--){if(i<this.currentFormat.length&&this.currentFormat[i]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}if(n>=0&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var i=e.start,n=this.currentFormat[i-1],a="",s="";if(t<0){for(var r=i+t;r>=0;r--)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==n){i=r,a=s;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==n){i=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}this.interactionMode=c.DateInputInteractionMode.None;var o=this.selection,l=o.start,h=o.end;if(l<h&&this.currentFormat[l]!==this.currentFormat[h-1])return this.setSelection(this.selectionByIndex(t>0?l:h-1)),this.resetSegmentValue=!0,void(this.interactionMode=c.DateInputInteractionMode.None);for(var u=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===u||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var m=d;m>=0&&m<this.currentFormat.length&&this.currentFormat[m]===this.currentFormat[d];)m+=t;d>m&&(m+1!==l||d+1!==h)?(this.setSelection({start:m+1,end:d+1}),this.resetSegmentValue=!0):d<m&&(d!==l||m!==h)&&(this.setSelection({start:d,end:m}),this.resetSegmentValue=!0),this.interactionMode=c.DateInputInteractionMode.None}},e.prototype.modifyDateSegmentValue=function(t,e,i){if(void 0===e&&(e=""),void 0===i&&(i={}),this.dateObject&&!this.options.readonly){var n=this.value,a=1,s=this.caret();if("S"===(e=e||this.currentFormat[s[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var r=(0,h.millisecondDigitsInFormat)(this.inputFormat);a=(0,h.millisecondStepFor)(r)}this.dateObject.modifyPart(e,a*t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!(0,d.isEqual)(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger(O,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger(E,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null,oldElementValue:"",newElementValue:""}),this.trigger(w,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger(b,(0,h.extend)({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(F,(0,h.extend)({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger(S,(0,h.extend)({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(C,(0,h.extend)({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger(V,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger(P,(0,h.extend)({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger(x,(0,h.extend)({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,i=t.end,n=this.elementValue.length;this.forceUpdate();var a=this.elementValue.length-n;this.setSelection({start:e+a,end:i+a})},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,i=t.format;this.currentFormat=i,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,i=t.end;this.setSelection({start:e||0,end:i||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!(0,h.isValidDate)(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(e),n=i.text,a=i.format;this.currentFormat=a,this.currentText=n;var s=this.options.hasPlaceholder||(0,h.isPresent)(this.options.placeholder),r=!this.isActive&&s&&!this.dateObject.hasValue();s&&(0,h.isPresent)(this.options.placeholder)&&(t.placeholder=this.options.placeholder);var o=r?"":n;this.previousElementValue=this.elementValue,this.setElementValue(o)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var i=void 0!==t,n=[t,t],a=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(i&&((0,h.isDocumentAvailable)()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),n=[a.selectionStart,a.selectionEnd])}catch(t){n=[]}return n}},e.prototype.selectNearestSegment=function(t){for(var e=t,i=t-1;e<this.currentFormat.length||i>=0;e++,i--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(i>=0&&"_"!==this.currentFormat[i])return void this.selectDateSegment(this.currentFormat[i])}},e.prototype.selectDateSegment=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e&&(e=n));e<0&&(e=0),this.caret(0,0),this.caret(e,i)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero;this.options.value=t;var i=this.createDateObject();return i.setLeadingZero(this.isActive?e:null),i},e.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new s.DateObject((0,h.extend)({},t))},e.prototype.getDateObjectOptions=function(){return{intlService:this.options.intlService,formatPlaceholder:this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value,toggleDayPeriod:this.options.toggleDayPeriod,autoSwitchParts:this.options.autoSwitchParts}},e.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));return e.indexOf(t.keyCode.toString())>=0||e.indexOf(t.keyCode)>=0||e.indexOf(t.key.toLowerCase().trim())>=0},e.prototype.autoFill=function(){var t,e,i,n,a,s,r=this.dateObject,o=new Date;(r.date||r.month||r.year||r.hours||r.minutes||r.seconds)&&(i=r.year?r.value.getFullYear():o.getFullYear(),e=r.month?r.value.getMonth():o.getMonth(),t=r.date?r.value.getDate():o.getDate(),n=r.hours?r.value.getHours():o.getHours(),a=r.minutes?r.value.getMinutes():o.getMinutes(),s=r.seconds?r.value.getSeconds():o.getSeconds(),r.setValue(new Date(i,e,t,n,a,s)),this.refreshElementValue(),this.triggerValueChange())},e}(u.Observable);e.DateInput=T},655:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInputInteractionMode=void 0,function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(i||(e.DateInputInteractionMode=i={}))},506:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInRange=e.dateSymbolMap=e.approximateStringMatching=e.unpadZero=e.padZero=void 0;var n=i(761),a=i(503);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,i=t.newText,s=t.formatPattern,r=t.selectionStart,o=t.isInCaretMode,l=t.keyEvent,h=r+e.length-i.length,u=e[h],c=e.substring(0,h),d=i.substring(0,r),p=[];if(c===d&&r>0)return p.push([s[r-1],d[r-1]]),p;if(0===c.indexOf(d)&&o&&(l.key===a.Key.DELETE||l.key===a.Key.BACKSPACE)||0===c.indexOf(d)&&!o&&(0===d.length||s[d.length-1]!==s[d.length])){var m="";o||1!==d.length||p.push([s[0],d[0]]);for(var v=d.length;v<c.length;v++)s[v]!==m&&s[v]!==n.Constants.formatSeparator&&(m=s[v],p.push([m,""]));return p}if(o&&(0===d.indexOf(c)||s[r-1]===n.Constants.formatSeparator)||!o&&(0===d.indexOf(c)||s[r-1]===n.Constants.formatSeparator)){var g=s[0];for(v=Math.max(0,c.length-1);v<s.length;v++)if(s[v]!==n.Constants.formatSeparator){g=s[v];break}return[[g,d[r-1]]]}return" "===d[d.length-1]||d[d.length-1]===u&&"_"===s[h]?[[s[r-1],n.Constants.formatSeparator]]:[[s[r-1],d[r-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,i){return null===t||!(e&&e>t||i&&i<t)}},231:e=>{e.exports=t},426:t=>{t.exports=e}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return i[t](s,s.exports,a),s.exports}var s={};return(()=>{var t=s;Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0;var e=a(415);Object.defineProperty(t,"DateInput",{enumerable:!0,get:function(){return e.DateInput}})})(),s})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@progress/kendo-date-math"),require("tslib")):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.KendoDateinputsCommon=e(require("@progress/kendo-date-math"),require("tslib")):t.KendoDateinputsCommon=e(t.KendoDateMath,t.self)}(self,((t,e)=>(()=>{"use strict";var i={761:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},953:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateObject=void 0;var n=i(231),a=i(930),s=i(506),r=i(849),o=i(761),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,i=t.formatPlaceholder,a=t.format,s=t.cycleTime,r=void 0!==s&&s,l=t.twoDigitYearMax,h=void 0===l?o.Constants.twoDigitYearMax:l,u=t.value,c=void 0===u?null:u,d=t.autoCorrectParts,p=void 0===d||d,m=t.toggleDayPeriod,v=void 0!==m&&m,g=t.autoSwitchParts,f=void 0===g||g;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.dayperiod=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=this.getDefaultDate(),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.setOptions({intlService:e,formatPlaceholder:i,format:a,cycleTime:r,twoDigitYearMax:h,value:c,autoCorrectParts:p,toggleDayPeriod:v,autoSwitchParts:f}),c)this._value=(0,n.cloneDate)(c);else{this._value=this.getDefaultDate();for(var y=this.dateFormatString(this.value,this.format).symbols,D=0;D<y.length;D++)this.setExisting(y[D],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=o.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),i=0;i<e.length;i++){var n=e[i],a=this.intl.cldr[n];if(a.name&&a.calendar&&a.numbers&&a.name!==o.Constants.defaultLocaleId){t=a.name;break}}return t},enumerable:!1,configurable:!0}),t.prototype.setOptions=function(t){this.intl=t.intlService,this.formatPlaceholder=t.formatPlaceholder||"wide",this.format=t.format,this.cycleTime=t.cycleTime,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=t.twoDigitYearMax,this.autoCorrectParts=t.autoCorrectParts,this.toggleDayPeriod=t.toggleDayPeriod,this.autoSwitchParts=t.autoSwitchParts},t.prototype.setValue=function(t){t?(0,n.isEqual)(t,this._value)?(0,n.isEqual)(t,this._value)&&this.dayPeriods&&this.setExisting("a",!0):(this._value=(0,n.cloneDate)(t),this.modifyExisting(!0)):(this._value=this.getDefaultDate(),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,i){return e||"literal"!==i.type&&"dayperiod"!==i.type&&t.getExisting(i.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return(0,n.cloneDate)(this.value)},t.prototype.createDefaultDate=function(){return(0,n.createDate)(2e3,0,31)},t.prototype.getDefaultDate=function(){return(0,n.getDate)(this.createDefaultDate())},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,i=this.intl.formatDate(this.value,e,this.localeId),n=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var a="",o=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),h=0;h<o.length;h++){var u=n.symbols[h];if("literal"===n.partMap[h].type)a+=i[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(n,h);if("M"===u){var d=((0,r.parseToInt)(this.getInvalidDatePartValue(u))+1).toString();c.length>2?a+=l[u][h]:this.getInvalidDatePartValue(u)?(a+=(0,s.padZero)(c.length-d.length)+d,h+=c.length-1):a+=l[u][h]}else this.getInvalidDatePartValue(u)?(d=this.getInvalidDatePartValue(u).toString(),a+=(0,s.padZero)(c.length-d.length)+d,h+=c.length-1):a+=l[u][h]}else a+=i[h]}i=a}return this.merge(i,n)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var i=t||this.format,n={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var a=e.getInvalidDatePart(t).date;if(a){var s=e.intl.formatDate(a,i,e.localeId);n[t]=s}})),n},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,i=0;i<e.length;i++)this.setExisting(e[i],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"t":case"a":return this.dayperiod;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"t":case"a":this.dayperiod=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if((0,r.isPresent)(t)&&(0,r.isPresent)(e)&&0!==e){var i,a=(0,n.cloneDate)(this.value),s=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o){var u=a.getHours();switch(t){case"y":a.setFullYear(a.getFullYear()+e);break;case"M":a=(0,n.addMonths)(this.value,e);break;case"d":case"E":a.setDate(a.getDate()+e);break;case"h":case"H":a.setHours(a.getHours()+e),s=!0;break;case"m":a.setMinutes(a.getMinutes()+e),s=!0;break;case"s":a.setSeconds(a.getSeconds()+e),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+e);break;case"a":this.toggleDayPeriod?a.setHours(u>=12?u-12:u+12):a.setHours(a.getHours()+12*e),s=!0}}else{var c=this._partiallyInvalidDate.invalidDateParts||{},d=this.getInvalidDatePartValue(t),p=c.y.value||a.getFullYear(),m=c.M.value||a.getMonth(),v=c.d.value||c.E.value||a.getDate(),g=c.h.value||c.H.value||a.getHours(),f=c.m.value||a.getMinutes(),y=c.s.value||a.getSeconds(),D=c.S.value||a.getMilliseconds();switch(t){case"y":p+=e;break;case"M":m+=e;break;case"d":case"E":v+=e}if("M"===t){if((m<0||m>11)&&h)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!h){if(m<0)m=(0,r.clamp)(m%11+1+11,0,11);else{var E=(0,r.isPresent)(d)?m:(e-1)%12;m=(0,r.clamp)(E,0,11)}m=(0,r.clamp)(m,0,11)}m=(0,r.clamp)(m,0,11)}else if("d"===t)if(h){if(v<=0||v>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!h){if((0,r.isPresent)(d)&&(v<=0||v>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var P=(0,r.isPresent)(d)?v:31-Math.abs(e%31)+1;v=(0,r.clamp)(P,1,31)}else P=(0,r.isPresent)(d)?v:e%31,v=(0,r.clamp)(P,1,31);v=(0,r.clamp)(v,1,31)}var b=(0,n.createDate)(p,m,v,g,f,y,D),S=o||l?this.modifyDateSymbolWithValue(a,t,o?m:v):null,M=(0,r.areDatePartsEqualTo)(b,p,m,v,g,f,y,D);this.getValue()&&(0,r.areDatePartsEqualTo)(b,p,m,v,g,f,y,D)?(a=(0,n.cloneDate)(b),this.markDatePartsAsExisting()):o&&S?S.getMonth()===m?this.getExisting("d")?M?(a=(0,n.cloneDate)(b),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:m,date:(0,n.cloneDate)(S),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(this.resetInvalidDateSymbol(t),a=(0,n.cloneDate)(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),a=(0,n.cloneDate)(S)):(i=!0,this.setInvalidDatePart(t,{value:m,date:(0,n.cloneDate)(S),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===v?this.getExisting("M")?M?(a=(0,n.cloneDate)(b),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:v,date:(0,n.cloneDate)(S),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)):M?(a=(0,n.cloneDate)(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),a=(0,n.cloneDate)(S)):(i=!0,this.setInvalidDatePart(t,{value:v,date:(0,n.cloneDate)(this.value),startDateOffset:e,startDate:(0,n.cloneDate)(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(a=this.normalizeCentury(a)),s&&!this.cycleTime&&(a.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=a,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,a=t.resetSegmentValue,o=t.cycleSegmentValue,l=t.rawTextValue,h=t.isDeleting,u=t.originalFormat,c=!o,d=this.dateFormatString(this.value,this.format),p=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),m=d.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),v=0;v<p.length;v++){for(var g=p[v],f=0;f<g.pattern.length;f++)p[v+f]&&(p[v+f].literal=g.pattern[f]);v+=g.pattern.length-1}for(v=0;v<m.length;v++){for(g=m[v],f=0;f<g.pattern.length;f++)m[v+f]&&(m[v+f].text=g.pattern[f]);v+=g.pattern.length-1}var y={value:null,switchToNext:!1,resetPart:c&&"M"===e&&d.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!i){if(!c)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,r.extend)(y,{value:null,switchToNext:!1});for(v=0;v<p.length;v++){var D=p[v].literal,E=l.startsWith(D),P=l.endsWith(D),b=l.indexOf(D+D)>=0;if(E||P||b)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,r.extend)(y,{value:null,switchToNext:!1})}}var S=this.intl.formatDate(this.value,this.format,this.localeId),M=d.symbols,I=!1,x="",O="",w="",C="",F="",V="",k="";for(v=0;v<m.length;v++)k+=m[v].text;var T=this.format===M||this.format===k||this.format===u||this.format.length===u.length,_=(T?k:u).indexOf(e),A=(T?k:u).lastIndexOf(e)-_+1,N=u.length-l.length;if(c||!c&&!this.autoCorrectParts){var j=0;for(v=0;v<S.length;v++)if(M[v]===e){var L=this.getExisting(e);if("y"===e)if(!this.hasInvalidDatePart()&&this.getExisting("y"))O+=S[v];else{var K=this.getInvalidDatePartValue(e);(0,r.isPresent)(K)?(O+=(K||"").toString()[j]||"",j++):O+=L?S[v]:"0"}else O+=L?S[v]:"0";N>0?w.length+N<A&&(w+=l[v]||""):w+=l[v]||"",I=!0}else I?(V+=S[v],F+=S[v]):(x+=S[v],C+=S[v]);if(T&&(k.length<l.length?w+=i:!h&&(u.length,l.length),w.length>A))return(0,r.extend)(y,{value:null,switchToNext:!1});if(!T||T&&!this.autoCorrectParts){O="",w="",x="",V="",I=!1;var W=0;for(v=0;v<u.length;v++)u[v]===e?(L=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?O+=S[v]:(K=this.getInvalidDatePartValue(e),(0,r.isPresent)(K)?(O+=(K||"").toString()[W]||"",W++):O+=L?S[v]:"0"):O+=L?S[v]||"":"0",N>0?w.length+N<A&&(w+=l[v]||""):w+=l[v]||"",I=!0):I?V+=l[v-N]||"":x+=l[v]||"";u.length<l.length&&(w+=i)}}if(!c)if(this.autoCorrectParts)for(O="",w="",x="",V="",I=!1,v=0;v<S.length;v++)M[v]===e?(O+=(L=this.getExisting(e))?S[v]:"0",I=!0):I?V+=S[v]:x+=S[v];else O=a?w:O;var H=null,B=this.matchMonth(i),Z=B.monthName,R=B.matchesCount,Y=this.matchDayPeriod(i,e),U="0"===i,q=this.leadingZero||{};U?("0"===w&&(w=O),0!==(0,r.parseToInt)(a?i:(c?w:O)+i)||this.isAbbrMonth(d.partMap,e)||"a"===e||this.incrementLeadingZero(e)):this.resetLeadingZero();var z=this.partPattern(d.partMap,e),G=z?z.pattern:null,J=this.patternLength(G)||G.length;if(c&&h&&!w)return this.setExisting(e,!1),(0,r.extend)(y,{value:null,switchToNext:!1});var $=O.length-3,Q=!0,X=c?w:O;for(v=Math.max(0,$);v<=O.length&&Q;v++){X=a?i:c?w:O.substring(v)+i,this.autoSwitchParts&&"h"===e&&"12"===O.substring(v)&&(X=X.replace("12","0")),!c&&this.autoCorrectParts||(Q=!1,X=(0,s.unpadZero)(X),X=(0,s.padZero)(J-X.length)+X);var tt=parseInt(X,10),et=x+X+V;(H=this.intl.parseDate(et,this.format,this.localeId))&&this.value&&d.partMap.every((function(t){return"year"!==t.type&&"month"!==t.type&&"day"!=t.type}))&&(H.setFullYear(this.value.getFullYear()),H.setMonth(this.value.getMonth()),H.setDate(this.value.getDate()));var it=!1;c&&!(0,r.isValidDate)(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(C+X+F,this.format,this.localeId),it=!0);var nt=!isNaN(parseInt(i,10))||c&&h&&""===i;if(!H&&!isNaN(tt)&&nt&&this.autoCorrectParts){if("M"===e&&!Z){var at=tt-1;at>-1&&at<12&&((H=(0,n.cloneDate)(this.value)).setMonth(at),H.getMonth()!==at&&(H=(0,n.lastDayOfMonth)((0,n.addMonths)(H,-1))))}"y"===e&&(H=(0,n.createDate)(parseInt(X,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(c&&(0,r.isValidDate)(H)||!c&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=(0,n.lastDayOfMonth)((0,n.addMonths)(H,-1))))}if(c&&(0,r.isValidDate)(H)||!c&&H){var st=this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:it,middle:X,patternValue:G,basePrefix:C,baseSuffix:F,prefix:x,suffix:V,symbol:e,patternLength:J,leadingZero:q}),rt=st.switchToNext;return this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),"H"===e&&H.getHours()>=12&&this.setExisting("a",!0),this._value=H,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e?this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")):"y"===e&&this.markDatePartsAsExisting(),this.hasInvalidDatePart()||(this.markDatePartsAsExisting(),st.peekedDate||!st.switchToNext||this.autoCorrectParts||"M"===e||"d"===e&&30===st.parsedPeekedValue&&1===this.value.getMonth()&&(rt=!1))),(0,r.extend)(y,{value:this.value,switchToNext:rt})}}if(Z&&(H=this.intl.parseDate(x+Z+V,this.format,this.localeId)))return this._value=H,this.setExisting(e,!0),(0,r.extend)(y,{value:this.value,switchToNext:1===R});if(Y&&(H=this.intl.parseDate(x+Y+V,this.format)||this.intl.parseDate(C+Y+F,this.format)))return this._value=H,this.setExisting(e,!0),(0,r.extend)(y,{value:this.value,switchToNext:!0});if(U&&"a"!==e&&this.setExisting(e,!1),!this.autoCorrectParts){var ot=void 0,lt=c?w:X,ht=(0,r.parseToInt)(lt);if((0,r.isNumber)(ht)&&(0,r.isParseableToInt)(lt)){if("d"===e&&(ht<=0||ht>31)||"M"===e&&(ht<=0||ht>11)){if(c)return(0,r.extend)(y,{value:null,switchToNext:!1});lt=i,ht=(0,r.parseToInt)(lt)}if(!(0,r.isNumber)(ht)||!(0,r.isParseableToInt)(lt))return(0,r.extend)(y,{value:null,switchToNext:!1});ot="M"===e?ht-1:ht;var ut="y"===e,ct="M"===e,dt="d"===e,pt=(0,n.cloneDate)(this._value),mt=this._partiallyInvalidDate.invalidDateParts||{},vt=ut?ot:mt.y.value||pt.getFullYear(),gt=ct?ot:mt.M.value||pt.getMonth(),ft=dt?ot:mt.d.value||mt.E.value||pt.getDate(),yt=mt.h.value||mt.H.value||pt.getHours(),Dt=mt.m.value||pt.getMinutes(),Et=mt.s.value||pt.getSeconds(),Pt=mt.S.value||pt.getMilliseconds(),bt=(0,n.createDate)(vt,gt,ft,yt,Dt,Et,Pt),St=(0,r.areDatePartsEqualTo)(bt,vt,gt,ft,yt,Dt,Et,Pt),Mt=ut||ct||dt?this.modifyDateSymbolWithValue(pt,e,ut?vt:ct?gt:ft):null,It=!1;if(ct&&Mt?Mt.getMonth()===gt?this.getExisting("d")?St?(pt=(0,n.cloneDate)(bt),this.resetInvalidDateSymbol(e)):(It=!0,this.setInvalidDatePart(e,{value:gt,date:(0,n.cloneDate)(Mt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):St?(this.resetInvalidDateSymbol(e),pt=(0,n.cloneDate)(bt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),pt=(0,n.cloneDate)(Mt)):(It=!0,this.setInvalidDatePart(e,{value:gt,date:(0,n.cloneDate)(Mt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):dt&&Mt?Mt.getDate()===ft?this.getExisting("M")?St?(pt=(0,n.cloneDate)(bt),this.resetInvalidDateSymbol(e)):(It=!0,this.setInvalidDatePart(e,{value:ft,date:(0,n.cloneDate)(Mt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):St?(pt=(0,n.cloneDate)(bt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),pt=(0,n.cloneDate)(Mt)):(It=!0,this.setInvalidDatePart(e,{value:ft,date:(0,n.cloneDate)(this.value),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):ut&&Mt&&(Mt.getFullYear()===vt?this.getExisting("d")&&this.getExisting("M")?St?(pt=(0,n.cloneDate)(bt),this.resetInvalidDateSymbol(e)):(It=!0,this.setInvalidDatePart(e,{value:vt,date:(0,n.cloneDate)(Mt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1)):St?(this.resetInvalidDateSymbol(e),pt=(0,n.cloneDate)(bt),this.getExisting("M")&&this.getExisting("d")&&(this.setExisting("y",!0),this.resetInvalidDateSymbol("y"))):(this.resetInvalidDateSymbol(e),pt=(0,n.cloneDate)(Mt)):(It=!0,this.setInvalidDatePart(e,{value:vt,date:(0,n.cloneDate)(Mt),startDate:(0,n.cloneDate)(this.value)}),this.setExisting(e,!1))),!It){if(this.setExisting(e,!0),c&&!(0,r.isValidDate)(H)){var xt=this.intl.parseDate(C+X+F,this.format,this.localeId);(0,r.isValidDate)(xt)&&(this._value=xt)}else this._value=pt;this.getValue()&&this.resetInvalidDate()}return rt=!1,rt="M"===e?ht>=2||lt.length>=2:T?this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:!this.autoCorrectParts,middle:X,patternValue:G,basePrefix:C,baseSuffix:F,prefix:x,suffix:V,symbol:e,patternLength:J,leadingZero:q}).switchToNext:lt.length>A,(0,r.extend)(y,{value:null,switchToNext:rt,hasInvalidDatePart:It})}}return(0,r.extend)(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(s.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.getLeadingZero=function(){return this.leadingZero||{}},t.prototype.normalizeCentury=function(t){if(!(0,r.isPresent)(t))return t;var e=(0,r.cropTwoDigitYear)(t),i=this.getNormalizedCenturyBase(e);return(0,r.setYears)(t,i+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var i=this.partPattern(t,e);return"month"===i.type&&i.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var i=t.replace(/^0*/,"")+"0";return(0,s.padZero)(e.length-i.length)+i},t.prototype.matchMonth=function(t){var e=this;if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return{monthName:"",matchesCount:0};for(;this.typedMonthPart.length>0;){for(var i=[],n=0;n<this.monthNames.length;n++)this.monthNames[n].toLowerCase().startsWith(this.typedMonthPart)&&i.push(this.monthNames[n]);if(i.length>0)return{monthName:i[0],matchesCount:i.length};var a=parseInt(this.typedMonthPart,10);if(a>=1&&a<=12&&a.toString().startsWith(this.typedMonthPart)){var s=[1,2,3,4,5,6,7,8,9,10,11,12].reduce((function(t,i){return i.toString().startsWith(e.typedMonthPart)?t+1:t}),0);return{monthName:this.monthNames[a-1],matchesCount:s}}this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return{monthName:"",matchesCount:0}},t.prototype.matchDayPeriod=function(t,e){var i=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(i))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(i))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),i=0;i<e.length;i++)if("month"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),i=0;i<e.length;i++)if("dayperiod"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:l.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var i=this.intl.splitDateFormat(e,this.localeId),n=[],s=[],r=0;r<i.length;r++)for(var l=this.intl.formatDate(t,{pattern:i[r].pattern},this.localeId).length;l>0;)n.push(this.symbols[i[r].pattern[0]]||o.Constants.formatSeparator),s.push(i[r]),l--;var h=new a.Mask;return h.symbols=n.join(""),h.partMap=s,h},t.prototype.merge=function(t,e){for(var i="",n="",a=e.symbols,o=!1,l=0,h=this.getFormattedInvalidDates(a),u=a.length-1;u>=0;u--){var c=this.getPartsForSegment(e,u);if(-1===this.knownParts.indexOf(a[u])||this.getExisting(a[u]))this.autoCorrectParts?i=t[u]+i:t.length!==a.length?o?i=t[u]+i:l>0?(i=t[u]+i,--l<=0&&(o=!0)):i=(t[u+t.length-a.length]||"")+i:i=t[u]+i,n=a[u]+n;else{var d=a[u],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;u>=0&&d===a[u];)u--;u++}if(this.leadingZero&&this.leadingZero[d])i="0"+i;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(d)){var m=this.getInvalidDatePartValue(d).toString();"M"===d?(m=((0,r.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),c.length>2?i=h[d][u]+i:(m=((0,r.parseToInt)(this.getInvalidDatePartValue(d))+1).toString(),i=(0,s.padZero)(c.length-m.length)+m+i,p=c.length-1,l=m.length-c.length)):(i=(0,s.padZero)(c.length-m.length)+m+i,p=c.length-1,l=m.length-c.length)}else i=this.dateFieldName(e.partMap[u])+i;for(;n.length<i.length;)n=a[u]+n;0!==p&&(u=u-p+(t.length-a.length))}}return{text:i,format:n}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var i=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,r.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!1)})),i&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var i=e.value,n=void 0===i?null:i,a=e.date,s=void 0===a?null:a,r=e.startDateOffset,o=void 0===r?0:r,l=e.startDate,h=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=n,this._partiallyInvalidDate.invalidDateParts[t].date=s,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=o,this._partiallyInvalidDate.startDate=h)},t.prototype.hasInvalidDatePart=function(){var t=this,e=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(i){t._partiallyInvalidDate.invalidDateParts[i]&&(0,r.isPresent)(t._partiallyInvalidDate.invalidDateParts[i].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,i){var a=(0,n.cloneDate)(t),s=!1;switch(e){case"y":a.setFullYear(a.getFullYear()+i);break;case"M":a=(0,n.addMonths)(this.value,i);break;case"d":case"E":a.setDate(a.getDate()+i);break;case"h":case"H":a.setHours(a.getHours()+i),s=!0;break;case"m":a.setMinutes(a.getMinutes()+i),s=!0;break;case"s":a.setSeconds(a.getSeconds()+i),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+i);break;case"a":a.setHours(a.getHours()+12*i),s=!0}return{date:a,timeModified:s}},t.prototype.modifyDateSymbolWithValue=function(t,e,i){var a=(0,n.cloneDate)(t);switch(e){case"y":a.setFullYear(i);break;case"M":a=(0,n.addMonths)(t,i-t.getMonth());break;case"d":case"E":a.setDate(i);break;case"h":case"H":case"a":a.setHours(i);break;case"m":a.setMinutes(i);break;case"s":a.setSeconds(i);break;case"S":a.setMilliseconds(i)}return a},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var i=t.partMap[e],n=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(i.type!==s.type||i.pattern!==s.pattern)break;n.push(s)}for(a=e-1;a>=0&&(s=t.partMap[a],i.type===s.type&&i.pattern===s.pattern);a--)n.unshift(s);return n},t.prototype.isPeekDateOverflowingDatePart=function(t){var e=t.useBasePrefixAndSuffix,i=t.middle,n=t.patternValue,a=t.basePrefix,o=t.baseSuffix,l=t.prefix,h=t.suffix,u=t.symbol,c=t.patternLength,d=t.leadingZero,p=this.peek(i,n),m=e?"".concat(a).concat(p).concat(o):"".concat(l).concat(p).concat(h),v=this.intl.parseDate(m,this.format,this.localeId),g=((this.leadingZero||{})[u]||0)+(0,s.unpadZero)(i).length>=c;return{peekedDate:v,peekedDateString:m,peekedValue:p,parsedPeekedValue:(0,r.parseToInt)(p),switchToNext:null===v||(d[u]?n.length<=i.length:g)}},t}();e.DateObject=h},503:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},874:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=void 0,e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0;e.Mask=function(){this.symbols="",this.partMap=[]}},179:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var n=i(849),a={events:{}},s=function(){function t(t){this.options=(0,n.extend)({},a,t)}return t.prototype.destroy=function(){this.options={}},t.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!(0,n.isFunction)(this.options.events[t])&&(this.options.events[t]((0,n.extend)(i,e,{sender:this})),i.defaultPrevented)},t}();e.Observable=s},849:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.isValidDate=e.areDatePartsEqualTo=e.millisecondStepFor=e.millisecondDigitsInFormat=e.setYears=e.cropTwoDigitYear=e.isFunction=e.noop=e.deepExtend=e.extend=e.clamp=e.isParseableToInt=e.parseToInt=e.isNumber=e.isDocumentAvailable=e.isPresent=void 0;var n=i(426),a=i(231),s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return(0,e.isPresent)(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.isParseableToInt=function(t){return(0,e.isNumber)((0,e.parseToInt)(t))&&/^[0-9]+$/.test(t)},e.clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var i,a,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return t;var l=r.shift();if(s(t)&&s(l))for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&"__proto__"!==h&&"constructor"!==h&&"prototype"!==h&&(l[h]instanceof HTMLElement?t[h]=l[h]:!s(l[h])||l[h]instanceof Date?(0,e.extend)(t,((a={})[h]=l[h],a)):(t[h]&&s(t[h])||(0,e.extend)(t,((i={})[h]={},i)),(0,e.deepExtend)(t[h],l[h])));return e.deepExtend.apply(void 0,n.__spreadArray([t],r,!1))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!(0,e.isPresent)(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=function(t,e){var i=(0,a.cloneDate)(t);return i.setFullYear(e),i},e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,i,n,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==i||t.getDate()!==n||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},e.isValidDate=function(t){return(0,e.isPresent)(t)&&t.getTime&&(0,e.isNumber)(t.getTime())},e.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Macintosh/i.test(navigator.userAgent)}},415:(t,e,i)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInput=void 0;var a=i(426),s=i(953),r=i(506),o=i(874),l=i(503),h=i(849),u=i(179),c=i(655),d=i(231),p=i(761),m="dragStart",v="drop",g="touchstart",f="mousedown",y="mouseup",D="click",E="input",P="keydown",b="focus",S="blur",M="paste",I="DOMMouseScroll",x="mousewheel",O="valueChange",w="inputEnd",C="blurEnd",F="focusEnd",V="change",k={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(n={},n[O]=null,n[E]=null,n[w]=null,n[b]=null,n[F]=null,n[S]=null,n[C]=null,n[P]=null,n[x]=null,n[V]=null,n),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1,toggleDayPeriod:!1},T=function(t){function e(e,i){var n=t.call(this,i)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=c.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(e,i),n}return a.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!1,configurable:!0}),e.prototype.init=function(t,e){var i=(0,h.isValidDate)(this.options.value)?(0,d.cloneDate)(this.options.value):new Date(e.formattedValue);(0,h.isValidDate)(i)||(i=null),this.element=t,this.options=(0,h.extend)({},k,e,{steps:a.__assign(a.__assign({},k.steps),e.steps)}),this.intl=this.options.intlService,this.dateObject=this.createDateObject(),this.dateObject.setValue(i),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener(m,this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener(v,this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener(D,this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener(f,this.onElementMouseDown),this.element.addEventListener(g,this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener(y,this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener(E,this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener(P,this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener(b,this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener(S,this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener(V,this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener(M,this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener(I,this.onElementMouseWheel),this.element.addEventListener(x,this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener(m,this.onElementDragStart),this.element.removeEventListener(v,this.onElementDrop),this.element.removeEventListener(g,this.onElementMouseDown),this.element.removeEventListener(f,this.onElementMouseDown),this.element.removeEventListener(y,this.onElementMouseUp),this.element.removeEventListener(D,this.onElementClick),this.element.removeEventListener(E,this.onElementInput),this.element.removeEventListener(P,this.onElementKeyDown),this.element.removeEventListener(b,this.onElementFocus),this.element.removeEventListener(S,this.onElementBlur),this.element.removeEventListener(V,this.onElementChange),this.element.removeEventListener(M,this.onElementPaste),this.element.removeEventListener(I,this.onElementMouseWheel),this.element.removeEventListener(x,this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=(0,h.extend)({},this.options,t,{steps:a.__assign(a.__assign({},k.steps),t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.setDateObjectOptions=function(){if(this.dateObject){var t=this.getDateObjectOptions();this.dateObject.setOptions(t)}},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var i=this.element.selectionStart!==this.element.selectionEnd,n=(0,h.isPresent)(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,a=!i&&n?0:this.caret()[0];this.selectNearestSegment(a)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.elementValue;if(this.element&&this.dateObject){var i=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var n=this.keyDownEvent||{},a=n.keyCode===o.KeyCode.BACKSPACE||n.key===l.Key.BACKSPACE,s=n.keyCode===o.KeyCode.DELETE||n.key===l.Key.DELETE,u=this.interactionMode;!this.options.allowCaretMode||u===c.DateInputInteractionMode.Caret||s||a||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var m=this.isInCaretMode();if(m&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var v=this.dateObject&&this.dateObject.getValue(),g=this.dateObject?this.dateObject.value:null,f=this.dateObject.getTextAndFormat(),y=f.text,D=f.format;this.currentFormat=D;var E;E=m&&(a||s||u===c.DateInputInteractionMode.Caret)?this.previousElementValue:y;var P=this.elementValue,b=(0,r.approximateStringMatching)({oldText:E,newText:P,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:m,keyEvent:this.keyDownEvent});if(b&&b.length&&b[0]&&b[0][1]!==p.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!m||b&&0!==b.length){if(m&&1===b.length){if(!b[0]||!b[0][0])return void this.restorePreviousInputEventState();if(m&&b[0]&&(b[0][0]===p.Constants.formatSeparator||b[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var S=1===b.length&&b[0][1]===p.Constants.formatSeparator,M=[],I=!1,x=null;if(!S)for(var O=0;O<b.length;O++){var w=this.dateObject.parsePart({symbol:b[O][0],currentChar:b[O][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:a||s,originalFormat:this.currentFormat});M.push(w),w.value||(x={type:"parse"}),I=w.switchToNext}this.options.autoSwitchParts||(I=!1),this.resetSegmentValue=!1;var C,F=this.options.format===this.currentFormat||(0,h.isPresent)(this.options.format)&&this.options.format.length>1,V=M[M.length-1],k=V&&!(0,h.isPresent)(V.value),T=m&&(a||s)&&k,_=!!V&&V.resetPart,A=this.dateObject.getValue(),N=!(0,d.isEqual)(v,A),j=this.dateObject.value,L=this.selection;if(m){var K=b&&b.length>0?b[0][0]:null,W=this.dateObject.getLeadingZero()[K];b.length&&b[0][0]!==p.Constants.formatSeparator?I?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):_?(C=this.currentFormat[L.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(C))):this.restorePreviousInputEventState():T?(this.forceUpdate(),b.length&&b[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(b[0][0]))):k?"0"===t.data&&W||((0,h.isPresent)(v)&&!(0,h.isPresent)(A)?this.restorePreviousInputEventState():!(0,h.isPresent)(v)&&(0,h.isPresent)(A)?this.forceUpdateWithSelection():(0,h.isPresent)(v)&&(0,h.isPresent)(A)?N?this.forceUpdateWithSelection():this.restorePreviousInputEventState():(0,h.isPresent)(v)||(0,h.isPresent)(A)?g!==j||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):k||F||this.forceUpdateWithSelection():(this.options.autoSwitchParts||b[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(b[0][0]))}else m||(this.forceUpdate(),b.length&&b[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(b[0][0])),this.options.autoSwitchParts?S?(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):I&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):V&&V.switchToNext?this.resetSegmentValue=!0:S&&(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),a&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1));this.tryTriggerValueChange({oldValue:v,event:t}),this.triggerInputEnd({event:t,error:x,oldElementValue:e,newElementValue:this.elementValue}),m&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=c.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,i=e.start,n=e.end,a=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:n},this.keyEventMatchesAutoSwitchKeys(t)){var s=t.keyCode===o.KeyCode.TAB;if(!s)return t.preventDefault(),void this.switchDateSegment(1);var r=this.selection,l=r.start,h=r.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),l!==this.selection.start||h!==this.selection.end)return void t.preventDefault()}var u=this.currentFormat[this.selection.start],c=this.getStepFromSymbol(u),d=!1,p=this.elementValue;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(c,u,a),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-c,u,a),p!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:p}),d=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ENTER:break;case o.KeyCode.HOME:this.selectNearestSegment(0),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;case o.KeyCode.END:this.selectNearestSegment(this.elementValue.length),d=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;default:return}d&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){var e=this.elementValue;if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var i=t;i.shiftKey?this.switchDateSegment((i.wheelDelta||-i.detail)>0?-1:1):this.modifyDateSegmentValue((i.wheelDelta||-i.detail)>0?1:-1),i.returnValue=!1,i.preventDefault&&i.preventDefault(),e!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:e})}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;(0,h.isPresent)(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var i=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:i,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:p.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),(0,h.isDocumentAvailable)()&&(0,h.isIOS)()&&this.element.scrollIntoView({block:"nearest",inline:"nearest"}),t.start!==t.end&&(this.interactionMode=c.DateInputInteractionMode.Selection))},e.prototype.selectionBySymbol=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e&&(e=n));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?i+=this.currentText.length-this.currentFormat.length:i=Math.max(0,i-(this.currentFormat.length-this.currentText.length))),{start:e,end:i}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},i=t,n=t-1;i<this.currentFormat.length||n>=0;i++,n--){if(i<this.currentFormat.length&&this.currentFormat[i]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}if(n>=0&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var i=e.start,n=this.currentFormat[i-1],a="",s="";if(t<0){for(var r=i+t;r>=0;r--)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==n){i=r,a=s;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==n){i=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}this.interactionMode=c.DateInputInteractionMode.None;var o=this.selection,l=o.start,h=o.end;if(l<h&&this.currentFormat[l]!==this.currentFormat[h-1])return this.setSelection(this.selectionByIndex(t>0?l:h-1)),this.resetSegmentValue=!0,void(this.interactionMode=c.DateInputInteractionMode.None);for(var u=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===u||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var m=d;m>=0&&m<this.currentFormat.length&&this.currentFormat[m]===this.currentFormat[d];)m+=t;d>m&&(m+1!==l||d+1!==h)?(this.setSelection({start:m+1,end:d+1}),this.resetSegmentValue=!0):d<m&&(d!==l||m!==h)&&(this.setSelection({start:d,end:m}),this.resetSegmentValue=!0),this.interactionMode=c.DateInputInteractionMode.None}},e.prototype.modifyDateSegmentValue=function(t,e,i){if(void 0===e&&(e=""),void 0===i&&(i={}),this.dateObject&&!this.options.readonly){var n=this.value,a=1,s=this.caret();if("S"===(e=e||this.currentFormat[s[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var r=(0,h.millisecondDigitsInFormat)(this.inputFormat);a=(0,h.millisecondStepFor)(r)}this.dateObject.modifyPart(e,a*t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!(0,d.isEqual)(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger(O,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger(E,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null,oldElementValue:"",newElementValue:""}),this.trigger(w,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger(b,(0,h.extend)({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(F,(0,h.extend)({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger(S,(0,h.extend)({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger(C,(0,h.extend)({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger(V,(0,h.extend)(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger(P,(0,h.extend)({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger(x,(0,h.extend)({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,i=t.end,n=this.elementValue.length;this.forceUpdate();var a=this.elementValue.length-n;this.setSelection({start:e+a,end:i+a})},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,i=t.format;this.currentFormat=i,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,i=t.end;this.setSelection({start:e||0,end:i||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!(0,h.isValidDate)(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(e),n=i.text,a=i.format;this.currentFormat=a,this.currentText=n;var s=this.options.hasPlaceholder||(0,h.isPresent)(this.options.placeholder),r=!this.isActive&&s&&!this.dateObject.hasValue();s&&(0,h.isPresent)(this.options.placeholder)&&(t.placeholder=this.options.placeholder);var o=r?"":n;this.previousElementValue=this.elementValue,this.setElementValue(o)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var i=void 0!==t,n=[t,t],a=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(i&&((0,h.isDocumentAvailable)()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),n=[a.selectionStart,a.selectionEnd])}catch(t){n=[]}return n}},e.prototype.selectNearestSegment=function(t){for(var e=t,i=t-1;e<this.currentFormat.length||i>=0;e++,i--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(i>=0&&"_"!==this.currentFormat[i])return void this.selectDateSegment(this.currentFormat[i])}},e.prototype.selectDateSegment=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e&&(e=n));e<0&&(e=0),this.caret(0,0),this.caret(e,i)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero;this.options.value=t;var i=this.createDateObject();return i.setLeadingZero(this.isActive?e:null),i},e.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new s.DateObject((0,h.extend)({},t))},e.prototype.getDateObjectOptions=function(){return{intlService:this.options.intlService,formatPlaceholder:this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value,toggleDayPeriod:this.options.toggleDayPeriod,autoSwitchParts:this.options.autoSwitchParts}},e.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));return e.indexOf(t.keyCode.toString())>=0||e.indexOf(t.keyCode)>=0||e.indexOf(t.key.toLowerCase().trim())>=0},e.prototype.autoFill=function(){var t,e,i,n,a,s,r=this.dateObject,o=new Date;(r.date||r.month||r.year||r.hours||r.minutes||r.seconds)&&(i=r.year?r.value.getFullYear():o.getFullYear(),e=r.month?r.value.getMonth():o.getMonth(),t=r.date?r.value.getDate():o.getDate(),n=r.hours?r.value.getHours():o.getHours(),a=r.minutes?r.value.getMinutes():o.getMinutes(),s=r.seconds?r.value.getSeconds():o.getSeconds(),r.setValue(new Date(i,e,t,n,a,s)),this.refreshElementValue(),this.triggerValueChange())},e}(u.Observable);e.DateInput=T},655:(t,e)=>{var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DateInputInteractionMode=void 0,function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(i||(e.DateInputInteractionMode=i={}))},506:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInRange=e.dateSymbolMap=e.approximateStringMatching=e.unpadZero=e.padZero=void 0;var n=i(761),a=i(503);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,i=t.newText,s=t.formatPattern,r=t.selectionStart,o=t.isInCaretMode,l=t.keyEvent,h=r+e.length-i.length,u=e[h],c=e.substring(0,h),d=i.substring(0,r),p=[];if(c===d&&r>0)return p.push([s[r-1],d[r-1]]),p;if(0===c.indexOf(d)&&o&&(l.key===a.Key.DELETE||l.key===a.Key.BACKSPACE)||0===c.indexOf(d)&&!o&&(0===d.length||s[d.length-1]!==s[d.length])){var m="";o||1!==d.length||p.push([s[0],d[0]]);for(var v=d.length;v<c.length;v++)s[v]!==m&&s[v]!==n.Constants.formatSeparator&&(m=s[v],p.push([m,""]));return p}if(o&&(0===d.indexOf(c)||s[r-1]===n.Constants.formatSeparator)||!o&&(0===d.indexOf(c)||s[r-1]===n.Constants.formatSeparator)){var g=s[0];for(v=Math.max(0,c.length-1);v<s.length;v++)if(s[v]!==n.Constants.formatSeparator){g=s[v];break}return[[g,d[r-1]]]}return" "===d[d.length-1]||d[d.length-1]===u&&"_"===s[h]?[[s[r-1],n.Constants.formatSeparator]]:[[s[r-1],d[r-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,i){return null===t||!(e&&e>t||i&&i<t)}},231:e=>{e.exports=t},426:t=>{t.exports=e}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return i[t](s,s.exports,a),s.exports}var s={};return(()=>{var t=s;Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0;var e=a(415);Object.defineProperty(t,"DateInput",{enumerable:!0,get:function(){return e.DateInput}})})(),s})()));
@@ -803,7 +803,7 @@ var DateObject = /** @class */ (function () {
803
803
  }
804
804
  }
805
805
  var parsedDate = null;
806
- var monthByChar = this.matchMonth(currentChar);
806
+ var _b = this.matchMonth(currentChar), monthByChar = _b.monthName, matchesCount = _b.matchesCount;
807
807
  var dayPeriod = this.matchDayPeriod(currentChar, symbol);
808
808
  var isZeroCurrentChar = currentChar === '0';
809
809
  var leadingZero = this.leadingZero || {};
@@ -970,7 +970,7 @@ var DateObject = /** @class */ (function () {
970
970
  if (parsedDate) {
971
971
  this._value = parsedDate;
972
972
  this.setExisting(symbol, true);
973
- return extend(parseResult, { value: this.value, switchToNext: false });
973
+ return extend(parseResult, { value: this.value, switchToNext: matchesCount === 1 });
974
974
  }
975
975
  }
976
976
  if (dayPeriod) {
@@ -1272,24 +1272,37 @@ var DateObject = /** @class */ (function () {
1272
1272
  * @hidden
1273
1273
  */
1274
1274
  DateObject.prototype.matchMonth = function (typedChar) {
1275
+ var _this = this;
1275
1276
  this.typedMonthPart += typedChar.toLowerCase();
1276
1277
  if (this.monthNames.length === 0) {
1277
- return '';
1278
+ return { monthName: '', matchesCount: 0 };
1278
1279
  }
1279
1280
  while (this.typedMonthPart.length > 0) {
1281
+ var matchingMonths = [];
1280
1282
  for (var i = 0; i < this.monthNames.length; i++) {
1281
- if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {
1282
- return this.monthNames[i];
1283
+ var monthName = this.monthNames[i].toLowerCase();
1284
+ if (monthName.startsWith(this.typedMonthPart)) {
1285
+ matchingMonths.push(this.monthNames[i]);
1283
1286
  }
1284
1287
  }
1288
+ if (matchingMonths.length > 0) {
1289
+ return { monthName: matchingMonths[0], matchesCount: matchingMonths.length };
1290
+ }
1285
1291
  var monthAsNum = parseInt(this.typedMonthPart, 10);
1286
1292
  /* ensure they exact match */
1287
- if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart) {
1288
- return this.monthNames[monthAsNum - 1];
1293
+ if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString().startsWith(this.typedMonthPart)) {
1294
+ // count the amount of possible months for each number
1295
+ // 1 -> 4 (1, 10, 11, 12)
1296
+ // 2-9 -> 1
1297
+ var months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
1298
+ var matchesCount = months.reduce(function (count, month) {
1299
+ return month.toString().startsWith(_this.typedMonthPart) ? count + 1 : count;
1300
+ }, 0);
1301
+ return { monthName: this.monthNames[monthAsNum - 1], matchesCount: matchesCount };
1289
1302
  }
1290
1303
  this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);
1291
1304
  }
1292
- return '';
1305
+ return { monthName: '', matchesCount: 0 };
1293
1306
  };
1294
1307
  /**
1295
1308
  * @hidden
@@ -789,7 +789,7 @@ export class DateObject {
789
789
  }
790
790
  }
791
791
  let parsedDate = null;
792
- const monthByChar = this.matchMonth(currentChar);
792
+ const { monthName: monthByChar, matchesCount } = this.matchMonth(currentChar);
793
793
  const dayPeriod = this.matchDayPeriod(currentChar, symbol);
794
794
  const isZeroCurrentChar = currentChar === '0';
795
795
  const leadingZero = this.leadingZero || {};
@@ -956,7 +956,7 @@ export class DateObject {
956
956
  if (parsedDate) {
957
957
  this._value = parsedDate;
958
958
  this.setExisting(symbol, true);
959
- return extend(parseResult, { value: this.value, switchToNext: false });
959
+ return extend(parseResult, { value: this.value, switchToNext: matchesCount === 1 });
960
960
  }
961
961
  }
962
962
  if (dayPeriod) {
@@ -1260,22 +1260,34 @@ export class DateObject {
1260
1260
  matchMonth(typedChar) {
1261
1261
  this.typedMonthPart += typedChar.toLowerCase();
1262
1262
  if (this.monthNames.length === 0) {
1263
- return '';
1263
+ return { monthName: '', matchesCount: 0 };
1264
1264
  }
1265
1265
  while (this.typedMonthPart.length > 0) {
1266
+ const matchingMonths = [];
1266
1267
  for (let i = 0; i < this.monthNames.length; i++) {
1267
- if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {
1268
- return this.monthNames[i];
1268
+ const monthName = this.monthNames[i].toLowerCase();
1269
+ if (monthName.startsWith(this.typedMonthPart)) {
1270
+ matchingMonths.push(this.monthNames[i]);
1269
1271
  }
1270
1272
  }
1273
+ if (matchingMonths.length > 0) {
1274
+ return { monthName: matchingMonths[0], matchesCount: matchingMonths.length };
1275
+ }
1271
1276
  const monthAsNum = parseInt(this.typedMonthPart, 10);
1272
1277
  /* ensure they exact match */
1273
- if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart) {
1274
- return this.monthNames[monthAsNum - 1];
1278
+ if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString().startsWith(this.typedMonthPart)) {
1279
+ // count the amount of possible months for each number
1280
+ // 1 -> 4 (1, 10, 11, 12)
1281
+ // 2-9 -> 1
1282
+ const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
1283
+ const matchesCount = months.reduce((count, month) => {
1284
+ return month.toString().startsWith(this.typedMonthPart) ? count + 1 : count;
1285
+ }, 0);
1286
+ return { monthName: this.monthNames[monthAsNum - 1], matchesCount: matchesCount };
1275
1287
  }
1276
1288
  this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);
1277
1289
  }
1278
- return '';
1290
+ return { monthName: '', matchesCount: 0 };
1279
1291
  }
1280
1292
  /**
1281
1293
  * @hidden
@@ -123,7 +123,10 @@ export declare class DateObject {
123
123
  /**
124
124
  * @hidden
125
125
  */
126
- matchMonth(typedChar: any): string;
126
+ matchMonth(typedChar: any): {
127
+ monthName: string;
128
+ matchesCount: number;
129
+ };
127
130
  /**
128
131
  * @hidden
129
132
  */
@@ -806,7 +806,7 @@ var DateObject = /** @class */ (function () {
806
806
  }
807
807
  }
808
808
  var parsedDate = null;
809
- var monthByChar = this.matchMonth(currentChar);
809
+ var _b = this.matchMonth(currentChar), monthByChar = _b.monthName, matchesCount = _b.matchesCount;
810
810
  var dayPeriod = this.matchDayPeriod(currentChar, symbol);
811
811
  var isZeroCurrentChar = currentChar === '0';
812
812
  var leadingZero = this.leadingZero || {};
@@ -973,7 +973,7 @@ var DateObject = /** @class */ (function () {
973
973
  if (parsedDate) {
974
974
  this._value = parsedDate;
975
975
  this.setExisting(symbol, true);
976
- return (0, utils_2.extend)(parseResult, { value: this.value, switchToNext: false });
976
+ return (0, utils_2.extend)(parseResult, { value: this.value, switchToNext: matchesCount === 1 });
977
977
  }
978
978
  }
979
979
  if (dayPeriod) {
@@ -1275,24 +1275,37 @@ var DateObject = /** @class */ (function () {
1275
1275
  * @hidden
1276
1276
  */
1277
1277
  DateObject.prototype.matchMonth = function (typedChar) {
1278
+ var _this = this;
1278
1279
  this.typedMonthPart += typedChar.toLowerCase();
1279
1280
  if (this.monthNames.length === 0) {
1280
- return '';
1281
+ return { monthName: '', matchesCount: 0 };
1281
1282
  }
1282
1283
  while (this.typedMonthPart.length > 0) {
1284
+ var matchingMonths = [];
1283
1285
  for (var i = 0; i < this.monthNames.length; i++) {
1284
- if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {
1285
- return this.monthNames[i];
1286
+ var monthName = this.monthNames[i].toLowerCase();
1287
+ if (monthName.startsWith(this.typedMonthPart)) {
1288
+ matchingMonths.push(this.monthNames[i]);
1286
1289
  }
1287
1290
  }
1291
+ if (matchingMonths.length > 0) {
1292
+ return { monthName: matchingMonths[0], matchesCount: matchingMonths.length };
1293
+ }
1288
1294
  var monthAsNum = parseInt(this.typedMonthPart, 10);
1289
1295
  /* ensure they exact match */
1290
- if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart) {
1291
- return this.monthNames[monthAsNum - 1];
1296
+ if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString().startsWith(this.typedMonthPart)) {
1297
+ // count the amount of possible months for each number
1298
+ // 1 -> 4 (1, 10, 11, 12)
1299
+ // 2-9 -> 1
1300
+ var months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
1301
+ var matchesCount = months.reduce(function (count, month) {
1302
+ return month.toString().startsWith(_this.typedMonthPart) ? count + 1 : count;
1303
+ }, 0);
1304
+ return { monthName: this.monthNames[monthAsNum - 1], matchesCount: matchesCount };
1292
1305
  }
1293
1306
  this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);
1294
1307
  }
1295
- return '';
1308
+ return { monthName: '', matchesCount: 0 };
1296
1309
  };
1297
1310
  /**
1298
1311
  * @hidden
@@ -1 +1 @@
1
- System.register("@progress/kendo-dateinputs-common",["@progress/kendo-date-math","tslib"],function(r,t){var o={},l={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(l,"__esModule",{value:!0}),{setters:[function(e){Object.keys(e).forEach(function(t){o[t]=e[t]})},function(e){Object.keys(e).forEach(function(t){l[t]=e[t]})}],execute:function(){function i(t){var e=s[t];return void 0!==e||(e=s[t]={exports:{}},n[t](e,e.exports,i)),e.exports}var n,s,t,e,a;r((n={761:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},953:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateObject=void 0;var at=i(618),o=i(930),rt=i(506),ot=i(849),c=i(761),n=/d|M|H|h|m|s/;function s(t){var e=t.intlService,i=t.formatPlaceholder,n=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?c.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,o=t.autoCorrectParts,o=void 0===o||o,l=t.toggleDayPeriod,l=void 0!==l&&l,t=t.autoSwitchParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.dayperiod=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=this.getDefaultDate(),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.setOptions({intlService:e,formatPlaceholder:i,format:n,cycleTime:s,twoDigitYearMax:a,value:r,autoCorrectParts:o,toggleDayPeriod:l,autoSwitchParts:t}),r)this._value=(0,at.cloneDate)(r);else{this._value=this.getDefaultDate();for(var h=this.dateFormatString(this.value,this.format).symbols,u=0;u<h.length;u++)this.setExisting(h[u],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=c.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),i=0;i<e.length;i++){var n=e[i],n=this.intl.cldr[n];if(n.name&&n.calendar&&n.numbers&&n.name!==c.Constants.defaultLocaleId){t=n.name;break}}return t},enumerable:!1,configurable:!0}),s.prototype.setOptions=function(t){this.intl=t.intlService,this.formatPlaceholder=t.formatPlaceholder||"wide",this.format=t.format,this.cycleTime=t.cycleTime,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=t.twoDigitYearMax,this.autoCorrectParts=t.autoCorrectParts,this.toggleDayPeriod=t.toggleDayPeriod,this.autoSwitchParts=t.autoSwitchParts},s.prototype.setValue=function(t){t?(0,at.isEqual)(t,this._value)?(0,at.isEqual)(t,this._value)&&this.dayPeriods&&this.setExisting("a",!0):(this._value=(0,at.cloneDate)(t),this.modifyExisting(!0)):(this._value=this.getDefaultDate(),this.modifyExisting(!1)),this.resetInvalidDate()},s.prototype.hasValue=function(){var i=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&i.getExisting(e.pattern[0])},!1)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return(0,at.cloneDate)(this.value)},s.prototype.createDefaultDate=function(){return(0,at.createDate)(2e3,0,31)},s.prototype.getDefaultDate=function(){return(0,at.getDate)(this.createDefaultDate())},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),i=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var n="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.length;r++){var o,l,h=i.symbols[r];"literal"!==i.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(i,r),"M"===h?(l=((0,ot.parseToInt)(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(n+=(0,rt.padZero)(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),n+=(0,rt.padZero)(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):n+=e[r]}e=n}return this.merge(e,i)},s.prototype.getFormattedInvalidDates=function(t){var i=this,n=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=i.getInvalidDatePart(t).date;e&&(e=i.intl.formatDate(e,n,i.localeId),s[t]=e)}),s},s.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,i=0;i<e.length;i++)this.setExisting(e[i],t)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"t":case"a":return this.dayperiod;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"t":case"a":this.dayperiod=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if((0,ot.isPresent)(t)&&(0,ot.isPresent)(e)&&0!==e){var i,n=(0,at.cloneDate)(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a){var l=n.getHours();switch(t){case"y":n.setFullYear(n.getFullYear()+e);break;case"M":n=(0,at.addMonths)(this.value,e);break;case"d":case"E":n.setDate(n.getDate()+e);break;case"h":case"H":n.setHours(n.getHours()+e),s=!0;break;case"m":n.setMinutes(n.getMinutes()+e),s=!0;break;case"s":n.setSeconds(n.getSeconds()+e),s=!0;break;case"S":n.setMilliseconds(n.getMilliseconds()+e);break;case"a":this.toggleDayPeriod?n.setHours(12<=l?l-12:l+12):n.setHours(n.getHours()+12*e),s=!0}}else{var h=this._partiallyInvalidDate.invalidDateParts||{},u=this.getInvalidDatePartValue(t),c=h.y.value||n.getFullYear(),d=h.M.value||n.getMonth(),p=h.d.value||h.E.value||n.getDate(),m=h.h.value||h.H.value||n.getHours(),g=h.m.value||n.getMinutes(),v=h.s.value||n.getSeconds(),h=h.S.value||n.getMilliseconds();switch(t){case"y":c+=e;break;case"M":d+=e;break;case"d":case"E":p+=e}if("M"===t){if((d<0||11<d)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(d=d<0?(0,ot.clamp)(d%11+1+11,0,11):(f=(0,ot.isPresent)(u)?d:(e-1)%12,(0,ot.clamp)(f,0,11)),d=(0,ot.clamp)(d,0,11)),d=(0,ot.clamp)(d,0,11)}else if("d"===t)if(o){if(p<=0||31<p)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if((0,ot.isPresent)(u)&&(p<=0||31<p))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);p=(f=e<0?(0,ot.isPresent)(u)?p:31-Math.abs(e%31)+1:(0,ot.isPresent)(u)?p:e%31,(0,ot.clamp)(f,1,31)),p=(0,ot.clamp)(p,1,31)}var o=(0,at.createDate)(c,d,p,m,g,v,h),u=a||r?this.modifyDateSymbolWithValue(n,t,a?d:p):null,f=(0,ot.areDatePartsEqualTo)(o,c,d,p,m,g,v,h);this.getValue()&&(0,ot.areDatePartsEqualTo)(o,c,d,p,m,g,v,h)?(n=(0,at.cloneDate)(o),this.markDatePartsAsExisting()):a&&u?u.getMonth()===d?this.getExisting("d")?f?(n=(0,at.cloneDate)(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:d,date:(0,at.cloneDate)(u),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)):f?(this.resetInvalidDateSymbol(t),n=(0,at.cloneDate)(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),n=(0,at.cloneDate)(u)):(i=!0,this.setInvalidDatePart(t,{value:d,date:(0,at.cloneDate)(u),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)):r&&u&&(u.getDate()===p?this.getExisting("M")?f?(n=(0,at.cloneDate)(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:p,date:(0,at.cloneDate)(u),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)):f?(n=(0,at.cloneDate)(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),n=(0,at.cloneDate)(u)):(i=!0,this.setInvalidDatePart(t,{value:p,date:(0,at.cloneDate)(this.value),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(n=this.normalizeCentury(n)),s&&!this.cycleTime&&(n.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=n,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,N=t.resetSegmentValue,n=t.rawTextValue,j=t.isDeleting,s=t.originalFormat,a=!t.cycleSegmentValue,r=this.dateFormatString(this.value,this.format),o=r.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),l=r.partMap.map(function(t){return{type:t.type,pattern:t.pattern,text:""}}),h=0;h<o.length;h++){for(var u=o[h],c=0;c<u.pattern.length;c++)o[h+c]&&(o[h+c].literal=u.pattern[c]);h+=u.pattern.length-1}for(h=0;h<l.length;h++){for(u=l[h],c=0;c<u.pattern.length;c++)l[h+c]&&(l[h+c].text=u.pattern[c]);h+=u.pattern.length-1}var d={value:null,switchToNext:!1,resetPart:a&&"M"===e&&r.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length}),hasInvalidDatePart:!1};if(!i){if(!a)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,ot.extend)(d,{value:null,switchToNext:!1});for(h=0;h<o.length;h++){var L=o[h].literal,K=n.startsWith(L),W=n.endsWith(L),L=0<=n.indexOf(L+L);if(K||W||L)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,ot.extend)(d,{value:null,switchToNext:!1})}}var p=this.intl.formatDate(this.value,this.format,this.localeId),H=r.symbols,m=!1,g="",v="",f="",y="",D="",E="",B="";for(h=0;h<l.length;h++)B+=l[h].text;var t=this.format===H||this.format===B||this.format===s||this.format.length===s.length,P=(t?B:s).indexOf(e),Z=(t?B:s).lastIndexOf(e)-P+1,R=s.length-n.length;if(a||!a&&!this.autoCorrectParts){var b,S,Y=0;for(h=0;h<p.length;h++)H[h]===e?(b=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?v+=p[h]:(S=this.getInvalidDatePartValue(e),(0,ot.isPresent)(S)?(v+=(S||"").toString()[Y]||"",Y++):v+=b?p[h]:"0"):v+=b?p[h]:"0",0<R&&!(f.length+R<Z)||(f+=n[h]||""),m=!0):m?(E+=p[h],D+=p[h]):(g+=p[h],y+=p[h]);if(t&&(B.length<n.length?f+=i:j||(s.length,n.length),f.length>Z))return(0,ot.extend)(d,{value:null,switchToNext:!1});if(!t||!this.autoCorrectParts){for(var v="",f="",g="",E="",m=!1,U=0,h=0;h<s.length;h++)s[h]===e?(b=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?v+=p[h]:(S=this.getInvalidDatePartValue(e),(0,ot.isPresent)(S)?(v+=(S||"").toString()[U]||"",U++):v+=b?p[h]:"0"):v+=b?p[h]||"":"0",0<R&&!(f.length+R<Z)||(f+=n[h]||""),m=!0):m?E+=n[h-R]||"":g+=n[h]||"";s.length<n.length&&(f+=i)}}if(!a)if(this.autoCorrectParts)for(E=g=f=v="",m=!1,h=0;h<p.length;h++)H[h]===e?(v+=(b=this.getExisting(e))?p[h]:"0",m=!0):m?E+=p[h]:g+=p[h];else v=N?f:v;var M=null,z=this.matchMonth(i),P=this.matchDayPeriod(i,e),I="0"===i,q=this.leadingZero||{},x=(I?("0"===f&&(f=v),0!==(0,ot.parseToInt)(N?i:(a?f:v)+i)||this.isAbbrMonth(r.partMap,e)||"a"===e||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(r.partMap,e)),G=x?x.pattern:null,J=this.patternLength(G)||G.length;if(a&&j&&!f)this.setExisting(e,!1);else{var x=v.length-3,$=!0,O=a?f:v;for(h=Math.max(0,x);h<=v.length&&$;h++){O=N?i:a?f:v.substring(h)+i,this.autoSwitchParts&&"h"===e&&"12"===v.substring(h)&&(O=O.replace("12","0")),!a&&this.autoCorrectParts||(O=($=!1,rt.unpadZero)(O),O=(0,rt.padZero)(J-O.length)+O);var Q,X=parseInt(O,10),tt=((M=this.intl.parseDate(g+O+E,this.format,this.localeId))&&this.value&&r.partMap.every(function(t){return"year"!==t.type&&"month"!==t.type&&"day"!=t.type})&&(M.setFullYear(this.value.getFullYear()),M.setMonth(this.value.getMonth()),M.setDate(this.value.getDate())),!1),et=(a&&!(0,ot.isValidDate)(M)&&this.autoCorrectParts&&(M=this.intl.parseDate(y+O+D,this.format,this.localeId),tt=!0),!isNaN(parseInt(i,10))||a&&j&&""===i);if(!M&&!isNaN(X)&&et&&this.autoCorrectParts&&("M"!==e||z||-1<(et=X-1)&&et<12&&((M=(0,at.cloneDate)(this.value)).setMonth(et),M.getMonth()!==et)&&(M=(0,at.lastDayOfMonth)((0,at.addMonths)(M,-1))),"y"===e)&&(M=(0,at.createDate)(parseInt(O,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),a&&(0,ot.isValidDate)(M)||!a&&M)&&this.date&&M.getDate()!==this.value.getDate()&&(M=(0,at.lastDayOfMonth)((0,at.addMonths)(M,-1))),a&&(0,ot.isValidDate)(M)||!a&&M)return Q=(X=this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:tt,middle:O,patternValue:G,basePrefix:y,baseSuffix:D,prefix:g,suffix:E,symbol:e,patternLength:J,leadingZero:q})).switchToNext,this.shouldNormalizeCentury()&&(M=this.normalizeCentury(M)),"H"===e&&12<=M.getHours()&&this.setExisting("a",!0),this._value=M,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e?this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")):"y"===e&&this.markDatePartsAsExisting(),this.hasInvalidDatePart())||(this.markDatePartsAsExisting(),X.peekedDate)||!X.switchToNext||this.autoCorrectParts||"M"===e||"d"===e&&30===X.parsedPeekedValue&&1===this.value.getMonth()&&(Q=!1),(0,ot.extend)(d,{value:this.value,switchToNext:Q})}if(z&&(M=this.intl.parseDate(g+z+E,this.format,this.localeId)))return this._value=M,this.setExisting(e,!0),(0,ot.extend)(d,{value:this.value,switchToNext:!1});if(P&&(M=this.intl.parseDate(g+P+E,this.format)||this.intl.parseDate(y+P+D,this.format)))return this._value=M,this.setExisting(e,!0),(0,ot.extend)(d,{value:this.value,switchToNext:!0});if(I&&"a"!==e&&this.setExisting(e,!1),!this.autoCorrectParts){var it,nt,st,w,C,F,V,k,_,T,A,x=void 0,P=a?f:O,I=(0,ot.parseToInt)(P);if((0,ot.isNumber)(I)&&(0,ot.isParseableToInt)(P)){if("d"===e&&(I<=0||31<I)||"M"===e&&(I<=0||11<I)){if(a)return(0,ot.extend)(d,{value:null,switchToNext:!1});I=(0,ot.parseToInt)(P=i)}return(0,ot.isNumber)(I)&&(0,ot.isParseableToInt)(P)?(x="M"===e?I-1:I,it="y"===e,nt="M"===e,st="d"===e,w=(0,at.cloneDate)(this._value),A=this._partiallyInvalidDate.invalidDateParts||{},C=it?x:A.y.value||w.getFullYear(),F=nt?x:A.M.value||w.getMonth(),x=st?x:A.d.value||A.E.value||w.getDate(),k=A.h.value||A.H.value||w.getHours(),_=A.m.value||w.getMinutes(),T=A.s.value||w.getSeconds(),A=A.S.value||w.getMilliseconds(),V=(0,at.createDate)(C,F,x,k,_,T,A),k=(0,ot.areDatePartsEqualTo)(V,C,F,x,k,_,T,A),_=it||nt||st?this.modifyDateSymbolWithValue(w,e,it?C:nt?F:x):null,T=!1,nt&&_?_.getMonth()===F?this.getExisting("d")?k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:F,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(_)):(T=!0,this.setInvalidDatePart(e,{value:F,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):st&&_?_.getDate()===x?this.getExisting("M")?k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:x,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(_)):(T=!0,this.setInvalidDatePart(e,{value:x,date:(0,at.cloneDate)(this.value),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):it&&_&&(_.getFullYear()===C?this.getExisting("d")&&this.getExisting("M")?k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:C,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(V),this.getExisting("M")&&this.getExisting("d")&&(this.setExisting("y",!0),this.resetInvalidDateSymbol("y"))):(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(_)):(T=!0,this.setInvalidDatePart(e,{value:C,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),a&&!(0,ot.isValidDate)(M)?(A=this.intl.parseDate(y+O+D,this.format,this.localeId),(0,ot.isValidDate)(A)&&(this._value=A)):this._value=w,this.getValue()&&this.resetInvalidDate()),Q=!1,Q="M"===e?2<=I||2<=P.length:t?this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:!this.autoCorrectParts,middle:O,patternValue:G,basePrefix:y,baseSuffix:D,prefix:g,suffix:E,symbol:e,patternLength:J,leadingZero:q}).switchToNext:P.length>Z,(0,ot.extend)(d,{value:null,switchToNext:Q,hasInvalidDatePart:T})):(0,ot.extend)(d,{value:null,switchToNext:!1})}}}return(0,ot.extend)(d,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(rt.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.getLeadingZero=function(){return this.leadingZero||{}},s.prototype.normalizeCentury=function(t){var e,i;return(0,ot.isPresent)(t)?(e=(0,ot.cropTwoDigitYear)(t),i=this.getNormalizedCenturyBase(e),(0,ot.setYears)(t,i+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return(0,rt.padZero)(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var i=parseInt(this.typedMonthPart,10);if(1<=i&&i<=12&&i.toString()===this.typedMonthPart)return this.monthNames[i-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),i=0;i<e.length;i++)if("month"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return[]},s.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),i=0;i<e.length;i++)if("dayperiod"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return null},s.prototype.patternLength=function(t){return"y"===t[0]?4:n.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var i=this.intl.splitDateFormat(e,this.localeId),n=[],s=[],a=0;a<i.length;a++)for(var r=this.intl.formatDate(t,{pattern:i[a].pattern},this.localeId).length;0<r;)n.push(this.symbols[i[a].pattern[0]]||c.Constants.formatSeparator),s.push(i[a]),r--;e=new o.Mask;return e.symbols=n.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var i="",n="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?i=t[l]+i:0<r?(i=t[l]+i,--r<=0&&(a=!0)):i=(t[l+t.length-s.length]||"")+i,n=s[l]+n;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?i="0"+i:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=((0,ot.parseToInt)(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?i=o[c][l]+i:(u=((0,ot.parseToInt)(this.getInvalidDatePartValue(c))+1).toString(),i=(0,rt.padZero)(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):(i=(0,rt.padZero)(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):i=this.dateFieldName(e.partMap[l])+i;n.length<i.length;)n=s[l]+n;0!==d&&(l=l-d+(t.length-s.length))}}return{text:i,format:n}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,i=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,ot.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!1)}),i&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var i=e.value,n=e.date,n=void 0===n?null:n,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===i?null:i,this._partiallyInvalidDate.invalidDateParts[t].date=n,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.hasInvalidDatePart=function(){var e=this,i=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,ot.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!0)}),i},s.prototype.modifyDateSymbolWithOffset=function(t,e,i){var n=(0,at.cloneDate)(t),s=!1;switch(e){case"y":n.setFullYear(n.getFullYear()+i);break;case"M":n=(0,at.addMonths)(this.value,i);break;case"d":case"E":n.setDate(n.getDate()+i);break;case"h":case"H":n.setHours(n.getHours()+i),s=!0;break;case"m":n.setMinutes(n.getMinutes()+i),s=!0;break;case"s":n.setSeconds(n.getSeconds()+i),s=!0;break;case"S":n.setMilliseconds(n.getMilliseconds()+i);break;case"a":n.setHours(n.getHours()+12*i),s=!0}return{date:n,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,i){var n=(0,at.cloneDate)(t);switch(e){case"y":n.setFullYear(i);break;case"M":n=(0,at.addMonths)(t,i-t.getMonth());break;case"d":case"E":n.setDate(i);break;case"h":case"H":case"a":n.setHours(i);break;case"m":n.setMinutes(i);break;case"s":n.setSeconds(i);break;case"S":n.setMilliseconds(i)}return n},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var i=t.partMap[e],n=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(i.type!==a.type||i.pattern!==a.pattern)break;n.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],i.type===a.type)&&i.pattern===a.pattern;s--)n.unshift(a);return n},s.prototype.isPeekDateOverflowingDatePart=function(t){var e=t.useBasePrefixAndSuffix,i=t.middle,n=t.patternValue,s=t.basePrefix,a=t.baseSuffix,r=t.prefix,o=t.suffix,l=t.symbol,h=t.patternLength,t=t.leadingZero,u=this.peek(i,n),e=e?"".concat(s).concat(u).concat(a):"".concat(r).concat(u).concat(o),s=this.intl.parseDate(e,this.format,this.localeId),a=((this.leadingZero||{})[l]||0)+(0,rt.unpadZero)(i).length>=h;return{peekedDate:s,peekedDateString:e,peekedValue:u,parsedPeekedValue:(0,ot.parseToInt)(u),switchToNext:null===s||(t[l]?n.length<=i.length:a)}},e.DateObject=s},503:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},874:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=void 0,e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0,e.Mask=function(){this.symbols="",this.partMap=[]}},179:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var n=i(849),s={events:{}};function a(t){this.options=(0,n.extend)({},s,t)}a.prototype.destroy=function(){this.options={}},a.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!(0,n.isFunction)(this.options.events[t])&&(this.options.events[t]((0,n.extend)(i,e,{sender:this})),i.defaultPrevented)},e.Observable=a},849:(t,r,e)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isIOS=r.isValidDate=r.areDatePartsEqualTo=r.millisecondStepFor=r.millisecondDigitsInFormat=r.setYears=r.cropTwoDigitYear=r.isFunction=r.noop=r.deepExtend=r.extend=r.clamp=r.isParseableToInt=r.parseToInt=r.isNumber=r.isDocumentAvailable=r.isPresent=void 0;function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var l=e(109),i=e(618);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return(0,r.isPresent)(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.isParseableToInt=function(t){return(0,r.isNumber)((0,r.parseToInt)(t))&&/^[0-9]+$/.test(t)},r.clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!i.length)return t;var s=i.shift();if(o(t)&&o(s))for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(s[a]instanceof HTMLElement?t[a]=s[a]:!o(s[a])||s[a]instanceof Date?(0,r.extend)(t,((e={})[a]=s[a],e)):(t[a]&&o(t[a])||(0,r.extend)(t,((e={})[a]={},e)),(0,r.deepExtend)(t[a],s[a])));return r.deepExtend.apply(void 0,l.__spreadArray([t],i,!1))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!(0,r.isPresent)(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=(0,i.cloneDate)(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,i,n,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==i||t.getDate()!==n||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return(0,r.isPresent)(t)&&t.getTime&&(0,r.isNumber)(t.getTime())},r.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&/Macintosh/i.test(navigator.userAgent)}},415:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateInput=void 0;var n,s=i(109),a=i(953),I=i(506),x=i(874),O=i(503),w=i(849),r=i(179),C=i(655),F=i(618),V=i(761),o="dragStart",l="touchstart",h="mousedown",u="mouseup",c="input",d="keydown",p="focus",m="blur",g="DOMMouseScroll",v="mousewheel",f="valueChange",y="inputEnd",D="blurEnd",E="focusEnd",P="change",b={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((i={})[f]=null,i[c]=null,i[y]=null,i[p]=null,i[E]=null,i[m]=null,i[D]=null,i[d]=null,i[v]=null,i[P]=null,i),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:V.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1,toggleDayPeriod:!1},i=(n=r.Observable,s.__extends(S,n),Object.defineProperty(S.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!1,configurable:!0}),S.prototype.init=function(t,e){var i=(0,w.isValidDate)(this.options.value)?(0,F.cloneDate)(this.options.value):new Date(e.formattedValue);(0,w.isValidDate)(i)||(i=null),this.element=t,this.options=(0,w.extend)({},b,e,{steps:s.__assign(s.__assign({},b.steps),e.steps)}),this.intl=this.options.intlService,this.dateObject=this.createDateObject(),this.dateObject.setValue(i),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=C.DateInputInteractionMode.None,this.forceUpdate()},S.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,n.prototype.destroy.call(this)},S.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener(o,this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener(h,this.onElementMouseDown),this.element.addEventListener(l,this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener(u,this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener(c,this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener(d,this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener(p,this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener(m,this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener(P,this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener(g,this.onElementMouseWheel),this.element.addEventListener(v,this.onElementMouseWheel)},S.prototype.unbindEvents=function(){this.element.removeEventListener(o,this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener(l,this.onElementMouseDown),this.element.removeEventListener(h,this.onElementMouseDown),this.element.removeEventListener(u,this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener(c,this.onElementInput),this.element.removeEventListener(d,this.onElementKeyDown),this.element.removeEventListener(p,this.onElementFocus),this.element.removeEventListener(m,this.onElementBlur),this.element.removeEventListener(P,this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener(g,this.onElementMouseWheel),this.element.removeEventListener(v,this.onElementMouseWheel)},S.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=(0,w.extend)({},this.options,t,{steps:s.__assign(s.__assign({},b.steps),t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},S.prototype.setDateObjectOptions=function(){var t;this.dateObject&&(t=this.getDateObjectOptions(),this.dateObject.setOptions(t))},S.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},S.prototype.isInCaretMode=function(){return this.interactionMode===C.DateInputInteractionMode.Caret},S.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},S.prototype.onElementDragStart=function(t){t.preventDefault()},S.prototype.onElementDrop=function(t){t.preventDefault()},S.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},S.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},S.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e,i=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=(0,w.isPresent)(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(i.start)))},S.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.elementValue;if(this.element&&this.dateObject){var i=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var n=this.keyDownEvent||{},s=n.keyCode===x.KeyCode.BACKSPACE||n.key===O.Key.BACKSPACE,a=n.keyCode===x.KeyCode.DELETE||n.key===O.Key.DELETE,n=this.interactionMode,r=(!this.options.allowCaretMode||n===C.DateInputInteractionMode.Caret||a||s||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=C.DateInputInteractionMode.Caret:this.interactionMode=C.DateInputInteractionMode.Selection,this.isInCaretMode());if(r&&this.keyDownEvent.key===O.Key.SPACE)this.restorePreviousInputEventState();else{var o=this.dateObject&&this.dateObject.getValue(),l=this.dateObject?this.dateObject.value:null,h=this.dateObject.getTextAndFormat(),u=h.text,n=(this.currentFormat=h.format,h=r&&(s||a||n===C.DateInputInteractionMode.Caret)?this.previousElementValue:u,this.elementValue),c=(0,I.approximateStringMatching)({oldText:h,newText:n,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:r,keyEvent:this.keyDownEvent});if(c&&c.length&&c[0]&&c[0][1]!==V.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!r||c&&0!==c.length){if(r&&1===c.length){if(!c[0]||!c[0][0])return void this.restorePreviousInputEventState();if(r&&c[0]&&(c[0][0]===V.Constants.formatSeparator||c[0][1]===V.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var u=1===c.length&&c[0][1]===V.Constants.formatSeparator,d=[],p=!1,m=null;if(!u)for(var g=0;g<c.length;g++){var v=this.dateObject.parsePart({symbol:c[g][0],currentChar:c[g][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:s||a,originalFormat:this.currentFormat});d.push(v),v.value||(m={type:"parse"}),p=v.switchToNext}this.options.autoSwitchParts||(p=!1),this.resetSegmentValue=!1;var f,h=this.options.format===this.currentFormat||(0,w.isPresent)(this.options.format)&&1<this.options.format.length,n=d[d.length-1],y=n&&!(0,w.isPresent)(n.value),D=r&&(s||a)&&y,E=!!n&&n.resetPart,P=this.dateObject.getValue(),b=!(0,F.isEqual)(o,P),S=this.dateObject.value,M=this.selection;r?(f=c&&0<c.length?c[0][0]:null,f=this.dateObject.getLeadingZero()[f],c.length&&c[0][0]!==V.Constants.formatSeparator?p?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):E?(E=this.currentFormat[M.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(E))):this.restorePreviousInputEventState():D?(this.forceUpdate(),c.length&&c[0][0]!==V.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(c[0][0]))):y?"0"===t.data&&f||((0,w.isPresent)(o)&&!(0,w.isPresent)(P)?this.restorePreviousInputEventState():!(0,w.isPresent)(o)&&(0,w.isPresent)(P)?this.forceUpdateWithSelection():(0,w.isPresent)(o)&&(0,w.isPresent)(P)?b?this.forceUpdateWithSelection():this.restorePreviousInputEventState():(0,w.isPresent)(o)||(0,w.isPresent)(P)?l===S&&this.restorePreviousInputEventState():this.forceUpdateWithSelection()):h||this.forceUpdateWithSelection():!this.options.autoSwitchParts&&c[0][1]===V.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(c[0][0]))):(this.forceUpdate(),c.length&&c[0][0]!==V.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(c[0][0])),this.options.autoSwitchParts?u?(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):p&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):n&&n.switchToNext?this.resetSegmentValue=!0:u&&(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),s&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1)),this.tryTriggerValueChange({oldValue:o,event:t}),this.triggerInputEnd({event:t,error:m,oldElementValue:e,newElementValue:this.elementValue}),r&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}}},S.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=C.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},S.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=C.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},S.prototype.onElementChange=function(t){this.triggerChange({event:t})},S.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,i=e.start,e=e.end,n=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:e},this.keyEventMatchesAutoSwitchKeys(t)){i=t.keyCode===x.KeyCode.TAB;if(!i)return t.preventDefault(),void this.switchDateSegment(1);var e=this.selection,s=e.start,e=e.end;if(t.shiftKey&&i?this.switchDateSegment(-1):this.switchDateSegment(1),s!==this.selection.start||e!==this.selection.end)return void t.preventDefault()}var a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1,l=this.elementValue;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===x.KeyCode.TAB)){switch(t.keyCode){case x.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,n),l!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:l}),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,n),l!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:l}),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ENTER:break;case x.KeyCode.HOME:this.selectNearestSegment(0),this.switchedPartOnPreviousKeyAction=!(o=!0),this.resetSegmentValue=!0;break;case x.KeyCode.END:this.selectNearestSegment(this.elementValue.length),this.switchedPartOnPreviousKeyAction=!(o=!0),this.resetSegmentValue=!0;break;default:return}o&&t.preventDefault()}}},S.prototype.onElementPaste=function(){this.isPasteInProgress=!0},S.prototype.onElementMouseWheel=function(t){var e,i=this.elementValue;this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((e=t).shiftKey?this.switchDateSegment(0<(e.wheelDelta||-e.detail)?-1:1):this.modifyDateSegmentValue(0<(e.wheelDelta||-e.detail)?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),i!==this.elementValue)&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:i})},S.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,i=((0,w.isPresent)(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:i,event:t})},Object.defineProperty(S.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:V.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:V.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!1,configurable:!0}),S.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),(0,w.isDocumentAvailable)()&&(0,w.isIOS)()&&this.element.scrollIntoView({block:"nearest",inline:"nearest"}),t.start!==t.end)&&(this.interactionMode=C.DateInputInteractionMode.Selection)},S.prototype.selectionBySymbol=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e)&&(e=n);return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?i+=this.currentText.length-this.currentFormat.length:i=Math.max(0,i-(this.currentFormat.length-this.currentText.length))),{start:e,end:i}},S.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},i=t,n=t-1;i<this.currentFormat.length||0<=n;i++,n--){if(i<this.currentFormat.length&&this.currentFormat[i]!==V.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}if(0<=n&&this.currentFormat[n]!==V.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}}return e},S.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var i=e.start,n=this.currentFormat[i-1],s="",a="";if(t<0){for(var r=i+t;0<=r;r--)if((a=this.currentFormat[r])!==V.Constants.formatSeparator&&a!==n){i=r,s=a;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==V.Constants.formatSeparator&&a!==n){i=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=C.DateInputInteractionMode.Selection)}this.interactionMode=C.DateInputInteractionMode.None;var e=this.selection,o=e.start,e=e.end;if(o<e&&this.currentFormat[o]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?o:e-1)),this.resetSegmentValue=!0,this.interactionMode=C.DateInputInteractionMode.None;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===V.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==V.Constants.formatSeparator){for(var u=h;0<=u&&u<this.currentFormat.length&&this.currentFormat[u]===this.currentFormat[h];)u+=t;u<h&&(u+1!==o||h+1!==e)?(this.setSelection({start:u+1,end:h+1}),this.resetSegmentValue=!0):h<u&&(h!==o||u!==e)&&(this.setSelection({start:h,end:u}),this.resetSegmentValue=!0),this.interactionMode=C.DateInputInteractionMode.None}}},S.prototype.modifyDateSegmentValue=function(t,e,i){var n,s,a;void 0===e&&(e=""),void 0===i&&(i={}),this.dateObject&&!this.options.readonly&&(n=this.value,a=1,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond&&1!==this.options.steps.millisecond||(s=(0,w.millisecondDigitsInFormat)(this.inputFormat),a=(0,w.millisecondStepFor)(s)),this.dateObject.modifyPart(e,a*t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},S.prototype.tryTriggerValueChange=function(t){if(!(0,F.isEqual)(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},S.prototype.triggerValueChange=function(t){return this.trigger(f,(0,w.extend)(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},S.prototype.triggerInput=function(t){return this.trigger(c,(0,w.extend)(t=void 0===t?{event:{}}:t,{value:this.value}))},S.prototype.triggerInputEnd=function(t){return this.trigger(y,(0,w.extend)(t=void 0===t?{event:{},error:null,oldElementValue:"",newElementValue:""}:t,{value:this.value}))},S.prototype.triggerFocus=function(t){return this.trigger(p,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerFocusEnd=function(t){return this.trigger(E,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerBlur=function(t){return this.trigger(m,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerBlurEnd=function(t){return this.trigger(D,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerChange=function(t){return this.trigger(P,(0,w.extend)(t=void 0===t?{event:{}}:t,{value:this.value}))},S.prototype.triggerKeyDown=function(t){return this.trigger(d,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerMouseWheel=function(t){return this.trigger(v,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},S.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,t=t.end,i=this.elementValue.length,i=(this.forceUpdate(),this.elementValue.length-i);this.setSelection({start:e+i,end:t+i})},S.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text;this.currentFormat=t.format,this.currentText=e},S.prototype.setElementValue=function(t){this.element.value=t},S.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},S.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},S.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},S.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start;this.setSelection({start:e||0,end:t.end||0})},S.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},S.prototype.verifyValue=function(t){if(t&&!(0,w.isValidDate)(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},S.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,e=this.dateObject.getTextAndFormat(e),i=e.text,e=(this.currentFormat=e.format,this.currentText=i,this.options.hasPlaceholder||(0,w.isPresent)(this.options.placeholder)),n=!this.isActive&&e&&!this.dateObject.hasValue(),e=(e&&(0,w.isPresent)(this.options.placeholder)&&(t.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e)},S.prototype.caret=function(t,e){void 0===e&&(e=t);var i=void 0!==t,n=[t,t],s=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(i&&((0,w.isDocumentAvailable)()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.selectionEnd])}catch(t){n=[]}return n}},S.prototype.selectNearestSegment=function(t){for(var e=t,i=t-1;e<this.currentFormat.length||0<=i;e++,i--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=i&&"_"!==this.currentFormat[i])return void this.selectDateSegment(this.currentFormat[i])}},S.prototype.selectDateSegment=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e)&&(e=n);e<0&&(e=0),this.caret(0,0),this.caret(e,i)},S.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=(this.options.value=t,this.createDateObject());return t.setLeadingZero(this.isActive?e:null),t},S.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new a.DateObject((0,w.extend)({},t))},S.prototype.getDateObjectOptions=function(){return{intlService:this.options.intlService,formatPlaceholder:this.options.formatPlaceholder||"formatPattern",format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value,toggleDayPeriod:this.options.toggleDayPeriod,autoSwitchParts:this.options.autoSwitchParts}},S.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()});return 0<=e.indexOf(t.keyCode.toString())||0<=e.indexOf(t.keyCode)||0<=e.indexOf(t.key.toLowerCase().trim())},S.prototype.autoFill=function(){var t,e,i,n,s,a=this.dateObject,r=new Date;(a.date||a.month||a.year||a.hours||a.minutes||a.seconds)&&(i=(a.year?a.value:r).getFullYear(),e=(a.month?a.value:r).getMonth(),t=(a.date?a.value:r).getDate(),n=(a.hours?a.value:r).getHours(),s=(a.minutes?a.value:r).getMinutes(),r=(a.seconds?a.value:r).getSeconds(),a.setValue(new Date(i,e,t,n,s,r)),this.refreshElementValue(),this.triggerValueChange())},S);function S(t,e){var i=n.call(this,e)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=C.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(t,e),i}e.DateInput=i},655:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateInputInteractionMode=void 0,e.DateInputInteractionMode={None:"none",Caret:"caret",Selection:"selection"}},506:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInRange=e.dateSymbolMap=e.approximateStringMatching=e.unpadZero=e.padZero=void 0;var p=i(761),m=i(503);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,i=t.newText,n=t.formatPattern,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=s+e.length-i.length,o=e[r],l=e.substring(0,r),e=i.substring(0,s),h=[];if(l===e&&0<s)return h.push([n[s-1],e[s-1]]),h;if(0===l.indexOf(e)&&a&&(t.key===m.Key.DELETE||t.key===m.Key.BACKSPACE)||0===l.indexOf(e)&&!a&&(0===e.length||n[e.length-1]!==n[e.length])){var u="";a||1!==e.length||h.push([n[0],e[0]]);for(var c=e.length;c<l.length;c++)n[c]!==u&&n[c]!==p.Constants.formatSeparator&&(u=n[c],h.push([u,""]));return h}if((!a||0!==e.indexOf(l)&&n[s-1]!==p.Constants.formatSeparator)&&(a||0!==e.indexOf(l)&&n[s-1]!==p.Constants.formatSeparator))return" "===e[e.length-1]||e[e.length-1]===o&&"_"===n[r]?[[n[s-1],p.Constants.formatSeparator]]:[[n[s-1],e[s-1]]];for(var d=n[0],c=Math.max(0,l.length-1);c<n.length;c++)if(n[c]!==p.Constants.formatSeparator){d=n[c];break}return[[d,e[s-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,i){return null===t||!(e&&t<e||i&&i<t)}},618:t=>{t.exports=o},109:t=>{t.exports=l}},s={},t=a={},Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0,e=i(415),Object.defineProperty(t,"DateInput",{enumerable:!0,get:function(){return e.DateInput}}),a))}}});
1
+ System.register("@progress/kendo-dateinputs-common",["@progress/kendo-date-math","tslib"],function(r,t){var o={},l={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(l,"__esModule",{value:!0}),{setters:[function(e){Object.keys(e).forEach(function(t){o[t]=e[t]})},function(e){Object.keys(e).forEach(function(t){l[t]=e[t]})}],execute:function(){function i(t){var e=s[t];return void 0!==e||(e=s[t]={exports:{}},n[t](e,e.exports,i)),e.exports}var n,s,t,e,a;r((n={761:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Constants=void 0,e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},953:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateObject=void 0;var at=i(618),o=i(930),rt=i(506),ot=i(849),c=i(761),n=/d|M|H|h|m|s/;function s(t){var e=t.intlService,i=t.formatPlaceholder,n=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?c.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,o=t.autoCorrectParts,o=void 0===o||o,l=t.toggleDayPeriod,l=void 0!==l&&l,t=t.autoSwitchParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.dayperiod=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=this.getDefaultDate(),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.setOptions({intlService:e,formatPlaceholder:i,format:n,cycleTime:s,twoDigitYearMax:a,value:r,autoCorrectParts:o,toggleDayPeriod:l,autoSwitchParts:t}),r)this._value=(0,at.cloneDate)(r);else{this._value=this.getDefaultDate();for(var h=this.dateFormatString(this.value,this.format).symbols,u=0;u<h.length;u++)this.setExisting(h[u],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=c.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),i=0;i<e.length;i++){var n=e[i],n=this.intl.cldr[n];if(n.name&&n.calendar&&n.numbers&&n.name!==c.Constants.defaultLocaleId){t=n.name;break}}return t},enumerable:!1,configurable:!0}),s.prototype.setOptions=function(t){this.intl=t.intlService,this.formatPlaceholder=t.formatPlaceholder||"wide",this.format=t.format,this.cycleTime=t.cycleTime,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=t.twoDigitYearMax,this.autoCorrectParts=t.autoCorrectParts,this.toggleDayPeriod=t.toggleDayPeriod,this.autoSwitchParts=t.autoSwitchParts},s.prototype.setValue=function(t){t?(0,at.isEqual)(t,this._value)?(0,at.isEqual)(t,this._value)&&this.dayPeriods&&this.setExisting("a",!0):(this._value=(0,at.cloneDate)(t),this.modifyExisting(!0)):(this._value=this.getDefaultDate(),this.modifyExisting(!1)),this.resetInvalidDate()},s.prototype.hasValue=function(){var i=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&i.getExisting(e.pattern[0])},!1)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return(0,at.cloneDate)(this.value)},s.prototype.createDefaultDate=function(){return(0,at.createDate)(2e3,0,31)},s.prototype.getDefaultDate=function(){return(0,at.getDate)(this.createDefaultDate())},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),i=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var n="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.length;r++){var o,l,h=i.symbols[r];"literal"!==i.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(i,r),"M"===h?(l=((0,ot.parseToInt)(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(n+=(0,rt.padZero)(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),n+=(0,rt.padZero)(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):n+=e[r]}e=n}return this.merge(e,i)},s.prototype.getFormattedInvalidDates=function(t){var i=this,n=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=i.getInvalidDatePart(t).date;e&&(e=i.intl.formatDate(e,n,i.localeId),s[t]=e)}),s},s.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,i=0;i<e.length;i++)this.setExisting(e[i],t)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"t":case"a":return this.dayperiod;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"t":case"a":this.dayperiod=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if((0,ot.isPresent)(t)&&(0,ot.isPresent)(e)&&0!==e){var i,n=(0,at.cloneDate)(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a){var l=n.getHours();switch(t){case"y":n.setFullYear(n.getFullYear()+e);break;case"M":n=(0,at.addMonths)(this.value,e);break;case"d":case"E":n.setDate(n.getDate()+e);break;case"h":case"H":n.setHours(n.getHours()+e),s=!0;break;case"m":n.setMinutes(n.getMinutes()+e),s=!0;break;case"s":n.setSeconds(n.getSeconds()+e),s=!0;break;case"S":n.setMilliseconds(n.getMilliseconds()+e);break;case"a":this.toggleDayPeriod?n.setHours(12<=l?l-12:l+12):n.setHours(n.getHours()+12*e),s=!0}}else{var h=this._partiallyInvalidDate.invalidDateParts||{},u=this.getInvalidDatePartValue(t),c=h.y.value||n.getFullYear(),d=h.M.value||n.getMonth(),p=h.d.value||h.E.value||n.getDate(),m=h.h.value||h.H.value||n.getHours(),g=h.m.value||n.getMinutes(),v=h.s.value||n.getSeconds(),h=h.S.value||n.getMilliseconds();switch(t){case"y":c+=e;break;case"M":d+=e;break;case"d":case"E":p+=e}if("M"===t){if((d<0||11<d)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(d=d<0?(0,ot.clamp)(d%11+1+11,0,11):(f=(0,ot.isPresent)(u)?d:(e-1)%12,(0,ot.clamp)(f,0,11)),d=(0,ot.clamp)(d,0,11)),d=(0,ot.clamp)(d,0,11)}else if("d"===t)if(o){if(p<=0||31<p)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if((0,ot.isPresent)(u)&&(p<=0||31<p))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);p=(f=e<0?(0,ot.isPresent)(u)?p:31-Math.abs(e%31)+1:(0,ot.isPresent)(u)?p:e%31,(0,ot.clamp)(f,1,31)),p=(0,ot.clamp)(p,1,31)}var o=(0,at.createDate)(c,d,p,m,g,v,h),u=a||r?this.modifyDateSymbolWithValue(n,t,a?d:p):null,f=(0,ot.areDatePartsEqualTo)(o,c,d,p,m,g,v,h);this.getValue()&&(0,ot.areDatePartsEqualTo)(o,c,d,p,m,g,v,h)?(n=(0,at.cloneDate)(o),this.markDatePartsAsExisting()):a&&u?u.getMonth()===d?this.getExisting("d")?f?(n=(0,at.cloneDate)(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:d,date:(0,at.cloneDate)(u),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)):f?(this.resetInvalidDateSymbol(t),n=(0,at.cloneDate)(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),n=(0,at.cloneDate)(u)):(i=!0,this.setInvalidDatePart(t,{value:d,date:(0,at.cloneDate)(u),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)):r&&u&&(u.getDate()===p?this.getExisting("M")?f?(n=(0,at.cloneDate)(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:p,date:(0,at.cloneDate)(u),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)):f?(n=(0,at.cloneDate)(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),n=(0,at.cloneDate)(u)):(i=!0,this.setInvalidDatePart(t,{value:p,date:(0,at.cloneDate)(this.value),startDateOffset:e,startDate:(0,at.cloneDate)(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(n=this.normalizeCentury(n)),s&&!this.cycleTime&&(n.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=n,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,N=t.resetSegmentValue,n=t.rawTextValue,j=t.isDeleting,s=t.originalFormat,a=!t.cycleSegmentValue,r=this.dateFormatString(this.value,this.format),o=r.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),l=r.partMap.map(function(t){return{type:t.type,pattern:t.pattern,text:""}}),h=0;h<o.length;h++){for(var u=o[h],c=0;c<u.pattern.length;c++)o[h+c]&&(o[h+c].literal=u.pattern[c]);h+=u.pattern.length-1}for(h=0;h<l.length;h++){for(u=l[h],c=0;c<u.pattern.length;c++)l[h+c]&&(l[h+c].text=u.pattern[c]);h+=u.pattern.length-1}var d={value:null,switchToNext:!1,resetPart:a&&"M"===e&&r.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length}),hasInvalidDatePart:!1};if(!i){if(!a)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,ot.extend)(d,{value:null,switchToNext:!1});for(h=0;h<o.length;h++){var L=o[h].literal,K=n.startsWith(L),W=n.endsWith(L),L=0<=n.indexOf(L+L);if(K||W||L)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),(0,ot.extend)(d,{value:null,switchToNext:!1})}}var p=this.intl.formatDate(this.value,this.format,this.localeId),H=r.symbols,m=!1,g="",v="",f="",y="",D="",E="",B="";for(h=0;h<l.length;h++)B+=l[h].text;var t=this.format===H||this.format===B||this.format===s||this.format.length===s.length,P=(t?B:s).indexOf(e),Z=(t?B:s).lastIndexOf(e)-P+1,R=s.length-n.length;if(a||!a&&!this.autoCorrectParts){var b,Y,U=0;for(h=0;h<p.length;h++)H[h]===e?(b=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?v+=p[h]:(Y=this.getInvalidDatePartValue(e),(0,ot.isPresent)(Y)?(v+=(Y||"").toString()[U]||"",U++):v+=b?p[h]:"0"):v+=b?p[h]:"0",0<R&&!(f.length+R<Z)||(f+=n[h]||""),m=!0):m?(E+=p[h],D+=p[h]):(g+=p[h],y+=p[h]);if(t&&(B.length<n.length?f+=i:j||(s.length,n.length),f.length>Z))return(0,ot.extend)(d,{value:null,switchToNext:!1});if(!t||!this.autoCorrectParts){for(var v="",f="",g="",E="",m=!1,z=0,h=0;h<s.length;h++)s[h]===e?(b=this.getExisting(e),"y"===e?!this.hasInvalidDatePart()&&this.getExisting("y")?v+=p[h]:(Y=this.getInvalidDatePartValue(e),(0,ot.isPresent)(Y)?(v+=(Y||"").toString()[z]||"",z++):v+=b?p[h]:"0"):v+=b?p[h]||"":"0",0<R&&!(f.length+R<Z)||(f+=n[h]||""),m=!0):m?E+=n[h-R]||"":g+=n[h]||"";s.length<n.length&&(f+=i)}}if(!a)if(this.autoCorrectParts)for(E=g=f=v="",m=!1,h=0;h<p.length;h++)H[h]===e?(v+=(b=this.getExisting(e))?p[h]:"0",m=!0):m?E+=p[h]:g+=p[h];else v=N?f:v;var S=null,P=this.matchMonth(i),q=P.monthName,P=P.matchesCount,M=this.matchDayPeriod(i,e),I="0"===i,G=this.leadingZero||{},x=(I?("0"===f&&(f=v),0!==(0,ot.parseToInt)(N?i:(a?f:v)+i)||this.isAbbrMonth(r.partMap,e)||"a"===e||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(r.partMap,e)),J=x?x.pattern:null,$=this.patternLength(J)||J.length;if(a&&j&&!f)this.setExisting(e,!1);else{var x=v.length-3,Q=!0,O=a?f:v;for(h=Math.max(0,x);h<=v.length&&Q;h++){O=N?i:a?f:v.substring(h)+i,this.autoSwitchParts&&"h"===e&&"12"===v.substring(h)&&(O=O.replace("12","0")),!a&&this.autoCorrectParts||(O=(Q=!1,rt.unpadZero)(O),O=(0,rt.padZero)($-O.length)+O);var X,tt=parseInt(O,10),et=((S=this.intl.parseDate(g+O+E,this.format,this.localeId))&&this.value&&r.partMap.every(function(t){return"year"!==t.type&&"month"!==t.type&&"day"!=t.type})&&(S.setFullYear(this.value.getFullYear()),S.setMonth(this.value.getMonth()),S.setDate(this.value.getDate())),!1),it=(a&&!(0,ot.isValidDate)(S)&&this.autoCorrectParts&&(S=this.intl.parseDate(y+O+D,this.format,this.localeId),et=!0),!isNaN(parseInt(i,10))||a&&j&&""===i);if(!S&&!isNaN(tt)&&it&&this.autoCorrectParts&&("M"!==e||q||-1<(it=tt-1)&&it<12&&((S=(0,at.cloneDate)(this.value)).setMonth(it),S.getMonth()!==it)&&(S=(0,at.lastDayOfMonth)((0,at.addMonths)(S,-1))),"y"===e)&&(S=(0,at.createDate)(parseInt(O,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),a&&(0,ot.isValidDate)(S)||!a&&S)&&this.date&&S.getDate()!==this.value.getDate()&&(S=(0,at.lastDayOfMonth)((0,at.addMonths)(S,-1))),a&&(0,ot.isValidDate)(S)||!a&&S)return X=(tt=this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:et,middle:O,patternValue:J,basePrefix:y,baseSuffix:D,prefix:g,suffix:E,symbol:e,patternLength:$,leadingZero:G})).switchToNext,this.shouldNormalizeCentury()&&(S=this.normalizeCentury(S)),"H"===e&&12<=S.getHours()&&this.setExisting("a",!0),this._value=S,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e?this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")):"y"===e&&this.markDatePartsAsExisting(),this.hasInvalidDatePart())||(this.markDatePartsAsExisting(),tt.peekedDate)||!tt.switchToNext||this.autoCorrectParts||"M"===e||"d"===e&&30===tt.parsedPeekedValue&&1===this.value.getMonth()&&(X=!1),(0,ot.extend)(d,{value:this.value,switchToNext:X})}if(q&&(S=this.intl.parseDate(g+q+E,this.format,this.localeId)))return this._value=S,this.setExisting(e,!0),(0,ot.extend)(d,{value:this.value,switchToNext:1===P});if(M&&(S=this.intl.parseDate(g+M+E,this.format)||this.intl.parseDate(y+M+D,this.format)))return this._value=S,this.setExisting(e,!0),(0,ot.extend)(d,{value:this.value,switchToNext:!0});if(I&&"a"!==e&&this.setExisting(e,!1),!this.autoCorrectParts){var nt,st,w,C,F,V,k,_,T,A,x=void 0,P=a?f:O,M=(0,ot.parseToInt)(P);if((0,ot.isNumber)(M)&&(0,ot.isParseableToInt)(P)){if("d"===e&&(M<=0||31<M)||"M"===e&&(M<=0||11<M)){if(a)return(0,ot.extend)(d,{value:null,switchToNext:!1});M=(0,ot.parseToInt)(P=i)}return(0,ot.isNumber)(M)&&(0,ot.isParseableToInt)(P)?(x="M"===e?M-1:M,I="y"===e,nt="M"===e,st="d"===e,w=(0,at.cloneDate)(this._value),A=this._partiallyInvalidDate.invalidDateParts||{},C=I?x:A.y.value||w.getFullYear(),F=nt?x:A.M.value||w.getMonth(),x=st?x:A.d.value||A.E.value||w.getDate(),k=A.h.value||A.H.value||w.getHours(),_=A.m.value||w.getMinutes(),T=A.s.value||w.getSeconds(),A=A.S.value||w.getMilliseconds(),V=(0,at.createDate)(C,F,x,k,_,T,A),k=(0,ot.areDatePartsEqualTo)(V,C,F,x,k,_,T,A),_=I||nt||st?this.modifyDateSymbolWithValue(w,e,I?C:nt?F:x):null,T=!1,nt&&_?_.getMonth()===F?this.getExisting("d")?k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:F,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(_)):(T=!0,this.setInvalidDatePart(e,{value:F,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):st&&_?_.getDate()===x?this.getExisting("M")?k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:x,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(_)):(T=!0,this.setInvalidDatePart(e,{value:x,date:(0,at.cloneDate)(this.value),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):I&&_&&(_.getFullYear()===C?this.getExisting("d")&&this.getExisting("M")?k?(w=(0,at.cloneDate)(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:C,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(V),this.getExisting("M")&&this.getExisting("d")&&(this.setExisting("y",!0),this.resetInvalidDateSymbol("y"))):(this.resetInvalidDateSymbol(e),w=(0,at.cloneDate)(_)):(T=!0,this.setInvalidDatePart(e,{value:C,date:(0,at.cloneDate)(_),startDate:(0,at.cloneDate)(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),a&&!(0,ot.isValidDate)(S)?(A=this.intl.parseDate(y+O+D,this.format,this.localeId),(0,ot.isValidDate)(A)&&(this._value=A)):this._value=w,this.getValue()&&this.resetInvalidDate()),X=!1,X="M"===e?2<=M||2<=P.length:t?this.isPeekDateOverflowingDatePart({useBasePrefixAndSuffix:!this.autoCorrectParts,middle:O,patternValue:J,basePrefix:y,baseSuffix:D,prefix:g,suffix:E,symbol:e,patternLength:$,leadingZero:G}).switchToNext:P.length>Z,(0,ot.extend)(d,{value:null,switchToNext:X,hasInvalidDatePart:T})):(0,ot.extend)(d,{value:null,switchToNext:!1})}}}return(0,ot.extend)(d,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(rt.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.getLeadingZero=function(){return this.leadingZero||{}},s.prototype.normalizeCentury=function(t){var e,i;return(0,ot.isPresent)(t)?(e=(0,ot.cropTwoDigitYear)(t),i=this.getNormalizedCenturyBase(e),(0,ot.setYears)(t,i+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return(0,rt.padZero)(e.length-t.length)+t},s.prototype.matchMonth=function(t){var i=this;if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=[],n=0;n<this.monthNames.length;n++)this.monthNames[n].toLowerCase().startsWith(this.typedMonthPart)&&e.push(this.monthNames[n]);if(0<e.length)return{monthName:e[0],matchesCount:e.length};var s,a=parseInt(this.typedMonthPart,10);if(1<=a&&a<=12&&a.toString().startsWith(this.typedMonthPart))return s=[1,2,3,4,5,6,7,8,9,10,11,12].reduce(function(t,e){return e.toString().startsWith(i.typedMonthPart)?t+1:t},0),{monthName:this.monthNames[a-1],matchesCount:s};this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return{monthName:"",matchesCount:0}},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),i=0;i<e.length;i++)if("month"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return[]},s.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),i=0;i<e.length;i++)if("dayperiod"===e[i].type&&e[i].names)return this.intl.dateFormatNames(t,e[i].names);return null},s.prototype.patternLength=function(t){return"y"===t[0]?4:n.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var i=this.intl.splitDateFormat(e,this.localeId),n=[],s=[],a=0;a<i.length;a++)for(var r=this.intl.formatDate(t,{pattern:i[a].pattern},this.localeId).length;0<r;)n.push(this.symbols[i[a].pattern[0]]||c.Constants.formatSeparator),s.push(i[a]),r--;e=new o.Mask;return e.symbols=n.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var i="",n="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?i=t[l]+i:0<r?(i=t[l]+i,--r<=0&&(a=!0)):i=(t[l+t.length-s.length]||"")+i,n=s[l]+n;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?i="0"+i:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=((0,ot.parseToInt)(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?i=o[c][l]+i:(u=((0,ot.parseToInt)(this.getInvalidDatePartValue(c))+1).toString(),i=(0,rt.padZero)(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):(i=(0,rt.padZero)(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):i=this.dateFieldName(e.partMap[l])+i;n.length<i.length;)n=s[l]+n;0!==d&&(l=l-d+(t.length-s.length))}}return{text:i,format:n}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,i=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,ot.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!1)}),i&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var i=e.value,n=e.date,n=void 0===n?null:n,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===i?null:i,this._partiallyInvalidDate.invalidDateParts[t].date=n,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.hasInvalidDatePart=function(){var e=this,i=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&(0,ot.isPresent)(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!0)}),i},s.prototype.modifyDateSymbolWithOffset=function(t,e,i){var n=(0,at.cloneDate)(t),s=!1;switch(e){case"y":n.setFullYear(n.getFullYear()+i);break;case"M":n=(0,at.addMonths)(this.value,i);break;case"d":case"E":n.setDate(n.getDate()+i);break;case"h":case"H":n.setHours(n.getHours()+i),s=!0;break;case"m":n.setMinutes(n.getMinutes()+i),s=!0;break;case"s":n.setSeconds(n.getSeconds()+i),s=!0;break;case"S":n.setMilliseconds(n.getMilliseconds()+i);break;case"a":n.setHours(n.getHours()+12*i),s=!0}return{date:n,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,i){var n=(0,at.cloneDate)(t);switch(e){case"y":n.setFullYear(i);break;case"M":n=(0,at.addMonths)(t,i-t.getMonth());break;case"d":case"E":n.setDate(i);break;case"h":case"H":case"a":n.setHours(i);break;case"m":n.setMinutes(i);break;case"s":n.setSeconds(i);break;case"S":n.setMilliseconds(i)}return n},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var i=t.partMap[e],n=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(i.type!==a.type||i.pattern!==a.pattern)break;n.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],i.type===a.type)&&i.pattern===a.pattern;s--)n.unshift(a);return n},s.prototype.isPeekDateOverflowingDatePart=function(t){var e=t.useBasePrefixAndSuffix,i=t.middle,n=t.patternValue,s=t.basePrefix,a=t.baseSuffix,r=t.prefix,o=t.suffix,l=t.symbol,h=t.patternLength,t=t.leadingZero,u=this.peek(i,n),e=e?"".concat(s).concat(u).concat(a):"".concat(r).concat(u).concat(o),s=this.intl.parseDate(e,this.format,this.localeId),a=((this.leadingZero||{})[l]||0)+(0,rt.unpadZero)(i).length>=h;return{peekedDate:s,peekedDateString:e,peekedValue:u,parsedPeekedValue:(0,ot.parseToInt)(u),switchToNext:null===s||(t[l]?n.length<=i.length:a)}},e.DateObject=s},503:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},874:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=void 0,e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},930:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0,e.Mask=function(){this.symbols="",this.partMap=[]}},179:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Observable=void 0;var n=i(849),s={events:{}};function a(t){this.options=(0,n.extend)({},s,t)}a.prototype.destroy=function(){this.options={}},a.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!(0,n.isFunction)(this.options.events[t])&&(this.options.events[t]((0,n.extend)(i,e,{sender:this})),i.defaultPrevented)},e.Observable=a},849:(t,r,e)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isIOS=r.isValidDate=r.areDatePartsEqualTo=r.millisecondStepFor=r.millisecondDigitsInFormat=r.setYears=r.cropTwoDigitYear=r.isFunction=r.noop=r.deepExtend=r.extend=r.clamp=r.isParseableToInt=r.parseToInt=r.isNumber=r.isDocumentAvailable=r.isPresent=void 0;function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var l=e(109),i=e(618);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return(0,r.isPresent)(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.isParseableToInt=function(t){return(0,r.isNumber)((0,r.parseToInt)(t))&&/^[0-9]+$/.test(t)},r.clamp=function(t,e,i){return Math.min(i,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e,i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!i.length)return t;var s=i.shift();if(o(t)&&o(s))for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(s[a]instanceof HTMLElement?t[a]=s[a]:!o(s[a])||s[a]instanceof Date?(0,r.extend)(t,((e={})[a]=s[a],e)):(t[a]&&o(t[a])||(0,r.extend)(t,((e={})[a]={},e)),(0,r.deepExtend)(t[a],s[a])));return r.deepExtend.apply(void 0,l.__spreadArray([t],i,!1))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!(0,r.isPresent)(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=(0,i.cloneDate)(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,i,n,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==i||t.getDate()!==n||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return(0,r.isPresent)(t)&&t.getTime&&(0,r.isNumber)(t.getTime())},r.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&/Macintosh/i.test(navigator.userAgent)}},415:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateInput=void 0;var n,s=i(109),a=i(953),I=i(506),x=i(874),O=i(503),w=i(849),r=i(179),C=i(655),F=i(618),V=i(761),o="dragStart",l="touchstart",h="mousedown",u="mouseup",c="input",d="keydown",p="focus",m="blur",g="DOMMouseScroll",v="mousewheel",f="valueChange",y="inputEnd",D="blurEnd",E="focusEnd",P="change",b={format:"d",hasPlaceholder:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((i={})[f]=null,i[c]=null,i[y]=null,i[p]=null,i[E]=null,i[m]=null,i[D]=null,i[d]=null,i[v]=null,i[P]=null,i),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:V.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1,toggleDayPeriod:!1},i=(n=r.Observable,s.__extends(S,n),Object.defineProperty(S.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!1,configurable:!0}),S.prototype.init=function(t,e){var i=(0,w.isValidDate)(this.options.value)?(0,F.cloneDate)(this.options.value):new Date(e.formattedValue);(0,w.isValidDate)(i)||(i=null),this.element=t,this.options=(0,w.extend)({},b,e,{steps:s.__assign(s.__assign({},b.steps),e.steps)}),this.intl=this.options.intlService,this.dateObject=this.createDateObject(),this.dateObject.setValue(i),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=C.DateInputInteractionMode.None,this.forceUpdate()},S.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,n.prototype.destroy.call(this)},S.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener(o,this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener(h,this.onElementMouseDown),this.element.addEventListener(l,this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener(u,this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener(c,this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener(d,this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener(p,this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener(m,this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener(P,this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener(g,this.onElementMouseWheel),this.element.addEventListener(v,this.onElementMouseWheel)},S.prototype.unbindEvents=function(){this.element.removeEventListener(o,this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener(l,this.onElementMouseDown),this.element.removeEventListener(h,this.onElementMouseDown),this.element.removeEventListener(u,this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener(c,this.onElementInput),this.element.removeEventListener(d,this.onElementKeyDown),this.element.removeEventListener(p,this.onElementFocus),this.element.removeEventListener(m,this.onElementBlur),this.element.removeEventListener(P,this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener(g,this.onElementMouseWheel),this.element.removeEventListener(v,this.onElementMouseWheel)},S.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=(0,w.extend)({},this.options,t,{steps:s.__assign(s.__assign({},b.steps),t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},S.prototype.setDateObjectOptions=function(){var t;this.dateObject&&(t=this.getDateObjectOptions(),this.dateObject.setOptions(t))},S.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},S.prototype.isInCaretMode=function(){return this.interactionMode===C.DateInputInteractionMode.Caret},S.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},S.prototype.onElementDragStart=function(t){t.preventDefault()},S.prototype.onElementDrop=function(t){t.preventDefault()},S.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},S.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},S.prototype.onElementClick=function(t){this.mouseDownStarted=!1,this.switchedPartOnPreviousKeyAction=!1;var e,i=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=(0,w.isPresent)(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(i.start)))},S.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.elementValue;if(this.element&&this.dateObject){var i=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var n=this.keyDownEvent||{},s=n.keyCode===x.KeyCode.BACKSPACE||n.key===O.Key.BACKSPACE,a=n.keyCode===x.KeyCode.DELETE||n.key===O.Key.DELETE,n=this.interactionMode,r=(!this.options.allowCaretMode||n===C.DateInputInteractionMode.Caret||a||s||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=C.DateInputInteractionMode.Caret:this.interactionMode=C.DateInputInteractionMode.Selection,this.isInCaretMode());if(r&&this.keyDownEvent.key===O.Key.SPACE)this.restorePreviousInputEventState();else{var o=this.dateObject&&this.dateObject.getValue(),l=this.dateObject?this.dateObject.value:null,h=this.dateObject.getTextAndFormat(),u=h.text,n=(this.currentFormat=h.format,h=r&&(s||a||n===C.DateInputInteractionMode.Caret)?this.previousElementValue:u,this.elementValue),c=(0,I.approximateStringMatching)({oldText:h,newText:n,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:r,keyEvent:this.keyDownEvent});if(c&&c.length&&c[0]&&c[0][1]!==V.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!r||c&&0!==c.length){if(r&&1===c.length){if(!c[0]||!c[0][0])return void this.restorePreviousInputEventState();if(r&&c[0]&&(c[0][0]===V.Constants.formatSeparator||c[0][1]===V.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var u=1===c.length&&c[0][1]===V.Constants.formatSeparator,d=[],p=!1,m=null;if(!u)for(var g=0;g<c.length;g++){var v=this.dateObject.parsePart({symbol:c[g][0],currentChar:c[g][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:s||a,originalFormat:this.currentFormat});d.push(v),v.value||(m={type:"parse"}),p=v.switchToNext}this.options.autoSwitchParts||(p=!1),this.resetSegmentValue=!1;var f,h=this.options.format===this.currentFormat||(0,w.isPresent)(this.options.format)&&1<this.options.format.length,n=d[d.length-1],y=n&&!(0,w.isPresent)(n.value),D=r&&(s||a)&&y,E=!!n&&n.resetPart,P=this.dateObject.getValue(),b=!(0,F.isEqual)(o,P),S=this.dateObject.value,M=this.selection;r?(f=c&&0<c.length?c[0][0]:null,f=this.dateObject.getLeadingZero()[f],c.length&&c[0][0]!==V.Constants.formatSeparator?p?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):E?(E=this.currentFormat[M.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(E))):this.restorePreviousInputEventState():D?(this.forceUpdate(),c.length&&c[0][0]!==V.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(c[0][0]))):y?"0"===t.data&&f||((0,w.isPresent)(o)&&!(0,w.isPresent)(P)?this.restorePreviousInputEventState():!(0,w.isPresent)(o)&&(0,w.isPresent)(P)?this.forceUpdateWithSelection():(0,w.isPresent)(o)&&(0,w.isPresent)(P)?b?this.forceUpdateWithSelection():this.restorePreviousInputEventState():(0,w.isPresent)(o)||(0,w.isPresent)(P)?l===S&&this.restorePreviousInputEventState():this.forceUpdateWithSelection()):h||this.forceUpdateWithSelection():!this.options.autoSwitchParts&&c[0][1]===V.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(c[0][0]))):(this.forceUpdate(),c.length&&c[0][0]!==V.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(c[0][0])),this.options.autoSwitchParts?u?(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):p&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):n&&n.switchToNext?this.resetSegmentValue=!0:u&&(this.resetSegmentValue=!0,i||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),s&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1)),this.tryTriggerValueChange({oldValue:o,event:t}),this.triggerInputEnd({event:t,error:m,oldElementValue:e,newElementValue:this.elementValue}),r&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}}},S.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=C.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},S.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=C.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},S.prototype.onElementChange=function(t){this.triggerChange({event:t})},S.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,i=e.start,e=e.end,n=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:e},this.keyEventMatchesAutoSwitchKeys(t)){i=t.keyCode===x.KeyCode.TAB;if(!i)return t.preventDefault(),void this.switchDateSegment(1);var e=this.selection,s=e.start,e=e.end;if(t.shiftKey&&i?this.switchDateSegment(-1):this.switchDateSegment(1),s!==this.selection.start||e!==this.selection.end)return void t.preventDefault()}var a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1,l=this.elementValue;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===x.KeyCode.TAB)){switch(t.keyCode){case x.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,n),l!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:l}),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,n),l!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:l}),this.switchedPartOnPreviousKeyAction=!(o=!0);break;case x.KeyCode.ENTER:break;case x.KeyCode.HOME:this.selectNearestSegment(0),this.switchedPartOnPreviousKeyAction=!(o=!0),this.resetSegmentValue=!0;break;case x.KeyCode.END:this.selectNearestSegment(this.elementValue.length),this.switchedPartOnPreviousKeyAction=!(o=!0),this.resetSegmentValue=!0;break;default:return}o&&t.preventDefault()}}},S.prototype.onElementPaste=function(){this.isPasteInProgress=!0},S.prototype.onElementMouseWheel=function(t){var e,i=this.elementValue;this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((e=t).shiftKey?this.switchDateSegment(0<(e.wheelDelta||-e.detail)?-1:1):this.modifyDateSegmentValue(0<(e.wheelDelta||-e.detail)?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),i!==this.elementValue)&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:i})},S.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,i=((0,w.isPresent)(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:i,event:t})},Object.defineProperty(S.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:V.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:V.Constants.defaultDateFormat},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!1,configurable:!0}),S.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),(0,w.isDocumentAvailable)()&&(0,w.isIOS)()&&this.element.scrollIntoView({block:"nearest",inline:"nearest"}),t.start!==t.end)&&(this.interactionMode=C.DateInputInteractionMode.Selection)},S.prototype.selectionBySymbol=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e)&&(e=n);return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?i+=this.currentText.length-this.currentFormat.length:i=Math.max(0,i-(this.currentFormat.length-this.currentText.length))),{start:e,end:i}},S.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},i=t,n=t-1;i<this.currentFormat.length||0<=n;i++,n--){if(i<this.currentFormat.length&&this.currentFormat[i]!==V.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}if(0<=n&&this.currentFormat[n]!==V.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}}return e},S.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var i=e.start,n=this.currentFormat[i-1],s="",a="";if(t<0){for(var r=i+t;0<=r;r--)if((a=this.currentFormat[r])!==V.Constants.formatSeparator&&a!==n){i=r,s=a;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==V.Constants.formatSeparator&&a!==n){i=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=C.DateInputInteractionMode.Selection)}this.interactionMode=C.DateInputInteractionMode.None;var e=this.selection,o=e.start,e=e.end;if(o<e&&this.currentFormat[o]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?o:e-1)),this.resetSegmentValue=!0,this.interactionMode=C.DateInputInteractionMode.None;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===V.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==V.Constants.formatSeparator){for(var u=h;0<=u&&u<this.currentFormat.length&&this.currentFormat[u]===this.currentFormat[h];)u+=t;u<h&&(u+1!==o||h+1!==e)?(this.setSelection({start:u+1,end:h+1}),this.resetSegmentValue=!0):h<u&&(h!==o||u!==e)&&(this.setSelection({start:h,end:u}),this.resetSegmentValue=!0),this.interactionMode=C.DateInputInteractionMode.None}}},S.prototype.modifyDateSegmentValue=function(t,e,i){var n,s,a;void 0===e&&(e=""),void 0===i&&(i={}),this.dateObject&&!this.options.readonly&&(n=this.value,a=1,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond&&1!==this.options.steps.millisecond||(s=(0,w.millisecondDigitsInFormat)(this.inputFormat),a=(0,w.millisecondStepFor)(s)),this.dateObject.modifyPart(e,a*t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},S.prototype.tryTriggerValueChange=function(t){if(!(0,F.isEqual)(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},S.prototype.triggerValueChange=function(t){return this.trigger(f,(0,w.extend)(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},S.prototype.triggerInput=function(t){return this.trigger(c,(0,w.extend)(t=void 0===t?{event:{}}:t,{value:this.value}))},S.prototype.triggerInputEnd=function(t){return this.trigger(y,(0,w.extend)(t=void 0===t?{event:{},error:null,oldElementValue:"",newElementValue:""}:t,{value:this.value}))},S.prototype.triggerFocus=function(t){return this.trigger(p,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerFocusEnd=function(t){return this.trigger(E,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerBlur=function(t){return this.trigger(m,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerBlurEnd=function(t){return this.trigger(D,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerChange=function(t){return this.trigger(P,(0,w.extend)(t=void 0===t?{event:{}}:t,{value:this.value}))},S.prototype.triggerKeyDown=function(t){return this.trigger(d,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.triggerMouseWheel=function(t){return this.trigger(v,(0,w.extend)({},t=void 0===t?{event:{}}:t))},S.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},S.prototype.forceUpdateWithSelection=function(){var t=this.selection,e=t.start,t=t.end,i=this.elementValue.length,i=(this.forceUpdate(),this.elementValue.length-i);this.setSelection({start:e+i,end:t+i})},S.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text;this.currentFormat=t.format,this.currentText=e},S.prototype.setElementValue=function(t){this.element.value=t},S.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},S.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},S.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},S.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start;this.setSelection({start:e||0,end:t.end||0})},S.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},S.prototype.verifyValue=function(t){if(t&&!(0,w.isValidDate)(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},S.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,e=this.dateObject.getTextAndFormat(e),i=e.text,e=(this.currentFormat=e.format,this.currentText=i,this.options.hasPlaceholder||(0,w.isPresent)(this.options.placeholder)),n=!this.isActive&&e&&!this.dateObject.hasValue(),e=(e&&(0,w.isPresent)(this.options.placeholder)&&(t.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e)},S.prototype.caret=function(t,e){void 0===e&&(e=t);var i=void 0!==t,n=[t,t],s=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(i&&((0,w.isDocumentAvailable)()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.selectionEnd])}catch(t){n=[]}return n}},S.prototype.selectNearestSegment=function(t){for(var e=t,i=t-1;e<this.currentFormat.length||0<=i;e++,i--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=i&&"_"!==this.currentFormat[i])return void this.selectDateSegment(this.currentFormat[i])}},S.prototype.selectDateSegment=function(t){for(var e=-1,i=0,n=0;n<this.currentFormat.length;n++)this.currentFormat[n]===t&&(i=n+1,-1===e)&&(e=n);e<0&&(e=0),this.caret(0,0),this.caret(e,i)},S.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=(this.options.value=t,this.createDateObject());return t.setLeadingZero(this.isActive?e:null),t},S.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new a.DateObject((0,w.extend)({},t))},S.prototype.getDateObjectOptions=function(){return{intlService:this.options.intlService,formatPlaceholder:this.options.formatPlaceholder||"formatPattern",format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value,toggleDayPeriod:this.options.toggleDayPeriod,autoSwitchParts:this.options.autoSwitchParts}},S.prototype.keyEventMatchesAutoSwitchKeys=function(t){var e=(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()});return 0<=e.indexOf(t.keyCode.toString())||0<=e.indexOf(t.keyCode)||0<=e.indexOf(t.key.toLowerCase().trim())},S.prototype.autoFill=function(){var t,e,i,n,s,a=this.dateObject,r=new Date;(a.date||a.month||a.year||a.hours||a.minutes||a.seconds)&&(i=(a.year?a.value:r).getFullYear(),e=(a.month?a.value:r).getMonth(),t=(a.date?a.value:r).getDate(),n=(a.hours?a.value:r).getHours(),s=(a.minutes?a.value:r).getMinutes(),r=(a.seconds?a.value:r).getSeconds(),a.setValue(new Date(i,e,t,n,s,r)),this.refreshElementValue(),this.triggerValueChange())},S);function S(t,e){var i=n.call(this,e)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=C.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(t,e),i}e.DateInput=i},655:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DateInputInteractionMode=void 0,e.DateInputInteractionMode={None:"none",Caret:"caret",Selection:"selection"}},506:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInRange=e.dateSymbolMap=e.approximateStringMatching=e.unpadZero=e.padZero=void 0;var p=i(761),m=i(503);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,i=t.newText,n=t.formatPattern,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=s+e.length-i.length,o=e[r],l=e.substring(0,r),e=i.substring(0,s),h=[];if(l===e&&0<s)return h.push([n[s-1],e[s-1]]),h;if(0===l.indexOf(e)&&a&&(t.key===m.Key.DELETE||t.key===m.Key.BACKSPACE)||0===l.indexOf(e)&&!a&&(0===e.length||n[e.length-1]!==n[e.length])){var u="";a||1!==e.length||h.push([n[0],e[0]]);for(var c=e.length;c<l.length;c++)n[c]!==u&&n[c]!==p.Constants.formatSeparator&&(u=n[c],h.push([u,""]));return h}if((!a||0!==e.indexOf(l)&&n[s-1]!==p.Constants.formatSeparator)&&(a||0!==e.indexOf(l)&&n[s-1]!==p.Constants.formatSeparator))return" "===e[e.length-1]||e[e.length-1]===o&&"_"===n[r]?[[n[s-1],p.Constants.formatSeparator]]:[[n[s-1],e[s-1]]];for(var d=n[0],c=Math.max(0,l.length-1);c<n.length;c++)if(n[c]!==p.Constants.formatSeparator){d=n[c];break}return[[d,e[s-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,i){return null===t||!(e&&t<e||i&&i<t)}},618:t=>{t.exports=o},109:t=>{t.exports=l}},s={},t=a={},Object.defineProperty(t,"__esModule",{value:!0}),t.DateInput=void 0,e=i(415),Object.defineProperty(t,"DateInput",{enumerable:!0,get:function(){return e.DateInput}}),a))}}});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-dateinputs-common",
3
3
  "description": "Kendo UI common date input utilities",
4
- "version": "0.4.6",
4
+ "version": "0.4.7",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],