@progress/kendo-dateinputs-common 0.2.0-dev.202301171717 → 0.2.0-dev.202301231327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoDateinputsCommon=e():t.KendoDateinputsCommon=e()}(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])?(t[u]||e.extend(t,((n={})[u]={},n)),e.deepExtend(t[u],l[u])):e.extend(t,((r={})[u]=l[u],r));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 M})),n.d(e,"durationInDecades",(function(){return w})),n.d(e,"durationInMonths",(function(){return P})),n.d(e,"durationInYears",(function(){return C})),n.d(e,"firstDayInWeek",(function(){return T})),n.d(e,"firstDayOfMonth",(function(){return I})),n.d(e,"firstDecadeOfCentury",(function(){return E})),n.d(e,"firstMonthOfYear",(function(){return x})),n.d(e,"firstYearOfDecade",(function(){return S})),n.d(e,"getDate",(function(){return _})),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}))},M=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},S=function(t){return b(t,(function(t){return t-t%10}))},w=function(t,e){return(S(e).getFullYear()-S(t).getFullYear())/10},P=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},C=function(t,e){return e.getFullYear()-t.getFullYear()},T=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},I=function(t){return s(t.getFullYear(),t.getMonth(),1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},O=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))},x=function(t){return O(t,0)},_=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(_(t),_(e))},k=function(t){return b(t,(function(t){return t-t%100+90}))},V=function(t){return O(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=_(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=e[a+e.length-n.length],h=e.substring(0,a+e.length-n.length),c=n.substring(0,a),d=[];if(h===c&&a>0)return d.push([o[a-1],c[a-1]]),d;if(0===h.indexOf(c)&&s&&(l.key===i.Key.DELETE||l.key===i.Key.BACKSPACE)||0===h.indexOf(c)&&!s&&(0===c.length||o[c.length-1]!==o[c.length])){var f="";s||1!==c.length||d.push([o[0],c[0]]);for(var p=c.length;p<h.length;p++)o[p]!==f&&o[p]!==r.Constants.formatSeparator&&(f=o[p],d.push([f,""]));return d}if(s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)||!s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)){var m=o[0];for(p=Math.max(0,h.length-1);p<o.length;p++)if(o[p]!==r.Constants.formatSeparator){m=o[p];break}return[[m,c[a-1]]]}return!s&&" "===c[c.length-1]||!s&&c[c.length-1]===u?[[o[a-1],r.Constants.formatSeparator]]:[[o[a-1],c[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",allowNulls:!1,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,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:f.Constants.twoDigitYearMax,autoCorrectParts:!0},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),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",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),e&&(this.unbindEvents(),this.init(this.element,this.options))},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;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.keyDownEvent||{},n=e.keyCode===s.KeyCode.BACKSPACE||e.key===l.Key.BACKSPACE,r=e.keyCode===s.KeyCode.DELETE||e.key===l.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var i=this.interactionMode;!this.options.allowCaretMode||i===c.DateInputInteractionMode.Caret||r||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var o=this.isInCaretMode();if(o&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var h=this.dateObject&&this.dateObject.getValue(),p=this.dateObject.getTextAndFormat(),m=p.text,g=p.format;this.currentFormat=g;var v="";v=o&&(n||r||i===c.DateInputInteractionMode.Caret)?this.previousElementValue:m;var y=this.elementValue,D=a.approximateStringMatching({oldText:v,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:o,keyEvent:this.keyDownEvent}),b=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&o&&this.currentFormat.length!==this.elementValue.length&&b&&b.length>0&&b!==f.Constants.formatSeparator&&(D&&0!==D.length?D[0]&&D[0][0]!==f.Constants.formatSeparator&&D[0][0]!==b&&(D[0][0]=b,D[0][1]=t.data||""):((D=[])[0][0]=b,D[0][1]=t.data||"")),!o||D&&0!==D.length){if(o&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(o&&D[0]&&(D[0][0]===f.Constants.formatSeparator||D[0][1]===f.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var E=1===D.length&&D[0][1]===f.Constants.formatSeparator,M=[],S=!1;if(!E)for(var w=0;w<D.length;w++){var P=this.dateObject.parsePart({symbol:D[w][0],currentChar:D[w][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||r,originalFormat:this.currentFormat});M.push(P),S=P.switchToNext}this.options.autoSwitchParts||(S=!1),this.resetSegmentValue=!1;var C,T=M[M.length-1],I=T&&!T.value,O=o&&(n||r)&&I,x=!!T&&T.resetPart,_=!!T&&T.hasInvalidDatePart,F=!d.isEqual(h,this.dateObject.value),j=this.selection;if((!o||O||x)&&(x&&(C=this.currentFormat[j.start]),this.forceUpdate()),D.length&&D[0][0]!==f.Constants.formatSeparator)if(!o||O||x)C?this.setSelection(this.selectionBySymbol(C)):(this.options.autoSwitchParts||D[0][1]!==f.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0]));else if(o)if(F&&u.isPresent(this.dateObject.getValue())||!F&&S&&u.isPresent(this.dateObject.getValue())){if(S)this.switchDateSegment(1);else if(this.options.format.length!==this.currentFormat.length&&b&&"y"!==b){var k=this.elementValue.length;this.forceUpdate();var V=this.elementValue.length-k;this.setSelection({start:j.start+V,end:j.start+V})}}else if(I){var U=this.dateObject.getLeadingZero()[b];S?this.switchDateSegment(1):"0"===t.data&&U||this.restorePreviousInputEventState()}if(S||!o||n||r||x||!I)this.options.autoSwitchParts&&(S||E)&&(o||this.switchDateSegment(1));else if(F)this.currentFormat.length===this.elementValue.length||i!==c.DateInputInteractionMode.Caret&&F||(i!==c.DateInputInteractionMode.Caret?(C=this.currentFormat[j.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(C))):_||this.restorePreviousInputEventState());else{U=this.dateObject.getLeadingZero()[b];"0"===t.data&&U||_||this.restorePreviousInputEventState()}this.tryTriggerValueChange({oldValue:h,event:t}),this.triggerInputEnd({event:t}),o&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,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.interactionMode=c.DateInputInteractionMode.None,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;this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:r},this.previousElementSelection={start:n,end:r};var i=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(i.indexOf(t.keyCode.toString())>=0||i.indexOf(t.keyCode)>=0||i.indexOf(t.key.toLowerCase().trim())>=0){var o=i.indexOf(l.Key.TAB.toLowerCase().trim())>=0||i.indexOf(s.KeyCode.TAB)>=0||i.indexOf(s.KeyCode.TAB.toString())>=0;if(!o)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,u=a.start,h=a.end;if(t.shiftKey&&o?this.switchDateSegment(-1):this.switchDateSegment(1),u!==this.selection.start||h!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],d=this.getStepFromSymbol(c),f=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),f=!0;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(d,c,event),f=!0;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),f=!0;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-d,c,event),f=!0;break;case s.KeyCode.ENTER:break;case s.KeyCode.DELETE:case s.KeyCode.BACKSPACE:if(this.options.allowNulls){var p=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:p,event:t})}return f=!0,void(t.keyCode===s.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(s.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(l.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case l.Key.HOME:this.selectNearestSegment(0);break;case l.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}f&&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)},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-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],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){var r=this.value,i=1*t,o=this.caret();if("S"===(e=e||this.currentFormat[o[0]])&&!this.options.steps.millisecond){var a=u.millisecondDigitsInFormat(this.inputFormat);i=u.millisecondStepFor(a)}this.dateObject.modifyPart(e,i),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:{}}),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.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.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,r=this.dateObject.getTextAndFormat(n),i=r.text,o=r.format;this.currentFormat=o,this.currentText=i;var a=this.options.hasPlaceholder||u.isPresent(this.options.placeholder),s=!this.isActive&&a&&!this.dateObject.hasValue();a&&u.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var l=s?"":i;this.previousElementValue=this.elementValue,this.setElementValue(l),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},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,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new o.DateObject(u.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},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 M})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return P})),n.d(e,"__importDefault",(function(){return C})),n.d(e,"__classPrivateFieldGet",(function(){return T})),n.d(e,"__classPrivateFieldSet",(function(){return I})),n.d(e,"__classPrivateFieldIn",(function(){return O}));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 M(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 S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var w=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(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 w(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function T(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 I(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 O(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.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.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=u,this.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.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"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"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),M=s||l?this.modifyDateSymbolWithValue(i,t,s?f:p):null,S=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&&M?M.getMonth()===f?this.getExisting("d")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(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(M)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):l&&M&&(M.getDate()===p?this.getExisting("M")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(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(M)):(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,n=t.symbol,i=t.currentChar,s=t.resetSegmentValue,l=t.cycleSegmentValue,u=t.rawTextValue,h=t.isDeleting,c=t.originalFormat,d=!l,f=this.dateFormatString(this.value,this.format),p=f.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),m=f.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),g=0;g<p.length;g++){for(var v=p[g],y=0;y<v.pattern.length;y++)p[g+y]&&(p[g+y].literal=v.pattern[y]);g+=v.pattern.length-1}for(g=0;g<m.length;g++){for(v=m[g],y=0;y<v.pattern.length;y++)m[g+y]&&(m[g+y].text=v.pattern[y]);g+=v.pattern.length-1}var D={value:null,switchPart:!1,resetPart:d&&"M"===n&&f.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!i){if(!d)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(g=0;g<p.length;g++){var b=p[g].literal,E=u.startsWith(b),M=u.endsWith(b),S=u.indexOf(b+b)>=0;if(E||M||S)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),a.extend(D,{value:null,switchToNext:!1})}}var w=this.intl.formatDate(this.value,this.format,this.localeId),P=f.symbols,C=!1,T="",I="",O="",x="",_="",F="",j="";for(g=0;g<m.length;g++)j+=m[g].text;var k=this.format===P||this.format===j||this.format===c||this.format.length===c.length,V=(k?j:c).indexOf(n),U=(k?j:c).lastIndexOf(n)-V+1,N=0,A=c.length-u.length;if(d||!d&&!this.autoCorrectParts){for(g=0;g<w.length;g++){if(P[g]===n)I+=this.getExisting(n)?w[g]:"0",h?(N<U-1&&(O+=u[g]||""),N++):A>0?O.length+A<U&&(O+=u[g]||""):O+=u[g]||"",C=!0;else C?(F+=w[g],_+=w[g]):(T+=w[g],x+=w[g])}if(k){if(j.length<u.length)O+=i;else if(!h&&c.length>u.length){var L=c.length-u.length,Y=O.substr(0,O.length-L);Y&&Y.length>0&&(O=Y)}if(O.length>U)return a.extend(D,{value:null,switchToNext:!1})}if(!k||k&&!this.autoCorrectParts){N=0,I="",O="",T="",F="",C=!1;for(g=0;g<c.length;g++){if(c[g]===n)I+=this.getExisting(n)?w[g]||"":"0",h?(N<U-1&&(O+=u[g]||""),N++):A>0?O.length+A<U&&(O+=u[g]||""):O+=u[g]||"",C=!0;else C?F+=u[g-A]||"":T+=u[g]||""}c.length<u.length&&(O+=i)}}if(!d)if(this.autoCorrectParts){N=0,I="",O="",T="",F="",C=!1;for(g=0;g<w.length;g++){if(P[g]===n)I+=this.getExisting(n)?w[g]:"0",C=!0;else C?F+=w[g]:T+=w[g]}}else I=s?O:I;var H=null,K=this.matchMonth(i),W=this.matchDayPeriod(i,n),R="0"===i,z=this.leadingZero||{};R?("0"===O&&(O=I),0!==a.parseToInt(s?i:(d?O:I)+i)||this.isAbbrMonth(f.partMap,n)||this.incrementLeadingZero(n)):this.resetLeadingZero();var B=this.partPattern(f.partMap,n),Z=B?B.pattern:null;if(d&&h&&!O)return this.setExisting(n,!1),a.extend(D,{value:null,switchToNext:!1});var G=I.length-3,q=!0,J=d?O:I;for(g=Math.max(0,G);g<=I.length&&q;g++){J=s?i:d?O:I.substring(g)+i,!d&&this.autoCorrectParts||(q=!1,J=o.unpadZero(J),J=o.padZero(U-J.length)+J);var Q=parseInt(J,10),X=T+J+F;H=this.intl.parseDate(X,this.format,this.localeId),d&&!a.isValidDate(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(x+J+_,this.format,this.localeId));var $=!isNaN(parseInt(i,10))||d&&h&&""===i;if(!H&&!isNaN(Q)&&$&&this.autoCorrectParts){if("M"===n&&!K){var tt=Q-1;tt>-1&&tt<12&&((H=r.cloneDate(this.value)).setMonth(tt),H.getMonth()!==tt&&(H=r.lastDayOfMonth(r.addMonths(H,-1))))}"y"===n&&(H=r.createDate(parseInt(J,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),(d&&a.isValidDate(H)||!d&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=r.lastDayOfMonth(r.addMonths(H,-1))))}if(d&&a.isValidDate(H)||!d&&H){var et=this.intl.parseDate(""+T+this.peek(J,Z)+F,this.format,this.localeId),nt=this.patternLength(Z)||Z.length,rt=((this.leadingZero||{})[n]||0)+(o.unpadZero(J)||i).length>=nt,it=null===et||z[n]&&Z.length<=J.length||rt;if(this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),this._value=H,this.setExisting(n,!0),this.resetInvalidDateSymbol(n),this.autoCorrectParts||("M"===n?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===n&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),d&&it)if("M"===n)it=(ot=a.parseToInt(O))>=2||O.length>=2;else it=it?k?O.length===U:O.length>U:it;return a.extend(D,{value:this.value,switchToNext:it})}}if(K&&(H=this.intl.parseDate(T+K+F,this.format,this.localeId)))return this._value=H,this.setExisting(n,!0),a.extend(D,{value:this.value,switchToNext:!1});if(W&&(H=this.intl.parseDate(T+W+F,this.format)))return this._value=H,a.extend(D,{value:this.value,switchToNext:!0});if(R&&(this.leadingZero=this.isAbbrMonth(f.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),!this.autoCorrectParts){var ot=void 0,at=d?O:J,st=a.parseToInt(at);if(a.isNumber(st)){if("d"===n&&(st<=0||st>31)||"M"===n&&(st<0||st>11))return a.extend(D,{value:null,switchToNext:!1});ot="M"===n?st-1:st;var lt="M"===n,ut="d"===n,ht=r.cloneDate(this._value),ct=this._partiallyInvalidDate.invalidDateParts||{},dt=ct.y.value||ht.getFullYear(),ft=lt?ot:ct.M.value||ht.getMonth(),pt=ut?ot:ct.d.value||ct.E.value||ht.getDate(),mt=ct.h.value||ct.H.value||ht.getHours(),gt=ct.m.value||ht.getMinutes(),vt=ct.s.value||ht.getSeconds(),yt=ct.S.value||ht.getMilliseconds(),Dt=r.createDate(dt,ft,pt,mt,gt,vt,yt),bt=a.areDatePartsEqualTo(Dt,dt,ft,pt,mt,gt,vt,yt),Et=lt||ut?this.modifyDateSymbolWithValue(ht,n,lt?ft:pt):null,Mt=!1;if(lt&&Et?Et.getMonth()===ft?this.getExisting("d")?bt?(ht=r.cloneDate(Dt),this.resetInvalidDateSymbol(n)):(Mt=!0,this.setInvalidDatePart(n,{value:ft,date:r.cloneDate(Et),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1)):bt?(this.resetInvalidDateSymbol(n),ht=r.cloneDate(Dt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(n),ht=r.cloneDate(Et)):(Mt=!0,this.setInvalidDatePart(n,{value:ft,date:r.cloneDate(Et),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1)):ut&&Et&&(Et.getDate()===pt?this.getExisting("M")?bt?(ht=r.cloneDate(Dt),this.resetInvalidDateSymbol(n)):(Mt=!0,this.setInvalidDatePart(n,{value:pt,date:r.cloneDate(Et),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1)):bt?(ht=r.cloneDate(Dt),this.resetInvalidDateSymbol(n),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(n),ht=r.cloneDate(Et)):(Mt=!0,this.setInvalidDatePart(n,{value:pt,date:r.cloneDate(this.value),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1))),!Mt){if(this.setExisting(n,!0),d&&!a.isValidDate(H)){var St=this.intl.parseDate(x+J+_,this.format,this.localeId);a.isValidDate(St)&&(this._value=St)}else this._value=ht;this.getValue()&&this.resetInvalidDate()}it=!1;return it="M"===n?st>=2||at.length>=2:k?at.length===U:at.length>U,a.extend(D,{value:null,switchToNext:it,hasInvalidDatePart:Mt})}}return a.extend(D,{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])?(t[u]||e.extend(t,((n={})[u]={},n)),e.deepExtend(t[u],l[u])):e.extend(t,((r={})[u]=l[u],r));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 M})),n.d(e,"durationInDecades",(function(){return w})),n.d(e,"durationInMonths",(function(){return P})),n.d(e,"durationInYears",(function(){return C})),n.d(e,"firstDayInWeek",(function(){return T})),n.d(e,"firstDayOfMonth",(function(){return I})),n.d(e,"firstDecadeOfCentury",(function(){return E})),n.d(e,"firstMonthOfYear",(function(){return x})),n.d(e,"firstYearOfDecade",(function(){return S})),n.d(e,"getDate",(function(){return _})),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}))},M=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},S=function(t){return b(t,(function(t){return t-t%10}))},w=function(t,e){return(S(e).getFullYear()-S(t).getFullYear())/10},P=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},C=function(t,e){return e.getFullYear()-t.getFullYear()},T=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},I=function(t){return s(t.getFullYear(),t.getMonth(),1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},O=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))},x=function(t){return O(t,0)},_=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(_(t),_(e))},k=function(t){return b(t,(function(t){return t-t%100+90}))},V=function(t){return O(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=_(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=e[a+e.length-n.length],h=e.substring(0,a+e.length-n.length),c=n.substring(0,a),d=[];if(h===c&&a>0)return d.push([o[a-1],c[a-1]]),d;if(0===h.indexOf(c)&&s&&(l.key===i.Key.DELETE||l.key===i.Key.BACKSPACE)||0===h.indexOf(c)&&!s&&(0===c.length||o[c.length-1]!==o[c.length])){var f="";s||1!==c.length||d.push([o[0],c[0]]);for(var p=c.length;p<h.length;p++)o[p]!==f&&o[p]!==r.Constants.formatSeparator&&(f=o[p],d.push([f,""]));return d}if(s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)||!s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)){var m=o[0];for(p=Math.max(0,h.length-1);p<o.length;p++)if(o[p]!==r.Constants.formatSeparator){m=o[p];break}return[[m,c[a-1]]]}return!s&&" "===c[c.length-1]||!s&&c[c.length-1]===u?[[o[a-1],r.Constants.formatSeparator]]:[[o[a-1],c[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",allowNulls:!1,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,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:f.Constants.twoDigitYearMax,autoCorrectParts:!0},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),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",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),e&&(this.unbindEvents(),this.init(this.element,this.options))},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;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.keyDownEvent||{},n=e.keyCode===s.KeyCode.BACKSPACE||e.key===l.Key.BACKSPACE,r=e.keyCode===s.KeyCode.DELETE||e.key===l.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var i=this.interactionMode;!this.options.allowCaretMode||i===c.DateInputInteractionMode.Caret||r||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var o=this.isInCaretMode();if(o&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var h=this.dateObject&&this.dateObject.getValue(),p=this.dateObject.getTextAndFormat(),m=p.text,g=p.format;this.currentFormat=g;var v="";v=o&&(n||r||i===c.DateInputInteractionMode.Caret)?this.previousElementValue:m;var y=this.elementValue,D=a.approximateStringMatching({oldText:v,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:o,keyEvent:this.keyDownEvent}),b=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&o&&this.currentFormat.length!==this.elementValue.length&&b&&b.length>0&&b!==f.Constants.formatSeparator&&(D&&0!==D.length?D[0]&&D[0][0]!==f.Constants.formatSeparator&&D[0][0]!==b&&(D[0][0]=b,D[0][1]=t.data||""):((D=[])[0][0]=b,D[0][1]=t.data||"")),!o||D&&0!==D.length){if(o&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(o&&D[0]&&(D[0][0]===f.Constants.formatSeparator||D[0][1]===f.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var E=1===D.length&&D[0][1]===f.Constants.formatSeparator,M=[],S=!1;if(!E)for(var w=0;w<D.length;w++){var P=this.dateObject.parsePart({symbol:D[w][0],currentChar:D[w][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||r,originalFormat:this.currentFormat});M.push(P),S=P.switchToNext}this.options.autoSwitchParts||(S=!1),this.resetSegmentValue=!1;var C,T=M[M.length-1],I=T&&!T.value,O=o&&(n||r)&&I,x=!!T&&T.resetPart,_=!!T&&T.hasInvalidDatePart,F=!d.isEqual(h,this.dateObject.value),j=this.selection;if((!o||O||x)&&(x&&(C=this.currentFormat[j.start]),this.forceUpdate()),D.length&&D[0][0]!==f.Constants.formatSeparator)if(!o||O||x)C?this.setSelection(this.selectionBySymbol(C)):(this.options.autoSwitchParts||D[0][1]!==f.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0]));else if(o)if(F&&u.isPresent(this.dateObject.getValue())||!F&&S&&u.isPresent(this.dateObject.getValue())){if(S)this.switchDateSegment(1);else if(this.options.format.length!==this.currentFormat.length&&b&&"y"!==b){var k=this.elementValue.length;this.forceUpdate();var V=this.elementValue.length-k;this.setSelection({start:j.start+V,end:j.start+V})}}else if(I){var U=this.dateObject.getLeadingZero()[b];S?this.switchDateSegment(1):"0"===t.data&&U||this.restorePreviousInputEventState()}if(S||!o||n||r||x||!I)this.options.autoSwitchParts&&(S||E)&&(o||this.switchDateSegment(1));else if(F)this.currentFormat.length===this.elementValue.length||i!==c.DateInputInteractionMode.Caret&&F||(i!==c.DateInputInteractionMode.Caret?(C=this.currentFormat[j.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(C))):_||this.restorePreviousInputEventState());else{U=this.dateObject.getLeadingZero()[b];"0"===t.data&&U||_||this.restorePreviousInputEventState()}this.tryTriggerValueChange({oldValue:h,event:t}),this.triggerInputEnd({event:t}),o&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,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.interactionMode=c.DateInputInteractionMode.None,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;this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:r},this.previousElementSelection={start:n,end:r};var i=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(i.indexOf(t.keyCode.toString())>=0||i.indexOf(t.keyCode)>=0||i.indexOf(t.key.toLowerCase().trim())>=0){var o=i.indexOf(l.Key.TAB.toLowerCase().trim())>=0||i.indexOf(s.KeyCode.TAB)>=0||i.indexOf(s.KeyCode.TAB.toString())>=0;if(!o)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,u=a.start,h=a.end;if(t.shiftKey&&o?this.switchDateSegment(-1):this.switchDateSegment(1),u!==this.selection.start||h!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],d=this.getStepFromSymbol(c),f=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),f=!0;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(d,c,event),f=!0;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),f=!0;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-d,c,event),f=!0;break;case s.KeyCode.ENTER:break;case s.KeyCode.DELETE:case s.KeyCode.BACKSPACE:if(this.options.allowNulls){var p=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:p,event:t})}return f=!0,void(t.keyCode===s.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(s.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(l.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case l.Key.HOME:this.selectNearestSegment(0);break;case l.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}f&&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)},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-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],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){var r=this.value,i=1*t,o=this.caret();if("S"===(e=e||this.currentFormat[o[0]])&&!this.options.steps.millisecond){var a=u.millisecondDigitsInFormat(this.inputFormat);i=u.millisecondStepFor(a)}this.dateObject.modifyPart(e,i),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:{}}),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.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.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,r=this.dateObject.getTextAndFormat(n),i=r.text,o=r.format;this.currentFormat=o,this.currentText=i;var a=this.options.hasPlaceholder||u.isPresent(this.options.placeholder),s=!this.isActive&&a&&!this.dateObject.hasValue();a&&u.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var l=s?"":i;this.previousElementValue=this.elementValue,this.setElementValue(l),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},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,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new o.DateObject(u.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},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 M})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return P})),n.d(e,"__importDefault",(function(){return C})),n.d(e,"__classPrivateFieldGet",(function(){return T})),n.d(e,"__classPrivateFieldSet",(function(){return I})),n.d(e,"__classPrivateFieldIn",(function(){return O}));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 M(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 S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var w=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(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 w(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function T(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 I(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 O(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.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.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=u,this.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.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"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"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),M=s||l?this.modifyDateSymbolWithValue(i,t,s?f:p):null,S=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&&M?M.getMonth()===f?this.getExisting("d")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(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(M)):(n=!0,this.setInvalidDatePart(t,{value:f,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):l&&M&&(M.getDate()===p?this.getExisting("M")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(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(M)):(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,n=t.symbol,i=t.currentChar,s=t.resetSegmentValue,l=t.cycleSegmentValue,u=t.rawTextValue,h=t.isDeleting,c=t.originalFormat,d=!l,f=this.dateFormatString(this.value,this.format),p=f.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),m=f.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),g=0;g<p.length;g++){for(var v=p[g],y=0;y<v.pattern.length;y++)p[g+y]&&(p[g+y].literal=v.pattern[y]);g+=v.pattern.length-1}for(g=0;g<m.length;g++){for(v=m[g],y=0;y<v.pattern.length;y++)m[g+y]&&(m[g+y].text=v.pattern[y]);g+=v.pattern.length-1}var D={value:null,switchPart:!1,resetPart:d&&"M"===n&&f.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!i){if(!d)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(g=0;g<p.length;g++){var b=p[g].literal,E=u.startsWith(b),M=u.endsWith(b),S=u.indexOf(b+b)>=0;if(E||M||S)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),a.extend(D,{value:null,switchToNext:!1})}}var w=this.intl.formatDate(this.value,this.format,this.localeId),P=f.symbols,C=!1,T="",I="",O="",x="",_="",F="",j="";for(g=0;g<m.length;g++)j+=m[g].text;var k=this.format===P||this.format===j||this.format===c||this.format.length===c.length,V=(k?j:c).indexOf(n),U=(k?j:c).lastIndexOf(n)-V+1,N=0,A=c.length-u.length;if(d||!d&&!this.autoCorrectParts){for(g=0;g<w.length;g++){if(P[g]===n)I+=this.getExisting(n)?w[g]:"0",h?(N<U-1&&(O+=u[g]||""),N++):A>0?O.length+A<U&&(O+=u[g]||""):O+=u[g]||"",C=!0;else C?(F+=w[g],_+=w[g]):(T+=w[g],x+=w[g])}if(k){if(j.length<u.length)O+=i;else if(!h&&c.length>u.length){var L=c.length-u.length,Y=O.substr(0,O.length-L);Y&&Y.length>0&&(O=Y)}if(O.length>U)return a.extend(D,{value:null,switchToNext:!1})}if(!k||k&&!this.autoCorrectParts){N=0,I="",O="",T="",F="",C=!1;for(g=0;g<c.length;g++){if(c[g]===n)I+=this.getExisting(n)?w[g]||"":"0",h?(N<U-1&&(O+=u[g]||""),N++):A>0?O.length+A<U&&(O+=u[g]||""):O+=u[g]||"",C=!0;else C?F+=u[g-A]||"":T+=u[g]||""}c.length<u.length&&(O+=i)}}if(!d)if(this.autoCorrectParts){N=0,I="",O="",T="",F="",C=!1;for(g=0;g<w.length;g++){if(P[g]===n)I+=this.getExisting(n)?w[g]:"0",C=!0;else C?F+=w[g]:T+=w[g]}}else I=s?O:I;var H=null,K=this.matchMonth(i),W=this.matchDayPeriod(i,n),R="0"===i,z=this.leadingZero||{};R?("0"===O&&(O=I),0!==a.parseToInt(s?i:(d?O:I)+i)||this.isAbbrMonth(f.partMap,n)||this.incrementLeadingZero(n)):this.resetLeadingZero();var B=this.partPattern(f.partMap,n),Z=B?B.pattern:null;if(d&&h&&!O)return this.setExisting(n,!1),a.extend(D,{value:null,switchToNext:!1});var G=I.length-3,q=!0,J=d?O:I;for(g=Math.max(0,G);g<=I.length&&q;g++){J=s?i:d?O:I.substring(g)+i,!d&&this.autoCorrectParts||(q=!1,J=o.unpadZero(J),J=o.padZero(U-J.length)+J);var Q=parseInt(J,10),X=T+J+F;H=this.intl.parseDate(X,this.format,this.localeId),d&&!a.isValidDate(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(x+J+_,this.format,this.localeId));var $=!isNaN(parseInt(i,10))||d&&h&&""===i;if(!H&&!isNaN(Q)&&$&&this.autoCorrectParts){if("M"===n&&!K){var tt=Q-1;tt>-1&&tt<12&&((H=r.cloneDate(this.value)).setMonth(tt),H.getMonth()!==tt&&(H=r.lastDayOfMonth(r.addMonths(H,-1))))}"y"===n&&(H=r.createDate(parseInt(J,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),(d&&a.isValidDate(H)||!d&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=r.lastDayOfMonth(r.addMonths(H,-1))))}if(d&&a.isValidDate(H)||!d&&H){var et=""+T+this.peek(J,Z)+F,nt=null===this.intl.parseDate(et,this.format,this.localeId)||z[n]&&Z.length<=J.length||!1;if(this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),this._value=H,this.setExisting(n,!0),this.resetInvalidDateSymbol(n),this.autoCorrectParts||("M"===n?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===n&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),d&&nt)if("M"===n)nt=(rt=a.parseToInt(O))>=2||O.length>=2;else nt=nt?k?O.length===U:O.length>U:nt;return a.extend(D,{value:this.value,switchToNext:nt})}}if(K&&(H=this.intl.parseDate(T+K+F,this.format,this.localeId)))return this._value=H,this.setExisting(n,!0),a.extend(D,{value:this.value,switchToNext:!1});if(W&&(H=this.intl.parseDate(T+W+F,this.format)))return this._value=H,a.extend(D,{value:this.value,switchToNext:!0});if(R&&(this.leadingZero=this.isAbbrMonth(f.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),!this.autoCorrectParts){var rt=void 0,it=d?O:J,ot=a.parseToInt(it);if(a.isNumber(ot)){if("d"===n&&(ot<=0||ot>31)||"M"===n&&(ot<0||ot>11))return a.extend(D,{value:null,switchToNext:!1});rt="M"===n?ot-1:ot;var at="M"===n,st="d"===n,lt=r.cloneDate(this._value),ut=this._partiallyInvalidDate.invalidDateParts||{},ht=ut.y.value||lt.getFullYear(),ct=at?rt:ut.M.value||lt.getMonth(),dt=st?rt:ut.d.value||ut.E.value||lt.getDate(),ft=ut.h.value||ut.H.value||lt.getHours(),pt=ut.m.value||lt.getMinutes(),mt=ut.s.value||lt.getSeconds(),gt=ut.S.value||lt.getMilliseconds(),vt=r.createDate(ht,ct,dt,ft,pt,mt,gt),yt=a.areDatePartsEqualTo(vt,ht,ct,dt,ft,pt,mt,gt),Dt=at||st?this.modifyDateSymbolWithValue(lt,n,at?ct:dt):null,bt=!1;if(at&&Dt?Dt.getMonth()===ct?this.getExisting("d")?yt?(lt=r.cloneDate(vt),this.resetInvalidDateSymbol(n)):(bt=!0,this.setInvalidDatePart(n,{value:ct,date:r.cloneDate(Dt),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1)):yt?(this.resetInvalidDateSymbol(n),lt=r.cloneDate(vt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(n),lt=r.cloneDate(Dt)):(bt=!0,this.setInvalidDatePart(n,{value:ct,date:r.cloneDate(Dt),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1)):st&&Dt&&(Dt.getDate()===dt?this.getExisting("M")?yt?(lt=r.cloneDate(vt),this.resetInvalidDateSymbol(n)):(bt=!0,this.setInvalidDatePart(n,{value:dt,date:r.cloneDate(Dt),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1)):yt?(lt=r.cloneDate(vt),this.resetInvalidDateSymbol(n),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(n),lt=r.cloneDate(Dt)):(bt=!0,this.setInvalidDatePart(n,{value:dt,date:r.cloneDate(this.value),startDate:r.cloneDate(this.value)}),this.setExisting(n,!1))),!bt){if(this.setExisting(n,!0),d&&!a.isValidDate(H)){var Et=this.intl.parseDate(x+J+_,this.format,this.localeId);a.isValidDate(Et)&&(this._value=Et)}else this._value=lt;this.getValue()&&this.resetInvalidDate()}nt=!1;return nt="M"===n?ot>=2||it.length>=2:k?it.length===U:it.length>U,a.extend(D,{value:null,switchToNext:nt,hasInvalidDatePart:bt})}}return a.extend(D,{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 n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},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(e,n){e.exports=t},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 i,a=n(0),s=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,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,i,a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];if(!a.length)return t;var l=a.shift();if(s(t)&&s(l))for(var h in l)r(l[h])?t[h]=l[h]:s(l[h])?(t[h]||e.extend(t,((n={})[h]={},n)),e.deepExtend(t[h],l[h])):e.extend(t,((i={})[h]=l[h],i));return e.deepExtend.apply(void 0,[t].concat(a))},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=(i="setFullYear",function(t,e){var n=a.cloneDate(t);return n[i](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,i,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),a=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,s=t.formatPattern,r=t.selectionStart,o=t.isInCaretMode,l=t.keyEvent,h=e[r+e.length-n.length],u=e.substring(0,r+e.length-n.length),c=n.substring(0,r),d=[];if(u===c&&r>0)return d.push([s[r-1],c[r-1]]),d;if(0===u.indexOf(c)&&o&&(l.key===a.Key.DELETE||l.key===a.Key.BACKSPACE)||0===u.indexOf(c)&&!o&&(0===c.length||s[c.length-1]!==s[c.length])){var p="";o||1!==c.length||d.push([s[0],c[0]]);for(var m=c.length;m<u.length;m++)s[m]!==p&&s[m]!==i.Constants.formatSeparator&&(p=s[m],d.push([p,""]));return d}if(o&&(0===c.indexOf(u)||s[r-1]===i.Constants.formatSeparator)||!o&&(0===c.indexOf(u)||s[r-1]===i.Constants.formatSeparator)){var f=s[0];for(m=Math.max(0,u.length-1);m<s.length;m++)if(s[m]!==i.Constants.formatSeparator){f=s[m];break}return[[f,c[r-1]]]}return!o&&" "===c[c.length-1]||!o&&c[c.length-1]===h?[[s[r-1],i.Constants.formatSeparator]]:[[s[r-1],c[r-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 i=n(6);e.DateInput=i.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=n(7),s=n(8),r=n(3),o=n(10),l=n(4),h=n(2),u=n(11),c=n(12),d=n(0),p=n(1),m={format:"d",allowNulls:!1,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={},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,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0},f=function(t){function e(e,n){var i=t.call(this,n)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=c.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(e,n),i}return a.__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=h.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);h.isValidDate(n)||(n=null),this.element=t,this.options=h.extend({},m,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",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=h.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},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;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,i=h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,a=!n&&i?0:this.caret()[0];this.selectNearestSegment(a)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===o.KeyCode.BACKSPACE||e.key===l.Key.BACKSPACE,i=e.keyCode===o.KeyCode.DELETE||e.key===l.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var a=this.interactionMode;!this.options.allowCaretMode||a===c.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var s=this.isInCaretMode();if(s&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var u=this.dateObject&&this.dateObject.getValue(),m=this.dateObject.getTextAndFormat(),f=m.text,v=m.format;this.currentFormat=v;var g="";g=s&&(n||i||a===c.DateInputInteractionMode.Caret)?this.previousElementValue:f;var y=this.elementValue,D=r.approximateStringMatching({oldText:g,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent}),E=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&s&&this.currentFormat.length!==this.elementValue.length&&E&&E.length>0&&E!==p.Constants.formatSeparator&&(D&&0!==D.length?D[0]&&D[0][0]!==p.Constants.formatSeparator&&D[0][0]!==E&&(D[0][0]=E,D[0][1]=t.data||""):((D=[])[0][0]=E,D[0][1]=t.data||"")),!s||D&&0!==D.length){if(s&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(s&&D[0]&&(D[0][0]===p.Constants.formatSeparator||D[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var b=1===D.length&&D[0][1]===p.Constants.formatSeparator,S=[],P=!1;if(!b)for(var M=0;M<D.length;M++){var I=this.dateObject.parsePart({symbol:D[M][0],currentChar:D[M][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});S.push(I),P=I.switchToNext}this.options.autoSwitchParts||(P=!1),this.resetSegmentValue=!1;var x,C=S[S.length-1],O=C&&!C.value,w=s&&(n||i)&&O,F=!!C&&C.resetPart,V=!!C&&C.hasInvalidDatePart,k=!d.isEqual(u,this.dateObject.value),T=this.selection;if((!s||w||F)&&(F&&(x=this.currentFormat[T.start]),this.forceUpdate()),D.length&&D[0][0]!==p.Constants.formatSeparator)if(!s||w||F)x?this.setSelection(this.selectionBySymbol(x)):(this.options.autoSwitchParts||D[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0]));else if(s)if(k&&h.isPresent(this.dateObject.getValue())||!k&&P&&h.isPresent(this.dateObject.getValue())){if(P)this.switchDateSegment(1);else if(this.options.format.length!==this.currentFormat.length&&E&&"y"!==E){var _=this.elementValue.length;this.forceUpdate();var N=this.elementValue.length-_;this.setSelection({start:T.start+N,end:T.start+N})}}else if(O){var A=this.dateObject.getLeadingZero()[E];P?this.switchDateSegment(1):"0"===t.data&&A||this.restorePreviousInputEventState()}if(P||!s||n||i||F||!O)this.options.autoSwitchParts&&(P||b)&&(s||this.switchDateSegment(1));else if(k)this.currentFormat.length===this.elementValue.length||a!==c.DateInputInteractionMode.Caret&&k||(a!==c.DateInputInteractionMode.Caret?(x=this.currentFormat[T.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(x))):V||this.restorePreviousInputEventState());else{A=this.dateObject.getLeadingZero()[E];"0"===t.data&&A||V||this.restorePreviousInputEventState()}this.tryTriggerValueChange({oldValue:u,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,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.interactionMode=c.DateInputInteractionMode.None,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,i=e.end;this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:i},this.previousElementSelection={start:n,end:i};var a=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(a.indexOf(t.keyCode.toString())>=0||a.indexOf(t.keyCode)>=0||a.indexOf(t.key.toLowerCase().trim())>=0){var s=a.indexOf(l.Key.TAB.toLowerCase().trim())>=0||a.indexOf(o.KeyCode.TAB)>=0||a.indexOf(o.KeyCode.TAB.toString())>=0;if(!s)return t.preventDefault(),void this.switchDateSegment(1);var r=this.selection,h=r.start,u=r.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),h!==this.selection.start||u!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],d=this.getStepFromSymbol(c),p=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),p=!0;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(d,c,event),p=!0;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),p=!0;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-d,c,event),p=!0;break;case o.KeyCode.ENTER:break;case o.KeyCode.DELETE:case o.KeyCode.BACKSPACE:if(this.options.allowNulls){var m=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:m,event:t})}return p=!0,void(t.keyCode===o.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(o.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(l.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case l.Key.HOME:this.selectNearestSegment(0);break;case l.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}p&&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 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: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)},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));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,i=t-1;n<this.currentFormat.length||i>=0;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(i>=0&&this.currentFormat[i]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],a="",s="";if(t<0){for(var r=n+t;r>=0;r--)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==i){n=r,a=s;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==i){n=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}this.interactionMode=c.DateInputInteractionMode.None;var o=this.selection,l=o.start,h=o.end;if(l<h&&this.currentFormat[l]!==this.currentFormat[h-1])return this.setSelection(this.selectionByIndex(t>0?l:h-1)),this.resetSegmentValue=!0,void(this.interactionMode=c.DateInputInteractionMode.None);for(var u=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===u||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var m=d;m>=0&&m<this.currentFormat.length&&this.currentFormat[m]===this.currentFormat[d];)m+=t;d>m&&(m+1!==l||d+1!==h)?(this.setSelection({start:m+1,end:d+1}),this.resetSegmentValue=!0):d<m&&(d!==l||m!==h)&&(this.setSelection({start:d,end:m}),this.resetSegmentValue=!0),this.interactionMode=c.DateInputInteractionMode.None}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject){var i=this.value,a=1*t,s=this.caret();if("S"===(e=e||this.currentFormat[s[0]])&&!this.options.steps.millisecond){var r=h.millisecondDigitsInFormat(this.inputFormat);a=h.millisecondStepFor(r)}this.dateObject.modifyPart(e,a),this.tryTriggerValueChange({oldValue:i,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",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:{}}),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.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&&!h.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(n),a=i.text,s=i.format;this.currentFormat=s,this.currentText=a;var r=this.options.hasPlaceholder||h.isPresent(this.options.placeholder),o=!this.isActive&&r&&!this.dateObject.hasValue();r&&h.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var l=o?"":a;this.previousElementValue=this.elementValue,this.setElementValue(l),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],a=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(n&&(h.isDocumentAvailable()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),i=[a.selectionStart,a.selectionEnd])}catch(t){i=[]}return i}},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,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new s.DateObject(h.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},e}(u.Observable);e.DateInput=f},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a=n(9),s=n(3),r=n(2),o=n(1),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,a=t.format,s=t.cycleTime,r=void 0!==s&&s,l=t.twoDigitYearMax,h=void 0===l?o.Constants.twoDigitYearMax:l,u=t.value,c=void 0===u?null:u,d=t.autoCorrectParts,p=void 0===d||d;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!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=i.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.intl=e,this.formatPlaceholder=n||"wide",this.format=a,this.cycleTime=r,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=h,this.autoCorrectParts=p,c)this._value=i.cloneDate(c);else{this._value=i.getDate(new Date);for(var m=this.dateFormatString(this.value,this.format).symbols,f=0;f<m.length;f++)this.setExisting(m[f],!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),n=0;n<e.length;n++){var i=e[n],a=this.intl.cldr[i];if(a.name&&a.calendar&&a.numbers&&a.name!==o.Constants.defaultLocaleId){t=a.name;break}}return t},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){t?i.isEqual(t,this._value)||(this._value=i.cloneDate(t),this.modifyExisting(!0)):(this._value=i.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 i.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),i=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var a="",o=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),h=0;h<o.length;h++){var u=i.symbols[h];if("literal"===i.partMap[h].type)a+=n[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(i,h);if("M"===u){var d=(r.parseToInt(this.getInvalidDatePartValue(u))+1).toString();if(c.length>2)a+=l[u][h];else if(this.getInvalidDatePartValue(u))a+=s.padZero(c.length-d.length)+d,h+=c.length-1;else a+=l[u][h]}else if(this.getInvalidDatePartValue(u)){d=this.getInvalidDatePartValue(u).toString();a+=s.padZero(c.length-d.length)+d,h+=c.length-1}else a+=l[u][h]}else a+=n[h]}n=a}return this.merge(n,i)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,i={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var a=e.getInvalidDatePart(t).date;if(a){var s=e.intl.formatDate(a,n,e.localeId);i[t]=s}})),i},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"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"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 n,a=i.cloneDate(this.value),s=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o)switch(t){case"y":a.setFullYear(a.getFullYear()+e);break;case"M":a=i.addMonths(this.value,e);break;case"d":case"E":a.setDate(a.getDate()+e);break;case"h":case"H":a.setHours(a.getHours()+e),s=!0;break;case"m":a.setMinutes(a.getMinutes()+e),s=!0;break;case"s":a.setSeconds(a.getSeconds()+e),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+e);break;case"a":a.setHours(a.getHours()+12*e),s=!0}else{var u=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=u.y.value||a.getFullYear(),p=u.M.value||a.getMonth(),m=u.d.value||u.E.value||a.getDate(),f=u.h.value||u.H.value||a.getHours(),v=u.m.value||a.getMinutes(),g=u.s.value||a.getSeconds(),y=u.S.value||a.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 b=i.createDate(d,p,m,f,v,g,y),S=o||l?this.modifyDateSymbolWithValue(a,t,o?p:m):null,P=r.areDatePartsEqualTo(b,d,p,m,f,v,g,y);this.getValue()&&r.areDatePartsEqualTo(b,d,p,m,f,v,g,y)?(a=i.cloneDate(b),this.markDatePartsAsExisting()):o&&S?S.getMonth()===p?this.getExisting("d")?P?(a=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(this.resetInvalidDateSymbol(t),a=i.cloneDate(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),a=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===m?this.getExisting("M")?P?(a=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(a=i.cloneDate(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),a=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(this.value),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(a=this.normalizeCentury(a)),s&&!this.cycleTime&&(a.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=a,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e,n=t.symbol,a=t.currentChar,o=t.resetSegmentValue,l=t.cycleSegmentValue,h=t.rawTextValue,u=t.isDeleting,c=t.originalFormat,d=!l,p=this.dateFormatString(this.value,this.format),m=p.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),f=p.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),v=0;v<m.length;v++){for(var g=m[v],y=0;y<g.pattern.length;y++)m[v+y]&&(m[v+y].literal=g.pattern[y]);v+=g.pattern.length-1}for(v=0;v<f.length;v++){for(g=f[v],y=0;y<g.pattern.length;y++)f[v+y]&&(f[v+y].text=g.pattern[y]);v+=g.pattern.length-1}var D={value:null,switchPart:!1,resetPart:d&&"M"===n&&p.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!a){if(!d)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(v=0;v<m.length;v++){var E=m[v].literal,b=h.startsWith(E),S=h.endsWith(E),P=h.indexOf(E+E)>=0;if(b||S||P)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),r.extend(D,{value:null,switchToNext:!1})}}var M=this.intl.formatDate(this.value,this.format,this.localeId),I=p.symbols,x=!1,C="",O="",w="",F="",V="",k="",T="";for(v=0;v<f.length;v++)T+=f[v].text;var _=this.format===I||this.format===T||this.format===c||this.format.length===c.length,N=(_?T:c).indexOf(n),A=(_?T:c).lastIndexOf(n)-N+1,j=0,L=c.length-h.length;if(d||!d&&!this.autoCorrectParts){for(v=0;v<M.length;v++){if(I[v]===n)O+=this.getExisting(n)?M[v]:"0",u?(j<A-1&&(w+=h[v]||""),j++):L>0?w.length+L<A&&(w+=h[v]||""):w+=h[v]||"",x=!0;else x?(k+=M[v],V+=M[v]):(C+=M[v],F+=M[v])}if(_){if(T.length<h.length)w+=a;else if(!u&&c.length>h.length){var K=c.length-h.length,B=w.substr(0,w.length-K);B&&B.length>0&&(w=B)}if(w.length>A)return r.extend(D,{value:null,switchToNext:!1})}if(!_||_&&!this.autoCorrectParts){j=0,O="",w="",C="",k="",x=!1;for(v=0;v<c.length;v++){if(c[v]===n)O+=this.getExisting(n)?M[v]||"":"0",u?(j<A-1&&(w+=h[v]||""),j++):L>0?w.length+L<A&&(w+=h[v]||""):w+=h[v]||"",x=!0;else x?k+=h[v-L]||"":C+=h[v]||""}c.length<h.length&&(w+=a)}}if(!d)if(this.autoCorrectParts){j=0,O="",w="",C="",k="",x=!1;for(v=0;v<M.length;v++){if(I[v]===n)O+=this.getExisting(n)?M[v]:"0",x=!0;else x?k+=M[v]:C+=M[v]}}else O=o?w:O;var H=null,W=this.matchMonth(a),R=this.matchDayPeriod(a,n),Z="0"===a,Y=this.leadingZero||{};Z?("0"===w&&(w=O),0!==r.parseToInt(o?a:(d?w:O)+a)||this.isAbbrMonth(p.partMap,n)||this.incrementLeadingZero(n)):this.resetLeadingZero();var U=this.partPattern(p.partMap,n),q=U?U.pattern:null;if(d&&u&&!w)return this.setExisting(n,!1),r.extend(D,{value:null,switchToNext:!1});var z=O.length-3,G=!0,J=d?w:O;for(v=Math.max(0,z);v<=O.length&&G;v++){J=o?a:d?w:O.substring(v)+a,!d&&this.autoCorrectParts||(G=!1,J=s.unpadZero(J),J=s.padZero(A-J.length)+J);var Q=parseInt(J,10),X=C+J+k;H=this.intl.parseDate(X,this.format,this.localeId),d&&!r.isValidDate(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(F+J+V,this.format,this.localeId));var $=!isNaN(parseInt(a,10))||d&&u&&""===a;if(!H&&!isNaN(Q)&&$&&this.autoCorrectParts){if("M"===n&&!W){var tt=Q-1;tt>-1&&tt<12&&((H=i.cloneDate(this.value)).setMonth(tt),H.getMonth()!==tt&&(H=i.lastDayOfMonth(i.addMonths(H,-1))))}"y"===n&&(H=i.createDate(parseInt(J,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),(d&&r.isValidDate(H)||!d&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=i.lastDayOfMonth(i.addMonths(H,-1))))}if(d&&r.isValidDate(H)||!d&&H){var et=this.intl.parseDate(""+C+this.peek(J,q)+k,this.format,this.localeId),nt=this.patternLength(q)||q.length,it=((this.leadingZero||{})[n]||0)+(s.unpadZero(J)||a).length>=nt,at=null===et||Y[n]&&q.length<=J.length||it;if(this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),this._value=H,this.setExisting(n,!0),this.resetInvalidDateSymbol(n),this.autoCorrectParts||("M"===n?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===n&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),d&&at)if("M"===n)at=(st=r.parseToInt(w))>=2||w.length>=2;else at=at?_?w.length===A:w.length>A:at;return r.extend(D,{value:this.value,switchToNext:at})}}if(W&&(H=this.intl.parseDate(C+W+k,this.format,this.localeId)))return this._value=H,this.setExisting(n,!0),r.extend(D,{value:this.value,switchToNext:!1});if(R&&(H=this.intl.parseDate(C+R+k,this.format)))return this._value=H,r.extend(D,{value:this.value,switchToNext:!0});if(Z&&(this.leadingZero=this.isAbbrMonth(p.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),!this.autoCorrectParts){var st=void 0,rt=d?w:J,ot=r.parseToInt(rt);if(r.isNumber(ot)){if("d"===n&&(ot<=0||ot>31)||"M"===n&&(ot<0||ot>11))return r.extend(D,{value:null,switchToNext:!1});st="M"===n?ot-1:ot;var lt="M"===n,ht="d"===n,ut=i.cloneDate(this._value),ct=this._partiallyInvalidDate.invalidDateParts||{},dt=ct.y.value||ut.getFullYear(),pt=lt?st:ct.M.value||ut.getMonth(),mt=ht?st:ct.d.value||ct.E.value||ut.getDate(),ft=ct.h.value||ct.H.value||ut.getHours(),vt=ct.m.value||ut.getMinutes(),gt=ct.s.value||ut.getSeconds(),yt=ct.S.value||ut.getMilliseconds(),Dt=i.createDate(dt,pt,mt,ft,vt,gt,yt),Et=r.areDatePartsEqualTo(Dt,dt,pt,mt,ft,vt,gt,yt),bt=lt||ht?this.modifyDateSymbolWithValue(ut,n,lt?pt:mt):null,St=!1;if(lt&&bt?bt.getMonth()===pt?this.getExisting("d")?Et?(ut=i.cloneDate(Dt),this.resetInvalidDateSymbol(n)):(St=!0,this.setInvalidDatePart(n,{value:pt,date:i.cloneDate(bt),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1)):Et?(this.resetInvalidDateSymbol(n),ut=i.cloneDate(Dt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(n),ut=i.cloneDate(bt)):(St=!0,this.setInvalidDatePart(n,{value:pt,date:i.cloneDate(bt),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1)):ht&&bt&&(bt.getDate()===mt?this.getExisting("M")?Et?(ut=i.cloneDate(Dt),this.resetInvalidDateSymbol(n)):(St=!0,this.setInvalidDatePart(n,{value:mt,date:i.cloneDate(bt),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1)):Et?(ut=i.cloneDate(Dt),this.resetInvalidDateSymbol(n),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(n),ut=i.cloneDate(bt)):(St=!0,this.setInvalidDatePart(n,{value:mt,date:i.cloneDate(this.value),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1))),!St){if(this.setExisting(n,!0),d&&!r.isValidDate(H)){var Pt=this.intl.parseDate(F+J+V,this.format,this.localeId);r.isValidDate(Pt)&&(this._value=Pt)}else this._value=ut;this.getValue()&&this.resetInvalidDate()}at=!1;return at="M"===n?ot>=2||rt.length>=2:_?rt.length===A:rt.length>A,r.extend(D,{value:null,switchToNext:at,hasInvalidDatePart:St})}}return r.extend(D,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(s.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.getLeadingZero=function(){return this.leadingZero||{}},t.prototype.normalizeCentury=function(t){if(!r.isPresent(t))return t;var e=r.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return r.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 s.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),i=[],s=[],r=0;r<n.length;r++)for(var l=this.intl.formatDate(t,{pattern:n[r].pattern},this.localeId).length;l>0;)i.push(this.symbols[n[r].pattern[0]]||o.Constants.formatSeparator),s.push(n[r]),l--;var h=new a.Mask;return h.symbols=i.join(""),h.partMap=s,h},t.prototype.merge=function(t,e){for(var n="",i="",a=e.symbols,o=!1,l=0,h=this.getFormattedInvalidDates(a),u=a.length-1;u>=0;u--){var c=this.getPartsForSegment(e,u);if(-1===this.knownParts.indexOf(a[u])||this.getExisting(a[u]))this.autoCorrectParts?n=t[u]+n:t.length!==a.length?o?n=t[u]+n:l>0?(n=t[u]+n,--l<=0&&(o=!0)):n=(t[u+t.length-a.length]||"")+n:n=t[u]+n,i=a[u]+i;else{var d=a[u],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;u>=0&&d===a[u];)u--;u++}if(this.leadingZero&&this.leadingZero[d])n="0"+n;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)n=h[d][u]+n;else m=(r.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),n=s.padZero(c.length-m.length)+m+n,p=c.length-1,l=m.length-c.length;else n=s.padZero(c.length-m.length)+m+n,p=c.length-1,l=m.length-c.length}else n=this.dateFieldName(e.partMap[u])+n;for(;i.length<n.length;)i=a[u]+i;0!==p&&(u=u-p+(t.length-a.length))}}return{text:n,format:i}},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]&&r.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,i=void 0===n?null:n,a=e.date,s=void 0===a?null:a,r=e.startDateOffset,o=void 0===r?0:r,l=e.startDate,h=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=i,this._partiallyInvalidDate.invalidDateParts[t].date=s,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=o,this._partiallyInvalidDate.startDate=h)},t.prototype.hasInvalidDatePart=function(){var t=this,e=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(n){t._partiallyInvalidDate.invalidDateParts[n]&&r.isPresent(t._partiallyInvalidDate.invalidDateParts[n].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var a=i.cloneDate(t),s=!1;switch(e){case"y":a.setFullYear(a.getFullYear()+n);break;case"M":a=i.addMonths(this.value,n);break;case"d":case"E":a.setDate(a.getDate()+n);break;case"h":case"H":a.setHours(a.getHours()+n),s=!0;break;case"m":a.setMinutes(a.getMinutes()+n),s=!0;break;case"s":a.setSeconds(a.getSeconds()+n),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+n);break;case"a":a.setHours(a.getHours()+12*n),s=!0}return{date:a,timeModified:s}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var a=i.cloneDate(t);switch(e){case"y":a.setFullYear(n);break;case"M":a=i.addMonths(t,n-t.getMonth());break;case"d":case"E":a.setDate(n);break;case"h":case"H":a.setHours(n);break;case"m":a.setMinutes(n);break;case"s":a.setSeconds(n);break;case"S":a.setMilliseconds(n);break;case"a":a.setHours(n)}return a},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(a=e-1;a>=0;a--){s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.unshift(s)}return i},t}();e.DateObject=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){this.symbols="",this.partMap=[]};e.Mask=i},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 i=n(2),a={events:{}},s=function(){function t(t){this.options=i.extend({},a,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!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=s},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(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 n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},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(e,n){e.exports=t},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 i,a=n(0),s=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,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,i,a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];if(!a.length)return t;var l=a.shift();if(s(t)&&s(l))for(var h in l)r(l[h])?t[h]=l[h]:s(l[h])?(t[h]||e.extend(t,((n={})[h]={},n)),e.deepExtend(t[h],l[h])):e.extend(t,((i={})[h]=l[h],i));return e.deepExtend.apply(void 0,[t].concat(a))},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=(i="setFullYear",function(t,e){var n=a.cloneDate(t);return n[i](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,i,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),a=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,s=t.formatPattern,r=t.selectionStart,o=t.isInCaretMode,l=t.keyEvent,h=e[r+e.length-n.length],u=e.substring(0,r+e.length-n.length),c=n.substring(0,r),d=[];if(u===c&&r>0)return d.push([s[r-1],c[r-1]]),d;if(0===u.indexOf(c)&&o&&(l.key===a.Key.DELETE||l.key===a.Key.BACKSPACE)||0===u.indexOf(c)&&!o&&(0===c.length||s[c.length-1]!==s[c.length])){var p="";o||1!==c.length||d.push([s[0],c[0]]);for(var m=c.length;m<u.length;m++)s[m]!==p&&s[m]!==i.Constants.formatSeparator&&(p=s[m],d.push([p,""]));return d}if(o&&(0===c.indexOf(u)||s[r-1]===i.Constants.formatSeparator)||!o&&(0===c.indexOf(u)||s[r-1]===i.Constants.formatSeparator)){var f=s[0];for(m=Math.max(0,u.length-1);m<s.length;m++)if(s[m]!==i.Constants.formatSeparator){f=s[m];break}return[[f,c[r-1]]]}return!o&&" "===c[c.length-1]||!o&&c[c.length-1]===h?[[s[r-1],i.Constants.formatSeparator]]:[[s[r-1],c[r-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 i=n(6);e.DateInput=i.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=n(7),s=n(8),r=n(3),o=n(10),l=n(4),h=n(2),u=n(11),c=n(12),d=n(0),p=n(1),m={format:"d",allowNulls:!1,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={},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,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0},f=function(t){function e(e,n){var i=t.call(this,n)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=c.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(e,n),i}return a.__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=h.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);h.isValidDate(n)||(n=null),this.element=t,this.options=h.extend({},m,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",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=h.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},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;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,i=h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,a=!n&&i?0:this.caret()[0];this.selectNearestSegment(a)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===o.KeyCode.BACKSPACE||e.key===l.Key.BACKSPACE,i=e.keyCode===o.KeyCode.DELETE||e.key===l.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var a=this.interactionMode;!this.options.allowCaretMode||a===c.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var s=this.isInCaretMode();if(s&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var u=this.dateObject&&this.dateObject.getValue(),m=this.dateObject.getTextAndFormat(),f=m.text,v=m.format;this.currentFormat=v;var g="";g=s&&(n||i||a===c.DateInputInteractionMode.Caret)?this.previousElementValue:f;var y=this.elementValue,D=r.approximateStringMatching({oldText:g,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent}),E=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&s&&this.currentFormat.length!==this.elementValue.length&&E&&E.length>0&&E!==p.Constants.formatSeparator&&(D&&0!==D.length?D[0]&&D[0][0]!==p.Constants.formatSeparator&&D[0][0]!==E&&(D[0][0]=E,D[0][1]=t.data||""):((D=[])[0][0]=E,D[0][1]=t.data||"")),!s||D&&0!==D.length){if(s&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(s&&D[0]&&(D[0][0]===p.Constants.formatSeparator||D[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var b=1===D.length&&D[0][1]===p.Constants.formatSeparator,S=[],P=!1;if(!b)for(var M=0;M<D.length;M++){var I=this.dateObject.parsePart({symbol:D[M][0],currentChar:D[M][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});S.push(I),P=I.switchToNext}this.options.autoSwitchParts||(P=!1),this.resetSegmentValue=!1;var x,C=S[S.length-1],O=C&&!C.value,w=s&&(n||i)&&O,F=!!C&&C.resetPart,V=!!C&&C.hasInvalidDatePart,k=!d.isEqual(u,this.dateObject.value),T=this.selection;if((!s||w||F)&&(F&&(x=this.currentFormat[T.start]),this.forceUpdate()),D.length&&D[0][0]!==p.Constants.formatSeparator)if(!s||w||F)x?this.setSelection(this.selectionBySymbol(x)):(this.options.autoSwitchParts||D[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0]));else if(s)if(k&&h.isPresent(this.dateObject.getValue())||!k&&P&&h.isPresent(this.dateObject.getValue())){if(P)this.switchDateSegment(1);else if(this.options.format.length!==this.currentFormat.length&&E&&"y"!==E){var _=this.elementValue.length;this.forceUpdate();var N=this.elementValue.length-_;this.setSelection({start:T.start+N,end:T.start+N})}}else if(O){var A=this.dateObject.getLeadingZero()[E];P?this.switchDateSegment(1):"0"===t.data&&A||this.restorePreviousInputEventState()}if(P||!s||n||i||F||!O)this.options.autoSwitchParts&&(P||b)&&(s||this.switchDateSegment(1));else if(k)this.currentFormat.length===this.elementValue.length||a!==c.DateInputInteractionMode.Caret&&k||(a!==c.DateInputInteractionMode.Caret?(x=this.currentFormat[T.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(x))):V||this.restorePreviousInputEventState());else{A=this.dateObject.getLeadingZero()[E];"0"===t.data&&A||V||this.restorePreviousInputEventState()}this.tryTriggerValueChange({oldValue:u,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,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.interactionMode=c.DateInputInteractionMode.None,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,i=e.end;this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:i},this.previousElementSelection={start:n,end:i};var a=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(a.indexOf(t.keyCode.toString())>=0||a.indexOf(t.keyCode)>=0||a.indexOf(t.key.toLowerCase().trim())>=0){var s=a.indexOf(l.Key.TAB.toLowerCase().trim())>=0||a.indexOf(o.KeyCode.TAB)>=0||a.indexOf(o.KeyCode.TAB.toString())>=0;if(!s)return t.preventDefault(),void this.switchDateSegment(1);var r=this.selection,h=r.start,u=r.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),h!==this.selection.start||u!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],d=this.getStepFromSymbol(c),p=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),p=!0;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(d,c,event),p=!0;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),p=!0;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-d,c,event),p=!0;break;case o.KeyCode.ENTER:break;case o.KeyCode.DELETE:case o.KeyCode.BACKSPACE:if(this.options.allowNulls){var m=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:m,event:t})}return p=!0,void(t.keyCode===o.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(o.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(l.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case l.Key.HOME:this.selectNearestSegment(0);break;case l.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}p&&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 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: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)},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));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,i=t-1;n<this.currentFormat.length||i>=0;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(i>=0&&this.currentFormat[i]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],a="",s="";if(t<0){for(var r=n+t;r>=0;r--)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==i){n=r,a=s;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==p.Constants.formatSeparator&&s!==i){n=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}this.interactionMode=c.DateInputInteractionMode.None;var o=this.selection,l=o.start,h=o.end;if(l<h&&this.currentFormat[l]!==this.currentFormat[h-1])return this.setSelection(this.selectionByIndex(t>0?l:h-1)),this.resetSegmentValue=!0,void(this.interactionMode=c.DateInputInteractionMode.None);for(var u=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===u||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var m=d;m>=0&&m<this.currentFormat.length&&this.currentFormat[m]===this.currentFormat[d];)m+=t;d>m&&(m+1!==l||d+1!==h)?(this.setSelection({start:m+1,end:d+1}),this.resetSegmentValue=!0):d<m&&(d!==l||m!==h)&&(this.setSelection({start:d,end:m}),this.resetSegmentValue=!0),this.interactionMode=c.DateInputInteractionMode.None}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject){var i=this.value,a=1*t,s=this.caret();if("S"===(e=e||this.currentFormat[s[0]])&&!this.options.steps.millisecond){var r=h.millisecondDigitsInFormat(this.inputFormat);a=h.millisecondStepFor(r)}this.dateObject.modifyPart(e,a),this.tryTriggerValueChange({oldValue:i,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",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:{}}),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.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&&!h.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(n),a=i.text,s=i.format;this.currentFormat=s,this.currentText=a;var r=this.options.hasPlaceholder||h.isPresent(this.options.placeholder),o=!this.isActive&&r&&!this.dateObject.hasValue();r&&h.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var l=o?"":a;this.previousElementValue=this.elementValue,this.setElementValue(l),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],a=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(n&&(h.isDocumentAvailable()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),i=[a.selectionStart,a.selectionEnd])}catch(t){i=[]}return i}},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,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new s.DateObject(h.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},e}(u.Observable);e.DateInput=f},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a=n(9),s=n(3),r=n(2),o=n(1),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,a=t.format,s=t.cycleTime,r=void 0!==s&&s,l=t.twoDigitYearMax,h=void 0===l?o.Constants.twoDigitYearMax:l,u=t.value,c=void 0===u?null:u,d=t.autoCorrectParts,p=void 0===d||d;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!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=i.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.intl=e,this.formatPlaceholder=n||"wide",this.format=a,this.cycleTime=r,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=h,this.autoCorrectParts=p,c)this._value=i.cloneDate(c);else{this._value=i.getDate(new Date);for(var m=this.dateFormatString(this.value,this.format).symbols,f=0;f<m.length;f++)this.setExisting(m[f],!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),n=0;n<e.length;n++){var i=e[n],a=this.intl.cldr[i];if(a.name&&a.calendar&&a.numbers&&a.name!==o.Constants.defaultLocaleId){t=a.name;break}}return t},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){t?i.isEqual(t,this._value)||(this._value=i.cloneDate(t),this.modifyExisting(!0)):(this._value=i.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 i.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),i=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var a="",o=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),h=0;h<o.length;h++){var u=i.symbols[h];if("literal"===i.partMap[h].type)a+=n[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(i,h);if("M"===u){var d=(r.parseToInt(this.getInvalidDatePartValue(u))+1).toString();if(c.length>2)a+=l[u][h];else if(this.getInvalidDatePartValue(u))a+=s.padZero(c.length-d.length)+d,h+=c.length-1;else a+=l[u][h]}else if(this.getInvalidDatePartValue(u)){d=this.getInvalidDatePartValue(u).toString();a+=s.padZero(c.length-d.length)+d,h+=c.length-1}else a+=l[u][h]}else a+=n[h]}n=a}return this.merge(n,i)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,i={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var a=e.getInvalidDatePart(t).date;if(a){var s=e.intl.formatDate(a,n,e.localeId);i[t]=s}})),i},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"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"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 n,a=i.cloneDate(this.value),s=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o)switch(t){case"y":a.setFullYear(a.getFullYear()+e);break;case"M":a=i.addMonths(this.value,e);break;case"d":case"E":a.setDate(a.getDate()+e);break;case"h":case"H":a.setHours(a.getHours()+e),s=!0;break;case"m":a.setMinutes(a.getMinutes()+e),s=!0;break;case"s":a.setSeconds(a.getSeconds()+e),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+e);break;case"a":a.setHours(a.getHours()+12*e),s=!0}else{var u=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=u.y.value||a.getFullYear(),p=u.M.value||a.getMonth(),m=u.d.value||u.E.value||a.getDate(),f=u.h.value||u.H.value||a.getHours(),v=u.m.value||a.getMinutes(),g=u.s.value||a.getSeconds(),y=u.S.value||a.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 b=i.createDate(d,p,m,f,v,g,y),S=o||l?this.modifyDateSymbolWithValue(a,t,o?p:m):null,P=r.areDatePartsEqualTo(b,d,p,m,f,v,g,y);this.getValue()&&r.areDatePartsEqualTo(b,d,p,m,f,v,g,y)?(a=i.cloneDate(b),this.markDatePartsAsExisting()):o&&S?S.getMonth()===p?this.getExisting("d")?P?(a=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(this.resetInvalidDateSymbol(t),a=i.cloneDate(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),a=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===m?this.getExisting("M")?P?(a=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(a=i.cloneDate(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),a=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(this.value),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(a=this.normalizeCentury(a)),s&&!this.cycleTime&&(a.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=a,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e,n=t.symbol,a=t.currentChar,o=t.resetSegmentValue,l=t.cycleSegmentValue,h=t.rawTextValue,u=t.isDeleting,c=t.originalFormat,d=!l,p=this.dateFormatString(this.value,this.format),m=p.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),f=p.partMap.map((function(t){return{type:t.type,pattern:t.pattern,text:""}})),v=0;v<m.length;v++){for(var g=m[v],y=0;y<g.pattern.length;y++)m[v+y]&&(m[v+y].literal=g.pattern[y]);v+=g.pattern.length-1}for(v=0;v<f.length;v++){for(g=f[v],y=0;y<g.pattern.length;y++)f[v+y]&&(f[v+y].text=g.pattern[y]);v+=g.pattern.length-1}var D={value:null,switchPart:!1,resetPart:d&&"M"===n&&p.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2})),hasInvalidDatePart:!1};if(!a){if(!d)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(v=0;v<m.length;v++){var E=m[v].literal,b=h.startsWith(E),S=h.endsWith(E),P=h.indexOf(E+E)>=0;if(b||S||P)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),r.extend(D,{value:null,switchToNext:!1})}}var M=this.intl.formatDate(this.value,this.format,this.localeId),I=p.symbols,x=!1,C="",O="",w="",F="",V="",k="",T="";for(v=0;v<f.length;v++)T+=f[v].text;var _=this.format===I||this.format===T||this.format===c||this.format.length===c.length,N=(_?T:c).indexOf(n),A=(_?T:c).lastIndexOf(n)-N+1,j=0,L=c.length-h.length;if(d||!d&&!this.autoCorrectParts){for(v=0;v<M.length;v++){if(I[v]===n)O+=this.getExisting(n)?M[v]:"0",u?(j<A-1&&(w+=h[v]||""),j++):L>0?w.length+L<A&&(w+=h[v]||""):w+=h[v]||"",x=!0;else x?(k+=M[v],V+=M[v]):(C+=M[v],F+=M[v])}if(_){if(T.length<h.length)w+=a;else if(!u&&c.length>h.length){var K=c.length-h.length,B=w.substr(0,w.length-K);B&&B.length>0&&(w=B)}if(w.length>A)return r.extend(D,{value:null,switchToNext:!1})}if(!_||_&&!this.autoCorrectParts){j=0,O="",w="",C="",k="",x=!1;for(v=0;v<c.length;v++){if(c[v]===n)O+=this.getExisting(n)?M[v]||"":"0",u?(j<A-1&&(w+=h[v]||""),j++):L>0?w.length+L<A&&(w+=h[v]||""):w+=h[v]||"",x=!0;else x?k+=h[v-L]||"":C+=h[v]||""}c.length<h.length&&(w+=a)}}if(!d)if(this.autoCorrectParts){j=0,O="",w="",C="",k="",x=!1;for(v=0;v<M.length;v++){if(I[v]===n)O+=this.getExisting(n)?M[v]:"0",x=!0;else x?k+=M[v]:C+=M[v]}}else O=o?w:O;var H=null,W=this.matchMonth(a),R=this.matchDayPeriod(a,n),Z="0"===a,Y=this.leadingZero||{};Z?("0"===w&&(w=O),0!==r.parseToInt(o?a:(d?w:O)+a)||this.isAbbrMonth(p.partMap,n)||this.incrementLeadingZero(n)):this.resetLeadingZero();var U=this.partPattern(p.partMap,n),q=U?U.pattern:null;if(d&&u&&!w)return this.setExisting(n,!1),r.extend(D,{value:null,switchToNext:!1});var z=O.length-3,G=!0,J=d?w:O;for(v=Math.max(0,z);v<=O.length&&G;v++){J=o?a:d?w:O.substring(v)+a,!d&&this.autoCorrectParts||(G=!1,J=s.unpadZero(J),J=s.padZero(A-J.length)+J);var Q=parseInt(J,10),X=C+J+k;H=this.intl.parseDate(X,this.format,this.localeId),d&&!r.isValidDate(H)&&this.autoCorrectParts&&(H=this.intl.parseDate(F+J+V,this.format,this.localeId));var $=!isNaN(parseInt(a,10))||d&&u&&""===a;if(!H&&!isNaN(Q)&&$&&this.autoCorrectParts){if("M"===n&&!W){var tt=Q-1;tt>-1&&tt<12&&((H=i.cloneDate(this.value)).setMonth(tt),H.getMonth()!==tt&&(H=i.lastDayOfMonth(i.addMonths(H,-1))))}"y"===n&&(H=i.createDate(parseInt(J,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),(d&&r.isValidDate(H)||!d&&H)&&this.date&&H.getDate()!==this.value.getDate()&&(H=i.lastDayOfMonth(i.addMonths(H,-1))))}if(d&&r.isValidDate(H)||!d&&H){var et=""+C+this.peek(J,q)+k,nt=null===this.intl.parseDate(et,this.format,this.localeId)||Y[n]&&q.length<=J.length||!1;if(this.shouldNormalizeCentury()&&(H=this.normalizeCentury(H)),this._value=H,this.setExisting(n,!0),this.resetInvalidDateSymbol(n),this.autoCorrectParts||("M"===n?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===n&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart()||this.markDatePartsAsExisting()),d&&nt)if("M"===n)nt=(it=r.parseToInt(w))>=2||w.length>=2;else nt=nt?_?w.length===A:w.length>A:nt;return r.extend(D,{value:this.value,switchToNext:nt})}}if(W&&(H=this.intl.parseDate(C+W+k,this.format,this.localeId)))return this._value=H,this.setExisting(n,!0),r.extend(D,{value:this.value,switchToNext:!1});if(R&&(H=this.intl.parseDate(C+R+k,this.format)))return this._value=H,r.extend(D,{value:this.value,switchToNext:!0});if(Z&&(this.leadingZero=this.isAbbrMonth(p.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),!this.autoCorrectParts){var it=void 0,at=d?w:J,st=r.parseToInt(at);if(r.isNumber(st)){if("d"===n&&(st<=0||st>31)||"M"===n&&(st<0||st>11))return r.extend(D,{value:null,switchToNext:!1});it="M"===n?st-1:st;var rt="M"===n,ot="d"===n,lt=i.cloneDate(this._value),ht=this._partiallyInvalidDate.invalidDateParts||{},ut=ht.y.value||lt.getFullYear(),ct=rt?it:ht.M.value||lt.getMonth(),dt=ot?it:ht.d.value||ht.E.value||lt.getDate(),pt=ht.h.value||ht.H.value||lt.getHours(),mt=ht.m.value||lt.getMinutes(),ft=ht.s.value||lt.getSeconds(),vt=ht.S.value||lt.getMilliseconds(),gt=i.createDate(ut,ct,dt,pt,mt,ft,vt),yt=r.areDatePartsEqualTo(gt,ut,ct,dt,pt,mt,ft,vt),Dt=rt||ot?this.modifyDateSymbolWithValue(lt,n,rt?ct:dt):null,Et=!1;if(rt&&Dt?Dt.getMonth()===ct?this.getExisting("d")?yt?(lt=i.cloneDate(gt),this.resetInvalidDateSymbol(n)):(Et=!0,this.setInvalidDatePart(n,{value:ct,date:i.cloneDate(Dt),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1)):yt?(this.resetInvalidDateSymbol(n),lt=i.cloneDate(gt),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(n),lt=i.cloneDate(Dt)):(Et=!0,this.setInvalidDatePart(n,{value:ct,date:i.cloneDate(Dt),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1)):ot&&Dt&&(Dt.getDate()===dt?this.getExisting("M")?yt?(lt=i.cloneDate(gt),this.resetInvalidDateSymbol(n)):(Et=!0,this.setInvalidDatePart(n,{value:dt,date:i.cloneDate(Dt),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1)):yt?(lt=i.cloneDate(gt),this.resetInvalidDateSymbol(n),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(n),lt=i.cloneDate(Dt)):(Et=!0,this.setInvalidDatePart(n,{value:dt,date:i.cloneDate(this.value),startDate:i.cloneDate(this.value)}),this.setExisting(n,!1))),!Et){if(this.setExisting(n,!0),d&&!r.isValidDate(H)){var bt=this.intl.parseDate(F+J+V,this.format,this.localeId);r.isValidDate(bt)&&(this._value=bt)}else this._value=lt;this.getValue()&&this.resetInvalidDate()}nt=!1;return nt="M"===n?st>=2||at.length>=2:_?at.length===A:at.length>A,r.extend(D,{value:null,switchToNext:nt,hasInvalidDatePart:Et})}}return r.extend(D,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(s.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.getLeadingZero=function(){return this.leadingZero||{}},t.prototype.normalizeCentury=function(t){if(!r.isPresent(t))return t;var e=r.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return r.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 s.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),i=[],s=[],r=0;r<n.length;r++)for(var l=this.intl.formatDate(t,{pattern:n[r].pattern},this.localeId).length;l>0;)i.push(this.symbols[n[r].pattern[0]]||o.Constants.formatSeparator),s.push(n[r]),l--;var h=new a.Mask;return h.symbols=i.join(""),h.partMap=s,h},t.prototype.merge=function(t,e){for(var n="",i="",a=e.symbols,o=!1,l=0,h=this.getFormattedInvalidDates(a),u=a.length-1;u>=0;u--){var c=this.getPartsForSegment(e,u);if(-1===this.knownParts.indexOf(a[u])||this.getExisting(a[u]))this.autoCorrectParts?n=t[u]+n:t.length!==a.length?o?n=t[u]+n:l>0?(n=t[u]+n,--l<=0&&(o=!0)):n=(t[u+t.length-a.length]||"")+n:n=t[u]+n,i=a[u]+i;else{var d=a[u],p=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(d)){for(;u>=0&&d===a[u];)u--;u++}if(this.leadingZero&&this.leadingZero[d])n="0"+n;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)n=h[d][u]+n;else m=(r.parseToInt(this.getInvalidDatePartValue(d))+1).toString(),n=s.padZero(c.length-m.length)+m+n,p=c.length-1,l=m.length-c.length;else n=s.padZero(c.length-m.length)+m+n,p=c.length-1,l=m.length-c.length}else n=this.dateFieldName(e.partMap[u])+n;for(;i.length<n.length;)i=a[u]+i;0!==p&&(u=u-p+(t.length-a.length))}}return{text:n,format:i}},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]&&r.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,i=void 0===n?null:n,a=e.date,s=void 0===a?null:a,r=e.startDateOffset,o=void 0===r?0:r,l=e.startDate,h=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=i,this._partiallyInvalidDate.invalidDateParts[t].date=s,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=o,this._partiallyInvalidDate.startDate=h)},t.prototype.hasInvalidDatePart=function(){var t=this,e=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(n){t._partiallyInvalidDate.invalidDateParts[n]&&r.isPresent(t._partiallyInvalidDate.invalidDateParts[n].value)&&(e=!0)})),e},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var a=i.cloneDate(t),s=!1;switch(e){case"y":a.setFullYear(a.getFullYear()+n);break;case"M":a=i.addMonths(this.value,n);break;case"d":case"E":a.setDate(a.getDate()+n);break;case"h":case"H":a.setHours(a.getHours()+n),s=!0;break;case"m":a.setMinutes(a.getMinutes()+n),s=!0;break;case"s":a.setSeconds(a.getSeconds()+n),s=!0;break;case"S":a.setMilliseconds(a.getMilliseconds()+n);break;case"a":a.setHours(a.getHours()+12*n),s=!0}return{date:a,timeModified:s}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var a=i.cloneDate(t);switch(e){case"y":a.setFullYear(n);break;case"M":a=i.addMonths(t,n-t.getMonth());break;case"d":case"E":a.setDate(n);break;case"h":case"H":a.setHours(n);break;case"m":a.setMinutes(n);break;case"s":a.setSeconds(n);break;case"S":a.setMilliseconds(n);break;case"a":a.setHours(n)}return a},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(a=e-1;a>=0;a--){s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.unshift(s)}return i},t}();e.DateObject=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){this.symbols="",this.partMap=[]};e.Mask=i},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 i=n(2),a={events:{}},s=function(){function t(t){this.options=i.extend({},a,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!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=s},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={}))}])}));
|
|
@@ -820,13 +820,10 @@ var DateObject = /** @class */ (function () {
|
|
|
820
820
|
if ((isInCaretMode && isValidDate(parsedDate)) || (!isInCaretMode && parsedDate)) {
|
|
821
821
|
// move to next segment if the part will overflow with next char
|
|
822
822
|
// when start from empty date (01, then 010), padded zeros should be trimmed
|
|
823
|
-
var
|
|
824
|
-
var
|
|
825
|
-
var
|
|
826
|
-
var
|
|
827
|
-
var switchToNext = peekDate === null ||
|
|
828
|
-
(leadingZero[symbol] && patternValue.length <= middle.length) ||
|
|
829
|
-
patternSatisfied;
|
|
823
|
+
var peekValue = this.peek(middle, patternValue);
|
|
824
|
+
var peekDateString = "" + prefix + peekValue + suffix;
|
|
825
|
+
var peekDate = this.intl.parseDate(peekDateString, this.format, this.localeId);
|
|
826
|
+
var switchToNext = peekDate === null || (leadingZero[symbol] && patternValue.length <= middle.length) || false;
|
|
830
827
|
if (this.shouldNormalizeCentury()) {
|
|
831
828
|
parsedDate = this.normalizeCentury(parsedDate);
|
|
832
829
|
}
|
|
@@ -805,13 +805,10 @@ export class DateObject {
|
|
|
805
805
|
if ((isInCaretMode && isValidDate(parsedDate)) || (!isInCaretMode && parsedDate)) {
|
|
806
806
|
// move to next segment if the part will overflow with next char
|
|
807
807
|
// when start from empty date (01, then 010), padded zeros should be trimmed
|
|
808
|
-
const
|
|
809
|
-
const
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
let switchToNext = peekDate === null ||
|
|
813
|
-
(leadingZero[symbol] && patternValue.length <= middle.length) ||
|
|
814
|
-
patternSatisfied;
|
|
808
|
+
const peekValue = this.peek(middle, patternValue);
|
|
809
|
+
const peekDateString = `${prefix}${peekValue}${suffix}`;
|
|
810
|
+
const peekDate = this.intl.parseDate(peekDateString, this.format, this.localeId);
|
|
811
|
+
let switchToNext = peekDate === null || (leadingZero[symbol] && patternValue.length <= middle.length) || false;
|
|
815
812
|
if (this.shouldNormalizeCentury()) {
|
|
816
813
|
parsedDate = this.normalizeCentury(parsedDate);
|
|
817
814
|
}
|
|
@@ -822,13 +822,10 @@ var DateObject = /** @class */ (function () {
|
|
|
822
822
|
if ((isInCaretMode && utils_2.isValidDate(parsedDate)) || (!isInCaretMode && parsedDate)) {
|
|
823
823
|
// move to next segment if the part will overflow with next char
|
|
824
824
|
// when start from empty date (01, then 010), padded zeros should be trimmed
|
|
825
|
-
var
|
|
826
|
-
var
|
|
827
|
-
var
|
|
828
|
-
var
|
|
829
|
-
var switchToNext = peekDate === null ||
|
|
830
|
-
(leadingZero[symbol] && patternValue.length <= middle.length) ||
|
|
831
|
-
patternSatisfied;
|
|
825
|
+
var peekValue = this.peek(middle, patternValue);
|
|
826
|
+
var peekDateString = "" + prefix + peekValue + suffix;
|
|
827
|
+
var peekDate = this.intl.parseDate(peekDateString, this.format, this.localeId);
|
|
828
|
+
var switchToNext = peekDate === null || (leadingZero[symbol] && patternValue.length <= middle.length) || false;
|
|
832
829
|
if (this.shouldNormalizeCentury()) {
|
|
833
830
|
parsedDate = this.normalizeCentury(parsedDate);
|
|
834
831
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(s){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 i(t){var e;return(a[t]||(e=a[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,a;n=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var n=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,n){return Math.min(n,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=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length)return t;var i,a=e.shift();if(o(t)&&o(a))for(var s in a)i=a[s],i instanceof HTMLElement?t[s]=a[s]:o(a[s])?(t[s]||r.extend(t,((i={})[s]={},i)),r.deepExtend(t[s],a[s])):r.extend(t,((i={})[s]=a[s],i));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=n.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,n,i,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,n){"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,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 d=n(1),p=n(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,n=t.newText,i=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,t=t.keyEvent,r=e[a+e.length-n.length],o=e.substring(0,a+e.length-n.length),e=n.substring(0,a),l=[];if(o===e&&0<a)return l.push([i[a-1],e[a-1]]),l;if(0===o.indexOf(e)&&s&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!s&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";s||1!==e.length||l.push([i[0],e[0]]);for(var u=e.length;u<o.length;u++)i[u]!==h&&i[u]!==d.Constants.formatSeparator&&(h=i[u],l.push([h,""]));return l}if((!s||0!==e.indexOf(o)&&i[a-1]!==d.Constants.formatSeparator)&&(s||0!==e.indexOf(o)&&i[a-1]!==d.Constants.formatSeparator))return!s&&" "===e[e.length-1]||!s&&e[e.length-1]===r?[[i[a-1],d.Constants.formatSeparator]]:[[i[a-1],e[a-1]]];for(var c=i[0],u=Math.max(0,o.length-1);u<i.length;u++)if(i[u]!==d.Constants.formatSeparator){c=i[u];break}return[[c,e[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&&t<e||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a={events:{}};function s(t){this.options=i.extend({},a,t)}s.prototype.destroy=function(){},s.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},e.Observable=s},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}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var $=n(2),o=n(8),tt=n(4),et=n(0),h=n(1),i=/d|M|H|h|m|s/;function a(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,a=t.cycleTime,a=void 0!==a&&a,s=t.twoDigitYearMax,s=void 0===s?h.Constants.twoDigitYearMax:s,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.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.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=s,this.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(a.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(a.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],i=this.intl.cldr[i];if(i.name&&i.calendar&&i.numbers&&i.name!==h.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),a.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()},a.prototype.hasValue=function(){var n=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&n.getExisting(e.pattern[0])},!1)},a.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return $.cloneDate(this.value)},a.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},a.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",a=this.intl.formatDate(this.value,t,this.localeId),s=this.getFormattedInvalidDates(t),r=0;r<a.length;r++){var o,l,h=n.symbols[r];"literal"!==n.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(n,r),"M"===h?(l=(et.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=tt.padZero(o.length-l.length)+l,r+=o.length-1):i+=s[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=tt.padZero(o.length-l.length)+l,r+=o.length-1):i+=s[h][r]):i+=e[r]}e=i}return this.merge(e,n)},a.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,a={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),a[t]=e)}),a},a.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)},a.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"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},a.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"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},a.prototype.modifyPart=function(t,e){if(et.isPresent(t)&&et.isPresent(e)&&0!==e){var n,i=$.cloneDate(this.value),a=!1,s="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=$.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),a=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||i.getFullYear(),c=l.M.value||i.getMonth(),d=l.d.value||l.E.value||i.getDate(),p=l.h.value||l.H.value||i.getHours(),m=l.m.value||i.getMinutes(),g=l.s.value||i.getSeconds(),l=l.S.value||i.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=s||r?this.modifyDateSymbolWithValue(i,t,s?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)?(i=$.cloneDate(o),this.markDatePartsAsExisting()):s&&h?h.getMonth()===c?this.getExisting("d")?v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(this.resetInvalidDateSymbol(t),i=$.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=$.cloneDate(h)):(n=!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?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=$.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(this.value),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),a&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},a.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,A=t.resetSegmentValue,i=t.cycleSegmentValue,a=t.rawTextValue,j=t.isDeleting,s=t.originalFormat,r=!i,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,switchPart:!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(!n){if(!r)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(h=0;h<o.length;h++){var L=o[h].literal,K=a.startsWith(L),B=a.endsWith(L),L=0<=a.indexOf(L+L);if(K||B||L)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1})}}var p=this.intl.formatDate(this.value,this.format,this.localeId),H=t.symbols,m=!1,g="",v="",f="",W="",R="",y="",Z="";for(h=0;h<l.length;h++)Z+=l[h].text;var D=this.format===H||this.format===Z||this.format===s||this.format.length===s.length,i=(D?Z:s).indexOf(e),E=(D?Z:s).lastIndexOf(e)-i+1,b=0,Y=s.length-a.length;if(r||!r&&!this.autoCorrectParts){for(h=0;h<p.length;h++)H[h]===e?(v+=this.getExisting(e)?p[h]:"0",j?(b<E-1&&(f+=a[h]||""),b++):0<Y&&!(f.length+Y<E)||(f+=a[h]||""),m=!0):m?(y+=p[h],R+=p[h]):(g+=p[h],W+=p[h]);if(D)if(Z.length<a.length?f+=n:!j&&s.length>a.length&&(i=s.length-a.length,i=f.substr(0,f.length-i))&&0<i.length&&(f=i),f.length>E)return et.extend(d,{value:null,switchToNext:!1});if(!D||!this.autoCorrectParts){for(y=g=f=v="",m=!1,h=b=0;h<s.length;h++)s[h]===e?(v+=this.getExisting(e)?p[h]||"":"0",j?(b<E-1&&(f+=a[h]||""),b++):0<Y&&!(f.length+Y<E)||(f+=a[h]||""),m=!0):m?y+=a[h-Y]||"":g+=a[h]||"";s.length<a.length&&(f+=n)}}if(!r)if(this.autoCorrectParts)for(y=g=f=v="",m=!1,h=b=0;h<p.length;h++)H[h]===e?(v+=this.getExisting(e)?p[h]:"0",m=!0):m?y+=p[h]:g+=p[h];else v=A?f:v;var S=null,U=this.matchMonth(n),i=this.matchDayPeriod(n,e),P="0"===n,z=this.leadingZero||{},M=(P?("0"===f&&(f=v),0!==et.parseToInt(A?n:(r?f:v)+n)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(t.partMap,e)),q=M?M.pattern:null;if(r&&j&&!f)this.setExisting(e,!1);else{for(var M=v.length-3,G=!0,I=r?f:v,h=Math.max(0,M);h<=v.length&&G;h++){I=A?n:r?f:v.substring(h)+n,!r&&this.autoCorrectParts||(G=!1,I=tt.unpadZero(I),I=tt.padZero(E-I.length)+I);var x,J=parseInt(I,10),S=this.intl.parseDate(g+I+y,this.format,this.localeId),C=(r&&!et.isValidDate(S)&&this.autoCorrectParts&&(S=this.intl.parseDate(W+I+R,this.format,this.localeId)),!isNaN(parseInt(n,10))||r&&j&&""===n);if(!S&&!isNaN(J)&&C&&this.autoCorrectParts&&("M"!==e||U||-1<(C=J-1)&&C<12&&((S=$.cloneDate(this.value)).setMonth(C),S.getMonth()!==C)&&(S=$.lastDayOfMonth($.addMonths(S,-1))),"y"===e)&&(S=$.createDate(parseInt(I,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(S)||!r&&S)&&this.date&&S.getDate()!==this.value.getDate()&&(S=$.lastDayOfMonth($.addMonths(S,-1))),r&&et.isValidDate(S)||!r&&S)return J=this.intl.parseDate(""+g+this.peek(I,q)+y,this.format,this.localeId),C=this.patternLength(q)||q.length,C=((this.leadingZero||{})[e]||0)+(tt.unpadZero(I)||n).length>=C,x=null===J||z[e]&&q.length<=I.length||C,this.shouldNormalizeCentury()&&(S=this.normalizeCentury(S)),this._value=S,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart())||this.markDatePartsAsExisting(),r&&(x=x&&("M"===e?2<=(X=et.parseToInt(f))||2<=f.length:x&&(D?f.length===E:f.length>E))),et.extend(d,{value:this.value,switchToNext:x})}if(U&&(S=this.intl.parseDate(g+U+y,this.format,this.localeId)))return this._value=S,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!1});if(i&&(S=this.intl.parseDate(g+i+y,this.format)))return this._value=S,et.extend(d,{value:this.value,switchToNext:!0});if(P&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((M={})[e]=!0,M),this.setExisting(e,!1)),!this.autoCorrectParts){var O,w,F,V,k,_,T,N,Q,X=void 0,i=r?f:I,P=et.parseToInt(i);if(et.isNumber(P))return"d"===e&&(P<=0||31<P)||"M"===e&&(P<0||11<P)?et.extend(d,{value:null,switchToNext:!1}):(X="M"===e?P-1:P,t="M"===e,M="d"===e,O=$.cloneDate(this._value),_=(V=this._partiallyInvalidDate.invalidDateParts||{}).y.value||O.getFullYear(),w=t?X:V.M.value||O.getMonth(),F=M?X:V.d.value||V.E.value||O.getDate(),T=V.h.value||V.H.value||O.getHours(),N=V.m.value||O.getMinutes(),Q=V.s.value||O.getSeconds(),V=V.S.value||O.getMilliseconds(),k=$.createDate(_,w,F,T,N,Q,V),_=et.areDatePartsEqualTo(k,_,w,F,T,N,Q,V),T=t||M?this.modifyDateSymbolWithValue(O,e,t?w:F):null,N=!1,t&&T?T.getMonth()===w?this.getExisting("d")?_?(O=$.cloneDate(k),this.resetInvalidDateSymbol(e)):(N=!0,this.setInvalidDatePart(e,{value:w,date:$.cloneDate(T),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):_?(this.resetInvalidDateSymbol(e),O=$.cloneDate(k),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),O=$.cloneDate(T)):(N=!0,this.setInvalidDatePart(e,{value:w,date:$.cloneDate(T),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):M&&T&&(T.getDate()===F?this.getExisting("M")?_?(O=$.cloneDate(k),this.resetInvalidDateSymbol(e)):(N=!0,this.setInvalidDatePart(e,{value:F,date:$.cloneDate(T),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):_?(O=$.cloneDate(k),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),O=$.cloneDate(T)):(N=!0,this.setInvalidDatePart(e,{value:F,date:$.cloneDate(this.value),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1))),N||(this.setExisting(e,!0),r&&!et.isValidDate(S)?(Q=this.intl.parseDate(W+I+R,this.format,this.localeId),et.isValidDate(Q)&&(this._value=Q)):this._value=O,this.getValue()&&this.resetInvalidDate()),x=!1,x="M"===e?2<=P||2<=i.length:D?i.length===E:i.length>E,et.extend(d,{value:null,switchToNext:x,hasInvalidDatePart:N}))}}return et.extend(d,{value:null,switchToNext:!1})},a.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(tt.dateSymbolMap,{})[t]},a.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},a.prototype.setLeadingZero=function(t){this.leadingZero=t},a.prototype.getLeadingZero=function(){return this.leadingZero||{}},a.prototype.normalizeCentury=function(t){var e,n;return et.isPresent(t)?(e=et.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),et.setYears(t,n+e)):t},a.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},a.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},a.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},a.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return tt.padZero(e.length-t.length)+t},a.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 n=parseInt(this.typedMonthPart,10);if(1<=n&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},a.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""},a.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[]},a.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},a.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},a.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],a=[],s=0;s<n.length;s++)for(var r=this.intl.formatDate(t,{pattern:n[s].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[s].pattern[0]]||h.Constants.formatSeparator),a.push(n[s]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=a,e},a.prototype.merge=function(t,e){for(var n="",i="",a=e.symbols,s=!1,r=0,o=this.getFormattedInvalidDates(a),l=a.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(a[l])||this.getExisting(a[l]))this.autoCorrectParts||t.length===a.length||s?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(s=!0)):n=(t[l+t.length-a.length]||"")+n,i=a[l]+i;else{var u,c=a[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===a[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),n=tt.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):(n=tt.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):n=this.dateFieldName(e.partMap[l])+n;i.length<n.length;)i=a[l]+i;0!==d&&(l=l-d+(t.length-a.length))}}return{text:n,format:i}},a.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})))},a.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},a.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},a.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},a.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},a.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},a.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},a.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},a.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,a=e.startDateOffset,a=void 0===a?0:a,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=a,this._partiallyInvalidDate.startDate=e)},a.prototype.hasInvalidDatePart=function(){var e=this,n=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!0)}),n},a.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=$.cloneDate(t),a=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=$.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),a=!0;break;case"m":i.setMinutes(i.getMinutes()+n),a=!0;break;case"s":i.setSeconds(i.getSeconds()+n),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),a=!0}return{date:i,timeModified:a}},a.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=$.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=$.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},a.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},a.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(a=e-1;0<=a&&(s=t.partMap[a],n.type===s.type&&n.pattern===s.pattern);a--)i.unshift(s);return i},e.DateObject=a},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=n(10),s=n(9),b=n(4),S=n(7),P=n(3),M=n(0),r=n(6),I=n(5),x=n(2),C=n(1),o={format:"d",allowNulls:!1,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={}).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,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:C.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,a.__extends(l,i),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var n=M.isValidDate(this.options.value)?x.cloneDate(this.options.value):new Date(e.formattedValue);M.isValidDate(n)||(n=null),this.element=t,this.options=M.extend({},o,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=I.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,i.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=M.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===I.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;var e,n=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=M.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(n.start)))},l.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===S.KeyCode.BACKSPACE||e.key===P.Key.BACKSPACE,i=e.keyCode===S.KeyCode.DELETE||e.key===P.Key.DELETE;if(this.element&&this.dateObject)if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var e=this.interactionMode,a=(!this.options.allowCaretMode||e===I.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=I.DateInputInteractionMode.Caret:this.interactionMode=I.DateInputInteractionMode.Selection,this.isInCaretMode());if(a&&this.keyDownEvent.key===P.Key.SPACE)this.restorePreviousInputEventState();else{var s=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,a&&(n||i||e===I.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=b.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:a,keyEvent:this.keyDownEvent}),r=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&a&&this.currentFormat.length!==this.elementValue.length&&r&&0<r.length&&r!==C.Constants.formatSeparator&&(l&&0!==l.length?l[0]&&l[0][0]!==C.Constants.formatSeparator&&l[0][0]!==r&&(l[0][0]=r,l[0][1]=t.data||""):((l=[])[0][0]=r,l[0][1]=t.data||"")),!a||l&&0!==l.length){if(a&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(a&&l[0]&&(l[0][0]===C.Constants.formatSeparator||l[0][1]===C.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var o=1===l.length&&l[0][1]===C.Constants.formatSeparator,h=[],u=!1;if(!o)for(var c=0;c<l.length;c++){var d=this.dateObject.parsePart({symbol:l[c][0],currentChar:l[c][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});h.push(d),u=d.switchToNext}this.options.autoSwitchParts||(u=!1),this.resetSegmentValue=!1;var p,m,g=h[h.length-1],v=g&&!g.value,f=a&&(n||i)&&v,y=!!g&&g.resetPart,g=!!g&&g.hasInvalidDatePart,D=!x.isEqual(s,this.dateObject.value),E=this.selection;a&&!f&&!y||(y&&(p=this.currentFormat[E.start]),this.forceUpdate()),l.length&&l[0][0]!==C.Constants.formatSeparator&&(!a||f||y?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===C.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):a&&(D&&M.isPresent(this.dateObject.getValue())||!D&&u&&M.isPresent(this.dateObject.getValue())?u?this.switchDateSegment(1):this.options.format.length!==this.currentFormat.length&&r&&"y"!==r&&(f=this.elementValue.length,this.forceUpdate(),f=this.elementValue.length-f,this.setSelection({start:E.start+f,end:E.start+f})):v&&(m=this.dateObject.getLeadingZero()[r],u?this.switchDateSegment(1):"0"===t.data&&m||this.restorePreviousInputEventState()))),u||!a||n||i||y||!v?this.options.autoSwitchParts&&(u||o)&&!a&&this.switchDateSegment(1):D?this.currentFormat.length===this.elementValue.length||e!==I.DateInputInteractionMode.Caret&&D||(e!==I.DateInputInteractionMode.Caret?(p=this.currentFormat[E.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):g||this.restorePreviousInputEventState()):(m=this.dateObject.getLeadingZero()[r],"0"===t.data&&m||g||this.restorePreviousInputEventState()),this.tryTriggerValueChange({oldValue:s,event:t}),this.triggerInputEnd({event:t}),a&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=I.DateInputInteractionMode.None,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.interactionMode=I.DateInputInteractionMode.None,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,n=e.start,e=e.end,n=(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:e},this.previousElementSelection={start:n,end:e},(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()}));if(0<=n.indexOf(t.keyCode.toString())||0<=n.indexOf(t.keyCode)||0<=n.indexOf(t.key.toLowerCase().trim())){e=0<=n.indexOf(P.Key.TAB.toLowerCase().trim())||0<=n.indexOf(S.KeyCode.TAB)||0<=n.indexOf(S.KeyCode.TAB.toString());if(!e)return t.preventDefault(),void this.switchDateSegment(1);var n=this.selection,i=n.start,n=n.end;if(t.shiftKey&&e?this.switchDateSegment(-1):this.switchDateSegment(1),i!==this.selection.start||n!==this.selection.end)return void t.preventDefault()}var a,s=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(s),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===S.KeyCode.TAB)){switch(t.keyCode){case S.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case S.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,s,event),o=!0;break;case S.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case S.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,s,event),o=!0;break;case S.KeyCode.ENTER:break;case S.KeyCode.DELETE:case S.KeyCode.BACKSPACE:return this.options.allowNulls&&(a=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:a,event:t})),o=!0,void(t.keyCode===S.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(S.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(P.Key.BACKSPACE))&&this.switchDateSegment(-1));case P.Key.HOME:this.selectNearestSegment(0);break;case P.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}o&&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,n=(M.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:n,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:C.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:C.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)},l.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);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}},l.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||0<=i;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},l.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],a="",s="";if(t<0){for(var r=n+t;0<=r;r--)if((s=this.currentFormat[r])!==C.Constants.formatSeparator&&s!==i){n=r,a=s;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==C.Constants.formatSeparator&&s!==i){n=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=I.DateInputInteractionMode.Selection)}this.interactionMode=I.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=I.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]===C.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==C.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=I.DateInputInteractionMode.None}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,a;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,a=this.caret(),"S"!==(e=e||this.currentFormat[a[0]])||this.options.steps.millisecond||(a=M.millisecondDigitsInFormat(this.inputFormat),t=M.millisecondStepFor(a)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!x.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",M.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},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&&!M.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(n),i=n.text,n=n.format,n=(this.currentFormat=n,this.currentText=i,this.options.hasPlaceholder||M.isPresent(this.options.placeholder)),a=!this.isActive&&n&&!this.dateObject.hasValue(),n=(n&&M.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),a?"":i);this.previousElementValue=this.elementValue,this.setElementValue(n),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},l.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],a=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(n&&(M.isDocumentAvailable()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),i=[a.selectionStart,a.selectionEnd])}catch(t){i=[]}return i}},l.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||0<=n;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=n&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},l.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);e<0&&(e=0),this.caret(0,0),this.caret(e,n)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(t){return new s.DateObject(M.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t=void 0===t?{}:t))},l);function l(t,e){var n=i.call(this,e)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=I.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(t,e),n}e.DateInput=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=n(11),a=(e.DateInput=n.DateInput,e);for(i in a)s(i,a[i])}],a={},i.m=n,i.c=a,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},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=12)}}});
|
|
1
|
+
System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(s){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 i(t){var e;return(a[t]||(e=a[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,a;n=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var n=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,n){return Math.min(n,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=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length)return t;var i,a=e.shift();if(o(t)&&o(a))for(var s in a)i=a[s],i instanceof HTMLElement?t[s]=a[s]:o(a[s])?(t[s]||r.extend(t,((i={})[s]={},i)),r.deepExtend(t[s],a[s])):r.extend(t,((i={})[s]=a[s],i));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=n.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,n,i,a,s,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==a||t.getMinutes()!==s||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,n){"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,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 d=n(1),p=n(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,n=t.newText,i=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,t=t.keyEvent,r=e[a+e.length-n.length],o=e.substring(0,a+e.length-n.length),e=n.substring(0,a),l=[];if(o===e&&0<a)return l.push([i[a-1],e[a-1]]),l;if(0===o.indexOf(e)&&s&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!s&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";s||1!==e.length||l.push([i[0],e[0]]);for(var u=e.length;u<o.length;u++)i[u]!==h&&i[u]!==d.Constants.formatSeparator&&(h=i[u],l.push([h,""]));return l}if((!s||0!==e.indexOf(o)&&i[a-1]!==d.Constants.formatSeparator)&&(s||0!==e.indexOf(o)&&i[a-1]!==d.Constants.formatSeparator))return!s&&" "===e[e.length-1]||!s&&e[e.length-1]===r?[[i[a-1],d.Constants.formatSeparator]]:[[i[a-1],e[a-1]]];for(var c=i[0],u=Math.max(0,o.length-1);u<i.length;u++)if(i[u]!==d.Constants.formatSeparator){c=i[u];break}return[[c,e[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&&t<e||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),a={events:{}};function s(t){this.options=i.extend({},a,t)}s.prototype.destroy=function(){},s.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},e.Observable=s},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}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var $=n(2),o=n(8),tt=n(4),et=n(0),h=n(1),i=/d|M|H|h|m|s/;function a(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,a=t.cycleTime,a=void 0!==a&&a,s=t.twoDigitYearMax,s=void 0===s?h.Constants.twoDigitYearMax:s,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.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.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=s,this.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(a.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(a.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],i=this.intl.cldr[i];if(i.name&&i.calendar&&i.numbers&&i.name!==h.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),a.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()},a.prototype.hasValue=function(){var n=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&n.getExisting(e.pattern[0])},!1)},a.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return $.cloneDate(this.value)},a.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},a.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",a=this.intl.formatDate(this.value,t,this.localeId),s=this.getFormattedInvalidDates(t),r=0;r<a.length;r++){var o,l,h=n.symbols[r];"literal"!==n.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(n,r),"M"===h?(l=(et.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=tt.padZero(o.length-l.length)+l,r+=o.length-1):i+=s[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=tt.padZero(o.length-l.length)+l,r+=o.length-1):i+=s[h][r]):i+=e[r]}e=i}return this.merge(e,n)},a.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,a={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),a[t]=e)}),a},a.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)},a.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"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},a.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"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},a.prototype.modifyPart=function(t,e){if(et.isPresent(t)&&et.isPresent(e)&&0!==e){var n,i=$.cloneDate(this.value),a=!1,s="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=$.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),a=!0;break;case"m":i.setMinutes(i.getMinutes()+e),a=!0;break;case"s":i.setSeconds(i.getSeconds()+e),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),a=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||i.getFullYear(),c=l.M.value||i.getMonth(),d=l.d.value||l.E.value||i.getDate(),p=l.h.value||l.H.value||i.getHours(),m=l.m.value||i.getMinutes(),g=l.s.value||i.getSeconds(),l=l.S.value||i.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=s||r?this.modifyDateSymbolWithValue(i,t,s?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)?(i=$.cloneDate(o),this.markDatePartsAsExisting()):s&&h?h.getMonth()===c?this.getExisting("d")?v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(this.resetInvalidDateSymbol(t),i=$.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=$.cloneDate(h)):(n=!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?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(h),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)):v?(i=$.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=$.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:$.cloneDate(this.value),startDateOffset:e,startDate:$.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),a&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},a.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,A=t.resetSegmentValue,i=t.cycleSegmentValue,a=t.rawTextValue,j=t.isDeleting,s=t.originalFormat,r=!i,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,switchPart:!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(!n){if(!r)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(h=0;h<o.length;h++){var L=o[h].literal,K=a.startsWith(L),B=a.endsWith(L),L=0<=a.indexOf(L+L);if(K||B||L)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),et.extend(d,{value:null,switchToNext:!1})}}var p=this.intl.formatDate(this.value,this.format,this.localeId),H=t.symbols,m=!1,g="",v="",f="",W="",R="",y="",Z="";for(h=0;h<l.length;h++)Z+=l[h].text;var D=this.format===H||this.format===Z||this.format===s||this.format.length===s.length,i=(D?Z:s).indexOf(e),E=(D?Z:s).lastIndexOf(e)-i+1,b=0,Y=s.length-a.length;if(r||!r&&!this.autoCorrectParts){for(h=0;h<p.length;h++)H[h]===e?(v+=this.getExisting(e)?p[h]:"0",j?(b<E-1&&(f+=a[h]||""),b++):0<Y&&!(f.length+Y<E)||(f+=a[h]||""),m=!0):m?(y+=p[h],R+=p[h]):(g+=p[h],W+=p[h]);if(D)if(Z.length<a.length?f+=n:!j&&s.length>a.length&&(i=s.length-a.length,i=f.substr(0,f.length-i))&&0<i.length&&(f=i),f.length>E)return et.extend(d,{value:null,switchToNext:!1});if(!D||!this.autoCorrectParts){for(y=g=f=v="",m=!1,h=b=0;h<s.length;h++)s[h]===e?(v+=this.getExisting(e)?p[h]||"":"0",j?(b<E-1&&(f+=a[h]||""),b++):0<Y&&!(f.length+Y<E)||(f+=a[h]||""),m=!0):m?y+=a[h-Y]||"":g+=a[h]||"";s.length<a.length&&(f+=n)}}if(!r)if(this.autoCorrectParts)for(y=g=f=v="",m=!1,h=b=0;h<p.length;h++)H[h]===e?(v+=this.getExisting(e)?p[h]:"0",m=!0):m?y+=p[h]:g+=p[h];else v=A?f:v;var S=null,U=this.matchMonth(n),i=this.matchDayPeriod(n,e),P="0"===n,z=this.leadingZero||{},M=(P?("0"===f&&(f=v),0!==et.parseToInt(A?n:(r?f:v)+n)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e)):this.resetLeadingZero(),this.partPattern(t.partMap,e)),q=M?M.pattern:null;if(r&&j&&!f)this.setExisting(e,!1);else{for(var M=v.length-3,G=!0,I=r?f:v,h=Math.max(0,M);h<=v.length&&G;h++){I=A?n:r?f:v.substring(h)+n,!r&&this.autoCorrectParts||(G=!1,I=tt.unpadZero(I),I=tt.padZero(E-I.length)+I);var x,J=parseInt(I,10),S=this.intl.parseDate(g+I+y,this.format,this.localeId),Q=(r&&!et.isValidDate(S)&&this.autoCorrectParts&&(S=this.intl.parseDate(W+I+R,this.format,this.localeId)),!isNaN(parseInt(n,10))||r&&j&&""===n);if(!S&&!isNaN(J)&&Q&&this.autoCorrectParts&&("M"!==e||U||-1<(Q=J-1)&&Q<12&&((S=$.cloneDate(this.value)).setMonth(Q),S.getMonth()!==Q)&&(S=$.lastDayOfMonth($.addMonths(S,-1))),"y"===e)&&(S=$.createDate(parseInt(I,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(S)||!r&&S)&&this.date&&S.getDate()!==this.value.getDate()&&(S=$.lastDayOfMonth($.addMonths(S,-1))),r&&et.isValidDate(S)||!r&&S)return J=""+g+this.peek(I,q)+y,x=null===this.intl.parseDate(J,this.format,this.localeId)||z[e]&&q.length<=I.length||!1,this.shouldNormalizeCentury()&&(S=this.normalizeCentury(S)),this._value=S,this.setExisting(e,!0),this.resetInvalidDateSymbol(e),this.autoCorrectParts||("M"===e?this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d")):"d"===e&&this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M")),this.hasInvalidDatePart())||this.markDatePartsAsExisting(),r&&(x=x&&("M"===e?2<=(X=et.parseToInt(f))||2<=f.length:x&&(D?f.length===E:f.length>E))),et.extend(d,{value:this.value,switchToNext:x})}if(U&&(S=this.intl.parseDate(g+U+y,this.format,this.localeId)))return this._value=S,this.setExisting(e,!0),et.extend(d,{value:this.value,switchToNext:!1});if(i&&(S=this.intl.parseDate(g+i+y,this.format)))return this._value=S,et.extend(d,{value:this.value,switchToNext:!0});if(P&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((M={})[e]=!0,M),this.setExisting(e,!1)),!this.autoCorrectParts){var C,O,w,F,V,k,_,T,N,X=void 0,i=r?f:I,P=et.parseToInt(i);if(et.isNumber(P))return"d"===e&&(P<=0||31<P)||"M"===e&&(P<0||11<P)?et.extend(d,{value:null,switchToNext:!1}):(X="M"===e?P-1:P,t="M"===e,M="d"===e,C=$.cloneDate(this._value),k=(F=this._partiallyInvalidDate.invalidDateParts||{}).y.value||C.getFullYear(),O=t?X:F.M.value||C.getMonth(),w=M?X:F.d.value||F.E.value||C.getDate(),_=F.h.value||F.H.value||C.getHours(),T=F.m.value||C.getMinutes(),N=F.s.value||C.getSeconds(),F=F.S.value||C.getMilliseconds(),V=$.createDate(k,O,w,_,T,N,F),k=et.areDatePartsEqualTo(V,k,O,w,_,T,N,F),_=t||M?this.modifyDateSymbolWithValue(C,e,t?O:w):null,T=!1,t&&_?_.getMonth()===O?this.getExisting("d")?k?(C=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:O,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(this.resetInvalidDateSymbol(e),C=$.cloneDate(V),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(e),C=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:O,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):M&&_&&(_.getDate()===w?this.getExisting("M")?k?(C=$.cloneDate(V),this.resetInvalidDateSymbol(e)):(T=!0,this.setInvalidDatePart(e,{value:w,date:$.cloneDate(_),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1)):k?(C=$.cloneDate(V),this.resetInvalidDateSymbol(e),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(e),C=$.cloneDate(_)):(T=!0,this.setInvalidDatePart(e,{value:w,date:$.cloneDate(this.value),startDate:$.cloneDate(this.value)}),this.setExisting(e,!1))),T||(this.setExisting(e,!0),r&&!et.isValidDate(S)?(N=this.intl.parseDate(W+I+R,this.format,this.localeId),et.isValidDate(N)&&(this._value=N)):this._value=C,this.getValue()&&this.resetInvalidDate()),x=!1,x="M"===e?2<=P||2<=i.length:D?i.length===E:i.length>E,et.extend(d,{value:null,switchToNext:x,hasInvalidDatePart:T}))}}return et.extend(d,{value:null,switchToNext:!1})},a.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(tt.dateSymbolMap,{})[t]},a.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},a.prototype.setLeadingZero=function(t){this.leadingZero=t},a.prototype.getLeadingZero=function(){return this.leadingZero||{}},a.prototype.normalizeCentury=function(t){var e,n;return et.isPresent(t)?(e=et.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),et.setYears(t,n+e)):t},a.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},a.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},a.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},a.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return tt.padZero(e.length-t.length)+t},a.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 n=parseInt(this.typedMonthPart,10);if(1<=n&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},a.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""},a.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[]},a.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},a.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},a.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],a=[],s=0;s<n.length;s++)for(var r=this.intl.formatDate(t,{pattern:n[s].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[s].pattern[0]]||h.Constants.formatSeparator),a.push(n[s]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=a,e},a.prototype.merge=function(t,e){for(var n="",i="",a=e.symbols,s=!1,r=0,o=this.getFormattedInvalidDates(a),l=a.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(a[l])||this.getExisting(a[l]))this.autoCorrectParts||t.length===a.length||s?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(s=!0)):n=(t[l+t.length-a.length]||"")+n,i=a[l]+i;else{var u,c=a[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===a[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(u=(et.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),n=tt.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):(n=tt.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):n=this.dateFieldName(e.partMap[l])+n;i.length<n.length;)i=a[l]+i;0!==d&&(l=l-d+(t.length-a.length))}}return{text:n,format:i}},a.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})))},a.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},a.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},a.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},a.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},a.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},a.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},a.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},a.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,a=e.startDateOffset,a=void 0===a?0:a,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=a,this._partiallyInvalidDate.startDate=e)},a.prototype.hasInvalidDatePart=function(){var e=this,n=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&et.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!0)}),n},a.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=$.cloneDate(t),a=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=$.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),a=!0;break;case"m":i.setMinutes(i.getMinutes()+n),a=!0;break;case"s":i.setSeconds(i.getSeconds()+n),a=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),a=!0}return{date:i,timeModified:a}},a.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=$.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=$.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},a.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},a.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],a=e;a<t.partMap.length;a++){var s=t.partMap[a];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(a=e-1;0<=a&&(s=t.partMap[a],n.type===s.type&&n.pattern===s.pattern);a--)i.unshift(s);return i},e.DateObject=a},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=n(10),s=n(9),b=n(4),S=n(7),P=n(3),M=n(0),r=n(6),I=n(5),x=n(2),C=n(1),o={format:"d",allowNulls:!1,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={}).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,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:C.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,a.__extends(l,i),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var n=M.isValidDate(this.options.value)?x.cloneDate(this.options.value):new Date(e.formattedValue);M.isValidDate(n)||(n=null),this.element=t,this.options=M.extend({},o,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=I.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,i.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=M.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===I.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;var e,n=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=M.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(n.start)))},l.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===S.KeyCode.BACKSPACE||e.key===P.Key.BACKSPACE,i=e.keyCode===S.KeyCode.DELETE||e.key===P.Key.DELETE;if(this.element&&this.dateObject)if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var e=this.interactionMode,a=(!this.options.allowCaretMode||e===I.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=I.DateInputInteractionMode.Caret:this.interactionMode=I.DateInputInteractionMode.Selection,this.isInCaretMode());if(a&&this.keyDownEvent.key===P.Key.SPACE)this.restorePreviousInputEventState();else{var s=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,a&&(n||i||e===I.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=b.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:a,keyEvent:this.keyDownEvent}),r=this.formatStateOnKeyDown.format[this.formatStateOnKeyDown.selectionStart]||"";if(this.options.allowCaretMode&&a&&this.currentFormat.length!==this.elementValue.length&&r&&0<r.length&&r!==C.Constants.formatSeparator&&(l&&0!==l.length?l[0]&&l[0][0]!==C.Constants.formatSeparator&&l[0][0]!==r&&(l[0][0]=r,l[0][1]=t.data||""):((l=[])[0][0]=r,l[0][1]=t.data||"")),!a||l&&0!==l.length){if(a&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(a&&l[0]&&(l[0][0]===C.Constants.formatSeparator||l[0][1]===C.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var o=1===l.length&&l[0][1]===C.Constants.formatSeparator,h=[],u=!1;if(!o)for(var c=0;c<l.length;c++){var d=this.dateObject.parsePart({symbol:l[c][0],currentChar:l[c][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});h.push(d),u=d.switchToNext}this.options.autoSwitchParts||(u=!1),this.resetSegmentValue=!1;var p,m,g=h[h.length-1],v=g&&!g.value,f=a&&(n||i)&&v,y=!!g&&g.resetPart,g=!!g&&g.hasInvalidDatePart,D=!x.isEqual(s,this.dateObject.value),E=this.selection;a&&!f&&!y||(y&&(p=this.currentFormat[E.start]),this.forceUpdate()),l.length&&l[0][0]!==C.Constants.formatSeparator&&(!a||f||y?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===C.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):a&&(D&&M.isPresent(this.dateObject.getValue())||!D&&u&&M.isPresent(this.dateObject.getValue())?u?this.switchDateSegment(1):this.options.format.length!==this.currentFormat.length&&r&&"y"!==r&&(f=this.elementValue.length,this.forceUpdate(),f=this.elementValue.length-f,this.setSelection({start:E.start+f,end:E.start+f})):v&&(m=this.dateObject.getLeadingZero()[r],u?this.switchDateSegment(1):"0"===t.data&&m||this.restorePreviousInputEventState()))),u||!a||n||i||y||!v?this.options.autoSwitchParts&&(u||o)&&!a&&this.switchDateSegment(1):D?this.currentFormat.length===this.elementValue.length||e!==I.DateInputInteractionMode.Caret&&D||(e!==I.DateInputInteractionMode.Caret?(p=this.currentFormat[E.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):g||this.restorePreviousInputEventState()):(m=this.dateObject.getLeadingZero()[r],"0"===t.data&&m||g||this.restorePreviousInputEventState()),this.tryTriggerValueChange({oldValue:s,event:t}),this.triggerInputEnd({event:t}),a&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=I.DateInputInteractionMode.None,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.interactionMode=I.DateInputInteractionMode.None,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,n=e.start,e=e.end,n=(this.keyDownEvent=t,this.previousElementValue=this.element.value,this.formatStateOnKeyDown={format:this.currentFormat,selectionStart:n,selectionEnd:e},this.previousElementSelection={start:n,end:e},(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()}));if(0<=n.indexOf(t.keyCode.toString())||0<=n.indexOf(t.keyCode)||0<=n.indexOf(t.key.toLowerCase().trim())){e=0<=n.indexOf(P.Key.TAB.toLowerCase().trim())||0<=n.indexOf(S.KeyCode.TAB)||0<=n.indexOf(S.KeyCode.TAB.toString());if(!e)return t.preventDefault(),void this.switchDateSegment(1);var n=this.selection,i=n.start,n=n.end;if(t.shiftKey&&e?this.switchDateSegment(-1):this.switchDateSegment(1),i!==this.selection.start||n!==this.selection.end)return void t.preventDefault()}var a,s=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(s),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===S.KeyCode.TAB)){switch(t.keyCode){case S.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case S.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,s,event),o=!0;break;case S.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case S.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,s,event),o=!0;break;case S.KeyCode.ENTER:break;case S.KeyCode.DELETE:case S.KeyCode.BACKSPACE:return this.options.allowNulls&&(a=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:a,event:t})),o=!0,void(t.keyCode===S.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(S.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(P.Key.BACKSPACE))&&this.switchDateSegment(-1));case P.Key.HOME:this.selectNearestSegment(0);break;case P.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}o&&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,n=(M.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:n,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:C.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:C.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)},l.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);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}},l.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||0<=i;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==C.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},l.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],a="",s="";if(t<0){for(var r=n+t;0<=r;r--)if((s=this.currentFormat[r])!==C.Constants.formatSeparator&&s!==i){n=r,a=s;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((s=this.currentFormat[r])!==C.Constants.formatSeparator&&s!==i){n=r,a=s;break}if(a)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(a)),void(this.interactionMode=I.DateInputInteractionMode.Selection)}this.interactionMode=I.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=I.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]===C.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==C.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=I.DateInputInteractionMode.None}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,a;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,a=this.caret(),"S"!==(e=e||this.currentFormat[a[0]])||this.options.steps.millisecond||(a=M.millisecondDigitsInFormat(this.inputFormat),t=M.millisecondStepFor(a)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!x.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",M.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",M.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",M.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},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&&!M.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(n),i=n.text,n=n.format,n=(this.currentFormat=n,this.currentText=i,this.options.hasPlaceholder||M.isPresent(this.options.placeholder)),a=!this.isActive&&n&&!this.dateObject.hasValue(),n=(n&&M.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),a?"":i);this.previousElementValue=this.elementValue,this.setElementValue(n),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},l.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],a=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==a.selectionStart&&(n&&(M.isDocumentAvailable()&&document.activeElement!==a&&a.focus(),a.setSelectionRange(t,e)),i=[a.selectionStart,a.selectionEnd])}catch(t){i=[]}return i}},l.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||0<=n;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=n&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},l.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);e<0&&(e=0),this.caret(0,0),this.caret(e,n)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(t){return new s.DateObject(M.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t=void 0===t?{}:t))},l);function l(t,e){var n=i.call(this,e)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=I.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(t,e),n}e.DateInput=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=n(11),a=(e.DateInput=n.DateInput,e);for(i in a)s(i,a[i])}],a={},i.m=n,i.c=a,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},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=12)}}});
|