@progress/kendo-dateinputs-common 0.2.0-dev.202301131210 → 0.2.0-dev.202301161405
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-dateinputs-common.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/dateobject.js +97 -29
- package/dist/es/dateinput/dateinput.js +10 -6
- package/dist/es2015/common/dateobject.js +96 -29
- package/dist/es2015/dateinput/dateinput.js +10 -6
- package/dist/npm/common/dateobject.d.ts +4 -0
- package/dist/npm/common/dateobject.js +97 -29
- package/dist/npm/dateinput/dateinput.js +10 -6
- package/dist/systemjs/kendo-dateinputs-common.js +1 -1
- package/package.json +1 -1
|
@@ -602,8 +602,8 @@ var DateObject = /** @class */ (function () {
|
|
|
602
602
|
var hasFixedFormat = (this.format === baseFormat) ||
|
|
603
603
|
(this.format === originalFormat) ||
|
|
604
604
|
(this.format.length === originalFormat.length);
|
|
605
|
-
|
|
606
|
-
|
|
605
|
+
var processedSegmentCharsCount = 0;
|
|
606
|
+
if (isInCaretMode || (!isInCaretMode && !this.autoCorrectParts)) {
|
|
607
607
|
for (var i = 0; i < baseDate.length; i++) {
|
|
608
608
|
if (baseFormat[i] === symbol) {
|
|
609
609
|
var existing = this.getExisting(symbol);
|
|
@@ -629,7 +629,7 @@ var DateObject = /** @class */ (function () {
|
|
|
629
629
|
baseSuffix += baseDate[i];
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
if (hasFixedFormat) {
|
|
632
|
+
if (hasFixedFormat && this.autoCorrectParts) {
|
|
633
633
|
if (originalFormat.length < rawInputValue.length) {
|
|
634
634
|
datePartText += currentChar;
|
|
635
635
|
}
|
|
@@ -681,25 +681,41 @@ var DateObject = /** @class */ (function () {
|
|
|
681
681
|
var lengthDiff = originalFormat.length - rawInputValue.length;
|
|
682
682
|
var trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
|
|
683
683
|
if (trimmedDatePartText && trimmedDatePartText.length > 0) {
|
|
684
|
+
var originalDatePartText = datePartText;
|
|
684
685
|
datePartText = trimmedDatePartText;
|
|
686
|
+
if (prefix + datePartText + suffix !== rawInputValue) {
|
|
687
|
+
// move trimmed characters to the suffix
|
|
688
|
+
suffix = originalDatePartText.substring(datePartText.length) + suffix;
|
|
689
|
+
}
|
|
685
690
|
}
|
|
686
691
|
}
|
|
687
692
|
}
|
|
688
693
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
694
|
+
if (!isInCaretMode) {
|
|
695
|
+
if (this.autoCorrectParts) {
|
|
696
|
+
processedSegmentCharsCount = 0;
|
|
697
|
+
current = "";
|
|
698
|
+
datePartText = "";
|
|
699
|
+
prefix = "";
|
|
700
|
+
suffix = "";
|
|
701
|
+
replaced = false;
|
|
702
|
+
for (var i = 0; i < baseDate.length; i++) {
|
|
703
|
+
if (baseFormat[i] === symbol) {
|
|
704
|
+
var existing = this.getExisting(symbol);
|
|
705
|
+
current += existing ? baseDate[i] : '0';
|
|
706
|
+
replaced = true;
|
|
707
|
+
}
|
|
708
|
+
else if (!replaced) {
|
|
709
|
+
prefix += baseDate[i];
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
suffix += baseDate[i];
|
|
713
|
+
}
|
|
701
714
|
}
|
|
702
715
|
}
|
|
716
|
+
else {
|
|
717
|
+
current = resetSegmentValue ? datePartText : current;
|
|
718
|
+
}
|
|
703
719
|
}
|
|
704
720
|
var parsedDate = null;
|
|
705
721
|
var month = this.matchMonth(currentChar);
|
|
@@ -725,11 +741,12 @@ var DateObject = /** @class */ (function () {
|
|
|
725
741
|
}
|
|
726
742
|
var currentMaxLength = current.length - 3;
|
|
727
743
|
var tryParse = true;
|
|
744
|
+
var middle = isInCaretMode ? datePartText : current;
|
|
728
745
|
for (var i = Math.max(0, currentMaxLength); i <= current.length; i++) {
|
|
729
746
|
if (!tryParse) {
|
|
730
747
|
break;
|
|
731
748
|
}
|
|
732
|
-
|
|
749
|
+
middle = resetSegmentValue ?
|
|
733
750
|
currentChar :
|
|
734
751
|
isInCaretMode ?
|
|
735
752
|
datePartText :
|
|
@@ -758,11 +775,13 @@ var DateObject = /** @class */ (function () {
|
|
|
758
775
|
// use the base prefix and suffix, e.g. convert the candidate date string
|
|
759
776
|
// to "Thursday, February 1, 2022 3:04:05 AM"
|
|
760
777
|
// as "EEEE, February..." is not parsable
|
|
761
|
-
|
|
762
|
-
|
|
778
|
+
if (this.autoCorrectParts) {
|
|
779
|
+
parsedDate = this.intl.parseDate(basePrefix + middle + baseSuffix, this.format, this.localeId);
|
|
780
|
+
datePartText = middle;
|
|
781
|
+
}
|
|
763
782
|
}
|
|
764
783
|
var isCurrentCharParsable = !isNaN(parseInt(currentChar, 10)) || (isInCaretMode && isDeleting && currentChar === "");
|
|
765
|
-
if (!parsedDate && !isNaN(middleNumber) && isCurrentCharParsable) {
|
|
784
|
+
if (!parsedDate && !isNaN(middleNumber) && isCurrentCharParsable && this.autoCorrectParts) {
|
|
766
785
|
if (symbol === MONTH_SYMBOL && !month) {
|
|
767
786
|
// JS months start from 0 (January) instead of 1 (January)
|
|
768
787
|
var monthNumber = middleNumber - JS_MONTH_OFFSET;
|
|
@@ -797,6 +816,26 @@ var DateObject = /** @class */ (function () {
|
|
|
797
816
|
}
|
|
798
817
|
this._value = parsedDate;
|
|
799
818
|
this.setExisting(symbol, true);
|
|
819
|
+
this.resetInvalidDateSymbol(symbol);
|
|
820
|
+
if (!this.autoCorrectParts) {
|
|
821
|
+
if (symbol === "M") {
|
|
822
|
+
if (this.getExisting("M") && this.getExisting("y")) {
|
|
823
|
+
// changing from 28/Feb to 29/Feb to 29/March
|
|
824
|
+
this.setExisting("d", true);
|
|
825
|
+
this.resetInvalidDateSymbol("d");
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
else if (symbol === "d") {
|
|
829
|
+
if (this.getExisting("d") && this.getExisting("y")) {
|
|
830
|
+
// changing from 31/Jan to 31/Feb to 28/Feb
|
|
831
|
+
this.setExisting("M", true);
|
|
832
|
+
this.resetInvalidDateSymbol("M");
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
if (!this.hasInvalidDatePart()) {
|
|
836
|
+
this.markDatePartsAsExisting();
|
|
837
|
+
}
|
|
838
|
+
}
|
|
800
839
|
if (isInCaretMode && switchToNext) {
|
|
801
840
|
if (symbol === "M") {
|
|
802
841
|
if (segmentLength <= MONTH_PART_WITH_WORDS_THRESHOLD) {
|
|
@@ -843,25 +882,30 @@ var DateObject = /** @class */ (function () {
|
|
|
843
882
|
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
844
883
|
}
|
|
845
884
|
if (!this.autoCorrectParts) {
|
|
846
|
-
this.setExisting(symbol, false);
|
|
847
885
|
var datePartValue = void 0;
|
|
848
|
-
var textToParse = isInCaretMode ? datePartText :
|
|
886
|
+
var textToParse = isInCaretMode ? datePartText : middle;
|
|
849
887
|
var parsedValue = utils_2.parseToInt(textToParse);
|
|
850
888
|
if (utils_2.isNumber(parsedValue)) {
|
|
889
|
+
if ((symbol === "d" && (parsedValue <= 0 || parsedValue > 31)) ||
|
|
890
|
+
(symbol === "M" && (parsedValue < 0 || parsedValue > 11))) {
|
|
891
|
+
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
892
|
+
}
|
|
851
893
|
datePartValue = symbol === "M" ?
|
|
852
894
|
utils_2.clamp(parsedValue - JS_MONTH_OFFSET, 0, 12 - JS_MONTH_OFFSET) :
|
|
853
895
|
parsedValue;
|
|
854
|
-
}
|
|
855
|
-
if (utils_2.isNumber(datePartValue)) {
|
|
856
|
-
var newDate = this.modifyDateSymbolWithValue(this.value, symbol, datePartValue);
|
|
857
896
|
// if (!isEqual(newDate, this.value)) {
|
|
858
897
|
this.setExisting(symbol, false);
|
|
859
898
|
this.setInvalidDatePart(symbol, {
|
|
860
899
|
value: datePartValue,
|
|
861
|
-
date: kendo_date_math_1.cloneDate(
|
|
900
|
+
date: kendo_date_math_1.cloneDate(this.value),
|
|
862
901
|
startDate: this._partiallyInvalidDate.startDate || kendo_date_math_1.cloneDate(this.value)
|
|
863
902
|
});
|
|
864
903
|
// }
|
|
904
|
+
return utils_2.extend(parseResult, {
|
|
905
|
+
value: null,
|
|
906
|
+
switchToNext: false,
|
|
907
|
+
hasInvalidDatePart: true
|
|
908
|
+
});
|
|
865
909
|
}
|
|
866
910
|
}
|
|
867
911
|
return utils_2.extend(parseResult, { value: null, switchToNext: false });
|
|
@@ -1078,13 +1122,16 @@ var DateObject = /** @class */ (function () {
|
|
|
1078
1122
|
}
|
|
1079
1123
|
else {
|
|
1080
1124
|
datePartText = (utils_2.parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();
|
|
1081
|
-
|
|
1125
|
+
var formattedDatePart = utils_1.padZero(partsForSegment.length - datePartText.length) + datePartText;
|
|
1126
|
+
resultText = formattedDatePart + resultText;
|
|
1127
|
+
formatSymbolIndexModifier = partsForSegment.length - 1;
|
|
1082
1128
|
ignoreFormatSymbolsCount = datePartText.length - partsForSegment.length;
|
|
1083
1129
|
}
|
|
1084
1130
|
}
|
|
1085
1131
|
else {
|
|
1086
|
-
|
|
1087
|
-
|
|
1132
|
+
var formattedDatePart = utils_1.padZero(partsForSegment.length - datePartText.length) + datePartText;
|
|
1133
|
+
resultText = formattedDatePart + resultText;
|
|
1134
|
+
formatSymbolIndexModifier = partsForSegment.length - 1;
|
|
1088
1135
|
ignoreFormatSymbolsCount = datePartText.length - partsForSegment.length;
|
|
1089
1136
|
}
|
|
1090
1137
|
}
|
|
@@ -1175,13 +1222,34 @@ var DateObject = /** @class */ (function () {
|
|
|
1175
1222
|
};
|
|
1176
1223
|
DateObject.prototype.setInvalidDatePart = function (symbol, _a) {
|
|
1177
1224
|
var _b = _a.value, value = _b === void 0 ? null : _b, _c = _a.date, date = _c === void 0 ? null : _c, _d = _a.startDateOffset, startDateOffset = _d === void 0 ? 0 : _d, _e = _a.startDate, startDate = _e === void 0 ? null : _e;
|
|
1225
|
+
var clampedValue = value;
|
|
1226
|
+
if (symbol === "d") {
|
|
1227
|
+
clampedValue = utils_2.clamp(utils_2.isPresent(value) ? value : 1, 1, 31);
|
|
1228
|
+
}
|
|
1229
|
+
else if (symbol === "M") {
|
|
1230
|
+
clampedValue = utils_2.clamp(utils_2.isPresent(value) ? value : 0, 0, 11);
|
|
1231
|
+
}
|
|
1178
1232
|
if (this._partiallyInvalidDate.invalidDateParts[symbol]) {
|
|
1179
|
-
this._partiallyInvalidDate.invalidDateParts[symbol].value =
|
|
1233
|
+
this._partiallyInvalidDate.invalidDateParts[symbol].value = clampedValue;
|
|
1180
1234
|
this._partiallyInvalidDate.invalidDateParts[symbol].date = date;
|
|
1181
1235
|
this._partiallyInvalidDate.invalidDateParts[symbol].startDateOffset = startDateOffset;
|
|
1182
1236
|
this._partiallyInvalidDate.startDate = startDate;
|
|
1183
1237
|
}
|
|
1184
1238
|
};
|
|
1239
|
+
/**
|
|
1240
|
+
* @hidden
|
|
1241
|
+
*/
|
|
1242
|
+
DateObject.prototype.hasInvalidDatePart = function () {
|
|
1243
|
+
var _this = this;
|
|
1244
|
+
var hasInvalidDatePart = false;
|
|
1245
|
+
Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {
|
|
1246
|
+
if (_this._partiallyInvalidDate.invalidDateParts[key] &&
|
|
1247
|
+
utils_2.isPresent(_this._partiallyInvalidDate.invalidDateParts[key].value)) {
|
|
1248
|
+
hasInvalidDatePart = true;
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
return hasInvalidDatePart;
|
|
1252
|
+
};
|
|
1185
1253
|
/**
|
|
1186
1254
|
* @hidden
|
|
1187
1255
|
*/
|
|
@@ -346,6 +346,7 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
346
346
|
var lastParseResultHasNoValue = lastParseResult && !lastParseResult.value;
|
|
347
347
|
var parsingFailedOnDelete = (hasCaret && (isBackspaceKey || isDeleteKey) && lastParseResultHasNoValue);
|
|
348
348
|
var resetPart = lastParseResult ? lastParseResult.resetPart : false;
|
|
349
|
+
var hasInvalidDatePart = lastParseResult ? lastParseResult.hasInvalidDatePart : false;
|
|
349
350
|
var hasDateValueChanged = !kendo_date_math_1.isEqual(oldDateObjectValue, this.dateObject.value);
|
|
350
351
|
var symbolForSelection;
|
|
351
352
|
var currentSelection = this.selection;
|
|
@@ -371,13 +372,14 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
371
372
|
}
|
|
372
373
|
}
|
|
373
374
|
else if (hasCaret) {
|
|
374
|
-
if (hasDateValueChanged && utils_2.isPresent(this.dateObject.getValue())
|
|
375
|
+
if ((hasDateValueChanged && utils_2.isPresent(this.dateObject.getValue()) ||
|
|
376
|
+
(!hasDateValueChanged && switchPart && utils_2.isPresent(this.dateObject.getValue())))) {
|
|
375
377
|
if (switchPart) {
|
|
376
378
|
this.switchDateSegment(1);
|
|
377
379
|
}
|
|
378
380
|
}
|
|
379
381
|
else {
|
|
380
|
-
if (lastParseResultHasNoValue) {
|
|
382
|
+
if (lastParseResultHasNoValue && !hasInvalidDatePart) {
|
|
381
383
|
this.restorePreviousInputEventState();
|
|
382
384
|
}
|
|
383
385
|
}
|
|
@@ -390,20 +392,22 @@ var DateInput = /** @class */ (function (_super) {
|
|
|
390
392
|
}
|
|
391
393
|
else {
|
|
392
394
|
// the input is not complete, not parsable or not updatable
|
|
393
|
-
if (
|
|
395
|
+
if (originalInteractionMode !== interaction_mode_1.DateInputInteractionMode.Caret && hasDateValueChanged) {
|
|
394
396
|
}
|
|
395
|
-
else if (
|
|
397
|
+
else if (originalInteractionMode !== interaction_mode_1.DateInputInteractionMode.Caret) {
|
|
396
398
|
symbolForSelection = this.currentFormat[currentSelection.start];
|
|
397
399
|
this.forceUpdate();
|
|
398
400
|
this.setSelection(this.selectionBySymbol(symbolForSelection));
|
|
399
401
|
}
|
|
400
|
-
else {
|
|
402
|
+
else if (!hasInvalidDatePart) {
|
|
401
403
|
this.restorePreviousInputEventState();
|
|
402
404
|
}
|
|
403
405
|
}
|
|
404
406
|
}
|
|
405
407
|
else {
|
|
406
|
-
|
|
408
|
+
if (!hasInvalidDatePart) {
|
|
409
|
+
this.restorePreviousInputEventState();
|
|
410
|
+
}
|
|
407
411
|
}
|
|
408
412
|
}
|
|
409
413
|
else if (this.options.autoSwitchParts && (switchPart || navigationOnly)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function i(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,s;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,s=e.shift();if(o(t)&&o(s))for(var a in s)i=s[a],i instanceof HTMLElement?t[a]=s[a]:o(s[a])?(t[a]||r.extend(t,((i={})[a]={},i)),r.deepExtend(t[a],s[a])):r.extend(t,((i={})[a]=s[a],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,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,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,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=e[s+e.length-n.length],o=e.substring(0,s+e.length-n.length),e=n.substring(0,s),l=[];if(o===e&&0<s)return l.push([i[s-1],e[s-1]]),l;if(0===o.indexOf(e)&&a&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!a&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";a||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((!a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator)&&(a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator))return!a&&" "===e[e.length-1]||!a&&e[e.length-1]===r?[[i[s-1],d.Constants.formatSeparator]]:[[i[s-1],e[s-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[s-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),s={events:{}};function a(t){this.options=i.extend({},s,t)}a.prototype.destroy=function(){},a.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=a},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 B=n(2),o=n(8),W=n(4),H=n(0),h=n(1),i=/d|M|H|h|m|s/;function s(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.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=B.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=s,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=a,this.autoCorrectParts=t,r)this._value=B.cloneDate(r);else{this._value=B.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),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}),s.prototype.setValue=function(t){t?B.isEqual(t,this._value)||(this._value=B.cloneDate(t),this.modifyExisting(!0)):(this._value=B.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},s.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)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return B.cloneDate(this.value)},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.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=(H.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):i+=e[r]}e=i}return this.merge(e,n)},s.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),s[t]=e)}),s},s.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)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if(H.isPresent(t)&&H.isPresent(e)&&0!==e){var n,i=B.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=B.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),s=!0;break;case"m":i.setMinutes(i.getMinutes()+e),s=!0;break;case"s":i.setSeconds(i.getSeconds()+e),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),s=!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(),f=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?H.clamp(c%11+1+11,0,11):(g=H.isPresent(h)?c:(e-1)%12,H.clamp(g,0,11)),c=H.clamp(c,0,11)),c=H.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(H.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(g=e<0?H.isPresent(h)?d:31-Math.abs(e%31)+1:H.isPresent(h)?d:e%31,H.clamp(g,1,31)),d=H.clamp(d,1,31)}var o=B.createDate(u,c,d,p,m,f,l),h=a||r?this.modifyDateSymbolWithValue(i,t,a?c:d):null,g=H.areDatePartsEqualTo(o,u,c,d,p,m,f,l);this.getValue()&&H.areDatePartsEqualTo(o,u,c,d,p,m,f,l)?(i=B.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):g?(this.resetInvalidDateSymbol(t),i=B.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(this.value),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),s&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,a=t.rawTextValue,r=t.isDeleting,o=t.originalFormat,l=!s,t=this.dateFormatString(this.value,this.format),h=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),u=0;u<h.length;u++){for(var c=h[u],d=0;d<c.pattern.length;d++)h[u+d]&&(h[u+d].literal=c.pattern[d]);u+=c.pattern.length-1}var p={value:null,switchPart:!1,resetPart:l&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length})};if(!n){if(!l)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(u=0;u<h.length;u++){var m=h[u].literal,N=a.startsWith(m),j=a.endsWith(m),m=0<=a.indexOf(m+m);if(N||j||m)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),H.extend(p,{value:null,switchToNext:!1})}}var f=this.intl.formatDate(this.value,this.format,this.localeId),g=t.symbols,v=!1,y="",D="",E="",b="",L="",S="",s=o.indexOf(e),P=o.lastIndexOf(e)-s+1,M=this.format===g||this.format===o||this.format.length===o.length;if(l){for(var I=0,u=0;u<f.length;u++)g[u]===e?(D+=this.getExisting(e)?f[u]:"0",r?(I<P-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?(S+=f[u],L+=f[u]):(y+=f[u],b+=f[u]);if(M){if(o.length<a.length?E+=n:!r&&o.length>a.length&&(O=o.length-a.length,F=E.substring(0,E.length-O))&&0<F.length&&(E=F),E.length>P)return H.extend(p,{value:null,switchToNext:!1})}else{for(S=y=E=D="",v=!1,u=I=0;u<o.length;u++)o[u]===e?(D+=this.getExisting(e)?f[u]||"":"0",r?(I<P-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?S+=a[u]||"":y+=a[u]||"";o.length<a.length?E+=n:!r&&o.length>a.length&&(O=o.length-a.length,F=E.substring(0,E.length-O))&&0<F.length&&(E=F)}}else for(u=0;u<f.length;u++)g[u]===e?(D+=this.getExisting(e)?f[u]:"0",v=!0):v?S+=f[u]:y+=f[u];var x=null,C=this.matchMonth(n),s=this.matchDayPeriod(n,e),O="0"===n,K=this.leadingZero||{},F=(O&&!l?0!==parseInt(i?n:D+n,10)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e):this.resetLeadingZero(),this.partPattern(t.partMap,e)),w=F?F.pattern:null;if(l&&r&&!E)this.setExisting(e,!1);else{var V,F=D.length-3,k=!0;for(u=Math.max(0,F);u<=D.length&&k;u++){var _=i?n:l?E:D.substring(u)+n,T=(this.autoCorrectParts||(k=!1,l)||(_=W.unpadZero(_),_=W.padZero(P-_.length)+_),l&&(k=!1,_=W.unpadZero(_)),parseInt(_,10)),x=this.intl.parseDate(y+_+S,this.format,this.localeId),A=(!l||M||H.isValidDate(x)||(x=this.intl.parseDate(b+_+L,this.format,this.localeId),E=_),!isNaN(parseInt(n,10))||l&&r&&""===n);if(x||isNaN(T)||!A||("M"!==e||C||-1<(A=T-1)&&A<12&&((x=B.cloneDate(this.value)).setMonth(A),x.getMonth()!==A)&&(x=B.lastDayOfMonth(B.addMonths(x,-1))),"y"===e&&(x=B.createDate(parseInt(_,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),l&&H.isValidDate(x)||!l&&x)&&this.date&&x.getDate()!==this.value.getDate()&&(x=B.lastDayOfMonth(B.addMonths(x,-1)))),l&&H.isValidDate(x)||!l&&x)return T=this.intl.parseDate(""+y+this.peek(_,w)+S,this.format,this.localeId),A=this.patternLength(w)||w.length,A=((this.leadingZero||{})[e]||0)+(W.unpadZero(_)||n).length>=A,T=null===T||K[e]&&w.length<=_.length||A,this.shouldNormalizeCentury()&&(x=this.normalizeCentury(x)),this._value=x,this.setExisting(e,!0),l&&T&&("M"===e?P<=2&&(T=2<=(V=H.parseToInt(E))):T=T&&(M?E.length===P:E.length>P)),H.extend(p,{value:this.value,switchToNext:T})}if(C&&(x=this.intl.parseDate(y+C+S,this.format,this.localeId)))return this._value=x,this.setExisting(e,!0),H.extend(p,{value:this.value,switchToNext:!1});if(s&&(x=this.intl.parseDate(y+s+S,this.format)))return this._value=x,H.extend(p,{value:this.value,switchToNext:!0});O&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((F={})[e]=!0,F),this.setExisting(e,!1)),l&&E.length>P||this.autoCorrectParts||(this.setExisting(e,!1),V=void 0,s=H.parseToInt(l?E:D),H.isNumber(s)&&(V="M"===e?H.clamp(s-1,0,11):s),H.isNumber(V)&&(O=this.modifyDateSymbolWithValue(this.value,e,V),this.setExisting(e,!1),this.setInvalidDatePart(e,{value:V,date:B.cloneDate(O),startDate:this._partiallyInvalidDate.startDate||B.cloneDate(this.value)})))}return H.extend(p,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(W.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.normalizeCentury=function(t){var e,n;return H.isPresent(t)?(e=H.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),H.setYears(t,n+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return W.padZero(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var 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""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},s.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},s.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var r=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[a].pattern[0]]||h.Constants.formatSeparator),s.push(n[a]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var n="",i="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(a=!0)):n=(t[l+t.length-s.length]||"")+n,i=s[l]+i;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(n=(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,r=u.length-h.length)):(n=u+n,d=u.length-1,r=u.length-h.length)):n=this.dateFieldName(e.partMap[l])+n;i.length<n.length;)i=s[l]+i;0!==d&&(l=l-d+(t.length-s.length))}}return{text:n,format:i}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&H.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=B.cloneDate(t),s=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=B.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),s=!0;break;case"m":i.setMinutes(i.getMinutes()+n),s=!0;break;case"s":i.setSeconds(i.getSeconds()+n),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),s=!0}return{date:i,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=B.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=B.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},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(n.type!==a.type||n.pattern!==a.pattern)break;i.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],n.type===a.type&&n.pattern===a.pattern);s--)i.unshift(a);return i},e.DateObject=s},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(10),a=n(9),y=n(4),D=n(7),E=n(3),b=n(0),r=n(6),S=n(5),P=n(2),M=n(1),o={format:"d",allowNulls:!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:M.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,s.__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=b.isValidDate(this.options.value)?P.cloneDate(this.options.value):new Date(e.formattedValue);b.isValidDate(n)||(n=null),this.element=t,this.options=b.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=S.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=b.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===S.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=b.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===D.KeyCode.BACKSPACE||e.key===E.Key.BACKSPACE,i=e.keyCode===D.KeyCode.DELETE||e.key===E.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,s=(!this.options.allowCaretMode||e===S.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=S.DateInputInteractionMode.Caret:this.interactionMode=S.DateInputInteractionMode.Selection,this.isInCaretMode());if(s&&this.keyDownEvent.key===E.Key.SPACE)this.restorePreviousInputEventState();else{var a=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,s&&(n||i||e===S.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=y.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||l&&0!==l.length){if(s&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(s&&l[0]&&(l[0][0]===M.Constants.formatSeparator||l[0][1]===M.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var r=1===l.length&&l[0][1]===M.Constants.formatSeparator,h=[],u=!1;if(!r)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,o=h[h.length-1],m=o&&!o.value,f=s&&(n||i)&&m,o=!!o&&o.resetPart,g=!P.isEqual(a,this.dateObject.value),v=this.selection;s&&!f&&!o||(o&&(p=this.currentFormat[v.start]),this.forceUpdate()),l.length&&l[0][0]!==M.Constants.formatSeparator&&(!s||f||o?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===M.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):s&&(g&&b.isPresent(this.dateObject.getValue())?u&&this.switchDateSegment(1):m&&this.restorePreviousInputEventState())),u||!s||n||i||o||!m?this.options.autoSwitchParts&&(u||r)&&!s&&this.switchDateSegment(1):g?this.currentFormat.length===this.elementValue.length||s&&e!==S.DateInputInteractionMode.Caret&&g||(s&&e!==S.DateInputInteractionMode.Caret?(p=this.currentFormat[v.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:a,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=S.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=S.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})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,e=e.end,n=(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(E.Key.TAB.toLowerCase().trim())||0<=n.indexOf(D.KeyCode.TAB)||0<=n.indexOf(D.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 s,a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===D.KeyCode.TAB)){switch(t.keyCode){case D.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case D.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,event),o=!0;break;case D.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case D.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,event),o=!0;break;case D.KeyCode.ENTER:break;case D.KeyCode.DELETE:case D.KeyCode.BACKSPACE:return this.options.allowNulls&&(s=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:s,event:t})),o=!0,void(t.keyCode===D.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(D.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(E.Key.BACKSPACE))&&this.switchDateSegment(-1));case E.Key.HOME:this.selectNearestSegment(0);break;case E.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=(b.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:M.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:M.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]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==M.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],s="",a="";if(t<0){for(var r=n+t;0<=r;r--)if((a=this.currentFormat[r])!==M.Constants.formatSeparator&&a!==i){n=r,s=a;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==M.Constants.formatSeparator&&a!==i){n=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=S.DateInputInteractionMode.Selection)}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;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===M.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==M.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)}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,s;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond||(s=b.millisecondDigitsInFormat(this.inputFormat),t=b.millisecondStepFor(s)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!P.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",b.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",b.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&&!b.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.isActive&&b.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()),e=(b.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e),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],s=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(n&&(b.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),i=[s.selectionStart,s.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 a.DateObject(b.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=S.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),s=(e.DateInput=n.DateInput,e);for(i in s)a(i,s[i])}],s={},i.m=n,i.c=s,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(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function i(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,s;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,s=e.shift();if(o(t)&&o(s))for(var a in s)i=s[a],i instanceof HTMLElement?t[a]=s[a]:o(s[a])?(t[a]||r.extend(t,((i={})[a]={},i)),r.deepExtend(t[a],s[a])):r.extend(t,((i={})[a]=s[a],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,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,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,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=e[s+e.length-n.length],o=e.substring(0,s+e.length-n.length),e=n.substring(0,s),l=[];if(o===e&&0<s)return l.push([i[s-1],e[s-1]]),l;if(0===o.indexOf(e)&&a&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!a&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";a||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((!a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator)&&(a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator))return!a&&" "===e[e.length-1]||!a&&e[e.length-1]===r?[[i[s-1],d.Constants.formatSeparator]]:[[i[s-1],e[s-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[s-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),s={events:{}};function a(t){this.options=i.extend({},s,t)}a.prototype.destroy=function(){},a.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=a},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 B=n(2),o=n(8),W=n(4),H=n(0),h=n(1),i=/d|M|H|h|m|s/;function s(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.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=B.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=s,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=a,this.autoCorrectParts=t,r)this._value=B.cloneDate(r);else{this._value=B.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),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}),s.prototype.setValue=function(t){t?B.isEqual(t,this._value)||(this._value=B.cloneDate(t),this.modifyExisting(!0)):(this._value=B.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},s.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)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return B.cloneDate(this.value)},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.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=(H.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):i+=e[r]}e=i}return this.merge(e,n)},s.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),s[t]=e)}),s},s.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)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if(H.isPresent(t)&&H.isPresent(e)&&0!==e){var n,i=B.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=B.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),s=!0;break;case"m":i.setMinutes(i.getMinutes()+e),s=!0;break;case"s":i.setSeconds(i.getSeconds()+e),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),s=!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?H.clamp(c%11+1+11,0,11):(f=H.isPresent(h)?c:(e-1)%12,H.clamp(f,0,11)),c=H.clamp(c,0,11)),c=H.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(H.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(f=e<0?H.isPresent(h)?d:31-Math.abs(e%31)+1:H.isPresent(h)?d:e%31,H.clamp(f,1,31)),d=H.clamp(d,1,31)}var o=B.createDate(u,c,d,p,m,g,l),h=a||r?this.modifyDateSymbolWithValue(i,t,a?c:d):null,f=H.areDatePartsEqualTo(o,u,c,d,p,m,g,l);this.getValue()&&H.areDatePartsEqualTo(o,u,c,d,p,m,g,l)?(i=B.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?f?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):f?(this.resetInvalidDateSymbol(t),i=B.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?f?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):f?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(this.value),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),s&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,a=t.rawTextValue,r=t.isDeleting,o=t.originalFormat,l=!s,t=this.dateFormatString(this.value,this.format),h=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),u=0;u<h.length;u++){for(var c=h[u],d=0;d<c.pattern.length;d++)h[u+d]&&(h[u+d].literal=c.pattern[d]);u+=c.pattern.length-1}var p={value:null,switchPart:!1,resetPart:l&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length})};if(!n){if(!l)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(u=0;u<h.length;u++){var m=h[u].literal,N=a.startsWith(m),j=a.endsWith(m),m=0<=a.indexOf(m+m);if(N||j||m)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),H.extend(p,{value:null,switchToNext:!1})}}var g=this.intl.formatDate(this.value,this.format,this.localeId),f=t.symbols,v=!1,y="",D="",E="",b="",L="",P="",s=o.indexOf(e),S=o.lastIndexOf(e)-s+1,M=this.format===f||this.format===o||this.format.length===o.length,I=0;if(l||!l&&!this.autoCorrectParts){for(u=0;u<g.length;u++)f[u]===e?(D+=this.getExisting(e)?g[u]:"0",r?(I<S-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?(P+=g[u],L+=g[u]):(y+=g[u],b+=g[u]);if(M&&this.autoCorrectParts){if(o.length<a.length?E+=n:!r&&o.length>a.length&&(O=o.length-a.length,w=E.substring(0,E.length-O))&&0<w.length&&(E=w),E.length>S)return H.extend(p,{value:null,switchToNext:!1})}else{for(P=y=E=D="",v=!1,u=I=0;u<o.length;u++)o[u]===e?(D+=this.getExisting(e)?g[u]||"":"0",r?(I<S-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?P+=a[u]||"":y+=a[u]||"";o.length<a.length?E+=n:!r&&o.length>a.length&&(O=o.length-a.length,w=E.substring(0,E.length-O))&&0<w.length&&(s=E,y+(E=w)+P!==a)&&(P=s.substring(E.length)+P)}}if(!l)if(this.autoCorrectParts)for(P=y=E=D="",v=!1,u=I=0;u<g.length;u++)f[u]===e?(D+=this.getExisting(e)?g[u]:"0",v=!0):v?P+=g[u]:y+=g[u];else D=i?E:D;var x=null,C=this.matchMonth(n),O=this.matchDayPeriod(n,e),w="0"===n,K=this.leadingZero||{},s=(w&&!l?0!==parseInt(i?n:D+n,10)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e):this.resetLeadingZero(),this.partPattern(t.partMap,e)),F=s?s.pattern:null;if(l&&r&&!E)this.setExisting(e,!1);else{for(var s=D.length-3,V=!0,k=l?E:D,u=Math.max(0,s);u<=D.length&&V;u++){k=i?n:l?E:D.substring(u)+n,this.autoCorrectParts||(V=!1,l)||(k=W.unpadZero(k),k=W.padZero(S-k.length)+k),l&&(V=!1,k=W.unpadZero(k));var _=parseInt(k,10),x=this.intl.parseDate(y+k+P,this.format,this.localeId),T=(!l||M||H.isValidDate(x)||this.autoCorrectParts&&(x=this.intl.parseDate(b+k+L,this.format,this.localeId),E=k),!isNaN(parseInt(n,10))||l&&r&&""===n);if(!x&&!isNaN(_)&&T&&this.autoCorrectParts&&("M"!==e||C||-1<(T=_-1)&&T<12&&((x=B.cloneDate(this.value)).setMonth(T),x.getMonth()!==T)&&(x=B.lastDayOfMonth(B.addMonths(x,-1))),"y"===e)&&(x=B.createDate(parseInt(k,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),l&&H.isValidDate(x)||!l&&x)&&this.date&&x.getDate()!==this.value.getDate()&&(x=B.lastDayOfMonth(B.addMonths(x,-1))),l&&H.isValidDate(x)||!l&&x)return _=this.intl.parseDate(""+y+this.peek(k,F)+P,this.format,this.localeId),T=this.patternLength(F)||F.length,T=((this.leadingZero||{})[e]||0)+(W.unpadZero(k)||n).length>=T,_=null===_||K[e]&&F.length<=k.length||T,this.shouldNormalizeCentury()&&(x=this.normalizeCentury(x)),this._value=x,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(),l&&_&&("M"===e?S<=2&&(_=2<=(A=H.parseToInt(E))):_=_&&(M?E.length===S:E.length>S)),H.extend(p,{value:this.value,switchToNext:_})}if(C&&(x=this.intl.parseDate(y+C+P,this.format,this.localeId)))return this._value=x,this.setExisting(e,!0),H.extend(p,{value:this.value,switchToNext:!1});if(O&&(x=this.intl.parseDate(y+O+P,this.format)))return this._value=x,H.extend(p,{value:this.value,switchToNext:!0});if(w&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((s={})[e]=!0,s),this.setExisting(e,!1)),!(l&&E.length>S||this.autoCorrectParts)){var A=void 0,O=H.parseToInt(l?E:k);if(H.isNumber(O))return"d"===e&&(O<=0||31<O)||"M"===e&&(O<0||11<O)?H.extend(p,{value:null,switchToNext:!1}):(A="M"===e?H.clamp(O-1,0,11):O,this.setExisting(e,!1),this.setInvalidDatePart(e,{value:A,date:B.cloneDate(this.value),startDate:this._partiallyInvalidDate.startDate||B.cloneDate(this.value)}),H.extend(p,{value:null,switchToNext:!1,hasInvalidDatePart:!0}))}}return H.extend(p,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(W.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.normalizeCentury=function(t){var e,n;return H.isPresent(t)?(e=H.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),H.setYears(t,n+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return W.padZero(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var 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""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},s.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},s.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var r=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[a].pattern[0]]||h.Constants.formatSeparator),s.push(n[a]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var n="",i="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(a=!0)):n=(t[l+t.length-s.length]||"")+n,i=s[l]+i;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),n=W.padZero(h.length-u.length)+u+n,d=h.length-1,r=u.length-h.length)):(n=W.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=s[l]+i;0!==d&&(l=l-d+(t.length-s.length))}}return{text:n,format:i}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&H.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var n=e.value,n=void 0===n?null:n,i=e.date,i=void 0===i?null:i,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e,a=n;"d"===t?a=H.clamp(H.isPresent(n)?n:1,1,31):"M"===t&&(a=H.clamp(H.isPresent(n)?n:0,0,11)),this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=a,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.hasInvalidDatePart=function(){var e=this,n=!1;return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&H.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!0)}),n},s.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=B.cloneDate(t),s=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=B.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),s=!0;break;case"m":i.setMinutes(i.getMinutes()+n),s=!0;break;case"s":i.setSeconds(i.getSeconds()+n),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),s=!0}return{date:i,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=B.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=B.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},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(n.type!==a.type||n.pattern!==a.pattern)break;i.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],n.type===a.type&&n.pattern===a.pattern);s--)i.unshift(a);return i},e.DateObject=s},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(10),a=n(9),D=n(4),E=n(7),b=n(3),P=n(0),r=n(6),S=n(5),M=n(2),I=n(1),o={format:"d",allowNulls:!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:I.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,s.__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=P.isValidDate(this.options.value)?M.cloneDate(this.options.value):new Date(e.formattedValue);P.isValidDate(n)||(n=null),this.element=t,this.options=P.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=S.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=P.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===S.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=P.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===E.KeyCode.BACKSPACE||e.key===b.Key.BACKSPACE,i=e.keyCode===E.KeyCode.DELETE||e.key===b.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,s=(!this.options.allowCaretMode||e===S.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=S.DateInputInteractionMode.Caret:this.interactionMode=S.DateInputInteractionMode.Selection,this.isInCaretMode());if(s&&this.keyDownEvent.key===b.Key.SPACE)this.restorePreviousInputEventState();else{var a=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,s&&(n||i||e===S.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=D.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||l&&0!==l.length){if(s&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(s&&l[0]&&(l[0][0]===I.Constants.formatSeparator||l[0][1]===I.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var r=1===l.length&&l[0][1]===I.Constants.formatSeparator,h=[],u=!1;if(!r)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,o=h[h.length-1],m=o&&!o.value,g=s&&(n||i)&&m,f=!!o&&o.resetPart,o=!!o&&o.hasInvalidDatePart,v=!M.isEqual(a,this.dateObject.value),y=this.selection;s&&!g&&!f||(f&&(p=this.currentFormat[y.start]),this.forceUpdate()),l.length&&l[0][0]!==I.Constants.formatSeparator&&(!s||g||f?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===I.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):s&&(v&&P.isPresent(this.dateObject.getValue())||!v&&u&&P.isPresent(this.dateObject.getValue())?u&&this.switchDateSegment(1):m&&!o&&this.restorePreviousInputEventState())),u||!s||n||i||f||!m?this.options.autoSwitchParts&&(u||r)&&!s&&this.switchDateSegment(1):v?this.currentFormat.length===this.elementValue.length||e!==S.DateInputInteractionMode.Caret&&v||(e!==S.DateInputInteractionMode.Caret?(p=this.currentFormat[y.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):o||this.restorePreviousInputEventState()):o||this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:a,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=S.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=S.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})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,e=e.end,n=(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(b.Key.TAB.toLowerCase().trim())||0<=n.indexOf(E.KeyCode.TAB)||0<=n.indexOf(E.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 s,a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===E.KeyCode.TAB)){switch(t.keyCode){case E.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case E.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,event),o=!0;break;case E.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case E.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,event),o=!0;break;case E.KeyCode.ENTER:break;case E.KeyCode.DELETE:case E.KeyCode.BACKSPACE:return this.options.allowNulls&&(s=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:s,event:t})),o=!0,void(t.keyCode===E.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(E.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(b.Key.BACKSPACE))&&this.switchDateSegment(-1));case b.Key.HOME:this.selectNearestSegment(0);break;case b.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=(P.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:I.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:I.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]!==I.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==I.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],s="",a="";if(t<0){for(var r=n+t;0<=r;r--)if((a=this.currentFormat[r])!==I.Constants.formatSeparator&&a!==i){n=r,s=a;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==I.Constants.formatSeparator&&a!==i){n=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=S.DateInputInteractionMode.Selection)}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;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===I.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==I.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)}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,s;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond||(s=P.millisecondDigitsInFormat(this.inputFormat),t=P.millisecondStepFor(s)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!M.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",P.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",P.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",P.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",P.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",P.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",P.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",P.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",P.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",P.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",P.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&&!P.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.isActive&&P.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()),e=(P.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e),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],s=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(n&&(P.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),i=[s.selectionStart,s.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 a.DateObject(P.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=S.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),s=(e.DateInput=n.DateInput,e);for(i in s)a(i,s[i])}],s={},i.m=n,i.c=s,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)}}});
|