@progress/kendo-dateinputs-common 0.3.2 → 0.3.3-dev.202404291104
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.
- package/dist/cdn/js/kendo-dateinputs-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/dateinput/dateinput.js +15 -2
- package/dist/es2015/dateinput/dateinput.js +15 -2
- package/dist/npm/dateinput/dateinput.d.ts +2 -0
- package/dist/npm/dateinput/dateinput.js +15 -2
- package/dist/systemjs/kendo-dateinputs-common.js +1 -1
- package/package.json +1 -1
|
@@ -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()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(2),o=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},a=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},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,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if(!i.length)return t;var l=i.shift();if(o(t)&&o(l))for(var u in l)a(l[u])?t[u]=l[u]:!o(l[u])||l[u]instanceof Date?e.extend(t,((r={})[u]=l[u],r)):(t[u]&&o(t[u])||e.extend(t,((n={})[u]={},n)),e.deepExtend(t[u],l[u]));return e.deepExtend.apply(void 0,[t].concat(i))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(r="setFullYear",function(t,e){var n=i.cloneDate(t);return n[r](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,o,a,s){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==r||t.getHours()!==i||t.getMinutes()!==o||t.getSeconds()!==a||t.getMilliseconds()!==s)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";n.r(e),n.d(e,"addCenturies",(function(){return d})),n.d(e,"addDays",(function(){return a})),n.d(e,"addDecades",(function(){return f})),n.d(e,"addMonths",(function(){return u})),n.d(e,"addWeeks",(function(){return p})),n.d(e,"addYears",(function(){return c})),n.d(e,"adjustDST",(function(){return o})),n.d(e,"cloneDate",(function(){return i})),n.d(e,"MS_PER_MINUTE",(function(){return m})),n.d(e,"MS_PER_HOUR",(function(){return g})),n.d(e,"MS_PER_DAY",(function(){return v})),n.d(e,"createDate",(function(){return s})),n.d(e,"dayOfWeek",(function(){return D})),n.d(e,"Day",(function(){return y})),n.d(e,"Direction",(function(){return r})),n.d(e,"durationInCenturies",(function(){return S})),n.d(e,"durationInDecades",(function(){return P})),n.d(e,"durationInMonths",(function(){return w})),n.d(e,"durationInYears",(function(){return O})),n.d(e,"firstDayInWeek",(function(){return C})),n.d(e,"firstDayOfMonth",(function(){return T})),n.d(e,"firstDecadeOfCentury",(function(){return E})),n.d(e,"firstMonthOfYear",(function(){return _})),n.d(e,"firstYearOfDecade",(function(){return M})),n.d(e,"getDate",(function(){return x})),n.d(e,"isEqual",(function(){return F})),n.d(e,"isEqualDate",(function(){return j})),n.d(e,"lastDayOfMonth",(function(){return l})),n.d(e,"lastDecadeOfCentury",(function(){return k})),n.d(e,"lastMonthOfYear",(function(){return V})),n.d(e,"lastYearOfDecade",(function(){return U})),n.d(e,"nextDayOfWeek",(function(){return N})),n.d(e,"prevDayOfWeek",(function(){return A})),n.d(e,"abbrTimezone",(function(){return Q})),n.d(e,"loadTimezone",(function(){return X})),n.d(e,"offset",(function(){return $})),n.d(e,"timezoneGroupNames",(function(){return tt})),n.d(e,"timezoneNames",(function(){return et})),n.d(e,"timezoneTitle",(function(){return nt})),n.d(e,"toLocalDate",(function(){return rt})),n.d(e,"ZonedDate",(function(){return dt})),n.d(e,"zonesPerGroup",(function(){return ft})),n.d(e,"weekInYear",(function(){return mt}));var r,i=function(t){return t?new Date(t.getTime()):null},o=function(t,e){var n=i(t);return 0===e&&23===n.getHours()&&n.setHours(n.getHours()+2),n},a=function(t,e){var n=i(t);return n.setDate(n.getDate()+e),o(n,t.getHours())},s=function(t,e,n,r,i,a,s){void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=0);var l=new Date(t,e,n,r,i,a,s);return t>-1&&t<100&&l.setFullYear(l.getFullYear()-1900),o(l,r)},l=function(t){var e=s(t.getFullYear(),t.getMonth()+1,1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return a(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}(o(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 o(h(t,t.getFullYear()+e),t.getHours())},d=function(t,e){return c(t,100*e)},f=function(t,e){return c(t,10*e)},p=function(t,e){return a(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 a=i(t),s=(e-a.getDay()+7*n)%7;return a.setDate(a.getDate()+s),o(a,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}))},S=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},M=function(t){return b(t,(function(t){return t-t%10}))},P=function(t,e){return(M(e).getFullYear()-M(t).getFullYear())/10},w=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},O=function(t,e){return e.getFullYear()-t.getFullYear()},C=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},T=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))},_=function(t){return I(t,0)},x=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(x(t),x(e))},k=function(t){return b(t,(function(t){return t-t%100+90}))},V=function(t){return I(t,11)},U=function(t){return b(t,(function(t){return t-t%10+9}))},N=function(t,e){return D(t,e,r.Forward)},A=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],o=e[4],a=e[5],s="u"===a[3]?6e4*-n:0;if(isNaN(o)){if(0===o.indexOf("last")){r=new Date(Date.UTC(t,Y[i]+1,1,a[0]-24,a[1],a[2])+s);var l=H[o.substr(4,3)],u=r.getUTCDay();r.setUTCDate(r.getUTCDate()+l-u-(l>u?7:0))}else if(o.indexOf(">=")>=0){r=new Date(Date.UTC(t,Y[i],o.substr(5),a[0],a[1],a[2],0)+s);l=H[o.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],o,a[0],a[1],a[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(":"),o=0;return i.length>1&&(o=60*i[0]+Number(i[1])),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"]}var a=new Date(e).getUTCFullYear();(r=r.filter((function(t){var e=t[0],n=t[1];return e<=a&&(n>=a||e===a&&"only"===n||"max"===n)}))).push(e),r.sort((function(t,e){return"number"!=typeof t&&(t=Number(K(a,t,n))),"number"!=typeof e&&(e=Number(K(a,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){return t.reduce((function(t,e){return t.concat(e)}),[])},G=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Z(e);return t.replace(B,(function(t,e){return r[parseInt(e,10)]}))},q=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(G(z,t));var n=e[t],r="string"==typeof n?e[n]:n;if(!r)throw new Error(G(z,t));return r}(t),r=n.length-1;r>=0;r--){var i=n[r][3];if(i&&e>i)break}var o=n[r+1];if(!o)throw new Error(G(z,t));return o},J=function(t,e){var n=e.getTime(),r=q(t,n);return{rule:R(r[1],n,r[0]),zone:r}},Q=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=J(t,e),r=n.zone,i=n.rule,o=r[2];return o.indexOf("/")>=0?o.split("/")[i&&+i[6]?1:0]:o.indexOf("%s")>=0?o.replace("%s",i&&"-"!==i[7]?i[7]:""):o},X=function(t){if(!t)throw new Error(G(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)},$=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=J(t,e),r=n.rule,i=n.zone;return parseFloat(r?i[0]-r[6]:i[0])},tt=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)},et=function(){return Object.keys(L.zones)},nt=function(t){return(L.titles[t]||{}).long||t};function rt(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}var it=function(t,e){return new Date(t.getTime()+e*m)},ot=function(t,e){return new Date(t.getTime()+e*g)},at=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dev"],lt=function(t,e){return void 0===e&&(e=2),(t<0?"-":"")+new Array(e).concat([Math.abs(t)]).join("0").slice(-e)};function ut(t,e){var n=$(e,t),r=ot(t,-1);return n<$(e,r)}function ht(t,e){var n=ut(t,e)?1:0;return ot(t,n)}function ct(t,e,n){if(e===n)return t;var r=$(e,t),i=$(n,t),o=r-i,a=it(t,o),s=$(n,a);return it(t,o+(i-s))}var dt=function(){function t(t,e){this._utcDate=i(t),this.timezone=e;var n=$(e,t);this.timezoneOffset=n;var r=ht(t,e);this._localDate=ct(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=ct(e,"Etc/UTC",n),i=ut(r,n),o=$(n,r),a=0;i&&(a=o>0?-1:1);var s=ot(r,a);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=$(this.timezone,this._utcDate),r=it(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=ht(new Date(this._utcDate.getTime()),this.timezone);n.setTime(n.getTime()+e);var r=ht(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()]+" "+st[t.getUTCMonth()]),n=this.toTimeString();return e+" "+this.getDate()+" "+this.getFullYear()+" "+n},t.prototype.toDateString=function(){return rt(this._utcDate).toDateString()},t.prototype.toTimeString=function(){var t=lt(this.getHours())+":"+lt(this.getMinutes())+":"+lt(this.getSeconds()),e=function(t){var e=t<=0?"+":"-",n=Math.abs(t);return"GMT"+e+lt(Math.floor(n/60))+lt(n%60)}(this.timezoneOffset),n=Q(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}(),ft=function(t){var e=L.titles;return Object.keys(e).reduce((function(n,r){return(e[r]||{}).group===t?n.concat(r.split(" ")):n}),[])},pt=function(t,e){var n=s(t.getFullYear(),0,1,-6),r=function(t,e){return e!==y.Monday?a(A(t,e),4):a(t,4-(t.getDay()||7))}(t,e).getTime()-n.getTime(),i=Math.floor(r/v);return 1+Math.floor(i/7)},mt=function(t,e){void 0===e&&(e=y.Monday),t=x(t);var n=a(t,-7),r=a(t,7),i=pt(t,e);return 0===i?pt(n,e)+1:53===i&&pt(r,e)>1?1:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(4);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,o=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,l=t.keyEvent,u=a+e.length-n.length,h=e[u],c=e.substring(0,u),d=n.substring(0,a),f=[];if(c===d&&a>0)return f.push([o[a-1],d[a-1]]),f;if(0===c.indexOf(d)&&s&&(l.key===i.Key.DELETE||l.key===i.Key.BACKSPACE)||0===c.indexOf(d)&&!s&&(0===d.length||o[d.length-1]!==o[d.length])){var p="";s||1!==d.length||f.push([o[0],d[0]]);for(var m=d.length;m<c.length;m++)o[m]!==p&&o[m]!==r.Constants.formatSeparator&&(p=o[m],f.push([p,""]));return f}if(s&&(0===d.indexOf(c)||o[a-1]===r.Constants.formatSeparator)||!s&&(0===d.indexOf(c)||o[a-1]===r.Constants.formatSeparator)){var g=o[0];for(m=Math.max(0,c.length-1);m<o.length;m++)if(o[m]!==r.Constants.formatSeparator){g=o[m];break}return[[g,d[a-1]]]}return" "===d[d.length-1]||d[d.length-1]===h&&"_"===o[u]?[[o[a-1],r.Constants.formatSeparator]]:[[o[a-1],d[a-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)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6);e.DateInput=r.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(7),o=n(8),a=n(3),s=n(10),l=n(4),u=n(1),h=n(11),c=n(12),d=n(2),f=n(0),p={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.valueChange=null,r.input=null,r.inputEnd=null,r.focus=null,r.focusEnd=null,r.blur=null,r.blurEnd=null,r.keydown=null,r.mousewheel=null,r.change=null,r),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:f.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1},m=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:!0,configurable:!0}),e.prototype.init=function(t,e){var n=u.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);u.isValidDate(n)||(n=null),this.element=t,this.options=u.extend({},p,e,{steps:i.__assign({},p.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("dragStart",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("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=u.extend({},this.options,t,{steps:i.__assign({},p.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=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){if(this.triggerInput({event:t}),this.element&&this.dateObject){var e=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var n=this.keyDownEvent||{},r=n.keyCode===s.KeyCode.BACKSPACE||n.key===l.Key.BACKSPACE,i=n.keyCode===s.KeyCode.DELETE||n.key===l.Key.DELETE,o=this.interactionMode;!this.options.allowCaretMode||o===c.DateInputInteractionMode.Caret||i||r||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var h=this.isInCaretMode();if(h&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var p=this.dateObject&&this.dateObject.getValue(),m=this.dateObject?this.dateObject.value:null,g=this.dateObject.getTextAndFormat(),v=g.text,y=g.format;this.currentFormat=y;var D="";D=h&&(r||i||o===c.DateInputInteractionMode.Caret)?this.previousElementValue:v;var b=this.elementValue,E=a.approximateStringMatching({oldText:D,newText:b,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:h,keyEvent:this.keyDownEvent});if(E&&E.length&&E[0]&&E[0][1]!==f.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!h||E&&0!==E.length){if(h&&1===E.length){if(!E[0]||!E[0][0])return void this.restorePreviousInputEventState();if(h&&E[0]&&(E[0][0]===f.Constants.formatSeparator||E[0][1]===f.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var S=1===E.length&&E[0][1]===f.Constants.formatSeparator,M=[],P=!1,w=null;if(!S)for(var O=0;O<E.length;O++){var C=this.dateObject.parsePart({symbol:E[O][0],currentChar:E[O][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:r||i,originalFormat:this.currentFormat});M.push(C),C.value||(w={type:"parse"}),P=C.switchToNext}this.options.autoSwitchParts||(P=!1),this.resetSegmentValue=!1;var T,I=this.options.format===this.currentFormat||u.isPresent(this.options.format)&&this.options.format.length>1,_=M[M.length-1],x=_&&!u.isPresent(_.value),F=h&&(r||i)&&x,j=!!_&&_.resetPart,k=this.dateObject.getValue(),V=!d.isEqual(p,k),U=this.dateObject.value,N=this.selection;if(h){var A=E&&E.length>0?E[0][0]:null,L=this.dateObject.getLeadingZero()[A];E.length&&E[0][0]!==f.Constants.formatSeparator?P?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):j?(T=this.currentFormat[N.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(T))):this.restorePreviousInputEventState():F?(this.forceUpdate(),E.length&&E[0][0]!==f.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(E[0][0]))):x?"0"===t.data&&L||(u.isPresent(p)&&!u.isPresent(k)?this.restorePreviousInputEventState():!u.isPresent(p)&&u.isPresent(k)?this.forceUpdateWithSelection():u.isPresent(p)&&u.isPresent(k)?V?this.forceUpdateWithSelection():this.restorePreviousInputEventState():u.isPresent(p)||u.isPresent(k)?m!==U||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):x||I||this.forceUpdateWithSelection():(this.options.autoSwitchParts||E[0][1]!==f.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(E[0][0]))}else h||(this.forceUpdate(),E.length&&E[0][0]!==f.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(E[0][0])),this.options.autoSwitchParts?S?(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):P&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):_&&_.switchToNext?this.resetSegmentValue=!0:S&&(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),r&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1));this.tryTriggerValueChange({oldValue:p,event:t}),this.triggerInputEnd({event:t,error:w}),h&&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;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:n,end:r},this.keyEventMatchesAutoSwitchKeys(t)){var i=t.keyCode===s.KeyCode.TAB;if(!i)return t.preventDefault(),void this.switchDateSegment(1);var o=this.selection,a=o.start,l=o.end;if(t.shiftKey&&i?this.switchDateSegment(-1):this.switchDateSegment(1),a!==this.selection.start||l!==this.selection.end)return void t.preventDefault()}var u=this.currentFormat[this.selection.start],h=this.getStepFromSymbol(u),c=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(h,u,event),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-h,u,event),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case s.KeyCode.ENTER:break;case s.KeyCode.HOME:this.selectNearestSegment(0),c=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;case s.KeyCode.END:this.selectNearestSegment(this.elementValue.length),c=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;default:return}c&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var e=t;e.shiftKey?this.switchDateSegment((e.wheelDelta||-e.detail)>0?-1:1):this.modifyDateSegmentValue((e.wheelDelta||-e.detail)>0?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;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:!0,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:f.Constants.defaultDateFormat},enumerable:!0,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:f.Constants.defaultDateFormat},enumerable:!0,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:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),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]!==f.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(r>=0&&this.currentFormat[r]!==f.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="",o="";if(t<0){for(var a=n+t;a>=0;a--)if((o=this.currentFormat[a])!==f.Constants.formatSeparator&&o!==r){n=a,i=o;break}}else for(a=n+t;a<this.currentFormat.length;a++)if((o=this.currentFormat[a])!==f.Constants.formatSeparator&&o!==r){n=a,i=o;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]===f.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==f.Constants.formatSeparator){for(var p=d;p>=0&&p<this.currentFormat.length&&this.currentFormat[p]===this.currentFormat[d];)p+=t;d>p&&(p+1!==l||d+1!==u)?(this.setSelection({start:p+1,end:d+1}),this.resetSegmentValue=!0):d<p&&(d!==l||p!==u)&&(this.setSelection({start:d,end:p}),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,o=this.caret();if("S"===(e=e||this.currentFormat[o[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var a=u.millisecondDigitsInFormat(this.inputFormat);i=u.millisecondStepFor(a)}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:{}}),!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("valueChange",u.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",u.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null}),this.trigger("inputEnd",u.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",u.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",u.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",u.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",u.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",u.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",u.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",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&&!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 o=this.options.hasPlaceholder||u.isPresent(this.options.placeholder),a=!this.isActive&&o&&!this.dateObject.hasValue();o&&u.isPresent(this.options.placeholder)&&(t.placeholder=this.options.placeholder);var s=a?"":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&&(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 o.DateObject(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}},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,o,a=this.dateObject,s=new Date;(a.date||a.month||a.year||a.hours||a.minutes||a.seconds)&&(n=a.year?a.value.getFullYear():s.getFullYear(),e=a.month?a.value.getMonth():s.getMonth(),t=a.date?a.value.getDate():s.getDate(),r=a.hours?a.value.getHours():s.getHours(),i=a.minutes?a.value.getMinutes():s.getMinutes(),o=a.seconds?a.value.getSeconds():s.getSeconds(),a.setValue(new Date(n,e,t,r,i,o)),this.refreshElementValue(),this.triggerValueChange())},e}(h.Observable);e.DateInput=m},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return l})),n.d(e,"__metadata",(function(){return u})),n.d(e,"__awaiter",(function(){return h})),n.d(e,"__generator",(function(){return c})),n.d(e,"__createBinding",(function(){return d})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return m})),n.d(e,"__spread",(function(){return g})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__spreadArray",(function(){return y})),n.d(e,"__await",(function(){return D})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return E})),n.d(e,"__asyncValues",(function(){return S})),n.d(e,"__makeTemplateObject",(function(){return M})),n.d(e,"__importStar",(function(){return w})),n.d(e,"__importDefault",(function(){return O})),n.d(e,"__classPrivateFieldGet",(function(){return C})),n.d(e,"__classPrivateFieldSet",(function(){return T})),n.d(e,"__classPrivateFieldIn",(function(){return I}));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])})(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 o=function(){return(o=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}).apply(this,arguments)};function a(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,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function l(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(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(a,s)}l((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),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=a.trys,(i=i.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 d=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 f(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||d(e,t,n)}function p(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 m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function v(){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 o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function y(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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 D(t){return this instanceof D?(this.v=t,this):new D(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof D?Promise.resolve(n.value.v).then(l,u):h(o[0][2],n)}catch(t){h(o[0][3],t)}var n}function l(t){s("next",t)}function u(t){s("throw",t)}function h(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function E(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:D(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function S(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(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 M(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var P=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function w(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&d(e,t,n);return P(e,t),e}function O(t){return t&&t.__esModule?t:{default:t}}function C(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 T(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 I(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(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(9),o=n(3),a=n(1),s=n(0),l=/d|M|H|h|m|s/,u=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,o=t.cycleTime,a=void 0!==o&&o,l=t.twoDigitYearMax,u=void 0===l?s.Constants.twoDigitYearMax:l,h=t.value,c=void 0===h?null:h,d=t.autoCorrectParts,f=void 0===d||d;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=r.getDate(new Date),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:a,twoDigitYearMax:u,value:c,autoCorrectParts:f}),c)this._value=r.cloneDate(c);else{this._value=r.getDate(new Date);for(var p=this.dateFormatString(this.value,this.format).symbols,m=0;m<p.length;m++)this.setExisting(p[m],!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:!0,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:!0,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},t.prototype.setValue=function(t){t?r.isEqual(t,this._value)||(this._value=r.cloneDate(t),this.modifyExisting(!0)):(this._value=r.getDate(new Date),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 r.cloneDate(this.value)},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=(a.parseToInt(this.getInvalidDatePartValue(h))+1).toString();if(c.length>2)i+=l[h][u];else if(this.getInvalidDatePartValue(h))i+=o.padZero(c.length-d.length)+d,u+=c.length-1;else i+=l[h][u]}else if(this.getInvalidDatePartValue(h)){d=this.getInvalidDatePartValue(h).toString();i+=o.padZero(c.length-d.length)+d,u+=c.length-1}else 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 o=e.intl.formatDate(i,n,e.localeId);r[t]=o}})),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(a.isPresent(t)&&a.isPresent(e)&&0!==e){var n,i=r.cloneDate(this.value),o=!1,s="M"===t,l="d"===t||"E"===t,u=this.getExisting(t);if(this.autoCorrectParts||!l&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=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),o=!0;break;case"m":i.setMinutes(i.getMinutes()+e),o=!0;break;case"s":i.setSeconds(i.getSeconds()+e),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),o=!0}else{var h=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=h.y.value||i.getFullYear(),f=h.M.value||i.getMonth(),p=h.d.value||h.E.value||i.getDate(),m=h.h.value||h.H.value||i.getHours(),g=h.m.value||i.getMinutes(),v=h.s.value||i.getSeconds(),y=h.S.value||i.getMilliseconds();switch(t){case"y":d+=e;break;case"M":f+=e;break;case"d":case"E":p+=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=a.clamp(f%11+1+11,0,11);else{var D=a.isPresent(c)?f:(e-1)%12;f=a.clamp(D,0,11)}f=a.clamp(f,0,11)}f=a.clamp(f,0,11)}else if("d"===t)if(u){if(p<=0||p>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!u){if(a.isPresent(c)&&(p<=0||p>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var b=a.isPresent(c)?p:31-Math.abs(e%31)+1;p=a.clamp(b,1,31)}else{b=a.isPresent(c)?p:e%31;p=a.clamp(b,1,31)}p=a.clamp(p,1,31)}var E=r.createDate(d,f,p,m,g,v,y),S=s||l?this.modifyDateSymbolWithValue(i,t,s?f:p):null,M=a.areDatePartsEqualTo(E,d,f,p,m,g,v,y);this.getValue()&&a.areDatePartsEqualTo(E,d,f,p,m,g,v,y)?(i=r.cloneDate(E),this.markDatePartsAsExisting()):s&&S?S.getMonth()===f?this.getExisting("d")?M?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(S),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):M?(this.resetInvalidDateSymbol(t),i=r.cloneDate(E),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(S),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===p?this.getExisting("M")?M?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(S),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):M?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(this.value),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),o&&!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),f=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),p=d.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),m=0;m<f.length;m++){for(var g=f[m],v=0;v<g.pattern.length;v++)f[m+v]&&(f[m+v].literal=g.pattern[v]);m+=g.pattern.length-1}for(m=0;m<p.length;m++){for(g=p[m],v=0;v<g.pattern.length;v++)p[m+v]&&(p[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),a.extend(y,{value:null,switchToNext:!1});for(m=0;m<f.length;m++){var D=f[m].literal,b=l.startsWith(D),E=l.endsWith(D),S=l.indexOf(D+D)>=0;if(b||E||S)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),a.extend(y,{value:null,switchToNext:!1})}}var M=this.intl.formatDate(this.value,this.format,this.localeId),P=d.symbols,w=!1,O="",C="",T="",I="",_="",x="",F="";for(m=0;m<p.length;m++)F+=p[m].text;var j=this.format===P||this.format===F||this.format===h||this.format.length===h.length,k=(j?F:h).indexOf(e),V=(j?F:h).lastIndexOf(e)-k+1,U=h.length-l.length;if(c||!c&&!this.autoCorrectParts){for(m=0;m<M.length;m++){if(P[m]===e)C+=this.getExisting(e)?M[m]:"0",U>0?T.length+U<V&&(T+=l[m]||""):T+=l[m]||"",w=!0;else w?(x+=M[m],_+=M[m]):(O+=M[m],I+=M[m])}if(j&&(F.length<l.length?T+=n:!u&&(h.length,l.length),T.length>V))return a.extend(y,{value:null,switchToNext:!1});if(!j||j&&!this.autoCorrectParts){C="",T="",O="",x="",w=!1;for(m=0;m<h.length;m++){if(h[m]===e)C+=this.getExisting(e)?M[m]||"":"0",U>0?T.length+U<V&&(T+=l[m]||""):T+=l[m]||"",w=!0;else w?x+=l[m-U]||"":O+=l[m]||""}h.length<l.length&&(T+=n)}}if(!c)if(this.autoCorrectParts){C="",T="",O="",x="",w=!1;for(m=0;m<M.length;m++){if(P[m]===e)C+=this.getExisting(e)?M[m]:"0",w=!0;else w?x+=M[m]:O+=M[m]}}else C=i?T:C;var N=null,A=this.matchMonth(n),L=this.matchDayPeriod(n,e),Y="0"===n,H=this.leadingZero||{};Y?("0"===T&&(T=C),0!==a.parseToInt(i?n:(c?T:C)+n)||this.isAbbrMonth(d.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero();var K=this.partPattern(d.partMap,e),W=K?K.pattern:null,R=this.patternLength(W)||W.length;if(c&&u&&!T)return this.setExisting(e,!1),a.extend(y,{value:null,switchToNext:!1});var z=C.length-3,B=!0,Z=c?T:C;for(m=Math.max(0,z);m<=C.length&&B;m++){Z=i?n:c?T:C.substring(m)+n,!c&&this.autoCorrectParts||(B=!1,Z=o.unpadZero(Z),Z=o.padZero(R-Z.length)+Z);var G=parseInt(Z,10),q=O+Z+x;N=this.intl.parseDate(q,this.format,this.localeId);var J=!1;c&&!a.isValidDate(N)&&this.autoCorrectParts&&(N=this.intl.parseDate(I+Z+_,this.format,this.localeId),J=!0);var Q=!isNaN(parseInt(n,10))||c&&u&&""===n;if(!N&&!isNaN(G)&&Q&&this.autoCorrectParts){if("M"===e&&!A){var X=G-1;X>-1&&X<12&&((N=r.cloneDate(this.value)).setMonth(X),N.getMonth()!==X&&(N=r.lastDayOfMonth(r.addMonths(N,-1))))}"y"===e&&(N=r.createDate(parseInt(Z,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&&a.isValidDate(N)||!c&&N)&&this.date&&N.getDate()!==this.value.getDate()&&(N=r.lastDayOfMonth(r.addMonths(N,-1))))}if(c&&a.isValidDate(N)||!c&&N){var $=this.peek(Z,W),tt=J?""+I+$+_:""+O+$+x,et=this.intl.parseDate(tt,this.format,this.localeId),nt=((this.leadingZero||{})[e]||0)+o.unpadZero(Z).length>=R,rt=null===et||(H[e]?W.length<=Z.length:nt);return this.shouldNormalizeCentury()&&(N=this.normalizeCentury(N)),this._value=N,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")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),a.extend(y,{value:this.value,switchToNext:rt})}}if(A&&(N=this.intl.parseDate(O+A+x,this.format,this.localeId)))return this._value=N,this.setExisting(e,!0),a.extend(y,{value:this.value,switchToNext:!1});if(L&&(N=this.intl.parseDate(O+L+x,this.format)||this.intl.parseDate(I+L+_,this.format)))return this._value=N,this.setExisting(e,!0),a.extend(y,{value:this.value,switchToNext:!0});if(Y&&this.setExisting(e,!1),!this.autoCorrectParts){var it=void 0,ot=c?T:Z,at=a.parseToInt(ot);if(a.isNumber(at)){if("d"===e&&(at<=0||at>31)||"M"===e&&(at<0||at>11))return a.extend(y,{value:null,switchToNext:!1});it="M"===e?at-1:at;var st="M"===e,lt="d"===e,ut=r.cloneDate(this._value),ht=this._partiallyInvalidDate.invalidDateParts||{},ct=ht.y.value||ut.getFullYear(),dt=st?it:ht.M.value||ut.getMonth(),ft=lt?it:ht.d.value||ht.E.value||ut.getDate(),pt=ht.h.value||ht.H.value||ut.getHours(),mt=ht.m.value||ut.getMinutes(),gt=ht.s.value||ut.getSeconds(),vt=ht.S.value||ut.getMilliseconds(),yt=r.createDate(ct,dt,ft,pt,mt,gt,vt),Dt=a.areDatePartsEqualTo(yt,ct,dt,ft,pt,mt,gt,vt),bt=st||lt?this.modifyDateSymbolWithValue(ut,e,st?dt:ft):null,Et=!1;if(st&&bt?bt.getMonth()===dt?this.getExisting("d")?Dt?(ut=r.cloneDate(yt),this.resetInvalidDateSymbol(e)):(Et=!0,this.setInvalidDatePart(e,{value:dt,date:r.cloneDate(bt),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(this.resetInvalidDateSymbol(e),ut=r.cloneDate(yt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),ut=r.cloneDate(bt)):(Et=!0,this.setInvalidDatePart(e,{value:dt,date:r.cloneDate(bt),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1)):lt&&bt&&(bt.getDate()===ft?this.getExisting("M")?Dt?(ut=r.cloneDate(yt),this.resetInvalidDateSymbol(e)):(Et=!0,this.setInvalidDatePart(e,{value:ft,date:r.cloneDate(bt),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(ut=r.cloneDate(yt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),ut=r.cloneDate(bt)):(Et=!0,this.setInvalidDatePart(e,{value:ft,date:r.cloneDate(this.value),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1))),!Et){if(this.setExisting(e,!0),c&&!a.isValidDate(N)){var St=this.intl.parseDate(I+Z+_,this.format,this.localeId);a.isValidDate(St)&&(this._value=St)}else this._value=ut;this.getValue()&&this.resetInvalidDate()}rt=!1;return rt="M"===e?at>=2||ot.length>=2:j?ot.length===V:ot.length>V,a.extend(y,{value:null,switchToNext:rt,hasInvalidDatePart:Et})}}return a.extend(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(o.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(!a.isPresent(t))return t;var e=a.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return a.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 o.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=[],o=[],a=0;a<n.length;a++)for(var l=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;l>0;)r.push(this.symbols[n[a].pattern[0]]||s.Constants.formatSeparator),o.push(n[a]),l--;var u=new i.Mask;return u.symbols=r.join(""),u.partMap=o,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],f=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 p=this.getInvalidDatePartValue(d).toString();if("M"===d)if(p=(a.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),c.length>2)n=u[d][h]+n;else p=(a.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),n=o.padZero(c.length-p.length)+p+n,f=c.length-1,l=p.length-c.length;else n=o.padZero(c.length-p.length)+p+n,f=c.length-1,l=p.length-c.length}else n=this.dateFieldName(e.partMap[h])+n;for(;r.length<n.length;)r=i[h]+r;0!==f&&(h=h-f+(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]&&a.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,o=void 0===i?null:i,a=e.startDateOffset,s=void 0===a?0:a,l=e.startDate,u=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=r,this._partiallyInvalidDate.invalidDateParts[t].date=o,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]&&a.isPresent(t._partiallyInvalidDate.invalidDateParts[n].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=r.cloneDate(t),o=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=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),o=!0;break;case"m":i.setMinutes(i.getMinutes()+n),o=!0;break;case"s":i.setSeconds(i.getSeconds()+n),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),o=!0}return{date:i,timeModified:o}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=r.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=r.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(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 o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.push(o)}for(i=e-1;i>=0;i--){o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.unshift(o)}return r},t}();e.DateObject=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){this.symbols="",this.partMap=[]};e.Mask=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i={events:{}},o=function(){function t(t){this.options=r.extend({},i,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!r.isFunction(this.options.events[t])&&(this.options.events[t](r.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
|
|
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()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(2),o=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},a=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},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,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if(!i.length)return t;var l=i.shift();if(o(t)&&o(l))for(var u in l)a(l[u])?t[u]=l[u]:!o(l[u])||l[u]instanceof Date?e.extend(t,((r={})[u]=l[u],r)):(t[u]&&o(t[u])||e.extend(t,((n={})[u]={},n)),e.deepExtend(t[u],l[u]));return e.deepExtend.apply(void 0,[t].concat(i))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(r="setFullYear",function(t,e){var n=i.cloneDate(t);return n[r](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,o,a,s){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==r||t.getHours()!==i||t.getMinutes()!==o||t.getSeconds()!==a||t.getMilliseconds()!==s)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";n.r(e),n.d(e,"addCenturies",(function(){return d})),n.d(e,"addDays",(function(){return a})),n.d(e,"addDecades",(function(){return f})),n.d(e,"addMonths",(function(){return u})),n.d(e,"addWeeks",(function(){return p})),n.d(e,"addYears",(function(){return c})),n.d(e,"adjustDST",(function(){return o})),n.d(e,"cloneDate",(function(){return i})),n.d(e,"MS_PER_MINUTE",(function(){return m})),n.d(e,"MS_PER_HOUR",(function(){return g})),n.d(e,"MS_PER_DAY",(function(){return v})),n.d(e,"createDate",(function(){return s})),n.d(e,"dayOfWeek",(function(){return D})),n.d(e,"Day",(function(){return y})),n.d(e,"Direction",(function(){return r})),n.d(e,"durationInCenturies",(function(){return S})),n.d(e,"durationInDecades",(function(){return P})),n.d(e,"durationInMonths",(function(){return w})),n.d(e,"durationInYears",(function(){return O})),n.d(e,"firstDayInWeek",(function(){return C})),n.d(e,"firstDayOfMonth",(function(){return T})),n.d(e,"firstDecadeOfCentury",(function(){return b})),n.d(e,"firstMonthOfYear",(function(){return _})),n.d(e,"firstYearOfDecade",(function(){return M})),n.d(e,"getDate",(function(){return x})),n.d(e,"isEqual",(function(){return F})),n.d(e,"isEqualDate",(function(){return V})),n.d(e,"lastDayOfMonth",(function(){return l})),n.d(e,"lastDecadeOfCentury",(function(){return j})),n.d(e,"lastMonthOfYear",(function(){return k})),n.d(e,"lastYearOfDecade",(function(){return U})),n.d(e,"nextDayOfWeek",(function(){return N})),n.d(e,"prevDayOfWeek",(function(){return A})),n.d(e,"abbrTimezone",(function(){return Q})),n.d(e,"loadTimezone",(function(){return X})),n.d(e,"offset",(function(){return $})),n.d(e,"timezoneGroupNames",(function(){return tt})),n.d(e,"timezoneNames",(function(){return et})),n.d(e,"timezoneTitle",(function(){return nt})),n.d(e,"toLocalDate",(function(){return rt})),n.d(e,"ZonedDate",(function(){return dt})),n.d(e,"zonesPerGroup",(function(){return ft})),n.d(e,"weekInYear",(function(){return mt}));var r,i=function(t){return t?new Date(t.getTime()):null},o=function(t,e){var n=i(t);return 0===e&&23===n.getHours()&&n.setHours(n.getHours()+2),n},a=function(t,e){var n=i(t);return n.setDate(n.getDate()+e),o(n,t.getHours())},s=function(t,e,n,r,i,a,s){void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=0);var l=new Date(t,e,n,r,i,a,s);return t>-1&&t<100&&l.setFullYear(l.getFullYear()-1900),o(l,r)},l=function(t){var e=s(t.getFullYear(),t.getMonth()+1,1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return a(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}(o(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 o(h(t,t.getFullYear()+e),t.getHours())},d=function(t,e){return c(t,100*e)},f=function(t,e){return c(t,10*e)},p=function(t,e){return a(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 a=i(t),s=(e-a.getDay()+7*n)%7;return a.setDate(a.getDate()+s),o(a,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 E=function(t,e){return h(t,e(t.getFullYear()))},b=function(t){return E(t,(function(t){return t-t%100}))},S=function(t,e){return(b(e).getFullYear()-b(t).getFullYear())/100},M=function(t){return E(t,(function(t){return t-t%10}))},P=function(t,e){return(M(e).getFullYear()-M(t).getFullYear())/10},w=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},O=function(t,e){return e.getFullYear()-t.getFullYear()},C=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},T=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))},_=function(t){return I(t,0)},x=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()},V=function(t,e){return!t&&!e||t&&e&&F(x(t),x(e))},j=function(t){return E(t,(function(t){return t-t%100+90}))},k=function(t){return I(t,11)},U=function(t){return E(t,(function(t){return t-t%10+9}))},N=function(t,e){return D(t,e,r.Forward)},A=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],o=e[4],a=e[5],s="u"===a[3]?6e4*-n:0;if(isNaN(o)){if(0===o.indexOf("last")){r=new Date(Date.UTC(t,Y[i]+1,1,a[0]-24,a[1],a[2])+s);var l=H[o.substr(4,3)],u=r.getUTCDay();r.setUTCDate(r.getUTCDate()+l-u-(l>u?7:0))}else if(o.indexOf(">=")>=0){r=new Date(Date.UTC(t,Y[i],o.substr(5),a[0],a[1],a[2],0)+s);l=H[o.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],o,a[0],a[1],a[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(":"),o=0;return i.length>1&&(o=60*i[0]+Number(i[1])),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"]}var a=new Date(e).getUTCFullYear();(r=r.filter((function(t){var e=t[0],n=t[1];return e<=a&&(n>=a||e===a&&"only"===n||"max"===n)}))).push(e),r.sort((function(t,e){return"number"!=typeof t&&(t=Number(K(a,t,n))),"number"!=typeof e&&(e=Number(K(a,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){return t.reduce((function(t,e){return t.concat(e)}),[])},G=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Z(e);return t.replace(B,(function(t,e){return r[parseInt(e,10)]}))},q=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(G(z,t));var n=e[t],r="string"==typeof n?e[n]:n;if(!r)throw new Error(G(z,t));return r}(t),r=n.length-1;r>=0;r--){var i=n[r][3];if(i&&e>i)break}var o=n[r+1];if(!o)throw new Error(G(z,t));return o},J=function(t,e){var n=e.getTime(),r=q(t,n);return{rule:R(r[1],n,r[0]),zone:r}},Q=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=J(t,e),r=n.zone,i=n.rule,o=r[2];return o.indexOf("/")>=0?o.split("/")[i&&+i[6]?1:0]:o.indexOf("%s")>=0?o.replace("%s",i&&"-"!==i[7]?i[7]:""):o},X=function(t){if(!t)throw new Error(G(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)},$=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=J(t,e),r=n.rule,i=n.zone;return parseFloat(r?i[0]-r[6]:i[0])},tt=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)},et=function(){return Object.keys(L.zones)},nt=function(t){return(L.titles[t]||{}).long||t};function rt(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}var it=function(t,e){return new Date(t.getTime()+e*m)},ot=function(t,e){return new Date(t.getTime()+e*g)},at=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dev"],lt=function(t,e){return void 0===e&&(e=2),(t<0?"-":"")+new Array(e).concat([Math.abs(t)]).join("0").slice(-e)};function ut(t,e){var n=$(e,t),r=ot(t,-1);return n<$(e,r)}function ht(t,e){var n=ut(t,e)?1:0;return ot(t,n)}function ct(t,e,n){if(e===n)return t;var r=$(e,t),i=$(n,t),o=r-i,a=it(t,o),s=$(n,a);return it(t,o+(i-s))}var dt=function(){function t(t,e){this._utcDate=i(t),this.timezone=e;var n=$(e,t);this.timezoneOffset=n;var r=ht(t,e);this._localDate=ct(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=ct(e,"Etc/UTC",n),i=ut(r,n),o=$(n,r),a=0;i&&(a=o>0?-1:1);var s=ot(r,a);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=$(this.timezone,this._utcDate),r=it(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=ht(new Date(this._utcDate.getTime()),this.timezone);n.setTime(n.getTime()+e);var r=ht(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()]+" "+st[t.getUTCMonth()]),n=this.toTimeString();return e+" "+this.getDate()+" "+this.getFullYear()+" "+n},t.prototype.toDateString=function(){return rt(this._utcDate).toDateString()},t.prototype.toTimeString=function(){var t=lt(this.getHours())+":"+lt(this.getMinutes())+":"+lt(this.getSeconds()),e=function(t){var e=t<=0?"+":"-",n=Math.abs(t);return"GMT"+e+lt(Math.floor(n/60))+lt(n%60)}(this.timezoneOffset),n=Q(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}(),ft=function(t){var e=L.titles;return Object.keys(e).reduce((function(n,r){return(e[r]||{}).group===t?n.concat(r.split(" ")):n}),[])},pt=function(t,e){var n=s(t.getFullYear(),0,1,-6),r=function(t,e){return e!==y.Monday?a(A(t,e),4):a(t,4-(t.getDay()||7))}(t,e).getTime()-n.getTime(),i=Math.floor(r/v);return 1+Math.floor(i/7)},mt=function(t,e){void 0===e&&(e=y.Monday),t=x(t);var n=a(t,-7),r=a(t,7),i=pt(t,e);return 0===i?pt(n,e)+1:53===i&&pt(r,e)>1?1:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(4);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,o=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,l=t.keyEvent,u=a+e.length-n.length,h=e[u],c=e.substring(0,u),d=n.substring(0,a),f=[];if(c===d&&a>0)return f.push([o[a-1],d[a-1]]),f;if(0===c.indexOf(d)&&s&&(l.key===i.Key.DELETE||l.key===i.Key.BACKSPACE)||0===c.indexOf(d)&&!s&&(0===d.length||o[d.length-1]!==o[d.length])){var p="";s||1!==d.length||f.push([o[0],d[0]]);for(var m=d.length;m<c.length;m++)o[m]!==p&&o[m]!==r.Constants.formatSeparator&&(p=o[m],f.push([p,""]));return f}if(s&&(0===d.indexOf(c)||o[a-1]===r.Constants.formatSeparator)||!s&&(0===d.indexOf(c)||o[a-1]===r.Constants.formatSeparator)){var g=o[0];for(m=Math.max(0,c.length-1);m<o.length;m++)if(o[m]!==r.Constants.formatSeparator){g=o[m];break}return[[g,d[a-1]]]}return" "===d[d.length-1]||d[d.length-1]===h&&"_"===o[u]?[[o[a-1],r.Constants.formatSeparator]]:[[o[a-1],d[a-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)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6);e.DateInput=r.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(7),o=n(8),a=n(3),s=n(10),l=n(4),u=n(1),h=n(11),c=n(12),d=n(2),f=n(0),p={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.valueChange=null,r.input=null,r.inputEnd=null,r.focus=null,r.focusEnd=null,r.blur=null,r.blurEnd=null,r.keydown=null,r.mousewheel=null,r.change=null,r),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:f.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1},m=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:!0,configurable:!0}),e.prototype.init=function(t,e){var n=u.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);u.isValidDate(n)||(n=null),this.element=t,this.options=u.extend({},p,e,{steps:i.__assign({},p.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("dragStart",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("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=u.extend({},this.options,t,{steps:i.__assign({},p.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=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,o=r.keyCode===s.KeyCode.DELETE||r.key===l.Key.DELETE,h=this.interactionMode;!this.options.allowCaretMode||h===c.DateInputInteractionMode.Caret||o||i||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var p=this.isInCaretMode();if(p&&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 E="";E=p&&(i||o||h===c.DateInputInteractionMode.Caret)?this.previousElementValue:y;var b=this.elementValue,S=a.approximateStringMatching({oldText:E,newText:b,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:p,keyEvent:this.keyDownEvent});if(S&&S.length&&S[0]&&S[0][1]!==f.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!p||S&&0!==S.length){if(p&&1===S.length){if(!S[0]||!S[0][0])return void this.restorePreviousInputEventState();if(p&&S[0]&&(S[0][0]===f.Constants.formatSeparator||S[0][1]===f.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var M=1===S.length&&S[0][1]===f.Constants.formatSeparator,P=[],w=!1,O=null;if(!M)for(var C=0;C<S.length;C++){var T=this.dateObject.parsePart({symbol:S[C][0],currentChar:S[C][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:i||o,originalFormat:this.currentFormat});P.push(T),T.value||(O={type:"parse"}),w=T.switchToNext}this.options.autoSwitchParts||(w=!1),this.resetSegmentValue=!1;var I,_=this.options.format===this.currentFormat||u.isPresent(this.options.format)&&this.options.format.length>1,x=P[P.length-1],F=x&&!u.isPresent(x.value),V=p&&(i||o)&&F,j=!!x&&x.resetPart,k=this.dateObject.getValue(),U=!d.isEqual(m,k),N=this.dateObject.value,A=this.selection;if(p){var L=S&&S.length>0?S[0][0]:null,Y=this.dateObject.getLeadingZero()[L];S.length&&S[0][0]!==f.Constants.formatSeparator?w?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):j?(I=this.currentFormat[A.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(I))):this.restorePreviousInputEventState():V?(this.forceUpdate(),S.length&&S[0][0]!==f.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(S[0][0]))):F?"0"===t.data&&Y||(u.isPresent(m)&&!u.isPresent(k)?this.restorePreviousInputEventState():!u.isPresent(m)&&u.isPresent(k)?this.forceUpdateWithSelection():u.isPresent(m)&&u.isPresent(k)?U?this.forceUpdateWithSelection():this.restorePreviousInputEventState():u.isPresent(m)||u.isPresent(k)?g!==N||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):F||_||this.forceUpdateWithSelection():(this.options.autoSwitchParts||S[0][1]!==f.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(S[0][0]))}else p||(this.forceUpdate(),S.length&&S[0][0]!==f.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(S[0][0])),this.options.autoSwitchParts?M?(this.resetSegmentValue=!0,n||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):w&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):x&&x.switchToNext?this.resetSegmentValue=!0:M&&(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:O,oldElementValue:e,newElementValue:this.elementValue}),p&&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 o=t.keyCode===s.KeyCode.TAB;if(!o)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,l=a.start,u=a.end;if(t.shiftKey&&o?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,f=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),f!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:f}),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),f!==this.elementValue&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:f}),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(),n.stopPropagation&&n.stopPropagation(),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;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:!0,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:f.Constants.defaultDateFormat},enumerable:!0,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:f.Constants.defaultDateFormat},enumerable:!0,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:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),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]!==f.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(r>=0&&this.currentFormat[r]!==f.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="",o="";if(t<0){for(var a=n+t;a>=0;a--)if((o=this.currentFormat[a])!==f.Constants.formatSeparator&&o!==r){n=a,i=o;break}}else for(a=n+t;a<this.currentFormat.length;a++)if((o=this.currentFormat[a])!==f.Constants.formatSeparator&&o!==r){n=a,i=o;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]===f.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==f.Constants.formatSeparator){for(var p=d;p>=0&&p<this.currentFormat.length&&this.currentFormat[p]===this.currentFormat[d];)p+=t;d>p&&(p+1!==l||d+1!==u)?(this.setSelection({start:p+1,end:d+1}),this.resetSegmentValue=!0):d<p&&(d!==l||p!==u)&&(this.setSelection({start:d,end:p}),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,o=this.caret();if("S"===(e=e||this.currentFormat[o[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var a=u.millisecondDigitsInFormat(this.inputFormat);i=u.millisecondStepFor(a)}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:{}}),!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("valueChange",u.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",u.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null,oldElementValue:"",newElementValue:""}),this.trigger("inputEnd",u.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",u.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",u.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",u.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",u.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",u.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",u.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",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&&!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 o=this.options.hasPlaceholder||u.isPresent(this.options.placeholder),a=!this.isActive&&o&&!this.dateObject.hasValue();o&&u.isPresent(this.options.placeholder)&&(t.placeholder=this.options.placeholder);var s=a?"":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&&(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 o.DateObject(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}},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,o,a=this.dateObject,s=new Date;(a.date||a.month||a.year||a.hours||a.minutes||a.seconds)&&(n=a.year?a.value.getFullYear():s.getFullYear(),e=a.month?a.value.getMonth():s.getMonth(),t=a.date?a.value.getDate():s.getDate(),r=a.hours?a.value.getHours():s.getHours(),i=a.minutes?a.value.getMinutes():s.getMinutes(),o=a.seconds?a.value.getSeconds():s.getSeconds(),a.setValue(new Date(n,e,t,r,i,o)),this.refreshElementValue(),this.triggerValueChange())},e}(h.Observable);e.DateInput=m},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return l})),n.d(e,"__metadata",(function(){return u})),n.d(e,"__awaiter",(function(){return h})),n.d(e,"__generator",(function(){return c})),n.d(e,"__createBinding",(function(){return d})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return m})),n.d(e,"__spread",(function(){return g})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__spreadArray",(function(){return y})),n.d(e,"__await",(function(){return D})),n.d(e,"__asyncGenerator",(function(){return E})),n.d(e,"__asyncDelegator",(function(){return b})),n.d(e,"__asyncValues",(function(){return S})),n.d(e,"__makeTemplateObject",(function(){return M})),n.d(e,"__importStar",(function(){return w})),n.d(e,"__importDefault",(function(){return O})),n.d(e,"__classPrivateFieldGet",(function(){return C})),n.d(e,"__classPrivateFieldSet",(function(){return T})),n.d(e,"__classPrivateFieldIn",(function(){return I}));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])})(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 o=function(){return(o=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}).apply(this,arguments)};function a(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,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function l(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(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(a,s)}l((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),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=a.trys,(i=i.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 d=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 f(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||d(e,t,n)}function p(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 m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function v(){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 o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function y(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;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 D(t){return this instanceof D?(this.v=t,this):new D(t)}function E(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof D?Promise.resolve(n.value.v).then(l,u):h(o[0][2],n)}catch(t){h(o[0][3],t)}var n}function l(t){s("next",t)}function u(t){s("throw",t)}function h(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function b(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:D(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function S(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(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 M(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var P=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function w(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&d(e,t,n);return P(e,t),e}function O(t){return t&&t.__esModule?t:{default:t}}function C(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 T(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 I(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(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(9),o=n(3),a=n(1),s=n(0),l=/d|M|H|h|m|s/,u=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,o=t.cycleTime,a=void 0!==o&&o,l=t.twoDigitYearMax,u=void 0===l?s.Constants.twoDigitYearMax:l,h=t.value,c=void 0===h?null:h,d=t.autoCorrectParts,f=void 0===d||d;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=r.getDate(new Date),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:a,twoDigitYearMax:u,value:c,autoCorrectParts:f}),c)this._value=r.cloneDate(c);else{this._value=r.getDate(new Date);for(var p=this.dateFormatString(this.value,this.format).symbols,m=0;m<p.length;m++)this.setExisting(p[m],!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:!0,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:!0,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},t.prototype.setValue=function(t){t?r.isEqual(t,this._value)||(this._value=r.cloneDate(t),this.modifyExisting(!0)):(this._value=r.getDate(new Date),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 r.cloneDate(this.value)},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=(a.parseToInt(this.getInvalidDatePartValue(h))+1).toString();if(c.length>2)i+=l[h][u];else if(this.getInvalidDatePartValue(h))i+=o.padZero(c.length-d.length)+d,u+=c.length-1;else i+=l[h][u]}else if(this.getInvalidDatePartValue(h)){d=this.getInvalidDatePartValue(h).toString();i+=o.padZero(c.length-d.length)+d,u+=c.length-1}else 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 o=e.intl.formatDate(i,n,e.localeId);r[t]=o}})),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(a.isPresent(t)&&a.isPresent(e)&&0!==e){var n,i=r.cloneDate(this.value),o=!1,s="M"===t,l="d"===t||"E"===t,u=this.getExisting(t);if(this.autoCorrectParts||!l&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=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),o=!0;break;case"m":i.setMinutes(i.getMinutes()+e),o=!0;break;case"s":i.setSeconds(i.getSeconds()+e),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),o=!0}else{var h=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=h.y.value||i.getFullYear(),f=h.M.value||i.getMonth(),p=h.d.value||h.E.value||i.getDate(),m=h.h.value||h.H.value||i.getHours(),g=h.m.value||i.getMinutes(),v=h.s.value||i.getSeconds(),y=h.S.value||i.getMilliseconds();switch(t){case"y":d+=e;break;case"M":f+=e;break;case"d":case"E":p+=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=a.clamp(f%11+1+11,0,11);else{var D=a.isPresent(c)?f:(e-1)%12;f=a.clamp(D,0,11)}f=a.clamp(f,0,11)}f=a.clamp(f,0,11)}else if("d"===t)if(u){if(p<=0||p>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!u){if(a.isPresent(c)&&(p<=0||p>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=a.isPresent(c)?p:31-Math.abs(e%31)+1;p=a.clamp(E,1,31)}else{E=a.isPresent(c)?p:e%31;p=a.clamp(E,1,31)}p=a.clamp(p,1,31)}var b=r.createDate(d,f,p,m,g,v,y),S=s||l?this.modifyDateSymbolWithValue(i,t,s?f:p):null,M=a.areDatePartsEqualTo(b,d,f,p,m,g,v,y);this.getValue()&&a.areDatePartsEqualTo(b,d,f,p,m,g,v,y)?(i=r.cloneDate(b),this.markDatePartsAsExisting()):s&&S?S.getMonth()===f?this.getExisting("d")?M?(i=r.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(S),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):M?(this.resetInvalidDateSymbol(t),i=r.cloneDate(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(S),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===p?this.getExisting("M")?M?(i=r.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(S),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):M?(i=r.cloneDate(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(this.value),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),o&&!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),f=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),p=d.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),m=0;m<f.length;m++){for(var g=f[m],v=0;v<g.pattern.length;v++)f[m+v]&&(f[m+v].literal=g.pattern[v]);m+=g.pattern.length-1}for(m=0;m<p.length;m++){for(g=p[m],v=0;v<g.pattern.length;v++)p[m+v]&&(p[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),a.extend(y,{value:null,switchToNext:!1});for(m=0;m<f.length;m++){var D=f[m].literal,E=l.startsWith(D),b=l.endsWith(D),S=l.indexOf(D+D)>=0;if(E||b||S)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),a.extend(y,{value:null,switchToNext:!1})}}var M=this.intl.formatDate(this.value,this.format,this.localeId),P=d.symbols,w=!1,O="",C="",T="",I="",_="",x="",F="";for(m=0;m<p.length;m++)F+=p[m].text;var V=this.format===P||this.format===F||this.format===h||this.format.length===h.length,j=(V?F:h).indexOf(e),k=(V?F:h).lastIndexOf(e)-j+1,U=h.length-l.length;if(c||!c&&!this.autoCorrectParts){for(m=0;m<M.length;m++){if(P[m]===e)C+=this.getExisting(e)?M[m]:"0",U>0?T.length+U<k&&(T+=l[m]||""):T+=l[m]||"",w=!0;else w?(x+=M[m],_+=M[m]):(O+=M[m],I+=M[m])}if(V&&(F.length<l.length?T+=n:!u&&(h.length,l.length),T.length>k))return a.extend(y,{value:null,switchToNext:!1});if(!V||V&&!this.autoCorrectParts){C="",T="",O="",x="",w=!1;for(m=0;m<h.length;m++){if(h[m]===e)C+=this.getExisting(e)?M[m]||"":"0",U>0?T.length+U<k&&(T+=l[m]||""):T+=l[m]||"",w=!0;else w?x+=l[m-U]||"":O+=l[m]||""}h.length<l.length&&(T+=n)}}if(!c)if(this.autoCorrectParts){C="",T="",O="",x="",w=!1;for(m=0;m<M.length;m++){if(P[m]===e)C+=this.getExisting(e)?M[m]:"0",w=!0;else w?x+=M[m]:O+=M[m]}}else C=i?T:C;var N=null,A=this.matchMonth(n),L=this.matchDayPeriod(n,e),Y="0"===n,H=this.leadingZero||{};Y?("0"===T&&(T=C),0!==a.parseToInt(i?n:(c?T:C)+n)||this.isAbbrMonth(d.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero();var K=this.partPattern(d.partMap,e),W=K?K.pattern:null,R=this.patternLength(W)||W.length;if(c&&u&&!T)return this.setExisting(e,!1),a.extend(y,{value:null,switchToNext:!1});var z=C.length-3,B=!0,Z=c?T:C;for(m=Math.max(0,z);m<=C.length&&B;m++){Z=i?n:c?T:C.substring(m)+n,!c&&this.autoCorrectParts||(B=!1,Z=o.unpadZero(Z),Z=o.padZero(R-Z.length)+Z);var G=parseInt(Z,10),q=O+Z+x;N=this.intl.parseDate(q,this.format,this.localeId);var J=!1;c&&!a.isValidDate(N)&&this.autoCorrectParts&&(N=this.intl.parseDate(I+Z+_,this.format,this.localeId),J=!0);var Q=!isNaN(parseInt(n,10))||c&&u&&""===n;if(!N&&!isNaN(G)&&Q&&this.autoCorrectParts){if("M"===e&&!A){var X=G-1;X>-1&&X<12&&((N=r.cloneDate(this.value)).setMonth(X),N.getMonth()!==X&&(N=r.lastDayOfMonth(r.addMonths(N,-1))))}"y"===e&&(N=r.createDate(parseInt(Z,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&&a.isValidDate(N)||!c&&N)&&this.date&&N.getDate()!==this.value.getDate()&&(N=r.lastDayOfMonth(r.addMonths(N,-1))))}if(c&&a.isValidDate(N)||!c&&N){var $=this.peek(Z,W),tt=J?""+I+$+_:""+O+$+x,et=this.intl.parseDate(tt,this.format,this.localeId),nt=((this.leadingZero||{})[e]||0)+o.unpadZero(Z).length>=R,rt=null===et||(H[e]?W.length<=Z.length:nt);return this.shouldNormalizeCentury()&&(N=this.normalizeCentury(N)),this._value=N,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")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),a.extend(y,{value:this.value,switchToNext:rt})}}if(A&&(N=this.intl.parseDate(O+A+x,this.format,this.localeId)))return this._value=N,this.setExisting(e,!0),a.extend(y,{value:this.value,switchToNext:!1});if(L&&(N=this.intl.parseDate(O+L+x,this.format)||this.intl.parseDate(I+L+_,this.format)))return this._value=N,this.setExisting(e,!0),a.extend(y,{value:this.value,switchToNext:!0});if(Y&&this.setExisting(e,!1),!this.autoCorrectParts){var it=void 0,ot=c?T:Z,at=a.parseToInt(ot);if(a.isNumber(at)){if("d"===e&&(at<=0||at>31)||"M"===e&&(at<0||at>11))return a.extend(y,{value:null,switchToNext:!1});it="M"===e?at-1:at;var st="M"===e,lt="d"===e,ut=r.cloneDate(this._value),ht=this._partiallyInvalidDate.invalidDateParts||{},ct=ht.y.value||ut.getFullYear(),dt=st?it:ht.M.value||ut.getMonth(),ft=lt?it:ht.d.value||ht.E.value||ut.getDate(),pt=ht.h.value||ht.H.value||ut.getHours(),mt=ht.m.value||ut.getMinutes(),gt=ht.s.value||ut.getSeconds(),vt=ht.S.value||ut.getMilliseconds(),yt=r.createDate(ct,dt,ft,pt,mt,gt,vt),Dt=a.areDatePartsEqualTo(yt,ct,dt,ft,pt,mt,gt,vt),Et=st||lt?this.modifyDateSymbolWithValue(ut,e,st?dt:ft):null,bt=!1;if(st&&Et?Et.getMonth()===dt?this.getExisting("d")?Dt?(ut=r.cloneDate(yt),this.resetInvalidDateSymbol(e)):(bt=!0,this.setInvalidDatePart(e,{value:dt,date:r.cloneDate(Et),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(this.resetInvalidDateSymbol(e),ut=r.cloneDate(yt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),ut=r.cloneDate(Et)):(bt=!0,this.setInvalidDatePart(e,{value:dt,date:r.cloneDate(Et),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1)):lt&&Et&&(Et.getDate()===ft?this.getExisting("M")?Dt?(ut=r.cloneDate(yt),this.resetInvalidDateSymbol(e)):(bt=!0,this.setInvalidDatePart(e,{value:ft,date:r.cloneDate(Et),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(ut=r.cloneDate(yt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),ut=r.cloneDate(Et)):(bt=!0,this.setInvalidDatePart(e,{value:ft,date:r.cloneDate(this.value),startDate:r.cloneDate(this.value)}),this.setExisting(e,!1))),!bt){if(this.setExisting(e,!0),c&&!a.isValidDate(N)){var St=this.intl.parseDate(I+Z+_,this.format,this.localeId);a.isValidDate(St)&&(this._value=St)}else this._value=ut;this.getValue()&&this.resetInvalidDate()}rt=!1;return rt="M"===e?at>=2||ot.length>=2:V?ot.length===k:ot.length>k,a.extend(y,{value:null,switchToNext:rt,hasInvalidDatePart:bt})}}return a.extend(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(o.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(!a.isPresent(t))return t;var e=a.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return a.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 o.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=[],o=[],a=0;a<n.length;a++)for(var l=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;l>0;)r.push(this.symbols[n[a].pattern[0]]||s.Constants.formatSeparator),o.push(n[a]),l--;var u=new i.Mask;return u.symbols=r.join(""),u.partMap=o,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],f=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 p=this.getInvalidDatePartValue(d).toString();if("M"===d)if(p=(a.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),c.length>2)n=u[d][h]+n;else p=(a.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),n=o.padZero(c.length-p.length)+p+n,f=c.length-1,l=p.length-c.length;else n=o.padZero(c.length-p.length)+p+n,f=c.length-1,l=p.length-c.length}else n=this.dateFieldName(e.partMap[h])+n;for(;r.length<n.length;)r=i[h]+r;0!==f&&(h=h-f+(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]&&a.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,o=void 0===i?null:i,a=e.startDateOffset,s=void 0===a?0:a,l=e.startDate,u=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=r,this._partiallyInvalidDate.invalidDateParts[t].date=o,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]&&a.isPresent(t._partiallyInvalidDate.invalidDateParts[n].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=r.cloneDate(t),o=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=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),o=!0;break;case"m":i.setMinutes(i.getMinutes()+n),o=!0;break;case"s":i.setSeconds(i.getSeconds()+n),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),o=!0}return{date:i,timeModified:o}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=r.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=r.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(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 o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.push(o)}for(i=e-1;i>=0;i--){o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.unshift(o)}return r},t}();e.DateObject=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){this.symbols="",this.partMap=[]};e.Mask=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i={events:{}},o=function(){function t(t){this.options=r.extend({},i,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!r.isFunction(this.options.events[t])&&(this.options.events[t](r.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
|
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)}(window,(function(t,e){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=5)}([function(e,i){e.exports=t},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(0),a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},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,n,s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];if(!s.length)return t;var l=s.shift();if(a(t)&&a(l))for(var h in l)r(l[h])?t[h]=l[h]:!a(l[h])||l[h]instanceof Date?e.extend(t,((n={})[h]=l[h],n)):(t[h]&&a(t[h])||e.extend(t,((i={})[h]={},i)),e.deepExtend(t[h],l[h]));return e.deepExtend.apply(void 0,[t].concat(s))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(n="setFullYear",function(t,e){var i=s.cloneDate(t);return i[n](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,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)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),s=i(4);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,a=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([a[r-1],d[r-1]]),p;if(0===c.indexOf(d)&&o&&(l.key===s.Key.DELETE||l.key===s.Key.BACKSPACE)||0===c.indexOf(d)&&!o&&(0===d.length||a[d.length-1]!==a[d.length])){var m="";o||1!==d.length||p.push([a[0],d[0]]);for(var v=d.length;v<c.length;v++)a[v]!==m&&a[v]!==n.Constants.formatSeparator&&(m=a[v],p.push([m,""]));return p}if(o&&(0===d.indexOf(c)||a[r-1]===n.Constants.formatSeparator)||!o&&(0===d.indexOf(c)||a[r-1]===n.Constants.formatSeparator)){var f=a[0];for(v=Math.max(0,c.length-1);v<a.length;v++)if(a[v]!==n.Constants.formatSeparator){f=a[v];break}return[[f,d[r-1]]]}return" "===d[d.length-1]||d[d.length-1]===u&&"_"===a[h]?[[a[r-1],n.Constants.formatSeparator]]:[[a[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)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(6);e.DateInput=n.DateInput},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(7),a=i(8),r=i(3),o=i(10),l=i(4),h=i(2),u=i(11),c=i(12),d=i(0),p=i(1),m={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.valueChange=null,n.input=null,n.inputEnd=null,n.focus=null,n.focusEnd=null,n.blur=null,n.blurEnd=null,n.keydown=null,n.mousewheel=null,n.change=null,n),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1},v=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 s.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),e.prototype.init=function(t,e){var i=h.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);h.isValidDate(i)||(i=null),this.element=t,this.options=h.extend({},m,e,{steps:s.__assign({},m.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("dragStart",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("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=h.extend({},this.options,t,{steps:s.__assign({},m.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=h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,s=!i&&n?0:this.caret()[0];this.selectNearestSegment(s)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){if(this.triggerInput({event:t}),this.element&&this.dateObject){var e=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var i=this.keyDownEvent||{},n=i.keyCode===o.KeyCode.BACKSPACE||i.key===l.Key.BACKSPACE,s=i.keyCode===o.KeyCode.DELETE||i.key===l.Key.DELETE,a=this.interactionMode;!this.options.allowCaretMode||a===c.DateInputInteractionMode.Caret||s||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var u=this.isInCaretMode();if(u&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var m=this.dateObject&&this.dateObject.getValue(),v=this.dateObject?this.dateObject.value:null,f=this.dateObject.getTextAndFormat(),g=f.text,y=f.format;this.currentFormat=y;var D="";D=u&&(n||s||a===c.DateInputInteractionMode.Caret)?this.previousElementValue:g;var E=this.elementValue,P=r.approximateStringMatching({oldText:D,newText:E,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:u,keyEvent:this.keyDownEvent});if(P&&P.length&&P[0]&&P[0][1]!==p.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!u||P&&0!==P.length){if(u&&1===P.length){if(!P[0]||!P[0][0])return void this.restorePreviousInputEventState();if(u&&P[0]&&(P[0][0]===p.Constants.formatSeparator||P[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var b=1===P.length&&P[0][1]===p.Constants.formatSeparator,S=[],M=!1,I=null;if(!b)for(var x=0;x<P.length;x++){var O=this.dateObject.parsePart({symbol:P[x][0],currentChar:P[x][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||s,originalFormat:this.currentFormat});S.push(O),O.value||(I={type:"parse"}),M=O.switchToNext}this.options.autoSwitchParts||(M=!1),this.resetSegmentValue=!1;var w,C=this.options.format===this.currentFormat||h.isPresent(this.options.format)&&this.options.format.length>1,F=S[S.length-1],V=F&&!h.isPresent(F.value),k=u&&(n||s)&&V,_=!!F&&F.resetPart,T=this.dateObject.getValue(),j=!d.isEqual(m,T),A=this.dateObject.value,N=this.selection;if(u){var L=P&&P.length>0?P[0][0]:null,K=this.dateObject.getLeadingZero()[L];P.length&&P[0][0]!==p.Constants.formatSeparator?M?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):_?(w=this.currentFormat[N.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(w))):this.restorePreviousInputEventState():k?(this.forceUpdate(),P.length&&P[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(P[0][0]))):V?"0"===t.data&&K||(h.isPresent(m)&&!h.isPresent(T)?this.restorePreviousInputEventState():!h.isPresent(m)&&h.isPresent(T)?this.forceUpdateWithSelection():h.isPresent(m)&&h.isPresent(T)?j?this.forceUpdateWithSelection():this.restorePreviousInputEventState():h.isPresent(m)||h.isPresent(T)?v!==A||this.restorePreviousInputEventState():this.forceUpdateWithSelection()):V||C||this.forceUpdateWithSelection():(this.options.autoSwitchParts||P[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(P[0][0]))}else u||(this.forceUpdate(),P.length&&P[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(P[0][0])),this.options.autoSwitchParts?b?(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):M&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):F&&F.switchToNext?this.resetSegmentValue=!0:b&&(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),n&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1));this.tryTriggerValueChange({oldValue:m,event:t}),this.triggerInputEnd({event:t,error:I}),u&&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;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 a=this.selection,r=a.start,l=a.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),r!==this.selection.start||l!==this.selection.end)return void t.preventDefault()}var h=this.currentFormat[this.selection.start],u=this.getStepFromSymbol(h),c=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(u,h,event),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-u,h,event),c=!0,this.switchedPartOnPreviousKeyAction=!1;break;case o.KeyCode.ENTER:break;case o.KeyCode.HOME:this.selectNearestSegment(0),c=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;case o.KeyCode.END:this.selectNearestSegment(this.elementValue.length),c=!0,this.switchedPartOnPreviousKeyAction=!1,this.resetSegmentValue=!0;break;default:return}c&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var e=t;e.shiftKey?this.switchDateSegment((e.wheelDelta||-e.detail)>0?-1:1):this.modifyDateSegmentValue((e.wheelDelta||-e.detail)>0?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;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:!0,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:!0,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:!0,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:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),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],s="",a="";if(t<0){for(var r=i+t;r>=0;r--)if((a=this.currentFormat[r])!==p.Constants.formatSeparator&&a!==n){i=r,s=a;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==p.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 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,s=1,a=this.caret();if("S"===(e=e||this.currentFormat[a[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var r=h.millisecondDigitsInFormat(this.inputFormat);s=h.millisecondStepFor(r)}this.dateObject.modifyPart(e,s*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:{}}),!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("valueChange",h.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",h.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null}),this.trigger("inputEnd",h.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",h.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",h.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",h.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",h.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",h.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",h.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",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 s=this.elementValue.length-n;this.setSelection({start:e+s,end:i+s})},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&&!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,s=i.format;this.currentFormat=s,this.currentText=n;var a=this.options.hasPlaceholder||h.isPresent(this.options.placeholder),r=!this.isActive&&a&&!this.dateObject.hasValue();a&&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],s=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(i&&(h.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.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 a.DateObject(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}},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,s,a,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(),s=r.minutes?r.value.getMinutes():o.getMinutes(),a=r.seconds?r.value.getSeconds():o.getSeconds(),r.setValue(new Date(i,e,t,n,s,a)),this.refreshElementValue(),this.triggerValueChange())},e}(u.Observable);e.DateInput=v},function(t,i){t.exports=e},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),s=i(9),a=i(3),r=i(2),o=i(1),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,i=t.formatPlaceholder,s=t.format,a=t.cycleTime,r=void 0!==a&&a,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;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=n.getDate(new Date),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:s,cycleTime:r,twoDigitYearMax:h,value:c,autoCorrectParts:p}),c)this._value=n.cloneDate(c);else{this._value=n.getDate(new Date);for(var m=this.dateFormatString(this.value,this.format).symbols,v=0;v<m.length;v++)this.setExisting(m[v],!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:!0,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],s=this.intl.cldr[n];if(s.name&&s.calendar&&s.numbers&&s.name!==o.Constants.defaultLocaleId){t=s.name;break}}return t},enumerable:!0,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},t.prototype.setValue=function(t){t?n.isEqual(t,this._value)||(this._value=n.cloneDate(t),this.modifyExisting(!0)):(this._value=n.getDate(new Date),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 n.cloneDate(this.value)},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 s="",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)s+=i[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(n,h);if("M"===u){var d=(r.parseToInt(this.getInvalidDatePartValue(u))+1).toString();if(c.length>2)s+=l[u][h];else if(this.getInvalidDatePartValue(u))s+=a.padZero(c.length-d.length)+d,h+=c.length-1;else s+=l[u][h]}else if(this.getInvalidDatePartValue(u)){d=this.getInvalidDatePartValue(u).toString();s+=a.padZero(c.length-d.length)+d,h+=c.length-1}else s+=l[u][h]}else s+=i[h]}i=s}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 s=e.getInvalidDatePart(t).date;if(s){var a=e.intl.formatDate(s,i,e.localeId);n[t]=a}})),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(r.isPresent(t)&&r.isPresent(e)&&0!==e){var i,s=n.cloneDate(this.value),a=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o)switch(t){case"y":s.setFullYear(s.getFullYear()+e);break;case"M":s=n.addMonths(this.value,e);break;case"d":case"E":s.setDate(s.getDate()+e);break;case"h":case"H":s.setHours(s.getHours()+e),a=!0;break;case"m":s.setMinutes(s.getMinutes()+e),a=!0;break;case"s":s.setSeconds(s.getSeconds()+e),a=!0;break;case"S":s.setMilliseconds(s.getMilliseconds()+e);break;case"a":s.setHours(s.getHours()+12*e),a=!0}else{var u=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=u.y.value||s.getFullYear(),p=u.M.value||s.getMonth(),m=u.d.value||u.E.value||s.getDate(),v=u.h.value||u.H.value||s.getHours(),f=u.m.value||s.getMinutes(),g=u.s.value||s.getSeconds(),y=u.S.value||s.getMilliseconds();switch(t){case"y":d+=e;break;case"M":p+=e;break;case"d":case"E":m+=e}if("M"===t){if((p<0||p>11)&&h)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!h){if(p<0)p=r.clamp(p%11+1+11,0,11);else{var D=r.isPresent(c)?p:(e-1)%12;p=r.clamp(D,0,11)}p=r.clamp(p,0,11)}p=r.clamp(p,0,11)}else if("d"===t)if(h){if(m<=0||m>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!h){if(r.isPresent(c)&&(m<=0||m>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=r.isPresent(c)?m:31-Math.abs(e%31)+1;m=r.clamp(E,1,31)}else{E=r.isPresent(c)?m:e%31;m=r.clamp(E,1,31)}m=r.clamp(m,1,31)}var P=n.createDate(d,p,m,v,f,g,y),b=o||l?this.modifyDateSymbolWithValue(s,t,o?p:m):null,S=r.areDatePartsEqualTo(P,d,p,m,v,f,g,y);this.getValue()&&r.areDatePartsEqualTo(P,d,p,m,v,f,g,y)?(s=n.cloneDate(P),this.markDatePartsAsExisting()):o&&b?b.getMonth()===p?this.getExisting("d")?S?(s=n.cloneDate(P),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:p,date:n.cloneDate(b),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)):S?(this.resetInvalidDateSymbol(t),s=n.cloneDate(P),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),s=n.cloneDate(b)):(i=!0,this.setInvalidDatePart(t,{value:p,date:n.cloneDate(b),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)):l&&b&&(b.getDate()===m?this.getExisting("M")?S?(s=n.cloneDate(P),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:m,date:n.cloneDate(b),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)):S?(s=n.cloneDate(P),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),s=n.cloneDate(b)):(i=!0,this.setInvalidDatePart(t,{value:m,date:n.cloneDate(this.value),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(s=this.normalizeCentury(s)),a&&!this.cycleTime&&(s.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=s,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,s=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 f=p[v],g=0;g<f.pattern.length;g++)p[v+g]&&(p[v+g].literal=f.pattern[g]);v+=f.pattern.length-1}for(v=0;v<m.length;v++){for(f=m[v],g=0;g<f.pattern.length;g++)m[v+g]&&(m[v+g].text=f.pattern[g]);v+=f.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),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),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 _=this.format===M||this.format===k||this.format===u||this.format.length===u.length,T=(_?k:u).indexOf(e),j=(_?k:u).lastIndexOf(e)-T+1,A=u.length-l.length;if(c||!c&&!this.autoCorrectParts){for(v=0;v<S.length;v++){if(M[v]===e)O+=this.getExisting(e)?S[v]:"0",A>0?w.length+A<j&&(w+=l[v]||""):w+=l[v]||"",I=!0;else I?(V+=S[v],F+=S[v]):(x+=S[v],C+=S[v])}if(_&&(k.length<l.length?w+=i:!h&&(u.length,l.length),w.length>j))return r.extend(y,{value:null,switchToNext:!1});if(!_||_&&!this.autoCorrectParts){O="",w="",x="",V="",I=!1;for(v=0;v<u.length;v++){if(u[v]===e)O+=this.getExisting(e)?S[v]||"":"0",A>0?w.length+A<j&&(w+=l[v]||""):w+=l[v]||"",I=!0;else I?V+=l[v-A]||"":x+=l[v]||""}u.length<l.length&&(w+=i)}}if(!c)if(this.autoCorrectParts){O="",w="",x="",V="",I=!1;for(v=0;v<S.length;v++){if(M[v]===e)O+=this.getExisting(e)?S[v]:"0",I=!0;else I?V+=S[v]:x+=S[v]}}else O=s?w:O;var N=null,L=this.matchMonth(i),K=this.matchDayPeriod(i,e),W="0"===i,H=this.leadingZero||{};W?("0"===w&&(w=O),0!==r.parseToInt(s?i:(c?w:O)+i)||this.isAbbrMonth(d.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero();var B=this.partPattern(d.partMap,e),R=B?B.pattern:null,Z=this.patternLength(R)||R.length;if(c&&h&&!w)return this.setExisting(e,!1),r.extend(y,{value:null,switchToNext:!1});var Y=O.length-3,U=!0,q=c?w:O;for(v=Math.max(0,Y);v<=O.length&&U;v++){q=s?i:c?w:O.substring(v)+i,!c&&this.autoCorrectParts||(U=!1,q=a.unpadZero(q),q=a.padZero(Z-q.length)+q);var z=parseInt(q,10),G=x+q+V;N=this.intl.parseDate(G,this.format,this.localeId);var J=!1;c&&!r.isValidDate(N)&&this.autoCorrectParts&&(N=this.intl.parseDate(C+q+F,this.format,this.localeId),J=!0);var Q=!isNaN(parseInt(i,10))||c&&h&&""===i;if(!N&&!isNaN(z)&&Q&&this.autoCorrectParts){if("M"===e&&!L){var X=z-1;X>-1&&X<12&&((N=n.cloneDate(this.value)).setMonth(X),N.getMonth()!==X&&(N=n.lastDayOfMonth(n.addMonths(N,-1))))}"y"===e&&(N=n.createDate(parseInt(q,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&&r.isValidDate(N)||!c&&N)&&this.date&&N.getDate()!==this.value.getDate()&&(N=n.lastDayOfMonth(n.addMonths(N,-1))))}if(c&&r.isValidDate(N)||!c&&N){var $=this.peek(q,R),tt=J?""+C+$+F:""+x+$+V,et=this.intl.parseDate(tt,this.format,this.localeId),it=((this.leadingZero||{})[e]||0)+a.unpadZero(q).length>=Z,nt=null===et||(H[e]?R.length<=q.length:it);return this.shouldNormalizeCentury()&&(N=this.normalizeCentury(N)),this._value=N,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")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),r.extend(y,{value:this.value,switchToNext:nt})}}if(L&&(N=this.intl.parseDate(x+L+V,this.format,this.localeId)))return this._value=N,this.setExisting(e,!0),r.extend(y,{value:this.value,switchToNext:!1});if(K&&(N=this.intl.parseDate(x+K+V,this.format)||this.intl.parseDate(C+K+F,this.format)))return this._value=N,this.setExisting(e,!0),r.extend(y,{value:this.value,switchToNext:!0});if(W&&this.setExisting(e,!1),!this.autoCorrectParts){var st=void 0,at=c?w:q,rt=r.parseToInt(at);if(r.isNumber(rt)){if("d"===e&&(rt<=0||rt>31)||"M"===e&&(rt<0||rt>11))return r.extend(y,{value:null,switchToNext:!1});st="M"===e?rt-1:rt;var ot="M"===e,lt="d"===e,ht=n.cloneDate(this._value),ut=this._partiallyInvalidDate.invalidDateParts||{},ct=ut.y.value||ht.getFullYear(),dt=ot?st:ut.M.value||ht.getMonth(),pt=lt?st:ut.d.value||ut.E.value||ht.getDate(),mt=ut.h.value||ut.H.value||ht.getHours(),vt=ut.m.value||ht.getMinutes(),ft=ut.s.value||ht.getSeconds(),gt=ut.S.value||ht.getMilliseconds(),yt=n.createDate(ct,dt,pt,mt,vt,ft,gt),Dt=r.areDatePartsEqualTo(yt,ct,dt,pt,mt,vt,ft,gt),Et=ot||lt?this.modifyDateSymbolWithValue(ht,e,ot?dt:pt):null,Pt=!1;if(ot&&Et?Et.getMonth()===dt?this.getExisting("d")?Dt?(ht=n.cloneDate(yt),this.resetInvalidDateSymbol(e)):(Pt=!0,this.setInvalidDatePart(e,{value:dt,date:n.cloneDate(Et),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(this.resetInvalidDateSymbol(e),ht=n.cloneDate(yt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),ht=n.cloneDate(Et)):(Pt=!0,this.setInvalidDatePart(e,{value:dt,date:n.cloneDate(Et),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1)):lt&&Et&&(Et.getDate()===pt?this.getExisting("M")?Dt?(ht=n.cloneDate(yt),this.resetInvalidDateSymbol(e)):(Pt=!0,this.setInvalidDatePart(e,{value:pt,date:n.cloneDate(Et),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(ht=n.cloneDate(yt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),ht=n.cloneDate(Et)):(Pt=!0,this.setInvalidDatePart(e,{value:pt,date:n.cloneDate(this.value),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1))),!Pt){if(this.setExisting(e,!0),c&&!r.isValidDate(N)){var bt=this.intl.parseDate(C+q+F,this.format,this.localeId);r.isValidDate(bt)&&(this._value=bt)}else this._value=ht;this.getValue()&&this.resetInvalidDate()}nt=!1;return nt="M"===e?rt>=2||at.length>=2:_?at.length===j:at.length>j,r.extend(y,{value:null,switchToNext:nt,hasInvalidDatePart:Pt})}}return r.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(!r.isPresent(t))return t;var e=r.cropTwoDigitYear(t),i=this.getNormalizedCenturyBase(e);return 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 a.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=[],a=[],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),a.push(i[r]),l--;var h=new s.Mask;return h.symbols=n.join(""),h.partMap=a,h},t.prototype.merge=function(t,e){for(var i="",n="",s=e.symbols,o=!1,l=0,h=this.getFormattedInvalidDates(s),u=s.length-1;u>=0;u--){var c=this.getPartsForSegment(e,u);if(-1===this.knownParts.indexOf(s[u])||this.getExisting(s[u]))this.autoCorrectParts?i=t[u]+i:t.length!==s.length?o?i=t[u]+i:l>0?(i=t[u]+i,--l<=0&&(o=!0)):i=(t[u+t.length-s.length]||"")+i:i=t[u]+i,n=s[u]+n;else{var d=s[u],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;u>=0&&d===s[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();if("M"===d)if(m=(r.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),c.length>2)i=h[d][u]+i;else m=(r.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),i=a.padZero(c.length-m.length)+m+i,p=c.length-1,l=m.length-c.length;else i=a.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=s[u]+n;0!==p&&(u=u-p+(t.length-s.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]&&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,s=e.date,a=void 0===s?null:s,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=a,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]&&r.isPresent(t._partiallyInvalidDate.invalidDateParts[i].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,i){var s=n.cloneDate(t),a=!1;switch(e){case"y":s.setFullYear(s.getFullYear()+i);break;case"M":s=n.addMonths(this.value,i);break;case"d":case"E":s.setDate(s.getDate()+i);break;case"h":case"H":s.setHours(s.getHours()+i),a=!0;break;case"m":s.setMinutes(s.getMinutes()+i),a=!0;break;case"s":s.setSeconds(s.getSeconds()+i),a=!0;break;case"S":s.setMilliseconds(s.getMilliseconds()+i);break;case"a":s.setHours(s.getHours()+12*i),a=!0}return{date:s,timeModified:a}},t.prototype.modifyDateSymbolWithValue=function(t,e,i){var s=n.cloneDate(t);switch(e){case"y":s.setFullYear(i);break;case"M":s=n.addMonths(t,i-t.getMonth());break;case"d":case"E":s.setDate(i);break;case"h":case"H":s.setHours(i);break;case"m":s.setMinutes(i);break;case"s":s.setSeconds(i);break;case"S":s.setMilliseconds(i);break;case"a":s.setHours(i)}return s},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.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;s>=0;s--){a=t.partMap[s];if(i.type!==a.type||i.pattern!==a.pattern)break;n.unshift(a)}return n},t}();e.DateObject=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){this.symbols="",this.partMap=[]};e.Mask=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(2),s={events:{}},a=function(){function t(t){this.options=n.extend({},s,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!n.isFunction(this.options.events[t])&&(this.options.events[t](n.extend(i,e,{sender:this})),i.defaultPrevented)},t}();e.Observable=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
|
|
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)}(window,(function(t,e){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=5)}([function(e,i){e.exports=t},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(0),a=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},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,n,s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];if(!s.length)return t;var l=s.shift();if(a(t)&&a(l))for(var h in l)r(l[h])?t[h]=l[h]:!a(l[h])||l[h]instanceof Date?e.extend(t,((n={})[h]=l[h],n)):(t[h]&&a(t[h])||e.extend(t,((i={})[h]={},i)),e.deepExtend(t[h],l[h]));return e.deepExtend.apply(void 0,[t].concat(s))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(n="setFullYear",function(t,e){var i=s.cloneDate(t);return i[n](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,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)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),s=i(4);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,a=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([a[r-1],d[r-1]]),p;if(0===c.indexOf(d)&&o&&(l.key===s.Key.DELETE||l.key===s.Key.BACKSPACE)||0===c.indexOf(d)&&!o&&(0===d.length||a[d.length-1]!==a[d.length])){var m="";o||1!==d.length||p.push([a[0],d[0]]);for(var v=d.length;v<c.length;v++)a[v]!==m&&a[v]!==n.Constants.formatSeparator&&(m=a[v],p.push([m,""]));return p}if(o&&(0===d.indexOf(c)||a[r-1]===n.Constants.formatSeparator)||!o&&(0===d.indexOf(c)||a[r-1]===n.Constants.formatSeparator)){var f=a[0];for(v=Math.max(0,c.length-1);v<a.length;v++)if(a[v]!==n.Constants.formatSeparator){f=a[v];break}return[[f,d[r-1]]]}return" "===d[d.length-1]||d[d.length-1]===u&&"_"===a[h]?[[a[r-1],n.Constants.formatSeparator]]:[[a[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)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(6);e.DateInput=n.DateInput},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(7),a=i(8),r=i(3),o=i(10),l=i(4),h=i(2),u=i(11),c=i(12),d=i(0),p=i(1),m={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.valueChange=null,n.input=null,n.inputEnd=null,n.focus=null,n.focusEnd=null,n.blur=null,n.blurEnd=null,n.keydown=null,n.mousewheel=null,n.change=null,n),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1},v=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 s.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),e.prototype.init=function(t,e){var i=h.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);h.isValidDate(i)||(i=null),this.element=t,this.options=h.extend({},m,e,{steps:s.__assign({},m.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("dragStart",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("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=h.extend({},this.options,t,{steps:s.__assign({},m.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=h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,s=!i&&n?0:this.caret()[0];this.selectNearestSegment(s)}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||{},s=n.keyCode===o.KeyCode.BACKSPACE||n.key===l.Key.BACKSPACE,a=n.keyCode===o.KeyCode.DELETE||n.key===l.Key.DELETE,u=this.interactionMode;!this.options.allowCaretMode||u===c.DateInputInteractionMode.Caret||a||s||(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(),f=this.dateObject?this.dateObject.value:null,g=this.dateObject.getTextAndFormat(),y=g.text,D=g.format;this.currentFormat=D;var E="";E=m&&(s||a||u===c.DateInputInteractionMode.Caret)?this.previousElementValue:y;var P=this.elementValue,b=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:s||a,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||h.isPresent(this.options.format)&&this.options.format.length>1,V=M[M.length-1],k=V&&!h.isPresent(V.value),_=m&&(s||a)&&k,T=!!V&&V.resetPart,j=this.dateObject.getValue(),A=!d.isEqual(v,j),N=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)):T?(C=this.currentFormat[L.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(C))):this.restorePreviousInputEventState():_?(this.forceUpdate(),b.length&&b[0][0]!==p.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(b[0][0]))):k?"0"===t.data&&W||(h.isPresent(v)&&!h.isPresent(j)?this.restorePreviousInputEventState():!h.isPresent(v)&&h.isPresent(j)?this.forceUpdateWithSelection():h.isPresent(v)&&h.isPresent(j)?A?this.forceUpdateWithSelection():this.restorePreviousInputEventState():h.isPresent(v)||h.isPresent(j)?f!==N||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),s&&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,s=t;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:n},this.keyEventMatchesAutoSwitchKeys(t)){var a=t.keyCode===o.KeyCode.TAB;if(!a)return t.preventDefault(),void this.switchDateSegment(1);var r=this.selection,l=r.start,h=r.end;if(t.shiftKey&&a?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,s),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,s),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(),i.stopPropagation&&i.stopPropagation(),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;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:!0,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:!0,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:!0,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:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),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],s="",a="";if(t<0){for(var r=i+t;r>=0;r--)if((a=this.currentFormat[r])!==p.Constants.formatSeparator&&a!==n){i=r,s=a;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==p.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 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,s=1,a=this.caret();if("S"===(e=e||this.currentFormat[a[0]])&&(!this.options.steps.millisecond||1===this.options.steps.millisecond)){var r=h.millisecondDigitsInFormat(this.inputFormat);s=h.millisecondStepFor(r)}this.dateObject.modifyPart(e,s*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:{}}),!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("valueChange",h.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",h.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{},error:null,oldElementValue:"",newElementValue:""}),this.trigger("inputEnd",h.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",h.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",h.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",h.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",h.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",h.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",h.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",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 s=this.elementValue.length-n;this.setSelection({start:e+s,end:i+s})},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&&!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,s=i.format;this.currentFormat=s,this.currentText=n;var a=this.options.hasPlaceholder||h.isPresent(this.options.placeholder),r=!this.isActive&&a&&!this.dateObject.hasValue();a&&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],s=this.element;if(!i||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(i&&(h.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.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 a.DateObject(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}},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,s,a,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(),s=r.minutes?r.value.getMinutes():o.getMinutes(),a=r.seconds?r.value.getSeconds():o.getSeconds(),r.setValue(new Date(i,e,t,n,s,a)),this.refreshElementValue(),this.triggerValueChange())},e}(u.Observable);e.DateInput=v},function(t,i){t.exports=e},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),s=i(9),a=i(3),r=i(2),o=i(1),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,i=t.formatPlaceholder,s=t.format,a=t.cycleTime,r=void 0!==a&&a,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;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=n.getDate(new Date),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:s,cycleTime:r,twoDigitYearMax:h,value:c,autoCorrectParts:p}),c)this._value=n.cloneDate(c);else{this._value=n.getDate(new Date);for(var m=this.dateFormatString(this.value,this.format).symbols,v=0;v<m.length;v++)this.setExisting(m[v],!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:!0,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],s=this.intl.cldr[n];if(s.name&&s.calendar&&s.numbers&&s.name!==o.Constants.defaultLocaleId){t=s.name;break}}return t},enumerable:!0,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},t.prototype.setValue=function(t){t?n.isEqual(t,this._value)||(this._value=n.cloneDate(t),this.modifyExisting(!0)):(this._value=n.getDate(new Date),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 n.cloneDate(this.value)},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 s="",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)s+=i[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(n,h);if("M"===u){var d=(r.parseToInt(this.getInvalidDatePartValue(u))+1).toString();if(c.length>2)s+=l[u][h];else if(this.getInvalidDatePartValue(u))s+=a.padZero(c.length-d.length)+d,h+=c.length-1;else s+=l[u][h]}else if(this.getInvalidDatePartValue(u)){d=this.getInvalidDatePartValue(u).toString();s+=a.padZero(c.length-d.length)+d,h+=c.length-1}else s+=l[u][h]}else s+=i[h]}i=s}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 s=e.getInvalidDatePart(t).date;if(s){var a=e.intl.formatDate(s,i,e.localeId);n[t]=a}})),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(r.isPresent(t)&&r.isPresent(e)&&0!==e){var i,s=n.cloneDate(this.value),a=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o)switch(t){case"y":s.setFullYear(s.getFullYear()+e);break;case"M":s=n.addMonths(this.value,e);break;case"d":case"E":s.setDate(s.getDate()+e);break;case"h":case"H":s.setHours(s.getHours()+e),a=!0;break;case"m":s.setMinutes(s.getMinutes()+e),a=!0;break;case"s":s.setSeconds(s.getSeconds()+e),a=!0;break;case"S":s.setMilliseconds(s.getMilliseconds()+e);break;case"a":s.setHours(s.getHours()+12*e),a=!0}else{var u=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=u.y.value||s.getFullYear(),p=u.M.value||s.getMonth(),m=u.d.value||u.E.value||s.getDate(),v=u.h.value||u.H.value||s.getHours(),f=u.m.value||s.getMinutes(),g=u.s.value||s.getSeconds(),y=u.S.value||s.getMilliseconds();switch(t){case"y":d+=e;break;case"M":p+=e;break;case"d":case"E":m+=e}if("M"===t){if((p<0||p>11)&&h)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!h){if(p<0)p=r.clamp(p%11+1+11,0,11);else{var D=r.isPresent(c)?p:(e-1)%12;p=r.clamp(D,0,11)}p=r.clamp(p,0,11)}p=r.clamp(p,0,11)}else if("d"===t)if(h){if(m<=0||m>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!h){if(r.isPresent(c)&&(m<=0||m>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=r.isPresent(c)?m:31-Math.abs(e%31)+1;m=r.clamp(E,1,31)}else{E=r.isPresent(c)?m:e%31;m=r.clamp(E,1,31)}m=r.clamp(m,1,31)}var P=n.createDate(d,p,m,v,f,g,y),b=o||l?this.modifyDateSymbolWithValue(s,t,o?p:m):null,S=r.areDatePartsEqualTo(P,d,p,m,v,f,g,y);this.getValue()&&r.areDatePartsEqualTo(P,d,p,m,v,f,g,y)?(s=n.cloneDate(P),this.markDatePartsAsExisting()):o&&b?b.getMonth()===p?this.getExisting("d")?S?(s=n.cloneDate(P),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:p,date:n.cloneDate(b),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)):S?(this.resetInvalidDateSymbol(t),s=n.cloneDate(P),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),s=n.cloneDate(b)):(i=!0,this.setInvalidDatePart(t,{value:p,date:n.cloneDate(b),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)):l&&b&&(b.getDate()===m?this.getExisting("M")?S?(s=n.cloneDate(P),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:m,date:n.cloneDate(b),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)):S?(s=n.cloneDate(P),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),s=n.cloneDate(b)):(i=!0,this.setInvalidDatePart(t,{value:m,date:n.cloneDate(this.value),startDateOffset:e,startDate:n.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(s=this.normalizeCentury(s)),a&&!this.cycleTime&&(s.getDate(),this._value.getDate()),i||(this.setExisting(t,!0),this._value=s,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e=t.symbol,i=t.currentChar,s=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 f=p[v],g=0;g<f.pattern.length;g++)p[v+g]&&(p[v+g].literal=f.pattern[g]);v+=f.pattern.length-1}for(v=0;v<m.length;v++){for(f=m[v],g=0;g<f.pattern.length;g++)m[v+g]&&(m[v+g].text=f.pattern[g]);v+=f.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),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),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 _=this.format===M||this.format===k||this.format===u||this.format.length===u.length,T=(_?k:u).indexOf(e),j=(_?k:u).lastIndexOf(e)-T+1,A=u.length-l.length;if(c||!c&&!this.autoCorrectParts){for(v=0;v<S.length;v++){if(M[v]===e)O+=this.getExisting(e)?S[v]:"0",A>0?w.length+A<j&&(w+=l[v]||""):w+=l[v]||"",I=!0;else I?(V+=S[v],F+=S[v]):(x+=S[v],C+=S[v])}if(_&&(k.length<l.length?w+=i:!h&&(u.length,l.length),w.length>j))return r.extend(y,{value:null,switchToNext:!1});if(!_||_&&!this.autoCorrectParts){O="",w="",x="",V="",I=!1;for(v=0;v<u.length;v++){if(u[v]===e)O+=this.getExisting(e)?S[v]||"":"0",A>0?w.length+A<j&&(w+=l[v]||""):w+=l[v]||"",I=!0;else I?V+=l[v-A]||"":x+=l[v]||""}u.length<l.length&&(w+=i)}}if(!c)if(this.autoCorrectParts){O="",w="",x="",V="",I=!1;for(v=0;v<S.length;v++){if(M[v]===e)O+=this.getExisting(e)?S[v]:"0",I=!0;else I?V+=S[v]:x+=S[v]}}else O=s?w:O;var N=null,L=this.matchMonth(i),K=this.matchDayPeriod(i,e),W="0"===i,H=this.leadingZero||{};W?("0"===w&&(w=O),0!==r.parseToInt(s?i:(c?w:O)+i)||this.isAbbrMonth(d.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero();var B=this.partPattern(d.partMap,e),R=B?B.pattern:null,Z=this.patternLength(R)||R.length;if(c&&h&&!w)return this.setExisting(e,!1),r.extend(y,{value:null,switchToNext:!1});var Y=O.length-3,U=!0,q=c?w:O;for(v=Math.max(0,Y);v<=O.length&&U;v++){q=s?i:c?w:O.substring(v)+i,!c&&this.autoCorrectParts||(U=!1,q=a.unpadZero(q),q=a.padZero(Z-q.length)+q);var z=parseInt(q,10),G=x+q+V;N=this.intl.parseDate(G,this.format,this.localeId);var J=!1;c&&!r.isValidDate(N)&&this.autoCorrectParts&&(N=this.intl.parseDate(C+q+F,this.format,this.localeId),J=!0);var Q=!isNaN(parseInt(i,10))||c&&h&&""===i;if(!N&&!isNaN(z)&&Q&&this.autoCorrectParts){if("M"===e&&!L){var X=z-1;X>-1&&X<12&&((N=n.cloneDate(this.value)).setMonth(X),N.getMonth()!==X&&(N=n.lastDayOfMonth(n.addMonths(N,-1))))}"y"===e&&(N=n.createDate(parseInt(q,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&&r.isValidDate(N)||!c&&N)&&this.date&&N.getDate()!==this.value.getDate()&&(N=n.lastDayOfMonth(n.addMonths(N,-1))))}if(c&&r.isValidDate(N)||!c&&N){var $=this.peek(q,R),tt=J?""+C+$+F:""+x+$+V,et=this.intl.parseDate(tt,this.format,this.localeId),it=((this.leadingZero||{})[e]||0)+a.unpadZero(q).length>=Z,nt=null===et||(H[e]?R.length<=q.length:it);return this.shouldNormalizeCentury()&&(N=this.normalizeCentury(N)),this._value=N,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")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),r.extend(y,{value:this.value,switchToNext:nt})}}if(L&&(N=this.intl.parseDate(x+L+V,this.format,this.localeId)))return this._value=N,this.setExisting(e,!0),r.extend(y,{value:this.value,switchToNext:!1});if(K&&(N=this.intl.parseDate(x+K+V,this.format)||this.intl.parseDate(C+K+F,this.format)))return this._value=N,this.setExisting(e,!0),r.extend(y,{value:this.value,switchToNext:!0});if(W&&this.setExisting(e,!1),!this.autoCorrectParts){var st=void 0,at=c?w:q,rt=r.parseToInt(at);if(r.isNumber(rt)){if("d"===e&&(rt<=0||rt>31)||"M"===e&&(rt<0||rt>11))return r.extend(y,{value:null,switchToNext:!1});st="M"===e?rt-1:rt;var ot="M"===e,lt="d"===e,ht=n.cloneDate(this._value),ut=this._partiallyInvalidDate.invalidDateParts||{},ct=ut.y.value||ht.getFullYear(),dt=ot?st:ut.M.value||ht.getMonth(),pt=lt?st:ut.d.value||ut.E.value||ht.getDate(),mt=ut.h.value||ut.H.value||ht.getHours(),vt=ut.m.value||ht.getMinutes(),ft=ut.s.value||ht.getSeconds(),gt=ut.S.value||ht.getMilliseconds(),yt=n.createDate(ct,dt,pt,mt,vt,ft,gt),Dt=r.areDatePartsEqualTo(yt,ct,dt,pt,mt,vt,ft,gt),Et=ot||lt?this.modifyDateSymbolWithValue(ht,e,ot?dt:pt):null,Pt=!1;if(ot&&Et?Et.getMonth()===dt?this.getExisting("d")?Dt?(ht=n.cloneDate(yt),this.resetInvalidDateSymbol(e)):(Pt=!0,this.setInvalidDatePart(e,{value:dt,date:n.cloneDate(Et),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(this.resetInvalidDateSymbol(e),ht=n.cloneDate(yt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),ht=n.cloneDate(Et)):(Pt=!0,this.setInvalidDatePart(e,{value:dt,date:n.cloneDate(Et),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1)):lt&&Et&&(Et.getDate()===pt?this.getExisting("M")?Dt?(ht=n.cloneDate(yt),this.resetInvalidDateSymbol(e)):(Pt=!0,this.setInvalidDatePart(e,{value:pt,date:n.cloneDate(Et),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1)):Dt?(ht=n.cloneDate(yt),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),ht=n.cloneDate(Et)):(Pt=!0,this.setInvalidDatePart(e,{value:pt,date:n.cloneDate(this.value),startDate:n.cloneDate(this.value)}),this.setExisting(e,!1))),!Pt){if(this.setExisting(e,!0),c&&!r.isValidDate(N)){var bt=this.intl.parseDate(C+q+F,this.format,this.localeId);r.isValidDate(bt)&&(this._value=bt)}else this._value=ht;this.getValue()&&this.resetInvalidDate()}nt=!1;return nt="M"===e?rt>=2||at.length>=2:_?at.length===j:at.length>j,r.extend(y,{value:null,switchToNext:nt,hasInvalidDatePart:Pt})}}return r.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(!r.isPresent(t))return t;var e=r.cropTwoDigitYear(t),i=this.getNormalizedCenturyBase(e);return 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 a.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=[],a=[],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),a.push(i[r]),l--;var h=new s.Mask;return h.symbols=n.join(""),h.partMap=a,h},t.prototype.merge=function(t,e){for(var i="",n="",s=e.symbols,o=!1,l=0,h=this.getFormattedInvalidDates(s),u=s.length-1;u>=0;u--){var c=this.getPartsForSegment(e,u);if(-1===this.knownParts.indexOf(s[u])||this.getExisting(s[u]))this.autoCorrectParts?i=t[u]+i:t.length!==s.length?o?i=t[u]+i:l>0?(i=t[u]+i,--l<=0&&(o=!0)):i=(t[u+t.length-s.length]||"")+i:i=t[u]+i,n=s[u]+n;else{var d=s[u],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;u>=0&&d===s[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();if("M"===d)if(m=(r.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),c.length>2)i=h[d][u]+i;else m=(r.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),i=a.padZero(c.length-m.length)+m+i,p=c.length-1,l=m.length-c.length;else i=a.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=s[u]+n;0!==p&&(u=u-p+(t.length-s.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]&&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,s=e.date,a=void 0===s?null:s,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=a,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]&&r.isPresent(t._partiallyInvalidDate.invalidDateParts[i].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,i){var s=n.cloneDate(t),a=!1;switch(e){case"y":s.setFullYear(s.getFullYear()+i);break;case"M":s=n.addMonths(this.value,i);break;case"d":case"E":s.setDate(s.getDate()+i);break;case"h":case"H":s.setHours(s.getHours()+i),a=!0;break;case"m":s.setMinutes(s.getMinutes()+i),a=!0;break;case"s":s.setSeconds(s.getSeconds()+i),a=!0;break;case"S":s.setMilliseconds(s.getMilliseconds()+i);break;case"a":s.setHours(s.getHours()+12*i),a=!0}return{date:s,timeModified:a}},t.prototype.modifyDateSymbolWithValue=function(t,e,i){var s=n.cloneDate(t);switch(e){case"y":s.setFullYear(i);break;case"M":s=n.addMonths(t,i-t.getMonth());break;case"d":case"E":s.setDate(i);break;case"h":case"H":s.setHours(i);break;case"m":s.setMinutes(i);break;case"s":s.setSeconds(i);break;case"S":s.setMilliseconds(i);break;case"a":s.setHours(i)}return s},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.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;s>=0;s--){a=t.partMap[s];if(i.type!==a.type||i.pattern!==a.pattern)break;n.unshift(a)}return n},t}();e.DateObject=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){this.symbols="",this.partMap=[]};e.Mask=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(2),s={events:{}},a=function(){function t(t){this.options=n.extend({},s,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!n.isFunction(this.options.events[t])&&(this.options.events[t](n.extend(i,e,{sender:this})),i.defaultPrevented)},t}();e.Observable=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
|
|
@@ -254,6 +254,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
254
254
|
*/
|
|
255
255
|
DateInput.prototype.onElementInput = function (e) {
|
|
256
256
|
this.triggerInput({ event: e });
|
|
257
|
+
var oldElementValue = this.elementValue;
|
|
257
258
|
if (!this.element || !this.dateObject) {
|
|
258
259
|
return;
|
|
259
260
|
}
|
|
@@ -485,7 +486,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
485
486
|
oldValue: oldExistingDateValue,
|
|
486
487
|
event: e
|
|
487
488
|
});
|
|
488
|
-
this.triggerInputEnd({ event: e, error: error });
|
|
489
|
+
this.triggerInputEnd({ event: e, error: error, oldElementValue: oldElementValue, newElementValue: this.elementValue });
|
|
489
490
|
if (hasCaret) {
|
|
490
491
|
// a format like "F" can dynamically change the resolved format pattern based on the value, e.g.
|
|
491
492
|
// "Tuesday, February 1, 2022 3:04:05 AM" becomes
|
|
@@ -541,6 +542,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
541
542
|
return;
|
|
542
543
|
}
|
|
543
544
|
var _a = this.selection, start = _a.start, end = _a.end;
|
|
545
|
+
var event = e;
|
|
544
546
|
this.keyDownEvent = e;
|
|
545
547
|
this.previousElementValue = this.element.value;
|
|
546
548
|
this.previousElementSelection = { start: start, end: end };
|
|
@@ -570,6 +572,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
570
572
|
var symbol = this.currentFormat[this.selection.start];
|
|
571
573
|
var step = this.getStepFromSymbol(symbol);
|
|
572
574
|
var shouldPreventDefault = false;
|
|
575
|
+
var oldElementValue = this.elementValue;
|
|
573
576
|
if (e.altKey || e.ctrlKey || e.metaKey || e.keyCode === KeyCode.TAB) {
|
|
574
577
|
return;
|
|
575
578
|
}
|
|
@@ -581,6 +584,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
581
584
|
break;
|
|
582
585
|
case KeyCode.ARROW_UP:
|
|
583
586
|
this.modifyDateSegmentValue(step, symbol, event);
|
|
587
|
+
if (oldElementValue !== this.elementValue) {
|
|
588
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
589
|
+
}
|
|
584
590
|
shouldPreventDefault = true;
|
|
585
591
|
this.switchedPartOnPreviousKeyAction = false;
|
|
586
592
|
break;
|
|
@@ -591,6 +597,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
591
597
|
break;
|
|
592
598
|
case KeyCode.ARROW_DOWN:
|
|
593
599
|
this.modifyDateSegmentValue(-step, symbol, event);
|
|
600
|
+
if (oldElementValue !== this.elementValue) {
|
|
601
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
602
|
+
}
|
|
594
603
|
shouldPreventDefault = true;
|
|
595
604
|
this.switchedPartOnPreviousKeyAction = false;
|
|
596
605
|
break;
|
|
@@ -627,6 +636,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
627
636
|
* @hidden
|
|
628
637
|
*/
|
|
629
638
|
DateInput.prototype.onElementMouseWheel = function (e) {
|
|
639
|
+
var oldElementValue = this.elementValue;
|
|
630
640
|
if (!this.options.enableMouseWheel || this.triggerMouseWheel({ event: e })) {
|
|
631
641
|
return;
|
|
632
642
|
}
|
|
@@ -647,6 +657,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
647
657
|
if (event.stopPropagation) {
|
|
648
658
|
event.stopPropagation();
|
|
649
659
|
}
|
|
660
|
+
if (oldElementValue !== this.elementValue) {
|
|
661
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
662
|
+
}
|
|
650
663
|
};
|
|
651
664
|
DateInput.prototype.updateOnPaste = function (e) {
|
|
652
665
|
var value = this.intl.parseDate(this.elementValue, this.inputFormat) || this.value;
|
|
@@ -891,7 +904,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
891
904
|
* @hidden
|
|
892
905
|
*/
|
|
893
906
|
DateInput.prototype.triggerInputEnd = function (args) {
|
|
894
|
-
if (args === void 0) { args = { event: {}, error: null }; }
|
|
907
|
+
if (args === void 0) { args = { event: {}, error: null, oldElementValue: '', newElementValue: '' }; }
|
|
895
908
|
return this.trigger(INPUT_END, extend(args, {
|
|
896
909
|
value: this.value
|
|
897
910
|
}));
|
|
@@ -245,6 +245,7 @@ export class DateInput extends Observable {
|
|
|
245
245
|
*/
|
|
246
246
|
onElementInput(e) {
|
|
247
247
|
this.triggerInput({ event: e });
|
|
248
|
+
const oldElementValue = this.elementValue;
|
|
248
249
|
if (!this.element || !this.dateObject) {
|
|
249
250
|
return;
|
|
250
251
|
}
|
|
@@ -476,7 +477,7 @@ export class DateInput extends Observable {
|
|
|
476
477
|
oldValue: oldExistingDateValue,
|
|
477
478
|
event: e
|
|
478
479
|
});
|
|
479
|
-
this.triggerInputEnd({ event: e, error: error });
|
|
480
|
+
this.triggerInputEnd({ event: e, error: error, oldElementValue: oldElementValue, newElementValue: this.elementValue });
|
|
480
481
|
if (hasCaret) {
|
|
481
482
|
// a format like "F" can dynamically change the resolved format pattern based on the value, e.g.
|
|
482
483
|
// "Tuesday, February 1, 2022 3:04:05 AM" becomes
|
|
@@ -532,6 +533,7 @@ export class DateInput extends Observable {
|
|
|
532
533
|
return;
|
|
533
534
|
}
|
|
534
535
|
const { start, end } = this.selection;
|
|
536
|
+
const event = e;
|
|
535
537
|
this.keyDownEvent = e;
|
|
536
538
|
this.previousElementValue = this.element.value;
|
|
537
539
|
this.previousElementSelection = { start, end };
|
|
@@ -561,6 +563,7 @@ export class DateInput extends Observable {
|
|
|
561
563
|
const symbol = this.currentFormat[this.selection.start];
|
|
562
564
|
const step = this.getStepFromSymbol(symbol);
|
|
563
565
|
let shouldPreventDefault = false;
|
|
566
|
+
const oldElementValue = this.elementValue;
|
|
564
567
|
if (e.altKey || e.ctrlKey || e.metaKey || e.keyCode === KeyCode.TAB) {
|
|
565
568
|
return;
|
|
566
569
|
}
|
|
@@ -572,6 +575,9 @@ export class DateInput extends Observable {
|
|
|
572
575
|
break;
|
|
573
576
|
case KeyCode.ARROW_UP:
|
|
574
577
|
this.modifyDateSegmentValue(step, symbol, event);
|
|
578
|
+
if (oldElementValue !== this.elementValue) {
|
|
579
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
580
|
+
}
|
|
575
581
|
shouldPreventDefault = true;
|
|
576
582
|
this.switchedPartOnPreviousKeyAction = false;
|
|
577
583
|
break;
|
|
@@ -582,6 +588,9 @@ export class DateInput extends Observable {
|
|
|
582
588
|
break;
|
|
583
589
|
case KeyCode.ARROW_DOWN:
|
|
584
590
|
this.modifyDateSegmentValue(-step, symbol, event);
|
|
591
|
+
if (oldElementValue !== this.elementValue) {
|
|
592
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
593
|
+
}
|
|
585
594
|
shouldPreventDefault = true;
|
|
586
595
|
this.switchedPartOnPreviousKeyAction = false;
|
|
587
596
|
break;
|
|
@@ -618,6 +627,7 @@ export class DateInput extends Observable {
|
|
|
618
627
|
* @hidden
|
|
619
628
|
*/
|
|
620
629
|
onElementMouseWheel(e) {
|
|
630
|
+
const oldElementValue = this.elementValue;
|
|
621
631
|
if (!this.options.enableMouseWheel || this.triggerMouseWheel({ event: e })) {
|
|
622
632
|
return;
|
|
623
633
|
}
|
|
@@ -638,6 +648,9 @@ export class DateInput extends Observable {
|
|
|
638
648
|
if (event.stopPropagation) {
|
|
639
649
|
event.stopPropagation();
|
|
640
650
|
}
|
|
651
|
+
if (oldElementValue !== this.elementValue) {
|
|
652
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
653
|
+
}
|
|
641
654
|
}
|
|
642
655
|
updateOnPaste(e) {
|
|
643
656
|
let value = this.intl.parseDate(this.elementValue, this.inputFormat) || this.value;
|
|
@@ -860,7 +873,7 @@ export class DateInput extends Observable {
|
|
|
860
873
|
/**
|
|
861
874
|
* @hidden
|
|
862
875
|
*/
|
|
863
|
-
triggerInputEnd(args = { event: {}, error: null }) {
|
|
876
|
+
triggerInputEnd(args = { event: {}, error: null, oldElementValue: '', newElementValue: '' }) {
|
|
864
877
|
return this.trigger(INPUT_END, extend(args, {
|
|
865
878
|
value: this.value
|
|
866
879
|
}));
|
|
@@ -256,6 +256,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
256
256
|
*/
|
|
257
257
|
DateInput.prototype.onElementInput = function (e) {
|
|
258
258
|
this.triggerInput({ event: e });
|
|
259
|
+
var oldElementValue = this.elementValue;
|
|
259
260
|
if (!this.element || !this.dateObject) {
|
|
260
261
|
return;
|
|
261
262
|
}
|
|
@@ -487,7 +488,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
487
488
|
oldValue: oldExistingDateValue,
|
|
488
489
|
event: e
|
|
489
490
|
});
|
|
490
|
-
this.triggerInputEnd({ event: e, error: error });
|
|
491
|
+
this.triggerInputEnd({ event: e, error: error, oldElementValue: oldElementValue, newElementValue: this.elementValue });
|
|
491
492
|
if (hasCaret) {
|
|
492
493
|
// a format like "F" can dynamically change the resolved format pattern based on the value, e.g.
|
|
493
494
|
// "Tuesday, February 1, 2022 3:04:05 AM" becomes
|
|
@@ -543,6 +544,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
543
544
|
return;
|
|
544
545
|
}
|
|
545
546
|
var _a = this.selection, start = _a.start, end = _a.end;
|
|
547
|
+
var event = e;
|
|
546
548
|
this.keyDownEvent = e;
|
|
547
549
|
this.previousElementValue = this.element.value;
|
|
548
550
|
this.previousElementSelection = { start: start, end: end };
|
|
@@ -572,6 +574,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
572
574
|
var symbol = this.currentFormat[this.selection.start];
|
|
573
575
|
var step = this.getStepFromSymbol(symbol);
|
|
574
576
|
var shouldPreventDefault = false;
|
|
577
|
+
var oldElementValue = this.elementValue;
|
|
575
578
|
if (e.altKey || e.ctrlKey || e.metaKey || e.keyCode === keycode_1.KeyCode.TAB) {
|
|
576
579
|
return;
|
|
577
580
|
}
|
|
@@ -583,6 +586,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
583
586
|
break;
|
|
584
587
|
case keycode_1.KeyCode.ARROW_UP:
|
|
585
588
|
this.modifyDateSegmentValue(step, symbol, event);
|
|
589
|
+
if (oldElementValue !== this.elementValue) {
|
|
590
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
591
|
+
}
|
|
586
592
|
shouldPreventDefault = true;
|
|
587
593
|
this.switchedPartOnPreviousKeyAction = false;
|
|
588
594
|
break;
|
|
@@ -593,6 +599,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
593
599
|
break;
|
|
594
600
|
case keycode_1.KeyCode.ARROW_DOWN:
|
|
595
601
|
this.modifyDateSegmentValue(-step, symbol, event);
|
|
602
|
+
if (oldElementValue !== this.elementValue) {
|
|
603
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
604
|
+
}
|
|
596
605
|
shouldPreventDefault = true;
|
|
597
606
|
this.switchedPartOnPreviousKeyAction = false;
|
|
598
607
|
break;
|
|
@@ -629,6 +638,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
629
638
|
* @hidden
|
|
630
639
|
*/
|
|
631
640
|
DateInput.prototype.onElementMouseWheel = function (e) {
|
|
641
|
+
var oldElementValue = this.elementValue;
|
|
632
642
|
if (!this.options.enableMouseWheel || this.triggerMouseWheel({ event: e })) {
|
|
633
643
|
return;
|
|
634
644
|
}
|
|
@@ -649,6 +659,9 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
649
659
|
if (event.stopPropagation) {
|
|
650
660
|
event.stopPropagation();
|
|
651
661
|
}
|
|
662
|
+
if (oldElementValue !== this.elementValue) {
|
|
663
|
+
this.triggerInputEnd({ event: e, error: null, newElementValue: this.elementValue, oldElementValue: oldElementValue });
|
|
664
|
+
}
|
|
652
665
|
};
|
|
653
666
|
DateInput.prototype.updateOnPaste = function (e) {
|
|
654
667
|
var value = this.intl.parseDate(this.elementValue, this.inputFormat) || this.value;
|
|
@@ -893,7 +906,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
893
906
|
* @hidden
|
|
894
907
|
*/
|
|
895
908
|
DateInput.prototype.triggerInputEnd = function (args) {
|
|
896
|
-
if (args === void 0) { args = { event: {}, error: null }; }
|
|
909
|
+
if (args === void 0) { args = { event: {}, error: null, oldElementValue: '', newElementValue: '' }; }
|
|
897
910
|
return this.trigger(INPUT_END, utils_2.extend(args, {
|
|
898
911
|
value: this.value
|
|
899
912
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function n(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},i[t].call(e.exports,e,e.exports,n),e.l=!0,e)).exports}var i,s;i=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var i=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},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=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!e.length)return t;var n,s=e.shift();if(o(t)&&o(s))for(var a in s)n=s[a],n instanceof HTMLElement?t[a]=s[a]:!o(s[a])||s[a]instanceof Date?r.extend(t,((n={})[a]=s[a],n)):(t[a]&&o(t[a])||r.extend(t,((n={})[a]={},n)),r.deepExtend(t[a],s[a]));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=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 r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var p=i(1),m=i(3);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)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),s={events:{}};function a(t){this.options=n.extend({},s,t)}a.prototype.destroy=function(){},a.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!n.isFunction(this.options.events[t])&&(this.options.events[t](n.extend(i,e,{sender:this})),i.defaultPrevented)},e.Observable=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var $=i(2),o=i(8),tt=i(4),et=i(0),h=i(1),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?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,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=$.getDate(new Date),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:t}),r)this._value=$.cloneDate(r);else{this._value=$.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.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!==h.Constants.defaultLocaleId){t=n.name;break}}return t},enumerable:!0,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},s.prototype.setValue=function(t){t?$.isEqual(t,this._value)||(this._value=$.cloneDate(t),this.modifyExisting(!0)):(this._value=$.getDate(new Date),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 $.cloneDate(this.value)},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=(et.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(n+=tt.padZero(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),n+=tt.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(et.isPresent(t)&&et.isPresent(e)&&0!==e){var i,n=$.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":n.setFullYear(n.getFullYear()+e);break;case"M":n=$.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":n.setHours(n.getHours()+12*e),s=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||n.getFullYear(),c=l.M.value||n.getMonth(),d=l.d.value||l.E.value||n.getDate(),p=l.h.value||l.H.value||n.getHours(),m=l.m.value||n.getMinutes(),g=l.s.value||n.getSeconds(),l=l.S.value||n.getMilliseconds();switch(t){case"y":u+=e;break;case"M":c+=e;break;case"d":case"E":d+=e}if("M"===t){if((c<0||11<c)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(c=c<0?et.clamp(c%11+1+11,0,11):(v=et.isPresent(h)?c:(e-1)%12,et.clamp(v,0,11)),c=et.clamp(c,0,11)),c=et.clamp(c,0,11)}else if("d"===t)if(o){if(d<=0||31<d)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if(et.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(v=e<0?et.isPresent(h)?d:31-Math.abs(e%31)+1:et.isPresent(h)?d:e%31,et.clamp(v,1,31)),d=et.clamp(d,1,31)}var o=$.createDate(u,c,d,p,m,g,l),h=a||r?this.modifyDateSymbolWithValue(n,t,a?c:d):null,v=et.areDatePartsEqualTo(o,u,c,d,p,m,g,l);this.getValue()&&et.areDatePartsEqualTo(o,u,c,d,p,m,g,l)?(n=$.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(this.resetInvalidDateSymbol(t),n=$.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),n=$.cloneDate(h)):(i=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),n=$.cloneDate(h)):(i=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(this.value),startDateOffset:e,startDate:$.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.cycleSegmentValue,s=t.rawTextValue,j=t.isDeleting,a=t.originalFormat,r=!n,t=this.dateFormatString(this.value,this.format),o=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),l=t.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:r&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length}),hasInvalidDatePart:!1};if(!i){if(!r)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1});for(h=0;h<o.length;h++){var p=o[h].literal,L=s.startsWith(p),K=s.endsWith(p),p=0<=s.indexOf(p+p);if(L||K||p)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1})}}var m=this.intl.formatDate(this.value,this.format,this.localeId),W=t.symbols,g=!1,v="",f="",y="",D="",E="",P="",b="";for(h=0;h<l.length;h++)b+=l[h].text;var n=this.format===W||this.format===b||this.format===a||this.format.length===a.length,S=(n?b:a).indexOf(e),H=(n?b:a).lastIndexOf(e)-S+1,B=a.length-s.length;if(r||!r&&!this.autoCorrectParts){for(h=0;h<m.length;h++)W[h]===e?(f+=this.getExisting(e)?m[h]:"0",0<B&&!(y.length+B<H)||(y+=s[h]||""),g=!0):g?(P+=m[h],E+=m[h]):(v+=m[h],D+=m[h]);if(n&&(b.length<s.length?y+=i:j||(a.length,s.length),y.length>H))return et.extend(d,{value:null,switchToNext:!1});if(!n||!this.autoCorrectParts){for(P=v=y=f="",g=!1,h=0;h<a.length;h++)a[h]===e?(f+=this.getExisting(e)?m[h]||"":"0",0<B&&!(y.length+B<H)||(y+=s[h]||""),g=!0):g?P+=s[h-B]||"":v+=s[h]||"";a.length<s.length&&(y+=i)}}if(!r)if(this.autoCorrectParts)for(P=v=y=f="",g=!1,h=0;h<m.length;h++)W[h]===e?(f+=this.getExisting(e)?m[h]:"0",g=!0):g?P+=m[h]:v+=m[h];else f=N?y:f;var M=null,R=this.matchMonth(i),S=this.matchDayPeriod(i,e),I="0"===i,Z=this.leadingZero||{},t=(I?("0"===y&&(y=f),0!==et.parseToInt(N?i:(r?y:f)+i)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(t.partMap,e)),U=t?t.pattern:null,Y=this.patternLength(U)||U.length;if(r&&j&&!y)this.setExisting(e,!1);else{for(var t=f.length-3,z=!0,x=r?y:f,h=Math.max(0,t);h<=f.length&&z;h++){x=N?i:r?y:f.substring(h)+i,!r&&this.autoCorrectParts||(z=!1,x=tt.unpadZero(x),x=tt.padZero(Y-x.length)+x);var q,G=parseInt(x,10),M=this.intl.parseDate(v+x+P,this.format,this.localeId),J=!1,O=(r&&!et.isValidDate(M)&&this.autoCorrectParts&&(M=this.intl.parseDate(D+x+E,this.format,this.localeId),J=!0),!isNaN(parseInt(i,10))||r&&j&&""===i);if(!M&&!isNaN(G)&&O&&this.autoCorrectParts&&("M"!==e||R||-1<(O=G-1)&&O<12&&((M=$.cloneDate(this.value)).setMonth(O),M.getMonth()!==O)&&(M=$.lastDayOfMonth($.addMonths(M,-1))),"y"===e)&&(M=$.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),r&&et.isValidDate(M)||!r&&M)&&this.date&&M.getDate()!==this.value.getDate()&&(M=$.lastDayOfMonth($.addMonths(M,-1))),r&&et.isValidDate(M)||!r&&M)return G=this.peek(x,U),O=this.intl.parseDate(J?""+D+G+E:""+v+G+P,this.format,this.localeId),J=((this.leadingZero||{})[e]||0)+tt.unpadZero(x).length>=Y,q=null===O||(Z[e]?U.length<=x.length:J),this.shouldNormalizeCentury()&&(M=this.normalizeCentury(M)),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")),this.hasInvalidDatePart())||this.markDatePartsAsExisting(),et.extend(d,{value:this.value,switchToNext:q})}if(R&&(M=this.intl.parseDate(v+R+P,this.format,this.localeId)))return this._value=M,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!1});if(S&&(M=this.intl.parseDate(v+S+P,this.format)||this.intl.parseDate(D+S+E,this.format)))return this._value=M,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!0});if(I&&this.setExisting(e,!1),!this.autoCorrectParts){var Q,X,w,C,F,V,k,_,T,A,t=void 0,S=r?y:x,I=et.parseToInt(S);if(et.isNumber(I))return"d"===e&&(I<=0||31<I)||"M"===e&&(I<0||11<I)?et.extend(d,{value:null,switchToNext:!1}):(t="M"===e?I-1:I,Q="M"===e,X="d"===e,w=$.cloneDate(this._value),k=(F=this._partiallyInvalidDate.invalidDateParts||{}).y.value||w.getFullYear(),C=Q?t:F.M.value||w.getMonth(),t=X?t:F.d.value||F.E.value||w.getDate(),_=F.h.value||F.H.value||w.getHours(),T=F.m.value||w.getMinutes(),A=F.s.value||w.getSeconds(),F=F.S.value||w.getMilliseconds(),V=$.createDate(k,C,t,_,T,A,F),k=et.areDatePartsEqualTo(V,k,C,t,_,T,A,F),_=Q||X?this.modifyDateSymbolWithValue(w,e,Q?C:t):null,T=!1,Q&&_?_.getMonth()===C?this.getExisting("d")?k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:C,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=$.cloneDate(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),w=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:C,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):X&&_&&(_.getDate()===t?this.getExisting("M")?k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:t,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),w=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:t,date:$.cloneDate(this.value),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),r&&!et.isValidDate(M)?(A=this.intl.parseDate(D+x+E,this.format,this.localeId),et.isValidDate(A)&&(this._value=A)):this._value=w,this.getValue()&&this.resetInvalidDate()),q=!1,q="M"===e?2<=I||2<=S.length:n?S.length===H:S.length>H,et.extend(d,{value:null,switchToNext:q,hasInvalidDatePart:T}))}}return et.extend(d,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(tt.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 et.isPresent(t)?(e=et.cropTwoDigitYear(t),i=this.getNormalizedCenturyBase(e),et.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 tt.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]]||h.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=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?i=o[c][l]+i:(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),i=tt.padZero(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):(i=tt.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]&&et.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]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!0)}),i},s.prototype.modifyDateSymbolWithOffset=function(t,e,i){var n=$.cloneDate(t),s=!1;switch(e){case"y":n.setFullYear(n.getFullYear()+i);break;case"M":n=$.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=$.cloneDate(t);switch(e){case"y":n.setFullYear(i);break;case"M":n=$.addMonths(t,i-t.getMonth());break;case"d":case"E":n.setDate(i);break;case"h":case"H":n.setHours(i);break;case"m":n.setMinutes(i);break;case"s":n.setSeconds(i);break;case"S":n.setMilliseconds(i);break;case"a":n.setHours(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},e.DateObject=s},function(t,e){t.exports=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(10),a=i(9),M=i(4),I=i(7),x=i(3),O=i(0),r=i(6),w=i(5),C=i(2),F=i(1),o={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={}).valueChange=null,i.input=null,i.inputEnd=null,i.focus=null,i.focusEnd=null,i.blur=null,i.blurEnd=null,i.keydown=null,i.mousewheel=null,i.change=null,i),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:F.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1},i=(n=r.Observable,s.__extends(l,n),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var i=O.isValidDate(this.options.value)?C.cloneDate(this.options.value):new Date(e.formattedValue);O.isValidDate(i)||(i=null),this.element=t,this.options=O.extend({},o,e,{steps:s.__assign({},o.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=w.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,n.prototype.destroy.call(this)},l.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",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("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=O.extend({},this.options,t,{steps:s.__assign({},o.steps,t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.setDateObjectOptions=function(){var t;this.dateObject&&(t=this.getDateObjectOptions(),this.dateObject.setOptions(t))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===w.DateInputInteractionMode.Caret},l.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},l.prototype.onElementDragStart=function(t){t.preventDefault()},l.prototype.onElementDrop=function(t){t.preventDefault()},l.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},l.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},l.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=O.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)))},l.prototype.onElementInput=function(t){if(this.triggerInput({event:t}),this.element&&this.dateObject){var e=this.switchedPartOnPreviousKeyAction;if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var i=this.keyDownEvent||{},n=i.keyCode===I.KeyCode.BACKSPACE||i.key===x.Key.BACKSPACE,s=i.keyCode===I.KeyCode.DELETE||i.key===x.Key.DELETE,i=this.interactionMode,a=(!this.options.allowCaretMode||i===w.DateInputInteractionMode.Caret||s||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=w.DateInputInteractionMode.Caret:this.interactionMode=w.DateInputInteractionMode.Selection,this.isInCaretMode());if(a&&this.keyDownEvent.key===x.Key.SPACE)this.restorePreviousInputEventState();else{var r=this.dateObject&&this.dateObject.getValue(),o=this.dateObject?this.dateObject.value:null,l=this.dateObject.getTextAndFormat(),h=l.text,l=l.format,l=(this.currentFormat=l,a&&(n||s||i===w.DateInputInteractionMode.Caret)?this.previousElementValue:h),i=this.elementValue,u=M.approximateStringMatching({oldText:l,newText:i,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:a,keyEvent:this.keyDownEvent});if(u&&u.length&&u[0]&&u[0][1]!==F.Constants.formatSeparator&&(this.switchedPartOnPreviousKeyAction=!1),!a||u&&0!==u.length){if(a&&1===u.length){if(!u[0]||!u[0][0])return void this.restorePreviousInputEventState();if(a&&u[0]&&(u[0][0]===F.Constants.formatSeparator||u[0][1]===F.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var h=1===u.length&&u[0][1]===F.Constants.formatSeparator,c=[],d=!1,p=null;if(!h)for(var m=0;m<u.length;m++){var g=this.dateObject.parsePart({symbol:u[m][0],currentChar:u[m][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||s,originalFormat:this.currentFormat});c.push(g),g.value||(p={type:"parse"}),d=g.switchToNext}this.options.autoSwitchParts||(d=!1),this.resetSegmentValue=!1;var v,l=this.options.format===this.currentFormat||O.isPresent(this.options.format)&&1<this.options.format.length,i=c[c.length-1],f=i&&!O.isPresent(i.value),y=a&&(n||s)&&f,D=!!i&&i.resetPart,E=this.dateObject.getValue(),P=!C.isEqual(r,E),b=this.dateObject.value,S=this.selection;a?(v=u&&0<u.length?u[0][0]:null,v=this.dateObject.getLeadingZero()[v],u.length&&u[0][0]!==F.Constants.formatSeparator?d?(this.forceUpdateWithSelection(),this.switchDateSegment(1)):D?(D=this.currentFormat[S.start])?(this.forceUpdate(),this.setSelection(this.selectionBySymbol(D))):this.restorePreviousInputEventState():y?(this.forceUpdate(),u.length&&u[0][0]!==F.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(u[0][0]))):f?"0"===t.data&&v||(O.isPresent(r)&&!O.isPresent(E)?this.restorePreviousInputEventState():!O.isPresent(r)&&O.isPresent(E)?this.forceUpdateWithSelection():O.isPresent(r)&&O.isPresent(E)?P?this.forceUpdateWithSelection():this.restorePreviousInputEventState():O.isPresent(r)||O.isPresent(E)?o===b&&this.restorePreviousInputEventState():this.forceUpdateWithSelection()):l||this.forceUpdateWithSelection():!this.options.autoSwitchParts&&u[0][1]===F.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(u[0][0]))):(this.forceUpdate(),u.length&&u[0][0]!==F.Constants.formatSeparator&&this.setSelection(this.selectionBySymbol(u[0][0])),this.options.autoSwitchParts?h?(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):d&&(this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0):i&&i.switchToNext?this.resetSegmentValue=!0:h&&(this.resetSegmentValue=!0,e||this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!0),n&&this.options.selectPreviousSegmentOnBackspace&&this.switchDateSegment(-1)),this.tryTriggerValueChange({oldValue:r,event:t}),this.triggerInputEnd({event:t,error:p}),a&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=w.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},l.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.options.autoFill&&this.autoFill(),this.interactionMode=w.DateInputInteractionMode.None,this.switchedPartOnPreviousKeyAction=!1,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},l.prototype.onElementChange=function(t){this.triggerChange({event:t})},l.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){var e=this.selection,i=e.start,e=e.end;if(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.previousElementSelection={start:i,end:e},this.keyEventMatchesAutoSwitchKeys(t)){i=t.keyCode===I.KeyCode.TAB;if(!i)return t.preventDefault(),void this.switchDateSegment(1);var e=this.selection,n=e.start,e=e.end;if(t.shiftKey&&i?this.switchDateSegment(-1):this.switchDateSegment(1),n!==this.selection.start||e!==this.selection.end)return void t.preventDefault()}var s=this.currentFormat[this.selection.start],a=this.getStepFromSymbol(s),r=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===I.KeyCode.TAB)){switch(t.keyCode){case I.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case I.KeyCode.ARROW_UP:this.modifyDateSegmentValue(a,s,event),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case I.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case I.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-a,s,event),this.switchedPartOnPreviousKeyAction=!(r=!0);break;case I.KeyCode.ENTER:break;case I.KeyCode.HOME:this.selectNearestSegment(0),this.switchedPartOnPreviousKeyAction=!(r=!0),this.resetSegmentValue=!0;break;case I.KeyCode.END:this.selectNearestSegment(this.elementValue.length),this.switchedPartOnPreviousKeyAction=!(r=!0),this.resetSegmentValue=!0;break;default:return}r&&t.preventDefault()}}},l.prototype.onElementPaste=function(){this.isPasteInProgress=!0},l.prototype.onElementMouseWheel=function(t){this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((t=t).shiftKey?this.switchDateSegment(0<(t.wheelDelta||-t.detail)?-1:1):this.modifyDateSegmentValue(0<(t.wheelDelta||-t.detail)?1:-1),t.returnValue=!1,t.preventDefault&&t.preventDefault(),t.stopPropagation)&&t.stopPropagation()},l.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,i=(O.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(l.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:F.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:F.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.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:!0,configurable:!0}),l.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),t.start!==t.end)&&(this.interactionMode=w.DateInputInteractionMode.Selection)},l.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}},l.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]!==F.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}if(0<=n&&this.currentFormat[n]!==F.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}}return e},l.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])!==F.Constants.formatSeparator&&a!==n){i=r,s=a;break}}else for(r=i+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==F.Constants.formatSeparator&&a!==n){i=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=w.DateInputInteractionMode.Selection)}this.interactionMode=w.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=w.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]===F.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==F.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=w.DateInputInteractionMode.None}}},l.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=O.millisecondDigitsInFormat(this.inputFormat),a=O.millisecondStepFor(s)),this.dateObject.modifyPart(e,a*t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!C.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},l.prototype.triggerValueChange=function(t){return this.trigger("valueChange",O.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",O.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",O.extend(t=void 0===t?{event:{},error:null}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",O.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",O.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",O.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",O.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",O.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",O.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",O.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},l.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})},l.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},l.prototype.setElementValue=function(t){this.element.value=t},l.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}},l.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},l.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},l.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,t=t.end;this.setSelection({start:e||0,end:t||0})},l.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},l.prototype.verifyValue=function(t){if(t&&!O.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,e=this.dateObject.getTextAndFormat(e),i=e.text,e=e.format,e=(this.currentFormat=e,this.currentText=i,this.options.hasPlaceholder||O.isPresent(this.options.placeholder)),n=!this.isActive&&e&&!this.dateObject.hasValue(),e=(e&&O.isPresent(this.options.placeholder)&&(t.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e)},l.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&&(O.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.selectionEnd])}catch(t){n=[]}return n}},l.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])}},l.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)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=(this.options.value=t,this.createDateObject());return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new a.DateObject(O.extend({},t))},l.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}},l.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())},l.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())},l);function l(t,e){var i=n.call(this,e)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=w.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(t,e),i}e.DateInput=i},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=i(11),s=(e.DateInput=i.DateInput,e);for(n in s)a(n,s[n])}],s={},n.m=i,n.c=s,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}}});
|
|
1
|
+
System.register("@progress/kendo-dateinputs-common",["@progress/kendo-date-math","tslib"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function n(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},i[t].call(e.exports,e,e.exports,n),e.l=!0,e)).exports}var i,s;i=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var i=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},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=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!e.length)return t;var n,s=e.shift();if(o(t)&&o(s))for(var a in s)n=s[a],n instanceof HTMLElement?t[a]=s[a]:!o(s[a])||s[a]instanceof Date?r.extend(t,((n={})[a]=s[a],n)):(t[a]&&o(t[a])||r.extend(t,((n={})[a]={},n)),r.deepExtend(t[a],s[a]));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=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 r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var p=i(1),m=i(3);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)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),s={events:{}};function a(t){this.options=n.extend({},s,t)}a.prototype.destroy=function(){},a.prototype.trigger=function(t,e){void 0===e&&(e={});var i={defaultPrevented:!1,preventDefault:function(){i.defaultPrevented=!0}};return!!n.isFunction(this.options.events[t])&&(this.options.events[t](n.extend(i,e,{sender:this})),i.defaultPrevented)},e.Observable=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!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}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var $=i(2),o=i(8),tt=i(4),et=i(0),h=i(1),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?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,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=$.getDate(new Date),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:t}),r)this._value=$.cloneDate(r);else{this._value=$.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.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!==h.Constants.defaultLocaleId){t=n.name;break}}return t},enumerable:!0,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},s.prototype.setValue=function(t){t?$.isEqual(t,this._value)||(this._value=$.cloneDate(t),this.modifyExisting(!0)):(this._value=$.getDate(new Date),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 $.cloneDate(this.value)},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=(et.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(n+=tt.padZero(o.length-l.length)+l,r+=o.length-1):n+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),n+=tt.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(et.isPresent(t)&&et.isPresent(e)&&0!==e){var i,n=$.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":n.setFullYear(n.getFullYear()+e);break;case"M":n=$.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":n.setHours(n.getHours()+12*e),s=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||n.getFullYear(),c=l.M.value||n.getMonth(),d=l.d.value||l.E.value||n.getDate(),p=l.h.value||l.H.value||n.getHours(),m=l.m.value||n.getMinutes(),g=l.s.value||n.getSeconds(),l=l.S.value||n.getMilliseconds();switch(t){case"y":u+=e;break;case"M":c+=e;break;case"d":case"E":d+=e}if("M"===t){if((c<0||11<c)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(c=c<0?et.clamp(c%11+1+11,0,11):(v=et.isPresent(h)?c:(e-1)%12,et.clamp(v,0,11)),c=et.clamp(c,0,11)),c=et.clamp(c,0,11)}else if("d"===t)if(o){if(d<=0||31<d)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if(et.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(v=e<0?et.isPresent(h)?d:31-Math.abs(e%31)+1:et.isPresent(h)?d:e%31,et.clamp(v,1,31)),d=et.clamp(d,1,31)}var o=$.createDate(u,c,d,p,m,g,l),h=a||r?this.modifyDateSymbolWithValue(n,t,a?c:d):null,v=et.areDatePartsEqualTo(o,u,c,d,p,m,g,l);this.getValue()&&et.areDatePartsEqualTo(o,u,c,d,p,m,g,l)?(n=$.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(this.resetInvalidDateSymbol(t),n=$.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),n=$.cloneDate(h)):(i=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(i=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(n=$.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),n=$.cloneDate(h)):(i=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(this.value),startDateOffset:e,startDate:$.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.cycleSegmentValue,s=t.rawTextValue,j=t.isDeleting,a=t.originalFormat,r=!n,t=this.dateFormatString(this.value,this.format),o=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),l=t.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:r&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length}),hasInvalidDatePart:!1};if(!i){if(!r)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1});for(h=0;h<o.length;h++){var p=o[h].literal,L=s.startsWith(p),K=s.endsWith(p),p=0<=s.indexOf(p+p);if(L||K||p)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1})}}var m=this.intl.formatDate(this.value,this.format,this.localeId),W=t.symbols,g=!1,v="",f="",y="",D="",E="",P="",b="";for(h=0;h<l.length;h++)b+=l[h].text;var n=this.format===W||this.format===b||this.format===a||this.format.length===a.length,S=(n?b:a).indexOf(e),H=(n?b:a).lastIndexOf(e)-S+1,B=a.length-s.length;if(r||!r&&!this.autoCorrectParts){for(h=0;h<m.length;h++)W[h]===e?(f+=this.getExisting(e)?m[h]:"0",0<B&&!(y.length+B<H)||(y+=s[h]||""),g=!0):g?(P+=m[h],E+=m[h]):(v+=m[h],D+=m[h]);if(n&&(b.length<s.length?y+=i:j||(a.length,s.length),y.length>H))return et.extend(d,{value:null,switchToNext:!1});if(!n||!this.autoCorrectParts){for(P=v=y=f="",g=!1,h=0;h<a.length;h++)a[h]===e?(f+=this.getExisting(e)?m[h]||"":"0",0<B&&!(y.length+B<H)||(y+=s[h]||""),g=!0):g?P+=s[h-B]||"":v+=s[h]||"";a.length<s.length&&(y+=i)}}if(!r)if(this.autoCorrectParts)for(P=v=y=f="",g=!1,h=0;h<m.length;h++)W[h]===e?(f+=this.getExisting(e)?m[h]:"0",g=!0):g?P+=m[h]:v+=m[h];else f=N?y:f;var M=null,R=this.matchMonth(i),S=this.matchDayPeriod(i,e),I="0"===i,Z=this.leadingZero||{},t=(I?("0"===y&&(y=f),0!==et.parseToInt(N?i:(r?y:f)+i)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(t.partMap,e)),U=t?t.pattern:null,Y=this.patternLength(U)||U.length;if(r&&j&&!y)this.setExisting(e,!1);else{for(var t=f.length-3,z=!0,x=r?y:f,h=Math.max(0,t);h<=f.length&&z;h++){x=N?i:r?y:f.substring(h)+i,!r&&this.autoCorrectParts||(z=!1,x=tt.unpadZero(x),x=tt.padZero(Y-x.length)+x);var q,G=parseInt(x,10),M=this.intl.parseDate(v+x+P,this.format,this.localeId),J=!1,O=(r&&!et.isValidDate(M)&&this.autoCorrectParts&&(M=this.intl.parseDate(D+x+E,this.format,this.localeId),J=!0),!isNaN(parseInt(i,10))||r&&j&&""===i);if(!M&&!isNaN(G)&&O&&this.autoCorrectParts&&("M"!==e||R||-1<(O=G-1)&&O<12&&((M=$.cloneDate(this.value)).setMonth(O),M.getMonth()!==O)&&(M=$.lastDayOfMonth($.addMonths(M,-1))),"y"===e)&&(M=$.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),r&&et.isValidDate(M)||!r&&M)&&this.date&&M.getDate()!==this.value.getDate()&&(M=$.lastDayOfMonth($.addMonths(M,-1))),r&&et.isValidDate(M)||!r&&M)return G=this.peek(x,U),O=this.intl.parseDate(J?""+D+G+E:""+v+G+P,this.format,this.localeId),J=((this.leadingZero||{})[e]||0)+tt.unpadZero(x).length>=Y,q=null===O||(Z[e]?U.length<=x.length:J),this.shouldNormalizeCentury()&&(M=this.normalizeCentury(M)),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")),this.hasInvalidDatePart())||this.markDatePartsAsExisting(),et.extend(d,{value:this.value,switchToNext:q})}if(R&&(M=this.intl.parseDate(v+R+P,this.format,this.localeId)))return this._value=M,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!1});if(S&&(M=this.intl.parseDate(v+S+P,this.format)||this.intl.parseDate(D+S+E,this.format)))return this._value=M,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!0});if(I&&this.setExisting(e,!1),!this.autoCorrectParts){var Q,X,w,C,F,V,k,_,T,A,t=void 0,S=r?y:x,I=et.parseToInt(S);if(et.isNumber(I))return"d"===e&&(I<=0||31<I)||"M"===e&&(I<0||11<I)?et.extend(d,{value:null,switchToNext:!1}):(t="M"===e?I-1:I,Q="M"===e,X="d"===e,w=$.cloneDate(this._value),k=(F=this._partiallyInvalidDate.invalidDateParts||{}).y.value||w.getFullYear(),C=Q?t:F.M.value||w.getMonth(),t=X?t:F.d.value||F.E.value||w.getDate(),_=F.h.value||F.H.value||w.getHours(),T=F.m.value||w.getMinutes(),A=F.s.value||w.getSeconds(),F=F.S.value||w.getMilliseconds(),V=$.createDate(k,C,t,_,T,A,F),k=et.areDatePartsEqualTo(V,k,C,t,_,T,A,F),_=Q||X?this.modifyDateSymbolWithValue(w,e,Q?C:t):null,T=!1,Q&&_?_.getMonth()===C?this.getExisting("d")?k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:C,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),w=$.cloneDate(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),w=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:C,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):X&&_&&(_.getDate()===t?this.getExisting("M")?k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:t,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(w=$.cloneDate(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),w=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:t,date:$.cloneDate(this.value),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),r&&!et.isValidDate(M)?(A=this.intl.parseDate(D+x+E,this.format,this.localeId),et.isValidDate(A)&&(this._value=A)):this._value=w,this.getValue()&&this.resetInvalidDate()),q=!1,q="M"===e?2<=I||2<=S.length:n?S.length===H:S.length>H,et.extend(d,{value:null,switchToNext:q,hasInvalidDatePart:T}))}}return et.extend(d,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(tt.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 et.isPresent(t)?(e=et.cropTwoDigitYear(t),i=this.getNormalizedCenturyBase(e),et.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 tt.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]]||h.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=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?i=o[c][l]+i:(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),i=tt.padZero(h.length-u.length)+u+i,d=h.length-1,r=u.length-h.length)):(i=tt.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]&&et.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]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(i=!0)}),i},s.prototype.modifyDateSymbolWithOffset=function(t,e,i){var n=$.cloneDate(t),s=!1;switch(e){case"y":n.setFullYear(n.getFullYear()+i);break;case"M":n=$.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=$.cloneDate(t);switch(e){case"y":n.setFullYear(i);break;case"M":n=$.addMonths(t,i-t.getMonth());break;case"d":case"E":n.setDate(i);break;case"h":case"H":n.setHours(i);break;case"m":n.setMinutes(i);break;case"s":n.setSeconds(i);break;case"S":n.setMilliseconds(i);break;case"a":n.setHours(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},e.DateObject=s},function(t,e){t.exports=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,s=i(10),a=i(9),I=i(4),x=i(7),O=i(3),w=i(0),r=i(6),C=i(5),F=i(2),V=i(1),o={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={}).valueChange=null,i.input=null,i.inputEnd=null,i.focus=null,i.focusEnd=null,i.blur=null,i.blurEnd=null,i.keydown=null,i.mousewheel=null,i.change=null,i),selectNearestSegmentOnFocus:!1,selectPreviousSegmentOnBackspace:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:V.Constants.twoDigitYearMax,autoCorrectParts:!0,autoFill:!1},i=(n=r.Observable,s.__extends(l,n),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var i=w.isValidDate(this.options.value)?F.cloneDate(this.options.value):new Date(e.formattedValue);w.isValidDate(i)||(i=null),this.element=t,this.options=w.extend({},o,e,{steps:s.__assign({},o.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()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,n.prototype.destroy.call(this)},l.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",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("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=w.extend({},this.options,t,{steps:s.__assign({},o.steps,t.steps)}),this.setDateObjectOptions(),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.setDateObjectOptions=function(){var t;this.dateObject&&(t=this.getDateObjectOptions(),this.dateObject.setOptions(t))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===C.DateInputInteractionMode.Caret},l.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},l.prototype.onElementDragStart=function(t){t.preventDefault()},l.prototype.onElementDrop=function(t){t.preventDefault()},l.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},l.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},l.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=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)))},l.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,h=h.format,h=(this.currentFormat=h,r&&(s||a||n===C.DateInputInteractionMode.Caret)?this.previousElementValue:u),n=this.elementValue,c=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||w.isPresent(this.options.format)&&1<this.options.format.length,n=d[d.length-1],y=n&&!w.isPresent(n.value),D=r&&(s||a)&&y,E=!!n&&n.resetPart,P=this.dateObject.getValue(),b=!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||(w.isPresent(o)&&!w.isPresent(P)?this.restorePreviousInputEventState():!w.isPresent(o)&&w.isPresent(P)?this.forceUpdateWithSelection():w.isPresent(o)&&w.isPresent(P)?b?this.forceUpdateWithSelection():this.restorePreviousInputEventState():w.isPresent(o)||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()}}}},l.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}))},l.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}))},l.prototype.onElementChange=function(t){this.triggerChange({event:t})},l.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()}}},l.prototype.onElementPaste=function(){this.isPasteInProgress=!0},l.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(),e.stopPropagation&&e.stopPropagation(),i!==this.elementValue)&&this.triggerInputEnd({event:t,error:null,newElementValue:this.elementValue,oldElementValue:i})},l.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,i=(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(l.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:V.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:V.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.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:!0,configurable:!0}),l.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&(this.element.setSelectionRange(t.start,t.end),t.start!==t.end)&&(this.interactionMode=C.DateInputInteractionMode.Selection)},l.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}},l.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},l.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}}},l.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=w.millisecondDigitsInFormat(this.inputFormat),a=w.millisecondStepFor(s)),this.dateObject.modifyPart(e,a*t),this.tryTriggerValueChange({oldValue:n,event:i}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!F.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},l.prototype.triggerValueChange=function(t){return this.trigger("valueChange",w.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",w.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",w.extend(t=void 0===t?{event:{},error:null,oldElementValue:"",newElementValue:""}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",w.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",w.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",w.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",w.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",w.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",w.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",w.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},l.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})},l.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},l.prototype.setElementValue=function(t){this.element.value=t},l.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}},l.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},l.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},l.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,t=t.end;this.setSelection({start:e||0,end:t||0})},l.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},l.prototype.verifyValue=function(t){if(t&&!w.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.element,e=this.isActive?this.inputFormat:this.displayFormat,e=this.dateObject.getTextAndFormat(e),i=e.text,e=e.format,e=(this.currentFormat=e,this.currentText=i,this.options.hasPlaceholder||w.isPresent(this.options.placeholder)),n=!this.isActive&&e&&!this.dateObject.hasValue(),e=(e&&w.isPresent(this.options.placeholder)&&(t.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e)},l.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&&(w.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),n=[s.selectionStart,s.selectionEnd])}catch(t){n=[]}return n}},l.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])}},l.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)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=(this.options.value=t,this.createDateObject());return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(){var t=this.getDateObjectOptions();return new a.DateObject(w.extend({},t))},l.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}},l.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())},l.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())},l);function l(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},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=i(11),s=(e.DateInput=i.DateInput,e);for(n in s)a(n,s[n])}],s={},n.m=i,n.c=s,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}}});
|