{"version":3,"file":"kendo.dateinput.common.min.js","names":["global","factory","exports","module","require","define","amd","globalThis","self","kendodateinput","common","js","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","constructor","create","Direction","cloneDate","date","Date","getTime","adjustDST","hour","newDate","getHours","setHours","addDays","offset","setDate","getDate","createDate","year","month","day","hours","minutes","seconds","milliseconds","setFullYear","getFullYear","lastDayOfMonth","getMonth","getMinutes","getSeconds","getMilliseconds","addMonths","expectedMonth","setMonth","normalize","Day","isEqual","candidate","expected","timezones","rules","titles","zones","MONTHS","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","DAYS","Sun","Mon","Tue","Wed","Thu","Fri","Sat","ruleToDate","rule","zoneOffset","on","time","ruleOffset","isNaN","indexOf","UTC","targetDay","substr","ourDay","getUTCDay","setUTCDate","getUTCDate","CURRENT_UTC_TIME","findRule","zoneRule","utcTime","split","length","Number","getUTCFullYear","filter","currentRule","from","to","push","sort","a","NO_TZ_INFO","formatRegExp","formatMessage","message","arguments$1","arguments","values","_i","flattenValues","reduce","concat","replace","_","index","parseInt","findZone","timezone","zoneRules","Error","result","getZoneRules","idx","until","zone","zoneAndRule","getTimezoneOffset","_a","parseFloat","addMinutes","addHours","dayAbbr","monthAbbr","padNumber","num","len","Math","abs","join","slice","isZoneMissingHour","currentOffset","prevHour","shiftZoneMissingHour","utcDate","dstOffset","convertTimezoneUTC","utcLocal","fromTimezone","toTimezone","fromOffset","toOffset","baseDiff","midDate","midOffset","ZonedDate","_utcDate","tzOffset","timezoneOffset","localDate","_localDate","defineProperty","get","enumerable","configurable","fromLocalDate","shiftZone","fixedOffset","adjDate","fromUTCDate","toLocalDate","toUTCDate","clone","days","addTime","utcMid","setTime","utcResult","stripTime","ticks","getUTCMonth","getDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","setMilliseconds","ms","setUTCMilliseconds","setSeconds","sec","setUTCSeconds","setMinutes","min","setUTCMinutes","setUTCHours","setUTCMonth","setUTCFullYear","toISOString","toJSON","toString","dateString","timeString","toTimeString","toDateString","sign","value","floor","formatOffset","abbrev","base","abbrTimezone","toLocaleString","locales","options","toLocaleDateString","toLocaleTimeString","toUTCString","Symbol","toPrimitive","hint","valueOf","getVarDate","format","formatUTC","method","DateInputInteractionMode","Mask","symbols","partMap","Constants","Key","padZero","max","fill","unpadZero","dateSymbolMap","map","part","pattern","type","isObject","isArray","isPresent","isNumber","parseToInt","clamp","extend","args","assign","apply","deepExtend","target","_b","sources","source","shift","key","HTMLElement","setYears","areDatePartsEqualTo","isValidDate","SHORT_PATTERN_LENGTH_REGEXP","DateObject","intlService","formatPlaceholder","cycleTime","_c","twoDigitYearMax","_d","_e","autoCorrectParts","dayperiod","leadingZero","typedMonthPart","knownParts","E","H","M","h","m","s","y","S","_value","_partiallyInvalidDate","startDate","invalidDateParts","startDateOffset","setOptions","sampleFormat","dateFormatString","i","setExisting","set","resetInvalidDate","localeId","cldrKeys","keys","intl","cldr","name","calendar","numbers","monthNames","allFormattedMonths","dayPeriods","allDayPeriods","setValue","modifyExisting","hasValue","_this","splitDateFormat","getExisting","getValue","getFormattedDate","formatDate","getTextAndFormat","customFormat","text","mask","partiallyInvalidText","formattedDate","formattedDates","getFormattedInvalidDates","symbol","getInvalidDatePartValue","partsForSegment","getPartsForSegment","datePartText","merge","formattedDatesForSymbol","forEach","getInvalidDatePart","formattedInvalidDate","modifyPart","invalidDateFound","newValue","timeModified","isMonth","isDay","symbolExists","invalidDatePartValue","resetInvalidDateSymbol","monthValue","dayValue","dateCandidate","newValueCandidate","modifyDateSymbolWithValue","dateCandidateExists","markDatePartsAsExisting","setInvalidDatePart","shouldNormalizeCentury","normalizeCentury","parsePart","currentChar","resetSegmentValue","cycleSegmentValue","rawInputValue","rawTextValue","isDeleting","originalFormat","isInCaretMode","dateParts","datePartsLiterals","x","datePartIndex","literal","flatDateParts","datePart","j","parseResult","switchToNext","resetPart","some","hasInvalidDatePart","resetLeadingZero","rawValueStartsWithLiteral","startsWith","rawValueEndsWithLiteral","endsWith","rawValueHasConsecutiveLiterals","baseDate","baseFormat","replaced","prefix","current","basePrefix","baseSuffix","suffix","convertedBaseFormat","hasFixedFormat","datePartStartIndex","segmentLength","lastIndexOf","formatToTextLengthDiff","parsedDate","matchMonth","dayPeriod","matchDayPeriod","isZeroCurrentChar","isAbbrMonth","incrementLeadingZero","partPattern","patternValue","patternLength","currentMaxLength","tryParse","middle","substring","middleNumber","candidateDateString","parseDate","autoCorrectedPrefixAndSuffix","isCurrentCharParsable","monthNumber","peekedValue","peek","peekedDateString","peekedDate","patternSatisfied","datePartValue","textToParse","parsedValue","month_1","valueCandidate","symbolMap","hasLeadingZero","setLeadingZero","getLeadingZero","twoDigitYear","cropTwoDigitYear","centuryBase","getNormalizedCenturyBase","parts","names","peekValue","typedChar","toLowerCase","monthAsNum","lowerChart","am","pm","locale","dateFormatParts","dateFormatNames","test","partLength","returnValue","resultText","resultFormat","processTextSymbolsEnded","ignoreFormatSymbolsCount","formatSymbolIndex","formatSymbolIndexModifier","dateFieldName","nameType","resetInvalidDatePart","shouldResetInvalidDate","modifyDateSymbolWithOffset","partIndex","segmentPart","maskPartIndex","unshift","KeyCode","defaultOptions","events","Observable","destroy","trigger","eventName","eventData","defaultPrevented","preventDefault","sender","DRAG_START","DROP","TOUCH_START","MOUSE_DOWN","MOUSE_UP","CLICK","INPUT","KEY_DOWN","FOCUS","BLUR","PASTE","MOUSE_SCROLL","MOUSE_WHEEL","VALUE_CHANGE","INPUT_END","BLUR_END","FOCUS_END","CHANGE","defaultDateInputOptions","hasPlaceholder","placeholder","steps","millisecond","second","minute","selectNearestSegmentOnFocus","selectPreviousSegmentOnBackspace","enableMouseWheel","allowCaretMode","autoSwitchParts","autoSwitchKeys","autoFill","DateInput","_super","element","dateObject","currentText","currentFormat","interactionMode","None","previousElementSelection","start","end","init","dateValue","formattedValue","createDateObject","setTextAndFormat","bindEvents","forceUpdate","unbindEvents","onElementDragStart","bind","addEventListener","onElementDrop","onElementClick","onElementMouseDown","onElementMouseUp","onElementInput","onElementKeyDown","onElementFocus","onElementBlur","onElementChange","onElementPaste","onElementMouseWheel","removeEventListener","refresh","setDateObjectOptions","newOptions","getDateObjectOptions","resetLocale","Caret","focus","selectNearestSegment","e","mouseDownStarted","focusedPriorToMouseDown","isActive","switchedPartOnPreviousKeyAction","selection","detail","selectionPresent","selectionStart","selectionEnd","placeholderToggled","caret","setSelection","selectionByIndex","triggerInput","event","isPasteInProgress","updateOnPaste","keyDownEvent","isBackspaceKey","keyCode","isDeleteKey","originalInteractionMode","Selection","hasCaret","restorePreviousInputEventState","oldExistingDateValue","oldDateValue","diff","oldText","newText","formatPattern","keyEvent","oldTextSeparator","oldSegmentText","newSegmentText","deletedSymbol","approximateStringMatching","previousElementValue","elementValue","navigationOnly","parsePartsResults","switchPart","error","parsePartResult","symbolForSelection","lastParseResult","lastParseResultHasNoValue","parsingFailedOnDelete","newExistingDateValue","hasExistingDateValueChanged","newDateValue","currentSelection","diffChar","forceUpdateWithSelection","switchDateSegment","selectionBySymbol","data","tryTriggerValueChange","oldValue","triggerInputEnd","triggerFocus","refreshElementValue","triggerFocusEnd","triggerBlur","triggerBlurEnd","triggerChange","triggerKeyDown","keyEventMatchesAutoSwitchKeys","isTabKey","shiftKey","step","getStepFromSymbol","shouldPreventDefault","altKey","ctrlKey","metaKey","modifyDateSegmentValue","triggerMouseWheel","wheelDelta","stopPropagation","inputFormat","oldDateObjectValue","writeValue","displayFormat","undefined","document","activeElement","setSelectionRange","currentSymbol","symbolCandidate","previousFormatSymbol","readonly","digits","msDigits","match","pow","triggerValueChange","elementValueLength","selectionOffset","setElementValue","restorePreviousElementValue","restorePreviousElementSelection","verifyValue","getDateObject","showPlaceholder","newElementValue","isPosition","disabled","selectDateSegment","begin","keyObject","trim","currentDate","window","kendo","jQuery","ui","DateInputCommon"],"sources":["kendo.dateinput.common.js"],"mappings":"CAAA,SAAW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AWhT,MAAM7L,WAAaqoB,EAAYroB,WACrEW,EAAUke,EAAWle,QAAUke,EAAWhT,MAAM3K,aAAemnB,EAAYnnB,aAC3EN,EAAUie,EAAWje,QAAUie,EAAWhT,MAAM1K,aAAeknB,EAAYlnB,aAC/E0d,EAAW1M,SAAS,IAAIxS,KAAKY,EAAMC,EAAOC,EAAKC,EAAOC,EAASC,IAC/DtC,KAAK4mB,sBACL5mB,KAAKgnB,gBAEb,EACO5G,CACX,CAlmC8B,CAkmC5BxC,IAeF,OAHGoM,OAAOC,MAAMC,OADZD,MAAME,GAAGC,gBAAkBhK,GAEjB6J,KAIf","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('kendo.core.js')) :\n typeof define === 'function' && define.amd ? define(['kendo.core'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.kendodateinput = global.kendodateinput || {}, global.kendodateinput.common = global.kendodateinput.common || {}, global.kendodateinput.common.js = factory()));\n})(this, (function () {\n /******************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n\n var extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\n return extendStatics(d, b);\n };\n\n function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n { throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\"); }\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n\n var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n var arguments$1 = arguments;\n\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments$1[i];\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p]; } }\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n\n function __rest(s, e) {\n var t = {};\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n { t[p] = s[p]; } }\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n { t[p[i]] = s[p[i]]; }\n } }\n return t;\n }\n\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") { r = Reflect.decorate(decorators, target, key, desc); }\n else { for (var i = decorators.length - 1; i >= 0; i--) { if (d = decorators[i]) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; } } }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n }\n\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n }\n\n function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") { throw new TypeError(\"Function expected\"); } return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) { context[p] = p === \"access\" ? {} : contextIn[p]; }\n for (var p in contextIn.access) { context.access[p] = contextIn.access[p]; }\n context.addInitializer = function (f) { if (done) { throw new TypeError(\"Cannot add initializers after decoration has completed\"); } extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) { continue; }\n if (result === null || typeof result !== \"object\") { throw new TypeError(\"Object expected\"); }\n if (_ = accept(result.get)) { descriptor.get = _; }\n if (_ = accept(result.set)) { descriptor.set = _; }\n if (_ = accept(result.init)) { initializers.unshift(_); }\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") { initializers.unshift(_); }\n else { descriptor[key] = _; }\n }\n }\n if (target) { Object.defineProperty(target, contextIn.name, descriptor); }\n done = true;\n };\n\n function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n };\n\n function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n };\n\n function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") { name = name.description ? \"[\".concat(name.description, \"]\") : \"\"; }\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n };\n\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") { return Reflect.metadata(metadataKey, metadataValue); }\n }\n\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) { throw t[1]; } return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) { throw new TypeError(\"Generator is already executing.\"); }\n while (g && (g = 0, op[0] && (_ = 0)), _) { try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; }\n if (y = 0, t) { op = [op[0] & 2, t.value]; }\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) { _.ops.pop(); }\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } }\n if (op[0] & 5) { throw op[1]; } return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n\n var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) { k2 = k; }\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) { k2 = k; }\n o[k2] = m[k];\n });\n\n function __exportStar(m, o) {\n for (var p in m) { if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) { __createBinding(o, m, p); } }\n }\n\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) { return m.call(o); }\n if (o && typeof o.length === \"number\") { return {\n next: function () {\n if (o && i >= o.length) { o = void 0; }\n return { value: o && o[i++], done: !o };\n }\n }; }\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) { return o; }\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); }\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) { m.call(i); }\n }\n finally { if (e) { throw e.error; } }\n }\n return ar;\n }\n\n /** @deprecated */\n function __spread() {\n var arguments$1 = arguments;\n\n for (var ar = [], i = 0; i < arguments.length; i++)\n { ar = ar.concat(__read(arguments$1[i])); }\n return ar;\n }\n\n /** @deprecated */\n function __spreadArrays() {\n var arguments$1 = arguments;\n\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) { s += arguments$1[i].length; }\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n { for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n { r[k] = a[j]; } }\n return r;\n }\n\n function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) { for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) { ar = Array.prototype.slice.call(from, 0, i); }\n ar[i] = from[i];\n }\n } }\n return to.concat(ar || Array.prototype.slice.call(from));\n }\n\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) { throw new TypeError(\"Symbol.asyncIterator is not defined.\"); }\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) { resume(q[0][0], q[0][1]); } }\n }\n\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n }\n\n function __asyncValues(o) {\n if (!Symbol.asyncIterator) { throw new TypeError(\"Symbol.asyncIterator is not defined.\"); }\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n }\n\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };\n\n var __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function(o, v) {\n o[\"default\"] = v;\n };\n\n function __importStar(mod) {\n if (mod && mod.__esModule) { return mod; }\n var result = {};\n if (mod != null) { for (var k in mod) { if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) { __createBinding(result, mod, k); } } }\n __setModuleDefault(result, mod);\n return result;\n }\n\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n\n function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) { throw new TypeError(\"Private accessor was defined without a getter\"); }\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) { throw new TypeError(\"Cannot read private member from an object whose class did not declare it\"); }\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n }\n\n function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") { throw new TypeError(\"Private method is not writable\"); }\n if (kind === \"a\" && !f) { throw new TypeError(\"Private accessor was defined without a setter\"); }\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) { throw new TypeError(\"Cannot write private member to an object whose class did not declare it\"); }\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n }\n\n function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) { throw new TypeError(\"Cannot use 'in' operator on non-object\"); }\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n }\n\n var tslib_es6 = {\n __extends: __extends,\n __assign: __assign,\n __rest: __rest,\n __decorate: __decorate,\n __param: __param,\n __metadata: __metadata,\n __awaiter: __awaiter,\n __generator: __generator,\n __createBinding: __createBinding,\n __exportStar: __exportStar,\n __values: __values,\n __read: __read,\n __spread: __spread,\n __spreadArrays: __spreadArrays,\n __spreadArray: __spreadArray,\n __await: __await,\n __asyncGenerator: __asyncGenerator,\n __asyncDelegator: __asyncDelegator,\n __asyncValues: __asyncValues,\n __makeTemplateObject: __makeTemplateObject,\n __importStar: __importStar,\n __importDefault: __importDefault,\n __classPrivateFieldGet: __classPrivateFieldGet,\n __classPrivateFieldSet: __classPrivateFieldSet,\n __classPrivateFieldIn: __classPrivateFieldIn,\n };\n\n /**\n * A function that clones the passed date. The parameter could be `null`.\n *\n * @param date - The initial date value.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * cloneDate(new Date(2016, 0, 1)); // returns new Date(2016, 0, 1);\n * cloneDate(null); // returns null\n * ```\n */\n var cloneDate = function (date) { return date ? new Date(date.getTime()) : null; };\n\n /**\n * @hidden\n */\n var adjustDST = function (date, hour) {\n var newDate = cloneDate(date);\n if (hour === 0 && newDate.getHours() === 23) {\n newDate.setHours(newDate.getHours() + 2);\n }\n return newDate;\n };\n\n /**\n * A function that adds and subtracts days from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of days to add and subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addDays(new Date(2016, 0, 1), 5); // 2016-1-6\n * addDays(new Date(2016, 0, 1), -5); // 2015-12-26\n * ```\n */\n var addDays = function (date, offset) {\n var newDate = cloneDate(date);\n newDate.setDate(newDate.getDate() + offset);\n return adjustDST(newDate, date.getHours());\n };\n\n /**\n * A function which returns a new `Date` instance.\n *\n * @param year - The year value.\n * @param month - The month value.\n * @param day - The day value.\n * @param hours - The hours value.\n * @param minutes - The minutes value.\n * @param seconds - The seconds value.\n * @param milliseconds - milliseconds value.\n * @returns The date instance.\n *\n * @example\n * ```ts-no-run\n * createDate(2016, 0, 15); // 2016-01-15 00:00:00\n * createDate(2016, 0, 15, 22, 22, 20); // 2016-01-15 22:22:20\n * ```\n */\n var createDate = function (year, month, day, hours, minutes, seconds, milliseconds) {\n if (hours === void 0) { hours = 0; }\n if (minutes === void 0) { minutes = 0; }\n if (seconds === void 0) { seconds = 0; }\n if (milliseconds === void 0) { milliseconds = 0; }\n var date = new Date(year, month, day, hours, minutes, seconds, milliseconds);\n if (year > -1 && year < 100) {\n date.setFullYear(date.getFullYear() - 1900);\n }\n return adjustDST(date, hours);\n };\n\n /**\n * A function which returns the last date of the month.\n *\n * @param date - The initial date.\n * @returns - The last date of the initial date month.\n *\n * @example\n * ```ts-no-run\n * lastDayOfMonth(new Date(2016, 0, 15)); // 2016-01-31\n * ```\n */\n var lastDayOfMonth = function (date) {\n var newDate = createDate(date.getFullYear(), date.getMonth() + 1, 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return addDays(newDate, -1);\n };\n\n var MONTHS_LENGTH = 12;\n var normalize = function (date, expectedMonth) { return (date.getMonth() !== expectedMonth ? lastDayOfMonth(addMonths(date, -1)) : date //tslint:disable-line:no-use-before-declare\n ); };\n /**\n * A function that adds and subtracts months from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of months to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addMonths(new Date(2016, 5, 1), 5); // 2016-11-1\n * addMonths(new Date(2016, 5, 1), -5); // 2015-1-1\n * ```\n */\n var addMonths = function (date, offset) {\n var newDate = cloneDate(date);\n var diff = (newDate.getMonth() + offset) % MONTHS_LENGTH;\n var expectedMonth = (MONTHS_LENGTH + diff) % MONTHS_LENGTH;\n newDate.setMonth(newDate.getMonth() + offset);\n return normalize(adjustDST(newDate, date.getHours()), expectedMonth);\n };\n\n /**\n * @hidden\n */\n var setYear = function (value, year) {\n var month = value.getMonth();\n var candidate = createDate(year, month, value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());\n return candidate.getMonth() === month ? candidate : lastDayOfMonth(addMonths(candidate, -1));\n };\n\n /**\n * A function that adds and subtracts years from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of years to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addYears(new Date(2016, 5, 1), 5); // 2011-6-1\n * addYears(new Date(2016, 5, 1), -5); // 2021-6-1\n * ```\n */\n var addYears = function (value, offset) {\n return adjustDST(setYear(value, value.getFullYear() + offset), value.getHours());\n };\n\n /**\n * A function that adds and subtracts centuries from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of centuries to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addCenturies(new Date(2016, 5, 1), 5); // 2516-6-1\n * addCenturies(new Date(2016, 5, 1), -5); // 1516-6-1\n * ```\n */\n var addCenturies = function (value, offset) {\n return addYears(value, 100 * offset);\n };\n\n /**\n * A function that adds and subtracts decades from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of decades to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addDecades(new Date(2016, 5, 1), 5); // 2066-6-1\n * addDecades(new Date(2016, 5, 1), -5); // 1966-6-1\n * ```\n */\n var addDecades = function (value, offset) {\n return addYears(value, 10 * offset);\n };\n\n /**\n * A function that adds and subtracts weeks from a Date object.\n *\n * @param date - The initial date value.\n * @param offset - The number of weeks to add/subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addWeeks(new Date(2016, 5, 1), 3); // 2016-6-22\n * addWeeks(new Date(2016, 5, 1), -3); // 2015-5-11\n * ```\n */\n var addWeeks = function (date, offset) {\n return addDays(date, offset * 7);\n };\n\n /**\n * The number of milliseconds in one minute.\n */\n var MS_PER_MINUTE$1 = 60000;\n /**\n * The number of milliseconds in one hour.\n */\n var MS_PER_HOUR = 3600000;\n /**\n * The number of milliseconds in one standard day.\n */\n var MS_PER_DAY = 86400000;\n\n // tslint:disable:max-line-length\n /**\n * An enumeration which represents the horizontal direction. The `Forward` option moves forward. The `Backward` option moves backward.\n */\n var Direction;\n (function (Direction) {\n /**\n * The `Forward` value with an underlying `1` number value.\n */\n Direction[Direction[\"Forward\"] = 1] = \"Forward\";\n /**\n * The `Backward` value with an underlying `-1` (minus one) number value.\n */\n Direction[Direction[\"Backward\"] = -1] = \"Backward\";\n })(Direction || (Direction = {}));\n // tslint:enable:max-line-length\n\n /**\n * @hidden\n *\n * A function which returns the next or previous date for a specific week day. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @param direction - The `Direction` enum specifying the calculation direction.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Forward); // 2016-01-06, Wednesday\n * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Backward); // 2015-12-30, Wednesday\n * ```\n */\n var dayOfWeek = function (date, weekDay, direction) {\n if (direction === void 0) { direction = Direction.Forward; }\n var newDate = cloneDate(date);\n var newDay = ((weekDay - newDate.getDay()) + (7 * direction)) % 7;\n newDate.setDate(newDate.getDate() + newDay);\n return adjustDST(newDate, date.getHours());\n };\n\n /**\n * Enumeration which represents the week days.\n */\n var Day;\n (function (Day) {\n /**\n * The Sunday value with an underlying `0` number value.\n */\n Day[Day[\"Sunday\"] = 0] = \"Sunday\";\n /**\n * The Monday value with an underlying `1` number value.\n */\n Day[Day[\"Monday\"] = 1] = \"Monday\";\n /**\n * The Tuesday value with an underlying `2` number value.\n */\n Day[Day[\"Tuesday\"] = 2] = \"Tuesday\";\n /**\n * The Wednesday value with an underlying `3` number value.\n */\n Day[Day[\"Wednesday\"] = 3] = \"Wednesday\";\n /**\n * The Thursday value with an underlying `4` number value.\n */\n Day[Day[\"Thursday\"] = 4] = \"Thursday\";\n /**\n * The Friday value with an underlying `5` number value.\n */\n Day[Day[\"Friday\"] = 5] = \"Friday\";\n /**\n * The Saturday value with an underlying `6` number value.\n */\n Day[Day[\"Saturday\"] = 6] = \"Saturday\";\n })(Day || (Day = {}));\n\n /**\n * @hidden\n */\n var normalizeYear = function (value, year) { return (setYear(value, year(value.getFullYear()))); };\n\n /**\n * A function that returns a `Date` object of the first decade in a century.\n *\n * @param date - The start date value.\n * @returns - The first year in a century.\n *\n * @example\n * ```ts-no-run\n * firstDecadeOfCentury(new Date(2017, 0, 1)); // 2000-1-1\n * firstDecadeOfCentury(new Date(2007, 10, 22)); // 2000-11-22\n * firstDecadeOfCentury(new Date(2126, 0, 1)); // 2100-1-1\n * ```\n */\n var firstDecadeOfCentury = function (value) { return (normalizeYear(value, function (y) { return y - (y % 100); })); };\n\n /**\n * A function that calculates duration in centuries between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInCenturies(new Date(2016, 0, 1), new Date(3216, 0, 1)); // 12\n * durationInCenturies(new Date(2016, 6, 1), new Date(2617, 0, 1)); // 6\n * durationInCenturies(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\n var durationInCenturies = function (start, end) { return ((firstDecadeOfCentury(end).getFullYear() - firstDecadeOfCentury(start).getFullYear()) / 100); };\n\n /**\n * A function that returns a `Date` object of the first year in a decade.\n *\n * @param date - The start date value.\n * @returns - The first year in a decade.\n *\n * @example\n * ```ts-no-run\n * firstYearOfDecade(new Date(2017, 0, 1)); // 2010-1-1\n * firstYearOfDecade(new Date(2007, 10, 22)); // 2000-11-22\n * firstYearOfDecade(new Date(2026, 0, 1)); // 2020-1-1\n * ```\n */\n var firstYearOfDecade = function (value) { return (normalizeYear(value, function (y) { return y - (y % 10); })); };\n\n /**\n * A function that calculates duration in decades between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInDecades(new Date(2016, 0, 1), new Date(2136, 0, 1)); // 12\n * durationInDecades(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\n var durationInDecades = function (start, end) { return ((firstYearOfDecade(end).getFullYear() - firstYearOfDecade(start).getFullYear()) / 10); };\n\n /**\n * A function that calculates duration in months between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInMonths(new Date(2016, 0, 1), new Date(2017, 0, 1)); // 12\n * durationInMonths(new Date(2016, 6, 1), new Date(2017, 0, 1)); // 6\n * durationInMonths(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\n var durationInMonths = function (start, end) { return (((end.getFullYear() - start.getFullYear())) * 12 + (end.getMonth() - start.getMonth())); };\n\n /**\n * A function that calculates duration in years between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in years.\n *\n * @example\n * ```ts-no-run\n * durationInYears(new Date(2016, 0, 1), new Date(2028, 0, 1)); // 12\n * durationInYears(new Date(2016, 0, 1), new Date(2022, 0, 1)); // 6\n * durationInYears(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\n var durationInYears = function (start, end) { return (end.getFullYear() - start.getFullYear()); };\n\n /**\n * A function which returns the first date of the current week.\n *\n * @param date - The initial date.\n * @param weekStartDay [default: Day.Sunday] - The first day of the week.\n * @returns - The first date of the current week.\n *\n * @example\n * ```ts-no-run\n * firstDayInWeek(new Date(2016, 0, 15)); // 2016-01-10\n * firstDayInWeek(new Date(2016, 0, 15), Day.Monday); // 2016-01-11\n * ```\n */\n var firstDayInWeek = function (date, weekStartDay) {\n if (weekStartDay === void 0) { weekStartDay = Day.Sunday; }\n var first = cloneDate(date);\n while (first.getDay() !== weekStartDay) {\n first.setDate(first.getDate() - 1);\n }\n return first;\n };\n\n /**\n * A function which returns the first date of the month.\n *\n * @param date - The initial date.\n * @returns - The first date of the initial date month.\n *\n * @example\n * ```ts-no-run\n * firstDayOfMonth(new Date(2016, 0, 15)); // 2016-01-01\n * ```\n */\n var firstDayOfMonth = function (date) {\n return createDate(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n };\n\n /**\n * @hidden\n */\n var setMonth = function (value, month) {\n var day = value.getDate();\n var candidate = createDate(value.getFullYear(), month, day, value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());\n return candidate.getDate() === day ? candidate : lastDayOfMonth(addMonths(candidate, -1));\n };\n\n /**\n * A function that returns a `Date` object of the first month in a year.\n *\n * @param date - The start date value.\n * @returns - The first month in a year.\n *\n * @example\n * ```ts-no-run\n * firstMonthOfYear(new Date(2017, 11, 1)); // 2017-1-1\n * firstMonthOfYear(new Date(2017, 0, 1)); // 2017-1-1\n * ```\n */\n var firstMonthOfYear = function (value) { return setMonth(value, 0); };\n\n /**\n * A function which returns the passed date with a midnight time portion.\n *\n * @param date - The initial date.\n * @returns - The date with a midnight time portion.\n *\n * @example\n * ```ts-no-run\n * getDate(new Date(2016, 0, 15, 14, 30, 30)); // 2016-01-15 00:00:00\n * ```\n */\n var getDate = function (date) {\n return createDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);\n };\n\n /**\n * A function that compares two dates. The comparison also includes the time portion.\n *\n * @param candidate - The candidate date.\n * @param expected - The expected date.\n * @returns - A Boolean value indicating whether the values are equal.\n *\n * @example\n * ```ts-no-run\n * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 1)); // true\n * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 2)); // false\n * isEqual(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // false\n * ```\n */\n var isEqual = function (candidate, expected) {\n if (!candidate && !expected) {\n return true;\n }\n return candidate && expected && candidate.getTime() === expected.getTime();\n };\n\n /**\n * A function that compares the date portions of 2 dates.\n *\n * @param candidate - The candidate date.\n * @param expected - The expected date.\n * @returns - A Boolean value whether the values are equal.\n *\n * @example\n * ```ts-no-run\n * isEqualDate(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // true\n * isEqualDate(new Date(2016, 0, 1, 10), new Date(2016, 0, 2, 10)); // false\n * ```\n */\n var isEqualDate = function (candidate, expected) {\n if (!candidate && !expected) {\n return true;\n }\n return candidate && expected && isEqual(getDate(candidate), getDate(expected));\n };\n\n /**\n * A function that returns a `Date` object of the last decade in a century.\n *\n * @param date - The start date value.\n * @returns - The last year in a decade.\n *\n * @example\n * ```ts-no-run\n * lastDecadeOfCentury(new Date(2017, 0, 1)); // 2090-1-1\n * lastDecadeOfCentury(new Date(2007, 10, 22)); // 2090-11-22\n * lastDecadeOfCentury(new Date(2126, 0, 1)); // 2190-1-1\n * ```\n */\n var lastDecadeOfCentury = function (value) { return (normalizeYear(value, function (y) { return y - (y % 100) + 90; })); };\n\n /**\n * A function that returns a `Date` object of the last month in a year.\n *\n * @param date - The start date value.\n * @returns - The last month in a year.\n *\n * @example\n * ```ts-no-run\n * lastMonthOfYear(new Date(2017, 5, 3)); // 2017-12-3\n * lastMonthOfYear(new Date(2017, 11, 3)); // 2017-12-3\n * ```\n */\n var lastMonthOfYear = function (value) { return setMonth(value, 11); };\n\n /**\n * A function that returns a `Date` object of the last year in a decade.\n *\n * @param date - The start date value.\n * @returns - The last year in a decade.\n *\n * @example\n * ```ts-no-run\n * lastYearOfDecade(new Date(2017, 0, 1)); // 2019-1-1\n * lastYearOfDecade(new Date(2007, 10, 22)); // 2009-11-22\n * lastYearOfDecade(new Date(2026, 0, 1)); // 2029-1-1\n * ```\n */\n var lastYearOfDecade = function (value) { return (normalizeYear(value, function (y) { return y - (y % 10) + 9; })); };\n\n /**\n * A function which returns a date by a specific week name. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * nextDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2016-01-06, Wednesday\n * ```\n */\n var nextDayOfWeek = function (date, weekDay) {\n return dayOfWeek(date, weekDay, Direction.Forward);\n };\n\n /**\n * A function which returns a date by a specific week name. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * prevDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2015-12-30, Wednesday\n * ```\n */\n var prevDayOfWeek = function (date, weekDay) {\n return dayOfWeek(date, weekDay, Direction.Backward);\n };\n\n /**\n * @hidden\n *\n * An object which contains the information about the cities within the timezone.\n */\n var timezones = {\n rules: {},\n titles: {},\n zones: {}\n };\n\n var MONTHS = { Jan: 0, Feb: 1, Mar: 2, Apr: 3, May: 4, Jun: 5, Jul: 6, Aug: 7, Sep: 8, Oct: 9, Nov: 10, Dec: 11 };\n var DAYS = { Sun: 0, Mon: 1, Tue: 2, Wed: 3, Thu: 4, Fri: 5, Sat: 6 };\n var MS_PER_MINUTE = 60000;\n /**\n * @hidden\n *\n * A function that finds zone rules which become applicable after a specific time.\n *\n * @param year - The value of the year.\n * @param rule - A specific zone rule.\n * @param zone - The definition of the zone.\n *\n * @return - Returns an extended rule.\n *\n * @example\n * ```ts-no-run\n * ruleToDate(2018, rule); // A rule that contains {'2018': |2018 DST date| }\n * ```\n */\n var ruleToDate = function (year, rule, zoneOffset) {\n var month = rule[3];\n var on = rule[4];\n var time = rule[5];\n var date;\n var ruleOffset = time[3] === 'u' ? -zoneOffset * MS_PER_MINUTE : 0;\n if (!isNaN(on)) {\n date = new Date(Date.UTC(year, MONTHS[month], on, time[0], time[1], time[2]) + ruleOffset);\n }\n else if (on.indexOf('last') === 0) {\n date = new Date(Date.UTC(year, MONTHS[month] + 1, 1, time[0] - 24, time[1], time[2]) + ruleOffset);\n var targetDay = DAYS[on.substr(4, 3)];\n var ourDay = date.getUTCDay();\n date.setUTCDate(date.getUTCDate() + targetDay - ourDay - (targetDay > ourDay ? 7 : 0));\n }\n else if (on.indexOf('>=') >= 0) {\n date = new Date(Date.UTC(year, MONTHS[month], on.substr(5), time[0], time[1], time[2], 0) + ruleOffset);\n var targetDay = DAYS[on.substr(0, 3)];\n var ourDay = date.getUTCDay();\n date.setUTCDate(date.getUTCDate() + targetDay - ourDay + (targetDay < ourDay ? 7 : 0));\n }\n return date;\n };\n\n var CURRENT_UTC_TIME = (new Date()).getTime();\n /**\n * @hidden\n *\n * A function that finds zone rules which become applicable after a specific time.\n *\n * @param timezone - The timezone name. For example, `America/Chicago`, `Europe/Sofia`.\n * @param utcTime - The UTC time boundary for a zone rule. Defaults to the current UTC time.\n *\n * @return - Returns a zone rule for the specific zone name.\n *\n * @example\n * ```ts-no-run\n * findZone('Europe/Sofia'); //[-120,\"EU\",\"EE%sT\",null]\n * ```\n */\n var findRule = function (zoneRule, utcTime, zoneOffset) {\n if (utcTime === void 0) { utcTime = CURRENT_UTC_TIME; }\n if (zoneOffset === void 0) { zoneOffset = 0; }\n var rules = timezones.rules[zoneRule];\n if (!rules) {\n var time = zoneRule.split(\":\");\n var offset = 0;\n if (time.length > 1) {\n offset = time[0] * 60 + Number(time[1]);\n }\n return [-1000000, 'max', '-', 'Jan', 1, [0, 0, 0], offset, '-'];\n }\n var year = new Date(utcTime).getUTCFullYear();\n rules = rules.filter(function (currentRule) {\n var from = currentRule[0];\n var to = currentRule[1];\n return from <= year && (to >= year || (from === year && to === \"only\") || to === \"max\");\n });\n rules.push(utcTime);\n rules.sort(function (a, b) {\n if (typeof a !== \"number\") {\n a = Number(ruleToDate(year, a, zoneOffset));\n }\n if (typeof b !== \"number\") {\n b = Number(ruleToDate(year, b, zoneOffset));\n }\n return a - b;\n });\n var rule = rules[rules.indexOf(utcTime) - 1] || rules[rules.length - 1];\n return isNaN(rule) ? rule : null;\n };\n\n /** @hidden */\n var NO_TZ_INFO = 'The required {0} timezone information is not provided!';\n /** @hidden */\n var INVALID_TZ_STRUCTURE = 'The provided timezone information has invalid stucture!';\n var formatRegExp = /\\{(\\d+)}?\\}/g;\n var flatten = function (arr) { return arr.reduce(function (a, b) { return a.concat(b); }, []); };\n /** @hidden */\n var formatMessage = function (message) {\n var arguments$1 = arguments;\n\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments$1[_i];\n }\n var flattenValues = flatten(values);\n return message.replace(formatRegExp, function (_, index) { return flattenValues[parseInt(index, 10)]; });\n };\n\n /**\n * @hidden\n *\n * A function that gets all zone rules for a specific zone.\n *\n * @param timezone - The timezone name. For example, `America/Chicago`, `Europe/Sofia`.\n *\n * @return - Returns all zone rules for the specific zone name.\n *\n * @example\n * ```ts-no-run\n * findZone('Europe/Sofia'); //[[-120,\"E-Eur\",\"EE%sT\",883526400000], [-120,\"EU\",\"EE%sT\",null]]\n * ```\n */\n var getZoneRules = function (timezone) {\n var zones = timezones.zones;\n if (!zones) {\n throw new Error(formatMessage(NO_TZ_INFO, timezone));\n }\n var zoneRules = zones[timezone];\n var result = typeof zoneRules === \"string\" ? zones[zoneRules] : zoneRules;\n if (!result) {\n throw new Error(formatMessage(NO_TZ_INFO, timezone));\n }\n return result;\n };\n\n /**\n * @hidden\n *\n * A function that finds zone rules which become applicable after specific time.\n */\n var findZone = function (timezone, utcTime) {\n if (utcTime === void 0) { utcTime = new Date().getTime(); }\n if (timezone === 'Etc/UTC' || timezone === 'Etc/GMT') {\n return [0, \"-\", \"UTC\", null];\n }\n var zoneRules = getZoneRules(timezone);\n var idx = zoneRules.length - 1;\n for (; idx >= 0; idx--) {\n var until = zoneRules[idx][3];\n if (until && utcTime > until) {\n break;\n }\n }\n var zone = zoneRules[idx + 1];\n if (!zone) {\n throw new Error(formatMessage(NO_TZ_INFO, timezone));\n }\n return zone;\n };\n\n /**\n * @hidden\n *\n * A function that gets the information about the zone and the rule for a specific timezone.\n *\n */\n var zoneAndRule = function (timezone, date) {\n var utcTime = date.getTime();\n var zone = findZone(timezone, utcTime);\n return {\n rule: findRule(zone[1], utcTime, zone[0]),\n zone: zone\n };\n };\n\n // tslint:disable:max-line-length\n /**\n * A function which returns the abbreviated name of the timezone. You can specify an optional date for returning the timezone name at a different point in time. The corresponding UTC date is used for locating the relevant rule. Timezone names change both historically and when they reflect the Daylight Savings Time rules.\n *\n * @param timezone - The timezone name. For example, `America/Chicago`, `Europe/Sofia`.\n * @param date - A date for which to locate the zone rule. By default, the current time is used.\n *\n * @return - The abbreviated name of the timezone at the specified date or, if not set, returns now.\n *\n * @example\n * ```ts-no-run\n * import { abbrTimezone } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/Europe/Sofia';\n *\n * const dstDate = new Date('2018-04-01T00:00:00Z');\n * console.log(abbrTimezone('Europe/Sofia', dstDate)); // EEST\n *\n * const date = new Date('2018-01-01T00:00:00Z');\n * console.log(abbrTimezone('Europe/Sofia', date)); // EET\n * ```\n */\n // tslint:enable:max-line-length\n var abbrTimezone = function (timezone, date) {\n if (date === void 0) { date = new Date(); }\n if (timezone === \"Etc/UTC\") {\n return 'UTC';\n }\n if (timezone === \"Etc/GMT\") {\n return 'GMT';\n }\n if (timezone === '') {\n return '';\n }\n var _a = zoneAndRule(timezone, date), zone = _a.zone, rule = _a.rule;\n var base = zone[2];\n if (base.indexOf(\"/\") >= 0) {\n return base.split(\"/\")[rule && +rule[6] ? 1 : 0];\n }\n else if (base.indexOf(\"%s\") >= 0) {\n return base.replace(\"%s\", (!rule || rule[7] === \"-\") ? '' : rule[7]);\n }\n return base;\n };\n\n // tslint:disable:max-line-length\n /**\n * A function that loads the information about the provided timezone. The details for the loaded timezone will be available to all functions that are related to the manipulation of the timezone.\n *\n * @param timezoneInfo - The information about the timezone that will be loaded.\n *\n * @example\n * ```ts-no-run\n * loadTimezone({ zones: [...], rules: [...]});\n * ```\n */\n // tslint:enable:max-line-length\n var loadTimezone = function (tzInfo) {\n if (!tzInfo) {\n throw new Error(formatMessage(NO_TZ_INFO, ''));\n }\n var rules = tzInfo.rules, titles = tzInfo.titles, zones = tzInfo.zones;\n if (rules === undefined || zones === undefined) {\n throw new Error(INVALID_TZ_STRUCTURE);\n }\n Object.assign(timezones.rules, rules);\n Object.assign(timezones.titles, titles || {});\n Object.assign(timezones.zones, zones);\n };\n\n /**\n * @hidden\n *\n * A function that calculates the time offset based on zone name.\n *\n * @param timezone - The timezone name. For example, `America/Chicago`, `Europe/Sofia`.\n * @param date - A date for which the zone rule will be located.\n *\n * @return - Returns the timezone offset in minutes at the specified time.\n */\n var offset = function (timezone, date) {\n if (date === void 0) { date = new Date(); }\n if (timezone === 'Etc/UTC' || timezone === 'Etc/GMT') {\n return 0;\n }\n if (timezone === '') {\n return date.getTimezoneOffset();\n }\n var _a = zoneAndRule(timezone, date), rule = _a.rule, zone = _a.zone;\n return parseFloat(rule ? zone[0] - rule[6] : zone[0]);\n };\n\n /**\n * A function that returns a list of grouped timezone names.\n *\n * @return - Returns a list of grouped timezone names.\n *\n * @example\n * ```ts-no-run\n * import '@progress/kendo-date-math/timezones/europe-berlin';\n * import '@progress/kendo-date-math/timezones/europe-sofia';\n *\n * timezoneGroupNames(); // ['(GMT+01:00) Amsterdam, Berlin, ...', '(GMT+02:00) Sofia, Tallinn...']\n * ```\n */\n var timezoneGroupNames = function () {\n var groups = Object.keys(timezones.titles).reduce(function (tmp, t) {\n var group = timezones.titles[t].group;\n tmp[group] = group;\n return tmp;\n }, {});\n return Object.keys(groups);\n };\n\n /**\n * A function that returns the list of all timezones that are loaded.\n *\n * @return - Returns the list of all timezones that are loaded.\n *\n * @example\n * ```ts-no-run\n * import '@progress/kendo-date-math/timezones/europe-berlin';\n * import '@progress/kendo-date-math/timezones/europe-sofia';\n *\n * timezoneNames(); // ['Europe/Berlin', 'Europe/Sofia']\n * ```\n */\n var timezoneNames = function () { return Object.keys(timezones.zones); };\n\n /**\n * A function that returns the full name of the timezone.\n *\n * @param timezone - The timezone name. For example, `America/Chicago`, `Europe/Sofia`.\n *\n * @return - Returns the full names of the timezone and the group.\n *\n * @example\n * ```ts-no-run\n * timezoneTitle('America/Chicago'); // Central Standard Time\n * ```\n */\n var timezoneTitle = function (timezone) {\n var titles = timezones.titles;\n var info = titles[timezone] || {};\n return info.long || timezone;\n };\n\n /**\n * A function that creates a local date from the UTC date parts of the input.\n *\n * @param date - The date value that will be converted. Only the UTC date parts are read.\n * @return Date - A local date with the UTC time parts of the supplied date.\n *\n * @example\n * ```ts-no-run\n * import { toLocalDate } from '@progress/kendo-date-math'\n *\n * const date = new Date('2016-11-05');\n * const local = toLocalDate(date);\n *\n * // For example, if the browser is in GMT+0200,\n * // the local date will be shifted 2 hours back:\n * //\n * // \"Fri Nov 04 2016 22:00:00 GMT+0200\"\n * console.log(local);\n *\n * // This is the same as the UTC parts of the input date:\n * //\n * // \"2016-11-05T22:00:00.000Z\"\n * console.log(date.toISOString());\n * ```\n */\n function toLocalDate(date) {\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n }\n\n var addMinutes = function (date, minutes) { return new Date(date.getTime() + minutes * MS_PER_MINUTE$1); };\n var addHours = function (date, hours) { return new Date(date.getTime() + hours * MS_PER_HOUR); };\n var dayAbbr = [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ];\n var monthAbbr = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dev'\n ];\n var datePrefix = function (utcDate) {\n return dayAbbr[utcDate.getUTCDay()] + ' ' + monthAbbr[utcDate.getUTCMonth()];\n };\n var padNumber = function (num, len) {\n if (len === void 0) { len = 2; }\n var sign = num < 0 ? '-' : '';\n return sign + new Array(len).concat([Math.abs(num)]).join('0').slice(-len);\n };\n function isZoneMissingHour(date, timezone) {\n var currentOffset = offset(timezone, date);\n var prevHour = addHours(date, -1);\n var prevOffset = offset(timezone, prevHour);\n return currentOffset < prevOffset;\n }\n function shiftZoneMissingHour(utcDate, timezone) {\n // Adjust for missing hour during DST transition in timezone.\n var dstOffset = isZoneMissingHour(utcDate, timezone) ? 1 : 0;\n return addHours(utcDate, dstOffset);\n }\n function convertTimezoneUTC(utcLocal, fromTimezone, toTimezone) {\n if (fromTimezone === toTimezone) {\n return utcLocal;\n }\n var fromOffset = offset(fromTimezone, utcLocal);\n var toOffset = offset(toTimezone, utcLocal);\n var baseDiff = fromOffset - toOffset;\n var midDate = addMinutes(utcLocal, baseDiff);\n var midOffset = offset(toTimezone, midDate);\n var dstDiff = toOffset - midOffset;\n return addMinutes(utcLocal, baseDiff + dstDiff);\n }\n function formatOffset(tzOffset) {\n var sign = tzOffset <= 0 ? '+' : '-';\n var value = Math.abs(tzOffset);\n var hours = padNumber(Math.floor(value / 60));\n var minutes = padNumber(value % 60);\n return \"GMT\" + sign + hours + minutes;\n }\n /**\n * Represents a local date in a specified timezone.\n *\n * The following example demonstrates how to convert a local date to the specified timezone.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n *\n * const date = new Date('2018-03-13T00:00:00Z');\n * const tzDate = ZonedDate.fromLocalDate(date, 'America/New_York');\n *\n * // If you run this example in GMT+0200,\n * // the output will be '2018-03-12T22:00:00.000Z'.\n * console.log(tzDate.toISOString());\n * ```\n *\n * The following example demonstrates how to convert between timezones.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n * import '@progress/kendo-date-math/tz/America/Los_Angeles';\n *\n * // Note the \"Z\" suffix for UTC dates.\n * const date = new Date('2018-03-12T22:00:00Z');\n *\n * const tzDate = ZonedDate.fromLocalDate(date, 'America/New_York');\n * const result = tzDate.toTimezone('America/Los_Angeles');\n *\n * // Regardless of the browser timezone\n * // the output will be '2018-03-12T15:00:00.000Z'.\n * console.log(tzDate.toUTCDate());\n * ```\n */\n var ZonedDate = /** @class */ (function () {\n // The constructor is aliased as a static fromUTCDate method\n // to clarify the meaning of the utcDate parameter.\n //\n // It can be confused for a local date time while it is in fact\n // treated as a UTC date that represents the local date in the timezone.\n function ZonedDate(utcDate, timezone) {\n this._utcDate = cloneDate(utcDate);\n this.timezone = timezone;\n var tzOffset = offset(timezone, utcDate);\n this.timezoneOffset = tzOffset;\n var localDate = shiftZoneMissingHour(utcDate, timezone);\n this._localDate = convertTimezoneUTC(localDate, timezone, 'Etc/UTC');\n }\n Object.defineProperty(ZonedDate.prototype, \"cachedLocalDate\", {\n /**\n * Returns a cached local date that denotes the exact time in the set timezone.\n *\n * @return Date - A local date that denotes the exact time in the set timezone.\n *\n * This property is an alternative to `toLocalDate()` that returns a cached value instead of cloning it.\n *\n * > Modifying the returned instance will corrupt the `ZonedDate` state.\n */\n get: function () {\n return this._localDate;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ZonedDate.prototype, \"cachedUTCDate\", {\n /**\n * Returns a cached `Date` instance with UTC date parts that are set to the local time in the set timezone.\n *\n * @returns Date - A `Date` with UTC date parts that are set to the local time in the set timezone.\n *\n * This property is an alternative to `toUTCDate()` that returns a cached value instead of cloning it.\n *\n * > Modifying the returned instance will corrupt the `ZonedDate` state.\n */\n get: function () {\n return this._utcDate;\n },\n enumerable: true,\n configurable: true\n });\n // tslint:disable:max-line-length\n /**\n * Converts an existing date to a specified timezone.\n *\n * If the `timezone` parameter is omitted, the `ZonedDate` defaults to the timezone of the browser. This concept is known as \"floating date\" because it does not represent a particular moment in time. Instead, its actual value depends on the current timezone of the browser.\n *\n * @param date - The local date that represents the actual time instance.\n * @param timezone - The ID of the timezone that will be assumed. For example, `Europe/Sofia`.\n * @return ZonedDate - The date in the specified timezone.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n *\n * const date = new Date('2018-03-13T00:00:00');\n * const tzDate = ZonedDate.fromLocalDate(date, 'America/New_York');\n *\n * // If you run this example in GMT+0200,\n * // the output will be 'Mon Mar 12 2018 18:00:00 GMT+0200 (EET)'.\n * console.log(tzDate.toString());\n *\n * // If you run this example in UTC,\n * // the output will be '2018-03-12T22:00:00.000Z'.\n * console.log(tzDate.toISOString());\n * ```\n */\n // tslint:enable:max-line-length\n ZonedDate.fromLocalDate = function (date, timezone) {\n if (timezone === void 0) { timezone = ''; }\n var utcDate = convertTimezoneUTC(date, 'Etc/UTC', timezone);\n var shiftZone = isZoneMissingHour(utcDate, timezone);\n var zoneOffset = offset(timezone, utcDate);\n var fixedOffset = 0;\n if (shiftZone) {\n // Adjust for the missing hour during the DST transition in the timezone.\n fixedOffset = zoneOffset > 0 ? -1 : 1;\n }\n var adjDate = addHours(utcDate, fixedOffset);\n return ZonedDate.fromUTCDate(adjDate, timezone);\n };\n // tslint:disable:max-line-length\n /**\n * Creates a date in a specific timezone from the UTC date parts of the supplied `Date`.\n *\n * If the `timezone` parameter is omitted, the `ZonedDate` defaults to the timezone of the browser. This concept is known as \"floating date\" because it does not represent a particular moment in time. Instead, its actual value depends on the current timezone of the browser.\n *\n * @param date - The UTC date that represents the time in the target zone. This time is not the actual time instant in UTC.\n * @param timezone - The ID of the timezone that will be assumed. For example, `Europe/Sofia`.\n * @return ZonedDate - The date in the specified timezone.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n *\n * // Note the \"Z\" suffix for UTC dates.\n * const date = new Date('2018-03-12T18:00:00Z');\n *\n * // Alternative syntax using Date.UTC\n * // const date = new Date(Date.UTC(2018, 2, 12, 18, 0));\n *\n * const tzDate = ZonedDate.fromUTCDate(date, 'America/New_York');\n *\n * // Regardless of the browser timezone\n * // the output will be 'Mon Mar 12 2018 18:00:00 GMT+0200 (EET)'.\n * console.log(tzDate.toString());\n *\n * // Regardless of the browser timezone\n * // the output in UTC will be '2018-03-12T22:00:00.000Z'.\n * console.log(tzDate.toISOString());\n * ```\n */\n // tslint:enable:max-line-length\n ZonedDate.fromUTCDate = function (utcDate, timezone) {\n if (timezone === void 0) { timezone = ''; }\n return new ZonedDate(utcDate, timezone);\n };\n /**\n * Returns a local date that denotes the exact time in the set timezone.\n *\n * @return Date - A local date that denotes the exact time in the set timezone.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n *\n * // Note the \"Z\" suffix for UTC dates.\n * const date = new Date('2018-03-12T18:00:00Z');\n * const tzDate = ZonedDate.fromUTCDate(date, 'America/New_York');\n *\n * // The local date represents the same moment in time as the ZonedDate:\n * // `2018-03-12T22:00:00.000Z`.\n * console.log(tzDate.toLocalDate().toISOString());\n *\n * // The local date will apply the timezone of the browser. For example,\n * // `Tue Mar 13 2018 00:00:00 GMT+0200 (Eastern European Standard Time)`.\n * console.log(tzDate.toLocalDate().toString())\n * ```\n */\n ZonedDate.prototype.toLocalDate = function () {\n return cloneDate(this._localDate);\n };\n /**\n * Returns a `Date` instance with UTC date parts that are set to the local time in the set timezone.\n *\n * @returns Date - A `Date` with UTC date parts that are set to the local time in the set timezone.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n *\n * // Note the \"Z\" suffix for UTC dates.\n * const date = new Date('2018-03-12T18:00:00Z');\n * const tzDate = ZonedDate.fromUTCDate(date, 'America/New_York');\n *\n * // Regardless of the browser timezone\n * // the output will be '2018-03-12T18:00:00.000Z'.\n * console.log(tzDate.toUTCDate());\n * ```\n */\n ZonedDate.prototype.toUTCDate = function () {\n return cloneDate(this._utcDate);\n };\n /**\n * Converts the date to the specified timezone.\n *\n * @param toTimezone - The timezone to which the values will be converted. For example, `America/Los_Angeles`.\n * @returns ZonedDate - The resulting zoned date.\n *\n * @example\n * ```ts-no-run\n * import { ZonedDate } from '@progress/kendo-date-math';\n * import '@progress/kendo-date-math/tz/America/New_York';\n * import '@progress/kendo-date-math/tz/America/Los_Angeles';\n *\n * // Note the \"Z\" suffix for UTC dates.\n * const date = new Date('2018-03-12T22:00:00Z');\n *\n * const tzDate = ZonedDate.fromLocalDate(date, 'America/New_York');\n * const result = tzDate.toTimezone('America/Los_Angeles');\n *\n * // Regardless of the browser timezone\n * // the output will be '2018-03-12T15:00:00.000Z'.\n * console.log(tzDate.toUTCDate());\n * ```\n */\n ZonedDate.prototype.toTimezone = function (toTimezone) {\n if (this.timezone === toTimezone) {\n return this.clone();\n }\n var tzOffset = offset(this.timezone, this._utcDate);\n var date = addMinutes(this._utcDate, tzOffset);\n return ZonedDate.fromLocalDate(date, toTimezone);\n };\n /**\n * Returns a new instance that represents the same date.\n *\n * @returns Date - A copy of the instance of the current zoned date.\n */\n ZonedDate.prototype.clone = function () {\n return ZonedDate.fromUTCDate(this._utcDate, this.timezone);\n };\n // tslint:disable:max-line-length\n /**\n * Adds the specified number of days and returns a new instance with the resulting date in the same timezone.\n *\n * @param days - The number of days that will be added.\n * @returns ZonedDate - The resulting date.\n */\n // tslint:enable:max-line-length\n ZonedDate.prototype.addDays = function (days) {\n var newDate = new Date(this._utcDate.getTime());\n newDate.setUTCDate(newDate.getUTCDate() + days);\n return ZonedDate.fromUTCDate(newDate, this.timezone);\n };\n // tslint:disable:max-line-length\n /**\n * Adds the specified number of milliseconds and returns a new instance with the resulting date in the same timezone.\n *\n * The method compensates for DST transitions and ensures that the resulting date occurs exactly after the set amount of time in the timezone.\n *\n * @param milliseconds - The number of days that will be added.\n * @returns ZonedDate - The resulting date.\n */\n // tslint:enable:max-line-length\n ZonedDate.prototype.addTime = function (milliseconds) {\n var utcDate = new Date(this._utcDate.getTime());\n var utcMid = shiftZoneMissingHour(utcDate, this.timezone);\n utcMid.setTime(utcMid.getTime() + milliseconds);\n var utcResult = shiftZoneMissingHour(utcMid, this.timezone);\n return ZonedDate.fromUTCDate(utcResult, this.timezone);\n };\n // tslint:disable:max-line-length\n /**\n * Returns a new instance of the same zoned date having its time parts set to `00:00:00.000`.\n *\n * @returns ZonedDate - The same date having its time parts set to `00:00:00.000`.\n */\n // tslint:enable:max-line-length\n ZonedDate.prototype.stripTime = function () {\n var date = this._utcDate;\n var ticks = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);\n return ZonedDate.fromUTCDate(new Date(ticks), this.timezone);\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getTime = function () {\n return this._localDate.getTime();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getTimezoneOffset = function () {\n return this.timezoneOffset;\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getFullYear = function () {\n return this._utcDate.getUTCFullYear();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getMonth = function () {\n return this._utcDate.getUTCMonth();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getDate = function () {\n return this._utcDate.getUTCDate();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getDay = function () {\n return this._utcDate.getUTCDay();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getHours = function () {\n return this._utcDate.getUTCHours();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getMinutes = function () {\n return this._utcDate.getUTCMinutes();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getSeconds = function () {\n return this._utcDate.getUTCSeconds();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getMilliseconds = function () {\n return this._utcDate.getUTCMilliseconds();\n };\n // The local date UTC parts represent actual UTC time\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCDate = function () {\n return this._localDate.getUTCDate();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCDay = function () {\n return this._localDate.getUTCDay();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCFullYear = function () {\n return this._localDate.getUTCFullYear();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCHours = function () {\n return this._localDate.getUTCHours();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCMilliseconds = function () {\n return this._localDate.getUTCMilliseconds();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCMinutes = function () {\n return this._localDate.getUTCMinutes();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.getUTCMonth = function () {\n return this._localDate.getUTCMonth();\n };\n /** @hidden */\n ZonedDate.prototype.getUTCSeconds = function () {\n return this._localDate.getUTCSeconds();\n };\n /** @hidden */\n ZonedDate.prototype.setTime = function (time) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setMilliseconds = function (ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCMilliseconds = function (ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setSeconds = function (sec, ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCSeconds = function (sec, ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setMinutes = function (min, sec, ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCMinutes = function (min, sec, ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setHours = function (hours, min, sec, ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCHours = function (hours, min, sec, ms) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setDate = function (date) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCDate = function (date) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setMonth = function (month, date) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCMonth = function (month, date) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setFullYear = function (year, month, date) {\n throw new Error(\"Method not implemented.\");\n };\n /** @hidden */\n ZonedDate.prototype.setUTCFullYear = function (year, month, date) {\n throw new Error(\"Method not implemented.\");\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.toISOString = function () {\n return this._localDate.toISOString();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.toJSON = function () {\n return this._localDate.toJSON();\n };\n /**\n * @hidden\n */\n ZonedDate.prototype.toString = function () {\n var dateString = datePrefix(this._utcDate);\n var timeString = this.toTimeString();\n return dateString + \" \" + this.getDate() + \" \" + this.getFullYear() + \" \" + timeString;\n };\n /** @hidden */\n ZonedDate.prototype.toDateString = function () {\n return toLocalDate(this._utcDate).toDateString();\n };\n /** @hidden */\n ZonedDate.prototype.toTimeString = function () {\n var hours = padNumber(this.getHours());\n var minutes = padNumber(this.getMinutes());\n var seconds = padNumber(this.getSeconds());\n var time = hours + \":\" + minutes + \":\" + seconds;\n var tzOffset = formatOffset(this.timezoneOffset);\n var abbrev = abbrTimezone(this.timezone, this._utcDate);\n if (abbrev) {\n abbrev = \" (\" + abbrev + \")\";\n }\n return time + \" \" + tzOffset + abbrev;\n };\n ZonedDate.prototype.toLocaleString = function (locales, options) {\n return this._localDate.toLocaleString(locales, options);\n };\n ZonedDate.prototype.toLocaleDateString = function (locales, options) {\n return this._localDate.toLocaleDateString(locales, options);\n };\n ZonedDate.prototype.toLocaleTimeString = function (locales, options) {\n return this._localDate.toLocaleTimeString(locales, options);\n };\n /** @hidden */\n ZonedDate.prototype.toUTCString = function () {\n return this.toTimezone('Etc/UTC').toString();\n };\n ZonedDate.prototype[Symbol.toPrimitive] = function (hint) {\n if (hint === 'string' || hint === 'default') {\n return this.toString();\n }\n return this._localDate.getTime();\n };\n /** @hidden */\n ZonedDate.prototype.valueOf = function () {\n return this.getTime();\n };\n /** @hidden */\n ZonedDate.prototype.getVarDate = function () {\n throw new Error('Not implemented.');\n };\n /** @hidden */\n ZonedDate.prototype.format = function (_) {\n throw new Error('Not implemented.');\n };\n /** @hidden */\n ZonedDate.prototype.formatUTC = function (_) {\n throw new Error('Not implemented.');\n };\n return ZonedDate;\n }());\n\n /**\n * A function that returns all timezones which match the title of the zone.\n *\n * @param group - The fully qualified zone title. For example, Central Standard Time.\n *\n * @return - Returns the list of all matching timezone names. For example, `[America/Chicago, ...]`.\n *\n * @example\n * ```ts-no-run\n * zonesPerGroup('(GMT+01:00) Amsterdam, Berlin'); // ['Europe/Amsterdam', 'Europe/Berlin'...]\n * ```\n */\n var zonesPerGroup = function (group) {\n var titles = timezones.titles;\n return Object.keys(titles).reduce(function (result, title) {\n var info = titles[title] || {};\n return info.group === group ? result.concat(title.split(' ')) : result;\n }, []);\n };\n\n var moveDateToWeekStart = function (date, weekStartDay) {\n if (weekStartDay !== Day.Monday) {\n return addDays(prevDayOfWeek(date, weekStartDay), 4);\n }\n return addDays(date, (4 - (date.getDay() || 7)));\n };\n var calcWeekInYear = function (date, weekStartDay) {\n var firstWeekInYear = createDate(date.getFullYear(), 0, 1, -6);\n var newDate = moveDateToWeekStart(date, weekStartDay);\n var diffInMS = newDate.getTime() - firstWeekInYear.getTime();\n var days = Math.floor(diffInMS / MS_PER_DAY);\n return 1 + Math.floor(days / 7);\n };\n /**\n * A function that returns the number of the week within a year, which is calculated in relation to the date.\n *\n * For more information, refer to the [**ISO week date**](https://en.wikipedia.org/wiki/ISO_week_date) article.\n *\n * @param date - The date used for the week number calculation.\n * @param weekStartDay - The first day of the week. By default, the first week day is Monday.\n * @returns - The number of the week within the year.\n *\n * @example\n * ```ts-no-run\n * weekInYear(new Date(2016, 0, 1)); // Week 53, 2015\n * weekInYear(new Date(2016, 0, 5)); // Week 1, 2016\n * weekInYear(new Date(2017, 0, 1)); // Week 52, 2016\n * weekInYear(new Date(2017, 0, 2)); // Week 1, 2017\n * ```\n */\n var weekInYear = function (date, weekStartDay) {\n if (weekStartDay === void 0) { weekStartDay = Day.Monday; }\n date = getDate(date);\n var prevWeekDate = addDays(date, -7);\n var nextWeekDate = addDays(date, 7);\n var weekNumber = calcWeekInYear(date, weekStartDay);\n if (weekNumber === 0) {\n return calcWeekInYear(prevWeekDate, weekStartDay) + 1;\n }\n if (weekNumber === 53 && calcWeekInYear(nextWeekDate, weekStartDay) > 1) {\n return 1;\n }\n return weekNumber;\n };\n\n var Mask = /** @class */ (function () {\n function Mask() {\n this.symbols = '';\n this.partMap = [];\n }\n return Mask;\n }());\n\n var Constants = {\n formatSeparator: \"_\",\n twoDigitYearMax: 68,\n defaultDateFormat: \"d\",\n defaultLocaleId: \"en\"\n };\n\n var Key = {\n DELETE: \"Delete\",\n BACKSPACE: \"Backspace\",\n TAB: \"Tab\",\n ENTER: \"Enter\",\n ESCAPE: \"Escape\",\n ARROW_LEFT: \"ArrowLeft\",\n ARROW_UP: \"ArrowUp\",\n ARROW_RIGHT: \"ArrowRight\",\n ARROW_DOWN: \"ArrowDown\",\n SPACE: \" \",\n END: \"End\",\n HOME: \"Home\",\n PAGE_UP: \"PageUp\",\n PAGE_DOWN: \"PageDown\"\n };\n\n /**\n * @hidden\n */\n var padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };\n /**\n * @hidden\n */\n var unpadZero = function (value) { return value.replace(/^0*/, ''); };\n /**\n * @hidden\n */\n var approximateStringMatching = function (_a) {\n /*\n Remove the right part of the cursor.\n oldFormat = oldFormat.substring(0, caret + oldText.length - newText.length);\n */\n var oldText = _a.oldText, newText = _a.newText, formatPattern = _a.formatPattern, selectionStart = _a.selectionStart, isInCaretMode = _a.isInCaretMode, keyEvent = _a.keyEvent;\n var oldTextSeparator = oldText[selectionStart + oldText.length - newText.length];\n var oldSegmentText = oldText.substring(0, selectionStart + oldText.length - newText.length);\n var newSegmentText = newText.substring(0, selectionStart);\n var diff = [];\n /* Handle the typing of a single character over the same selection. */\n if (oldSegmentText === newSegmentText && selectionStart > 0) {\n diff.push([formatPattern[selectionStart - 1], newSegmentText[selectionStart - 1]]);\n return diff;\n }\n if (oldSegmentText.indexOf(newSegmentText) === 0 && (isInCaretMode &&\n (keyEvent.key === Key.DELETE || keyEvent.key === Key.BACKSPACE)) ||\n (oldSegmentText.indexOf(newSegmentText) === 0 && !isInCaretMode &&\n (newSegmentText.length === 0 ||\n formatPattern[newSegmentText.length - 1] !== formatPattern[newSegmentText.length]))) {\n /* Handle Delete/Backspace. */\n var deletedSymbol = '';\n /*\n The whole text is replaced by the same character.\n A nasty patch is required to keep the selection in the first segment.\n */\n if (!isInCaretMode && newSegmentText.length === 1) {\n diff.push([formatPattern[0], newSegmentText[0]]);\n }\n for (var i = newSegmentText.length; i < oldSegmentText.length; i++) {\n if (formatPattern[i] !== deletedSymbol && formatPattern[i] !== Constants.formatSeparator) {\n deletedSymbol = formatPattern[i];\n diff.push([deletedSymbol, '']);\n }\n }\n return diff;\n }\n /*\n Handle the insertion of the text (the new text is longer than the previous one).\n Handle the typing over a literal as well.\n */\n if ((isInCaretMode &&\n (newSegmentText.indexOf(oldSegmentText) === 0 ||\n formatPattern[selectionStart - 1] === Constants.formatSeparator)) ||\n (!isInCaretMode &&\n (newSegmentText.indexOf(oldSegmentText) === 0 ||\n formatPattern[selectionStart - 1] === Constants.formatSeparator))) {\n var symbol = formatPattern[0];\n for (var i = Math.max(0, oldSegmentText.length - 1); i < formatPattern.length; i++) {\n if (formatPattern[i] !== Constants.formatSeparator) {\n symbol = formatPattern[i];\n break;\n }\n }\n return [[symbol, newSegmentText[selectionStart - 1]]];\n }\n /* Handle the entering of a space or a separator for navigating to the next item. */\n if ((newSegmentText[newSegmentText.length - 1] === ' ') ||\n (newSegmentText[newSegmentText.length - 1] === oldTextSeparator)) {\n return [[formatPattern[selectionStart - 1], Constants.formatSeparator]];\n }\n /* Handle typing over a correctly selected part. */\n var result = [[formatPattern[selectionStart - 1], newSegmentText[selectionStart - 1]]];\n return result;\n };\n /**\n * @hidden\n */\n var dateSymbolMap = function (map, part) {\n map[part.pattern[0]] = part.type;\n return map;\n };\n /**\n * @hidden\n */\n var isInRange = function (candidate, min, max) { return (candidate === null || !((min && min > candidate) || (max && max < candidate))); };\n\n var isObject = function (value) { return value && typeof (value) === \"object\" && !Array.isArray(value); };\n var isHtmlElement = function (element) { return element instanceof HTMLElement; };\n var dateSetter = function (method) { return function (date, value) {\n var clone = cloneDate(date);\n clone[method](value);\n return clone;\n }; };\n /**\n * @hidden\n */\n var isPresent = function (value) { return value !== undefined && value !== null; };\n /**\n * @hidden\n */\n var isDocumentAvailable = function () { return !!document; };\n /**\n * @hidden\n */\n var isNumber = function (value) { return isPresent(value) && typeof (value) === \"number\" && !Number.isNaN(value); };\n /**\n * @hidden\n */\n var parseToInt = function (value) { return parseInt(value, 10); };\n /**\n * @hidden\n */\n var clamp = function (value, min, max) { return Math.min(max, Math.max(min, value)); };\n /**\n * @hidden\n */\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var extend = function () {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n return Object.assign.apply(Object, args);\n };\n /**\n * @hidden\n */\n var deepExtend = function (target) {\n var arguments$1 = arguments;\n\n var _a, _b;\n var sources = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n sources[_i - 1] = arguments$1[_i];\n }\n if (!sources.length) {\n return target;\n }\n var source = sources.shift();\n if (isObject(target) && isObject(source)) {\n for (var key in source) {\n if (isHtmlElement(source[key])) {\n target[key] = source[key];\n }\n else if (isObject(source[key]) && !(source[key] instanceof Date)) {\n if (!target[key] || !isObject(target[key])) {\n extend(target, (_a = {}, _a[key] = {}, _a));\n }\n deepExtend(target[key], source[key]);\n }\n else {\n extend(target, (_b = {}, _b[key] = source[key], _b));\n }\n }\n }\n return deepExtend.apply(void 0, [target].concat(sources));\n };\n /**\n * @hidden\n */\n var noop = function () { };\n /**\n * @hidden\n */\n var isFunction = function (fn) { return typeof (fn) === \"function\"; };\n /**\n * @hidden\n */\n var cropTwoDigitYear = function (date) {\n if (!isPresent(date) || isNaN(date.getTime())) {\n return 0;\n }\n return Number(date\n .getFullYear()\n .toString()\n .slice(-2));\n };\n /**\n * @hidden\n */\n var setYears = dateSetter('setFullYear');\n /**\n * @hidden\n */\n var millisecondDigitsInFormat = function (format) {\n var result = format && format.match(/S+(\\1)/);\n return result ? result[0].length : 0;\n };\n /**\n * @hidden\n */\n var millisecondStepFor = function (digits) {\n return Math.pow(10, 3 - digits);\n };\n /**\n * @hidden\n */\n var areDatePartsEqualTo = function (date, year, month, day, hour, minutes, seconds, milliseconds) {\n if (date &&\n date.getFullYear() === year &&\n date.getMonth() === month &&\n date.getDate() === day &&\n date.getHours() === hour &&\n date.getMinutes() === minutes &&\n date.getSeconds() === seconds &&\n date.getMilliseconds() === milliseconds) {\n return true;\n }\n return false;\n };\n /**\n * @hidden\n */\n var isValidDate = function (value) { return isPresent(value) && value.getTime && isNumber(value.getTime()); };\n\n var PREVIOUS_CENTURY_BASE = 1900;\n var CURRENT_CENTURY_BASE = 2000;\n var SHORT_PATTERN_LENGTH_REGEXP = /d|M|H|h|m|s/;\n var MONTH_PART_WITH_WORDS_THRESHOLD = 2;\n var MONTH_SYMBOL = \"M\";\n // JS months start from 0 (January) instead of 1 (January)\n var JS_MONTH_OFFSET = 1;\n var DateObject = /** @class */ (function () {\n function DateObject(_a) {\n var intlService = _a.intlService, formatPlaceholder = _a.formatPlaceholder, format = _a.format, _b = _a.cycleTime, cycleTime = _b === void 0 ? false : _b, _c = _a.twoDigitYearMax, twoDigitYearMax = _c === void 0 ? Constants.twoDigitYearMax : _c, _d = _a.value, value = _d === void 0 ? null : _d, _e = _a.autoCorrectParts, autoCorrectParts = _e === void 0 ? true : _e;\n this.year = true;\n this.month = true;\n this.date = true;\n this.hours = true;\n this.minutes = true;\n this.seconds = true;\n this.milliseconds = true;\n this.dayperiod = true;\n this.leadingZero = null;\n this.typedMonthPart = '';\n this.knownParts = 'adHhmMsEyS';\n this.symbols = {\n 'E': 'E',\n 'H': 'H',\n 'M': 'M',\n 'a': 'a',\n 'd': 'd',\n 'h': 'h',\n 'm': 'm',\n 's': 's',\n 'y': 'y',\n 'S': 'S'\n };\n this._value = getDate(new Date());\n this.cycleTime = false;\n this._partiallyInvalidDate = {\n startDate: null,\n invalidDateParts: {\n 'E': { value: null, date: null, startDateOffset: 0 },\n 'H': { value: null, date: null, startDateOffset: 0 },\n 'M': { value: null, date: null, startDateOffset: 0 },\n 'a': { value: null, date: null, startDateOffset: 0 },\n 'd': { value: null, date: null, startDateOffset: 0 },\n 'h': { value: null, date: null, startDateOffset: 0 },\n 'm': { value: null, date: null, startDateOffset: 0 },\n 's': { value: null, date: null, startDateOffset: 0 },\n 'y': { value: null, date: null, startDateOffset: 0 },\n 'S': { value: null, date: null, startDateOffset: 0 }\n }\n };\n this.setOptions({\n intlService: intlService,\n formatPlaceholder: formatPlaceholder,\n format: format,\n cycleTime: cycleTime,\n twoDigitYearMax: twoDigitYearMax,\n value: value,\n autoCorrectParts: autoCorrectParts\n });\n if (!value) {\n this._value = getDate(new Date());\n var sampleFormat = this.dateFormatString(this.value, this.format).symbols;\n for (var i = 0; i < sampleFormat.length; i++) {\n this.setExisting(sampleFormat[i], false);\n }\n }\n else {\n this._value = cloneDate(value);\n }\n }\n Object.defineProperty(DateObject.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n set: function (value) {\n if (value && !(value instanceof Date)) {\n // throw new Error(\"The 'value' should be a valid JavaScript Date instance.\");\n return;\n }\n this._value = value;\n this.resetInvalidDate();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateObject.prototype, \"localeId\", {\n get: function () {\n var localeId = Constants.defaultLocaleId;\n var cldrKeys = Object.keys(this.intl.cldr);\n for (var i = 0; i < cldrKeys.length; i++) {\n var key = cldrKeys[i];\n var value = this.intl.cldr[key];\n if (value.name && value.calendar && value.numbers &&\n value.name !== Constants.defaultLocaleId) {\n localeId = value.name;\n break;\n }\n }\n return localeId;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n DateObject.prototype.setOptions = function (options) {\n this.intl = options.intlService;\n this.formatPlaceholder = options.formatPlaceholder || 'wide';\n this.format = options.format;\n this.cycleTime = options.cycleTime;\n this.monthNames = this.allFormattedMonths(this.localeId);\n this.dayPeriods = this.allDayPeriods(this.localeId);\n this.twoDigitYearMax = options.twoDigitYearMax;\n this.autoCorrectParts = options.autoCorrectParts;\n };\n DateObject.prototype.setValue = function (value) {\n if (!value) {\n this._value = getDate(new Date());\n this.modifyExisting(false);\n }\n else if (!isEqual(value, this._value)) {\n this._value = cloneDate(value);\n this.modifyExisting(true);\n }\n this.resetInvalidDate();\n };\n /**\n * @hidden\n */\n DateObject.prototype.hasValue = function () {\n var _this = this;\n var pred = function (a, p) { return a || p.type !== 'literal' && p.type !== 'dayperiod' && _this.getExisting(p.pattern[0]); };\n return this.intl.splitDateFormat(this.format, this.localeId).reduce(pred, false);\n };\n /**\n * @hidden\n */\n DateObject.prototype.getValue = function () {\n for (var i = 0; i < this.knownParts.length; i++) {\n if (!this.getExisting(this.knownParts[i])) {\n return null;\n }\n }\n return cloneDate(this.value);\n };\n /**\n * @hidden\n */\n DateObject.prototype.getFormattedDate = function (format) {\n return this.intl.formatDate(this.getValue(), format, this.localeId);\n };\n /**\n * @hidden\n */\n DateObject.prototype.getTextAndFormat = function (customFormat) {\n if (customFormat === void 0) { customFormat = \"\"; }\n var format = customFormat || this.format;\n var text = this.intl.formatDate(this.value, format, this.localeId);\n var mask = this.dateFormatString(this.value, format);\n if (!this.autoCorrectParts && this._partiallyInvalidDate.startDate) {\n var partiallyInvalidText = \"\";\n var formattedDate = this.intl.formatDate(this.value, format, this.localeId);\n var formattedDates = this.getFormattedInvalidDates(format);\n for (var i = 0; i < formattedDate.length; i++) {\n var symbol = mask.symbols[i];\n if (mask.partMap[i].type === \"literal\") {\n partiallyInvalidText += text[i];\n }\n else if (this.getInvalidDatePartValue(symbol)) {\n var partsForSegment = this.getPartsForSegment(mask, i);\n if (symbol === \"M\") {\n var datePartText = (parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();\n if (partsForSegment.length > MONTH_PART_WITH_WORDS_THRESHOLD) {\n partiallyInvalidText += formattedDates[symbol][i];\n }\n else {\n if (this.getInvalidDatePartValue(symbol)) {\n var formattedDatePart = padZero(partsForSegment.length - datePartText.length) + datePartText;\n partiallyInvalidText += formattedDatePart;\n // add -1 as the first character in the segment is at index i\n i += partsForSegment.length - 1;\n }\n else {\n partiallyInvalidText += formattedDates[symbol][i];\n }\n }\n }\n else {\n if (this.getInvalidDatePartValue(symbol)) {\n var datePartText = this.getInvalidDatePartValue(symbol).toString();\n var formattedDatePart = padZero(partsForSegment.length - datePartText.length) + datePartText;\n partiallyInvalidText += formattedDatePart;\n // add -1 as the first character in the segment is at index i\n i += partsForSegment.length - 1;\n }\n else {\n partiallyInvalidText += formattedDates[symbol][i];\n }\n }\n }\n else {\n partiallyInvalidText += text[i];\n }\n }\n text = partiallyInvalidText;\n }\n var result = this.merge(text, mask);\n return result;\n };\n /**\n * @hidden\n */\n DateObject.prototype.getFormattedInvalidDates = function (customFormat) {\n var _this = this;\n if (customFormat === void 0) { customFormat = \"\"; }\n var format = customFormat || this.format;\n var formattedDatesForSymbol = {\n 'E': '',\n 'H': '',\n 'M': '',\n 'a': '',\n 'd': '',\n 'h': '',\n 'm': '',\n 's': '',\n 'y': '',\n 'S': ''\n };\n Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {\n var date = _this.getInvalidDatePart(key).date;\n if (date) {\n var formattedInvalidDate = _this.intl.formatDate(date, format, _this.localeId);\n formattedDatesForSymbol[key] = formattedInvalidDate;\n }\n });\n return formattedDatesForSymbol;\n };\n DateObject.prototype.modifyExisting = function (value) {\n var sampleFormat = this.dateFormatString(this.value, this.format).symbols;\n for (var i = 0; i < sampleFormat.length; i++) {\n this.setExisting(sampleFormat[i], value);\n }\n };\n /**\n * @hidden\n */\n DateObject.prototype.getExisting = function (symbol) {\n switch (symbol) {\n case 'y': return this.year;\n case 'M':\n case 'L': return this.month;\n case 'd': return this.date;\n case 'E': return this.date && this.month && this.year;\n case 'h':\n case 'H': return this.hours;\n case 't':\n case 'a': return this.dayperiod;\n case 'm': return this.minutes;\n case 's': return this.seconds;\n case \"S\": return this.milliseconds;\n default:\n return true;\n }\n };\n DateObject.prototype.setExisting = function (symbol, value) {\n switch (symbol) {\n case 'y':\n // allow 2/29 dates\n this.year = value;\n if (value === false) {\n this._value.setFullYear(2000);\n }\n break;\n case 'M':\n // make sure you can type 31 in the day part\n this.month = value;\n if (value === false) {\n if (this.autoCorrectParts) {\n this._value.setMonth(0);\n }\n }\n break;\n case 'd':\n this.date = value;\n break;\n case 'h':\n case 'H':\n this.hours = value;\n break;\n case 't':\n case 'a':\n this.dayperiod = value;\n break;\n case 'm':\n this.minutes = value;\n break;\n case 's':\n this.seconds = value;\n break;\n case \"S\":\n this.milliseconds = value;\n break;\n default:\n break;\n }\n if (this.getValue()) {\n this.resetInvalidDate();\n }\n };\n DateObject.prototype.modifyPart = function (symbol, offset) {\n if (!isPresent(symbol) || !isPresent(offset) || offset === 0) {\n return;\n }\n var newValue = cloneDate(this.value);\n var timeModified = false;\n var invalidDateFound;\n var isMonth = symbol === \"M\";\n var isDay = symbol === \"d\" || symbol === \"E\";\n var symbolExists = this.getExisting(symbol);\n if (!this.autoCorrectParts && (isDay || isMonth)) {\n var invalidDateParts = this._partiallyInvalidDate.invalidDateParts || {};\n var invalidDatePartValue = this.getInvalidDatePartValue(symbol);\n var year = invalidDateParts.y.value || newValue.getFullYear();\n var month = invalidDateParts.M.value || newValue.getMonth();\n var day = invalidDateParts.d.value || invalidDateParts.E.value || newValue.getDate();\n var hour = invalidDateParts.h.value || invalidDateParts.H.value || newValue.getHours();\n var minutes = invalidDateParts.m.value || newValue.getMinutes();\n var seconds = invalidDateParts.s.value || newValue.getSeconds();\n var milliseconds = invalidDateParts.S.value || newValue.getMilliseconds();\n switch (symbol) {\n case 'y':\n year += offset;\n break;\n case 'M':\n month += offset;\n break;\n case 'd':\n case 'E':\n day += offset;\n break;\n // case 'h':\n // case 'H': hour += offset; break;\n // case 'm': minutes += offset; break;\n // case 's': seconds += offset; break;\n // case 'S': milliseconds += offset; break;\n default: break;\n }\n if (symbol === \"M\") {\n if ((month < 0 || month > 11)) {\n if (symbolExists) {\n this.setExisting(symbol, false);\n this.resetInvalidDateSymbol(symbol);\n return;\n }\n }\n if (!symbolExists) {\n if (month < 0) {\n month = clamp(11 + ((month % 11) + 1), 0, 11);\n }\n else {\n var monthValue = isPresent(invalidDatePartValue) ?\n month :\n ((offset - JS_MONTH_OFFSET) % 12);\n month = clamp(monthValue, 0, 11);\n }\n month = clamp(month, 0, 11);\n }\n month = clamp(month, 0, 11);\n }\n else if (symbol === \"d\") {\n if (symbolExists) {\n if (day <= 0 || day > 31) {\n this.setExisting(symbol, false);\n this.resetInvalidDateSymbol(symbol);\n return;\n }\n }\n else if (!symbolExists) {\n if (isPresent(invalidDatePartValue)) {\n if (day <= 0 || day > 31) {\n this.setExisting(symbol, false);\n this.resetInvalidDateSymbol(symbol);\n return;\n }\n }\n if (offset < 0) {\n var dayValue = isPresent(invalidDatePartValue) ? day : 1 + (31 - Math.abs(offset % 31));\n day = clamp(dayValue, 1, 31);\n }\n else {\n var dayValue = isPresent(invalidDatePartValue) ? day : offset % 31;\n day = clamp(dayValue, 1, 31);\n }\n day = clamp(day, 1, 31);\n }\n }\n var dateCandidate = createDate(year, month, day, hour, minutes, seconds, milliseconds);\n var newValueCandidate = isMonth || isDay ?\n this.modifyDateSymbolWithValue(newValue, symbol, isMonth ? month : day) :\n null;\n var dateCandidateExists = areDatePartsEqualTo(dateCandidate, year, month, day, hour, minutes, seconds, milliseconds);\n if (this.getValue() && areDatePartsEqualTo(dateCandidate, year, month, day, hour, minutes, seconds, milliseconds)) {\n newValue = cloneDate(dateCandidate);\n this.markDatePartsAsExisting();\n }\n else if (isMonth && newValueCandidate) {\n if (newValueCandidate.getMonth() === month) {\n if (this.getExisting(\"d\")) {\n if (dateCandidateExists) {\n newValue = cloneDate(dateCandidate);\n this.resetInvalidDateSymbol(symbol);\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: month,\n date: cloneDate(newValueCandidate),\n startDateOffset: offset,\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n else if (dateCandidateExists) {\n this.resetInvalidDateSymbol(symbol);\n newValue = cloneDate(dateCandidate);\n if (this.getExisting(\"M\") && this.getExisting(\"y\")) {\n // changing from 28/Feb to 29/Feb to 29/March\n this.setExisting(\"d\", true);\n this.resetInvalidDateSymbol(\"d\");\n }\n }\n else {\n this.resetInvalidDateSymbol(symbol);\n newValue = cloneDate(newValueCandidate);\n }\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: month,\n date: cloneDate(newValueCandidate),\n startDateOffset: offset,\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n else if (isDay && newValueCandidate) {\n if (newValueCandidate.getDate() === day) {\n if (this.getExisting(\"M\")) {\n if (dateCandidateExists) {\n newValue = cloneDate(dateCandidate);\n this.resetInvalidDateSymbol(symbol);\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: day,\n date: cloneDate(newValueCandidate),\n startDateOffset: offset,\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n else if (dateCandidateExists) {\n newValue = cloneDate(dateCandidate);\n this.resetInvalidDateSymbol(symbol);\n if (this.getExisting(\"d\") && this.getExisting(\"y\")) {\n // changing from 31/Jan to 31/Feb to 28/Feb\n this.setExisting(\"M\", true);\n this.resetInvalidDateSymbol(\"M\");\n }\n }\n else {\n this.resetInvalidDateSymbol(symbol);\n newValue = cloneDate(newValueCandidate);\n }\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: day,\n date: cloneDate(this.value),\n startDateOffset: offset,\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n }\n else {\n switch (symbol) {\n case 'y':\n newValue.setFullYear(newValue.getFullYear() + offset);\n break;\n case 'M':\n newValue = addMonths(this.value, offset);\n break;\n case 'd':\n case 'E':\n newValue.setDate(newValue.getDate() + offset);\n break;\n case 'h':\n case 'H':\n newValue.setHours(newValue.getHours() + offset);\n timeModified = true;\n break;\n case 'm':\n newValue.setMinutes(newValue.getMinutes() + offset);\n timeModified = true;\n break;\n case 's':\n newValue.setSeconds(newValue.getSeconds() + offset);\n timeModified = true;\n break;\n case \"S\":\n newValue.setMilliseconds(newValue.getMilliseconds() + offset);\n break;\n case 'a':\n newValue.setHours(newValue.getHours() + (12 * offset));\n timeModified = true;\n break;\n default: break;\n }\n }\n if (this.shouldNormalizeCentury()) {\n newValue = this.normalizeCentury(newValue);\n }\n if (timeModified && !this.cycleTime && newValue.getDate() !== this._value.getDate()) {\n // todo: blazor has this fix, but this fails a unit test\n // newValue.setDate(this._value.getDate());\n // newValue.setMonth(this._value.getMonth());\n // newValue.setFullYear(this._value.getFullYear());\n }\n if (!invalidDateFound) {\n this.setExisting(symbol, true);\n this._value = newValue;\n if (this.getValue()) {\n this.resetInvalidDate();\n }\n }\n };\n /**\n * @hidden\n */\n DateObject.prototype.parsePart = function (_a) {\n var symbol = _a.symbol, currentChar = _a.currentChar, resetSegmentValue = _a.resetSegmentValue, cycleSegmentValue = _a.cycleSegmentValue, rawInputValue = _a.rawTextValue, isDeleting = _a.isDeleting, originalFormat = _a.originalFormat;\n var isInCaretMode = !cycleSegmentValue;\n var dateParts = this.dateFormatString(this.value, this.format);\n var datePartsLiterals = dateParts.partMap\n .filter(function (x) { return x.type === \"literal\"; })\n .map(function (x, index) {\n return {\n datePartIndex: index,\n type: x.type,\n pattern: x.pattern,\n literal: \"\"\n };\n });\n var flatDateParts = dateParts.partMap\n .map(function (x) {\n return {\n type: x.type,\n pattern: x.pattern,\n text: \"\"\n };\n });\n for (var i = 0; i < datePartsLiterals.length; i++) {\n var datePart = datePartsLiterals[i];\n for (var j = 0; j < datePart.pattern.length; j++) {\n if (datePartsLiterals[i + j]) {\n datePartsLiterals[i + j].literal = datePart.pattern[j];\n }\n }\n i += datePart.pattern.length - 1;\n }\n for (var i = 0; i < flatDateParts.length; i++) {\n var datePart = flatDateParts[i];\n for (var j = 0; j < datePart.pattern.length; j++) {\n if (flatDateParts[i + j]) {\n flatDateParts[i + j].text = datePart.pattern[j];\n }\n }\n i += datePart.pattern.length - 1;\n }\n var shouldResetPart = isInCaretMode && symbol === \"M\" && dateParts.partMap\n .filter(function (x) { return x.type === \"month\"; })\n .some(function (x) { return x.pattern.length > MONTH_PART_WITH_WORDS_THRESHOLD; });\n var parseResult = {\n value: null,\n switchToNext: false,\n resetPart: shouldResetPart,\n hasInvalidDatePart: false\n };\n if (!currentChar) {\n if (isInCaretMode) {\n for (var i = 0; i < datePartsLiterals.length; i++) {\n var literal = datePartsLiterals[i].literal;\n var rawValueStartsWithLiteral = rawInputValue.startsWith(literal);\n var rawValueEndsWithLiteral = rawInputValue.endsWith(literal);\n var rawValueHasConsecutiveLiterals = rawInputValue.indexOf(literal + literal) >= 0;\n if (rawValueStartsWithLiteral || rawValueEndsWithLiteral || rawValueHasConsecutiveLiterals) {\n this.resetLeadingZero();\n this.setExisting(symbol, false);\n this.resetInvalidDateSymbol(symbol);\n return extend(parseResult, { value: null, switchToNext: false });\n }\n }\n }\n else {\n this.resetLeadingZero();\n this.setExisting(symbol, false);\n this.resetInvalidDateSymbol(symbol);\n return extend(parseResult, { value: null, switchToNext: false });\n }\n }\n var baseDate = this.intl.formatDate(this.value, this.format, this.localeId);\n var baseFormat = dateParts.symbols;\n var replaced = false;\n var prefix = '';\n var current = '';\n var datePartText = '';\n var basePrefix = '';\n var baseSuffix = '';\n var suffix = '';\n var convertedBaseFormat = \"\";\n for (var i = 0; i < flatDateParts.length; i++) {\n convertedBaseFormat += flatDateParts[i].text;\n }\n var hasFixedFormat = (this.format === baseFormat) ||\n (this.format === convertedBaseFormat) ||\n (this.format === originalFormat) ||\n (this.format.length === originalFormat.length);\n var datePartStartIndex = (hasFixedFormat ? convertedBaseFormat : originalFormat).indexOf(symbol);\n var datePartEndIndex = (hasFixedFormat ? convertedBaseFormat : originalFormat).lastIndexOf(symbol);\n var segmentLength = datePartEndIndex - datePartStartIndex + 1;\n var formatToTextLengthDiff = originalFormat.length - rawInputValue.length;\n if (isInCaretMode || (!isInCaretMode && !this.autoCorrectParts)) {\n for (var i = 0; i < baseDate.length; i++) {\n if (baseFormat[i] === symbol) {\n var existing = this.getExisting(symbol);\n current += existing ? baseDate[i] : '0';\n if (formatToTextLengthDiff > 0) {\n if (datePartText.length + formatToTextLengthDiff < segmentLength) {\n datePartText += rawInputValue[i] || \"\";\n }\n }\n else {\n datePartText += rawInputValue[i] || \"\";\n }\n replaced = true;\n }\n else if (!replaced) {\n prefix += baseDate[i];\n basePrefix += baseDate[i];\n }\n else {\n suffix += baseDate[i];\n baseSuffix += baseDate[i];\n }\n }\n if (hasFixedFormat) {\n if (convertedBaseFormat.length < rawInputValue.length) {\n datePartText += currentChar;\n }\n else if (!isDeleting && originalFormat.length > rawInputValue.length) {\n // let the parsing to determine if the incomplete value is valid\n }\n if (datePartText.length > segmentLength) {\n return extend(parseResult, { value: null, switchToNext: false });\n }\n }\n if (!hasFixedFormat || (hasFixedFormat && !this.autoCorrectParts)) {\n current = \"\";\n datePartText = \"\";\n prefix = \"\";\n suffix = \"\";\n replaced = false;\n for (var i = 0; i < originalFormat.length; i++) {\n if (originalFormat[i] === symbol) {\n var existing = this.getExisting(symbol);\n current += existing ? baseDate[i] || \"\" : '0';\n if (formatToTextLengthDiff > 0) {\n if (datePartText.length + formatToTextLengthDiff < segmentLength) {\n datePartText += rawInputValue[i] || \"\";\n }\n }\n else {\n datePartText += rawInputValue[i] || \"\";\n }\n replaced = true;\n }\n else if (!replaced) {\n prefix += rawInputValue[i] || \"\";\n }\n else {\n suffix += rawInputValue[i - formatToTextLengthDiff] || \"\";\n }\n }\n if (originalFormat.length < rawInputValue.length) {\n datePartText += currentChar;\n }\n }\n }\n if (!isInCaretMode) {\n if (this.autoCorrectParts) {\n current = \"\";\n datePartText = \"\";\n prefix = \"\";\n suffix = \"\";\n replaced = false;\n for (var i = 0; i < baseDate.length; i++) {\n if (baseFormat[i] === symbol) {\n var existing = this.getExisting(symbol);\n current += existing ? baseDate[i] : '0';\n replaced = true;\n }\n else if (!replaced) {\n prefix += baseDate[i];\n }\n else {\n suffix += baseDate[i];\n }\n }\n }\n else {\n current = resetSegmentValue ? datePartText : current;\n }\n }\n var parsedDate = null;\n var month = this.matchMonth(currentChar);\n var dayPeriod = this.matchDayPeriod(currentChar, symbol);\n var isZeroCurrentChar = currentChar === '0';\n var leadingZero = this.leadingZero || {};\n if (isZeroCurrentChar) {\n if (datePartText === \"0\") {\n datePartText = current;\n }\n var valueNumber = parseToInt(resetSegmentValue ?\n currentChar :\n (isInCaretMode ? datePartText : current) + currentChar);\n if (valueNumber === 0 && !this.isAbbrMonth(dateParts.partMap, symbol)) {\n this.incrementLeadingZero(symbol);\n }\n }\n else {\n this.resetLeadingZero();\n }\n var partPattern = this.partPattern(dateParts.partMap, symbol);\n var patternValue = partPattern ? partPattern.pattern : null;\n var patternLength = this.patternLength(patternValue) || patternValue.length;\n if (isInCaretMode) {\n if (isDeleting && !datePartText) {\n this.setExisting(symbol, false);\n return extend(parseResult, { value: null, switchToNext: false });\n }\n }\n var currentMaxLength = current.length - 3;\n var tryParse = true;\n var middle = isInCaretMode ? datePartText : current;\n for (var i = Math.max(0, currentMaxLength); i <= current.length; i++) {\n if (!tryParse) {\n break;\n }\n middle = resetSegmentValue ?\n currentChar :\n isInCaretMode ?\n datePartText :\n (current.substring(i) + currentChar);\n if (isInCaretMode || !this.autoCorrectParts) {\n tryParse = false;\n middle = unpadZero(middle);\n // middle = padZero(segmentLength - middle.length) + middle;\n middle = padZero(patternLength - middle.length) + middle;\n }\n var middleNumber = parseInt(middle, 10);\n var candidateDateString = prefix + middle + suffix;\n parsedDate = this.intl.parseDate(candidateDateString, this.format, this.localeId);\n var autoCorrectedPrefixAndSuffix = false;\n if (isInCaretMode && !isValidDate(parsedDate)) {\n // if part of the date is not available, e.g. \"d\"\n // but an expanded format like \"F\" is used\n // the element value can be \"EEEE, February 1, 2022 3:04:05 AM\"\n // which is not parsable by intl\n // use the base prefix and suffix, e.g. convert the candidate date string\n // to \"Thursday, February 1, 2022 3:04:05 AM\"\n // as \"EEEE, February...\" is not parsable\n if (this.autoCorrectParts) {\n parsedDate = this.intl.parseDate(basePrefix + middle + baseSuffix, this.format, this.localeId);\n autoCorrectedPrefixAndSuffix = true;\n }\n }\n var isCurrentCharParsable = !isNaN(parseInt(currentChar, 10)) || (isInCaretMode && isDeleting && currentChar === \"\");\n if (!parsedDate && !isNaN(middleNumber) && isCurrentCharParsable && this.autoCorrectParts) {\n if (symbol === MONTH_SYMBOL && !month) {\n // JS months start from 0 (January) instead of 1 (January)\n var monthNumber = middleNumber - JS_MONTH_OFFSET;\n if (monthNumber > -1 && monthNumber < 12) {\n parsedDate = cloneDate(this.value);\n parsedDate.setMonth(monthNumber);\n if (parsedDate.getMonth() !== monthNumber) {\n parsedDate = lastDayOfMonth(addMonths(parsedDate, -1));\n }\n }\n }\n if (symbol === 'y') {\n parsedDate = createDate(parseInt(middle, 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);\n if (((isInCaretMode && isValidDate(parsedDate)) ||\n (!isInCaretMode && parsedDate)) && this.date && parsedDate.getDate() !== this.value.getDate()) {\n parsedDate = lastDayOfMonth(addMonths(parsedDate, -1));\n }\n }\n }\n if ((isInCaretMode && isValidDate(parsedDate)) || (!isInCaretMode && parsedDate)) {\n // move to next segment if the part will overflow with next char\n // when start from empty date (01, then 010), padded zeros should be trimmed\n var peekedValue = this.peek(middle, patternValue);\n var peekedDateString = autoCorrectedPrefixAndSuffix ?\n \"\" + basePrefix + peekedValue + baseSuffix :\n \"\" + prefix + peekedValue + suffix;\n var peekedDate = this.intl.parseDate(peekedDateString, this.format, this.localeId);\n var leadingZeroOffset = (this.leadingZero || {})[symbol] || 0;\n var patternSatisfied = (leadingZeroOffset + unpadZero(middle).length) >= patternLength;\n var switchToNext = peekedDate === null ||\n (leadingZero[symbol] ?\n patternValue.length <= middle.length :\n patternSatisfied);\n if (this.shouldNormalizeCentury()) {\n parsedDate = this.normalizeCentury(parsedDate);\n }\n this._value = parsedDate;\n this.setExisting(symbol, true);\n this.resetInvalidDateSymbol(symbol);\n if (!this.autoCorrectParts) {\n if (symbol === \"M\") {\n if (this.getExisting(\"M\") && this.getExisting(\"y\")) {\n // changing from 28/Feb to 29/Feb to 29/March\n this.setExisting(\"d\", true);\n this.resetInvalidDateSymbol(\"d\");\n }\n }\n else if (symbol === \"d\") {\n if (this.getExisting(\"d\") && this.getExisting(\"y\")) {\n // changing from 31/Jan to 31/Feb to 28/Feb\n this.setExisting(\"M\", true);\n this.resetInvalidDateSymbol(\"M\");\n }\n }\n if (!this.hasInvalidDatePart()) {\n this.markDatePartsAsExisting();\n }\n }\n return extend(parseResult, { value: this.value, switchToNext: switchToNext });\n }\n }\n if (month) {\n parsedDate = this.intl.parseDate(prefix + month + suffix, this.format, this.localeId);\n if (parsedDate) {\n this._value = parsedDate;\n this.setExisting(symbol, true);\n return extend(parseResult, { value: this.value, switchToNext: false });\n }\n }\n if (dayPeriod) {\n parsedDate = this.intl.parseDate(prefix + dayPeriod + suffix, this.format);\n if (parsedDate) {\n this._value = parsedDate;\n return extend(parseResult, { value: this.value, switchToNext: true });\n }\n }\n if (isZeroCurrentChar) {\n this.setExisting(symbol, false);\n }\n if (!this.autoCorrectParts) {\n var datePartValue = void 0;\n var textToParse = isInCaretMode ? datePartText : middle;\n var parsedValue = parseToInt(textToParse);\n if (isNumber(parsedValue)) {\n if ((symbol === \"d\" && (parsedValue <= 0 || parsedValue > 31)) ||\n (symbol === \"M\" && (parsedValue < 0 || parsedValue > 11))) {\n return extend(parseResult, { value: null, switchToNext: false });\n }\n datePartValue = symbol === \"M\" ?\n parsedValue - JS_MONTH_OFFSET :\n parsedValue;\n var isMonth = symbol === \"M\";\n var isDay = symbol === \"d\";\n var newValue = cloneDate(this._value);\n var invalidDateParts = this._partiallyInvalidDate.invalidDateParts || {};\n var year = invalidDateParts.y.value || newValue.getFullYear();\n /* tslint:disable:no-shadowed-variable */\n var month_1 = isMonth ? datePartValue : invalidDateParts.M.value || newValue.getMonth();\n /* tslint:enable:no-shadowed-variable */\n var day = isDay ? datePartValue : invalidDateParts.d.value || invalidDateParts.E.value || newValue.getDate();\n var hour = invalidDateParts.h.value || invalidDateParts.H.value || newValue.getHours();\n var minutes = invalidDateParts.m.value || newValue.getMinutes();\n var seconds = invalidDateParts.s.value || newValue.getSeconds();\n var milliseconds = invalidDateParts.S.value || newValue.getMilliseconds();\n var dateCandidate = createDate(year, month_1, day, hour, minutes, seconds, milliseconds);\n var dateCandidateExists = areDatePartsEqualTo(dateCandidate, year, month_1, day, hour, minutes, seconds, milliseconds);\n var newValueCandidate = isMonth || isDay ?\n this.modifyDateSymbolWithValue(newValue, symbol, isMonth ? month_1 : day) :\n null;\n var invalidDateFound = false;\n if (isMonth && newValueCandidate) {\n if (newValueCandidate.getMonth() === month_1) {\n if (this.getExisting(\"d\")) {\n if (dateCandidateExists) {\n newValue = cloneDate(dateCandidate);\n this.resetInvalidDateSymbol(symbol);\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: month_1,\n date: cloneDate(newValueCandidate),\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n else if (dateCandidateExists) {\n this.resetInvalidDateSymbol(symbol);\n newValue = cloneDate(dateCandidate);\n if (this.getExisting(\"M\") && this.getExisting(\"y\")) {\n // changing from 28/Feb to 29/Feb to 29/March\n this.setExisting(\"d\", true);\n this.resetInvalidDateSymbol(\"d\");\n }\n }\n else {\n this.resetInvalidDateSymbol(symbol);\n newValue = cloneDate(newValueCandidate);\n }\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: month_1,\n date: cloneDate(newValueCandidate),\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n else if (isDay && newValueCandidate) {\n if (newValueCandidate.getDate() === day) {\n if (this.getExisting(\"M\")) {\n if (dateCandidateExists) {\n newValue = cloneDate(dateCandidate);\n this.resetInvalidDateSymbol(symbol);\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: day,\n date: cloneDate(newValueCandidate),\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n else if (dateCandidateExists) {\n newValue = cloneDate(dateCandidate);\n this.resetInvalidDateSymbol(symbol);\n if (this.getExisting(\"d\") && this.getExisting(\"y\")) {\n // changing from 31/Jan to 31/Feb to 28/Feb\n this.setExisting(\"M\", true);\n this.resetInvalidDateSymbol(\"M\");\n }\n }\n else {\n this.resetInvalidDateSymbol(symbol);\n newValue = cloneDate(newValueCandidate);\n }\n }\n else {\n invalidDateFound = true;\n this.setInvalidDatePart(symbol, {\n value: day,\n date: cloneDate(this.value),\n startDate: cloneDate(this.value)\n });\n this.setExisting(symbol, false);\n }\n }\n if (!invalidDateFound) {\n this.setExisting(symbol, true);\n if (isInCaretMode && !isValidDate(parsedDate)) {\n var valueCandidate = this.intl.parseDate(basePrefix + middle + baseSuffix, this.format, this.localeId);\n if (isValidDate(valueCandidate)) {\n this._value = valueCandidate;\n }\n }\n else {\n this._value = newValue;\n }\n if (this.getValue()) {\n this.resetInvalidDate();\n }\n }\n var switchToNext = false;\n if (symbol === \"M\") {\n if (parsedValue >= 2 || textToParse.length >= 2) {\n switchToNext = true;\n }\n else {\n switchToNext = false;\n }\n }\n else {\n switchToNext = hasFixedFormat ?\n textToParse.length === segmentLength :\n textToParse.length > segmentLength;\n }\n return extend(parseResult, {\n value: null,\n switchToNext: switchToNext,\n hasInvalidDatePart: invalidDateFound\n });\n }\n }\n return extend(parseResult, { value: null, switchToNext: false });\n };\n /**\n * @hidden\n */\n DateObject.prototype.symbolMap = function (symbol) {\n return this.intl.splitDateFormat(this.format, this.localeId).reduce(dateSymbolMap, {})[symbol];\n };\n /**\n * @hidden\n */\n DateObject.prototype.resetLeadingZero = function () {\n var hasLeadingZero = this.leadingZero !== null;\n this.setLeadingZero(null);\n return hasLeadingZero;\n };\n DateObject.prototype.setLeadingZero = function (leadingZero) {\n this.leadingZero = leadingZero;\n };\n /**\n * @hidden\n */\n DateObject.prototype.getLeadingZero = function () {\n return this.leadingZero || {};\n };\n /**\n * @hidden\n */\n DateObject.prototype.normalizeCentury = function (date) {\n if (!isPresent(date)) {\n return date;\n }\n var twoDigitYear = cropTwoDigitYear(date);\n var centuryBase = this.getNormalizedCenturyBase(twoDigitYear);\n var normalizedDate = setYears(date, centuryBase + twoDigitYear);\n return normalizedDate;\n };\n DateObject.prototype.incrementLeadingZero = function (symbol) {\n var leadingZero = this.leadingZero || {};\n leadingZero[symbol] = (leadingZero[symbol] || 0) + 1;\n this.leadingZero = leadingZero;\n };\n /**\n * @hidden\n */\n DateObject.prototype.isAbbrMonth = function (parts, symbol) {\n var pattern = this.partPattern(parts, symbol);\n return pattern.type === 'month' && pattern.names;\n };\n /**\n * @hidden\n */\n DateObject.prototype.partPattern = function (parts, symbol) {\n return parts.filter(function (part) { return part.pattern.indexOf(symbol) !== -1; })[0];\n };\n /**\n * @hidden\n */\n DateObject.prototype.peek = function (value, pattern) {\n var peekValue = value.replace(/^0*/, '') + '0';\n return padZero(pattern.length - peekValue.length) + peekValue;\n };\n /**\n * @hidden\n */\n DateObject.prototype.matchMonth = function (typedChar) {\n this.typedMonthPart += typedChar.toLowerCase();\n if (this.monthNames.length === 0) {\n return '';\n }\n while (this.typedMonthPart.length > 0) {\n for (var i = 0; i < this.monthNames.length; i++) {\n if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {\n return this.monthNames[i];\n }\n }\n var monthAsNum = parseInt(this.typedMonthPart, 10);\n /* ensure they exact match */\n if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart) {\n return this.monthNames[monthAsNum - 1];\n }\n this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);\n }\n return '';\n };\n /**\n * @hidden\n */\n DateObject.prototype.matchDayPeriod = function (typedChar, symbol) {\n var lowerChart = typedChar.toLowerCase();\n if (symbol === 'a' && this.dayPeriods) {\n if (this.dayPeriods.am.toLowerCase().startsWith(lowerChart)) {\n return this.dayPeriods.am;\n }\n else if (this.dayPeriods.pm.toLowerCase().startsWith(lowerChart)) {\n return this.dayPeriods.pm;\n }\n }\n return '';\n };\n /**\n * @hidden\n */\n DateObject.prototype.allFormattedMonths = function (locale) {\n if (locale === void 0) { locale = \"en\"; }\n var dateFormatParts = this.intl.splitDateFormat(this.format, this.localeId);\n for (var i = 0; i < dateFormatParts.length; i++) {\n if (dateFormatParts[i].type === 'month' && dateFormatParts[i].names) {\n return this.intl.dateFormatNames(locale, dateFormatParts[i].names);\n }\n }\n return [];\n };\n /**\n * @hidden\n */\n DateObject.prototype.allDayPeriods = function (locale) {\n if (locale === void 0) { locale = \"en\"; }\n var dateFormatParts = this.intl.splitDateFormat(this.format);\n for (var i = 0; i < dateFormatParts.length; i++) {\n if (dateFormatParts[i].type === \"dayperiod\" && dateFormatParts[i].names) {\n return this.intl.dateFormatNames(locale, dateFormatParts[i].names);\n }\n }\n return null;\n };\n /**\n * @hidden\n */\n DateObject.prototype.patternLength = function (pattern) {\n if (pattern[0] === 'y') {\n return 4;\n }\n if (SHORT_PATTERN_LENGTH_REGEXP.test(pattern)) {\n return 2;\n }\n return 0;\n };\n /**\n * @hidden\n */\n DateObject.prototype.dateFormatString = function (date, format) {\n var dateFormatParts = this.intl.splitDateFormat(format, this.localeId);\n var parts = [];\n var partMap = [];\n for (var i = 0; i < dateFormatParts.length; i++) {\n var partLength = this.intl.formatDate(date, { pattern: dateFormatParts[i].pattern }, this.localeId).length;\n while (partLength > 0) {\n parts.push(this.symbols[dateFormatParts[i].pattern[0]] || Constants.formatSeparator);\n partMap.push(dateFormatParts[i]);\n partLength--;\n }\n }\n var returnValue = new Mask();\n returnValue.symbols = parts.join('');\n returnValue.partMap = partMap;\n return returnValue;\n };\n /**\n * @hidden\n */\n DateObject.prototype.merge = function (text, mask) {\n // Important: right to left.\n var resultText = '';\n var resultFormat = '';\n var format = mask.symbols;\n var processTextSymbolsEnded = false;\n var ignoreFormatSymbolsCount = 0;\n var formattedDates = this.getFormattedInvalidDates(format);\n for (var formatSymbolIndex = format.length - 1; formatSymbolIndex >= 0; formatSymbolIndex--) {\n var partsForSegment = this.getPartsForSegment(mask, formatSymbolIndex);\n if (this.knownParts.indexOf(format[formatSymbolIndex]) === -1 || this.getExisting(format[formatSymbolIndex])) {\n if (this.autoCorrectParts) {\n resultText = text[formatSymbolIndex] + resultText;\n }\n else {\n if (text.length !== format.length) {\n if (processTextSymbolsEnded) {\n resultText = text[formatSymbolIndex] + resultText;\n }\n else if (ignoreFormatSymbolsCount > 0) {\n resultText = text[formatSymbolIndex] + resultText;\n ignoreFormatSymbolsCount--;\n if (ignoreFormatSymbolsCount <= 0) {\n processTextSymbolsEnded = true;\n }\n }\n else {\n resultText = (text[formatSymbolIndex + text.length - format.length] || \"\") + resultText;\n }\n }\n else {\n resultText = text[formatSymbolIndex] + resultText;\n }\n }\n resultFormat = format[formatSymbolIndex] + resultFormat;\n }\n else {\n var symbol = format[formatSymbolIndex];\n var formatSymbolIndexModifier = 0;\n if (this.autoCorrectParts || (!this.autoCorrectParts && !this.getInvalidDatePartValue(symbol))) {\n while (formatSymbolIndex >= 0 && symbol === format[formatSymbolIndex]) {\n formatSymbolIndex--;\n }\n formatSymbolIndex++;\n }\n if (this.leadingZero && this.leadingZero[symbol]) {\n resultText = '0' + resultText;\n }\n else {\n if (!this.autoCorrectParts && this.getInvalidDatePartValue(symbol)) {\n var datePartText = this.getInvalidDatePartValue(symbol).toString();\n if (symbol === \"M\") {\n datePartText = (parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();\n if (partsForSegment.length > MONTH_PART_WITH_WORDS_THRESHOLD) {\n resultText = formattedDates[symbol][formatSymbolIndex] + resultText;\n }\n else {\n datePartText = (parseToInt(this.getInvalidDatePartValue(symbol)) + JS_MONTH_OFFSET).toString();\n var formattedDatePart = padZero(partsForSegment.length - datePartText.length) + datePartText;\n resultText = formattedDatePart + resultText;\n formatSymbolIndexModifier = partsForSegment.length - 1;\n ignoreFormatSymbolsCount = datePartText.length - partsForSegment.length;\n }\n }\n else {\n var formattedDatePart = padZero(partsForSegment.length - datePartText.length) + datePartText;\n resultText = formattedDatePart + resultText;\n formatSymbolIndexModifier = partsForSegment.length - 1;\n ignoreFormatSymbolsCount = datePartText.length - partsForSegment.length;\n }\n }\n else {\n resultText = this.dateFieldName(mask.partMap[formatSymbolIndex]) + resultText;\n }\n }\n while (resultFormat.length < resultText.length) {\n resultFormat = format[formatSymbolIndex] + resultFormat;\n }\n if (formatSymbolIndexModifier !== 0) {\n formatSymbolIndex = (formatSymbolIndex - formatSymbolIndexModifier) + (text.length - format.length);\n }\n }\n }\n return { text: resultText, format: resultFormat };\n };\n /**\n * @hidden\n */\n DateObject.prototype.dateFieldName = function (part) {\n var formatPlaceholder = this.formatPlaceholder || 'wide';\n if (formatPlaceholder[part.type]) {\n return formatPlaceholder[part.type];\n }\n if (formatPlaceholder === 'formatPattern') {\n return part.pattern;\n }\n return this.intl.dateFieldName(Object.assign(part, { nameType: formatPlaceholder }));\n };\n /**\n * @hidden\n */\n DateObject.prototype.getNormalizedCenturyBase = function (twoDigitYear) {\n return twoDigitYear > this.twoDigitYearMax ?\n PREVIOUS_CENTURY_BASE :\n CURRENT_CENTURY_BASE;\n };\n /**\n * @hidden\n */\n DateObject.prototype.shouldNormalizeCentury = function () {\n return this.intl.splitDateFormat(this.format).some(function (part) { return part.pattern === 'yy'; });\n };\n DateObject.prototype.resetInvalidDate = function () {\n var _this = this;\n this._partiallyInvalidDate.startDate = null;\n Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {\n _this.resetInvalidDatePart(key);\n });\n };\n DateObject.prototype.resetInvalidDateSymbol = function (symbol) {\n var _this = this;\n this.resetInvalidDatePart(symbol);\n var shouldResetInvalidDate = true;\n Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {\n if (_this._partiallyInvalidDate.invalidDateParts[key] &&\n isPresent(_this._partiallyInvalidDate.invalidDateParts[key].value)) {\n shouldResetInvalidDate = false;\n }\n });\n if (shouldResetInvalidDate) {\n this.resetInvalidDate();\n }\n };\n DateObject.prototype.resetInvalidDatePart = function (symbol) {\n if (this._partiallyInvalidDate.invalidDateParts[symbol]) {\n this._partiallyInvalidDate.invalidDateParts[symbol] = {\n value: null,\n date: null,\n startDateOffset: 0\n };\n }\n };\n /**\n * @hidden\n */\n DateObject.prototype.getInvalidDatePart = function (symbol) {\n var invalidDatePart = this._partiallyInvalidDate.invalidDateParts[symbol];\n return invalidDatePart || {};\n };\n /**\n * @hidden\n */\n DateObject.prototype.getInvalidDatePartValue = function (symbol) {\n var invalidDatePart = this._partiallyInvalidDate.invalidDateParts[symbol];\n return (invalidDatePart || {}).value;\n };\n DateObject.prototype.setInvalidDatePart = function (symbol, _a) {\n 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;\n if (this._partiallyInvalidDate.invalidDateParts[symbol]) {\n this._partiallyInvalidDate.invalidDateParts[symbol].value = value;\n this._partiallyInvalidDate.invalidDateParts[symbol].date = date;\n this._partiallyInvalidDate.invalidDateParts[symbol].startDateOffset = startDateOffset;\n this._partiallyInvalidDate.startDate = startDate;\n }\n };\n /**\n * @hidden\n */\n DateObject.prototype.hasInvalidDatePart = function () {\n var _this = this;\n var hasInvalidDatePart = false;\n Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function (key) {\n if (_this._partiallyInvalidDate.invalidDateParts[key] &&\n isPresent(_this._partiallyInvalidDate.invalidDateParts[key].value)) {\n hasInvalidDatePart = true;\n }\n });\n return hasInvalidDatePart;\n };\n /**\n * @hidden\n */\n DateObject.prototype.modifyDateSymbolWithOffset = function (date, symbol, offset) {\n var newValue = cloneDate(date);\n var timeModified = false;\n switch (symbol) {\n case 'y':\n newValue.setFullYear(newValue.getFullYear() + offset);\n break;\n case 'M':\n newValue = addMonths(this.value, offset);\n break;\n case 'd':\n case 'E':\n newValue.setDate(newValue.getDate() + offset);\n break;\n case 'h':\n case 'H':\n newValue.setHours(newValue.getHours() + offset);\n timeModified = true;\n break;\n case 'm':\n newValue.setMinutes(newValue.getMinutes() + offset);\n timeModified = true;\n break;\n case 's':\n newValue.setSeconds(newValue.getSeconds() + offset);\n timeModified = true;\n break;\n case \"S\":\n newValue.setMilliseconds(newValue.getMilliseconds() + offset);\n break;\n case 'a':\n newValue.setHours(newValue.getHours() + (12 * offset));\n timeModified = true;\n break;\n default: break;\n }\n return {\n date: newValue,\n timeModified: timeModified\n };\n };\n /**\n * @hidden\n */\n DateObject.prototype.modifyDateSymbolWithValue = function (date, symbol, value) {\n var newValue = cloneDate(date);\n switch (symbol) {\n case 'y':\n newValue.setFullYear(value);\n break;\n case 'M':\n newValue = addMonths(date, value - date.getMonth());\n break;\n case 'd':\n case 'E':\n newValue.setDate(value);\n break;\n case 'h':\n case 'H':\n newValue.setHours(value);\n break;\n case 'm':\n newValue.setMinutes(value);\n break;\n case 's':\n newValue.setSeconds(value);\n break;\n case \"S\":\n newValue.setMilliseconds(value);\n break;\n case 'a':\n newValue.setHours(value);\n break;\n default: break;\n }\n return newValue;\n };\n DateObject.prototype.markDatePartsAsExisting = function () {\n this.modifyExisting(true);\n };\n /**\n * @hidden\n */\n DateObject.prototype.getPartsForSegment = function (mask, partIndex) {\n var segmentPart = mask.partMap[partIndex];\n var partsForSegment = [];\n for (var maskPartIndex = partIndex; maskPartIndex < mask.partMap.length; maskPartIndex++) {\n var part = mask.partMap[maskPartIndex];\n if (segmentPart.type === part.type && segmentPart.pattern === part.pattern) {\n partsForSegment.push(part);\n }\n else {\n break;\n }\n }\n for (var maskPartIndex = partIndex - 1; maskPartIndex >= 0; maskPartIndex--) {\n var part = mask.partMap[maskPartIndex];\n if (segmentPart.type === part.type && segmentPart.pattern === part.pattern) {\n partsForSegment.unshift(part);\n }\n else {\n break;\n }\n }\n return partsForSegment;\n };\n return DateObject;\n }());\n\n var KeyCode = {\n BACKSPACE: 8,\n DELETE: 46,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n SPACE: 32,\n END: 35,\n HOME: 36,\n PAGE_UP: 33,\n PAGE_DOWN: 34\n };\n\n var defaultOptions = {\n events: {}\n };\n var Observable = /** @class */ (function () {\n function Observable(options) {\n this.options = deepExtend({}, defaultOptions, options);\n }\n Observable.prototype.destroy = function () {\n };\n /**\n * @hidden\n */\n Observable.prototype.trigger = function (eventName, args) {\n if (args === void 0) { args = {}; }\n var eventData = {\n defaultPrevented: false,\n preventDefault: function () {\n eventData.defaultPrevented = true;\n }\n };\n if (isFunction(this.options.events[eventName])) {\n this.options.events[eventName](extend(eventData, args, {\n sender: this\n }));\n return eventData.defaultPrevented;\n }\n return false;\n };\n return Observable;\n }());\n\n var DateInputInteractionMode;\n (function (DateInputInteractionMode) {\n DateInputInteractionMode[\"None\"] = \"none\";\n DateInputInteractionMode[\"Caret\"] = \"caret\";\n DateInputInteractionMode[\"Selection\"] = \"selection\";\n })(DateInputInteractionMode || (DateInputInteractionMode = {}));\n\n var _a;\n var DEFAULT_SEGMENT_STEP = 1;\n var DRAG_START = \"dragStart\";\n var DROP = \"drop\";\n var TOUCH_START = \"touchstart\";\n var MOUSE_DOWN = \"mousedown\";\n var MOUSE_UP = \"mouseup\";\n var CLICK = \"click\";\n var INPUT = \"input\";\n var KEY_DOWN = \"keydown\";\n var FOCUS = \"focus\";\n var BLUR = \"blur\";\n var PASTE = \"paste\";\n var MOUSE_SCROLL = \"DOMMouseScroll\";\n var MOUSE_WHEEL = \"mousewheel\";\n var VALUE_CHANGE = \"valueChange\";\n var INPUT_END = \"inputEnd\";\n var BLUR_END = \"blurEnd\";\n var FOCUS_END = \"focusEnd\";\n var CHANGE = \"change\";\n var defaultDateInputOptions = {\n format: \"d\",\n hasPlaceholder: false,\n placeholder: null,\n cycleTime: true,\n locale: null,\n steps: {\n millisecond: DEFAULT_SEGMENT_STEP,\n second: DEFAULT_SEGMENT_STEP,\n minute: DEFAULT_SEGMENT_STEP,\n hour: DEFAULT_SEGMENT_STEP,\n day: DEFAULT_SEGMENT_STEP,\n month: DEFAULT_SEGMENT_STEP,\n year: DEFAULT_SEGMENT_STEP\n },\n formatPlaceholder: null,\n events: (_a = {},\n _a[VALUE_CHANGE] = null,\n _a[INPUT] = null,\n _a[INPUT_END] = null,\n _a[FOCUS] = null,\n _a[FOCUS_END] = null,\n _a[BLUR] = null,\n _a[BLUR_END] = null,\n _a[KEY_DOWN] = null,\n _a[MOUSE_WHEEL] = null,\n _a[CHANGE] = null,\n _a),\n selectNearestSegmentOnFocus: false,\n selectPreviousSegmentOnBackspace: false,\n enableMouseWheel: false,\n allowCaretMode: false,\n autoSwitchParts: true,\n autoSwitchKeys: [],\n twoDigitYearMax: Constants.twoDigitYearMax,\n autoCorrectParts: true,\n autoFill: false\n };\n var DateInput = /** @class */ (function (_super) {\n __extends(DateInput, _super);\n function DateInput(element, options) {\n var _this = _super.call(this, options) || this;\n _this.dateObject = null;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _this.currentText = '';\n _this.currentFormat = '';\n _this.interactionMode = DateInputInteractionMode.None;\n _this.previousElementSelection = { start: 0, end: 0 };\n _this.init(element, options);\n return _this;\n }\n Object.defineProperty(DateInput.prototype, \"value\", {\n get: function () {\n return this.dateObject && this.dateObject.getValue();\n },\n enumerable: true,\n configurable: true\n });\n DateInput.prototype.init = function (element, options) {\n var dateValue = isValidDate(this.options.value) ? cloneDate(this.options.value) : new Date(options.formattedValue);\n if (!isValidDate(dateValue)) {\n dateValue = null;\n }\n this.element = element;\n // this.element._kendoWidget = this;\n this.options = deepExtend({}, defaultDateInputOptions, options);\n this.intl = this.options.intlService;\n this.dateObject = this.createDateObject();\n this.dateObject.setValue(dateValue);\n this.setTextAndFormat();\n this.bindEvents();\n this.resetSegmentValue = true;\n this.interactionMode = DateInputInteractionMode.None;\n this.forceUpdate();\n };\n DateInput.prototype.destroy = function () {\n this.unbindEvents();\n this.dateObject = null;\n _super.prototype.destroy.call(this);\n };\n DateInput.prototype.bindEvents = function () {\n this.onElementDragStart = this.onElementDragStart.bind(this);\n this.element.addEventListener(DRAG_START, this.onElementDragStart);\n this.onElementDrop = this.onElementDrop.bind(this);\n this.element.addEventListener(DROP, this.onElementDrop);\n this.onElementClick = this.onElementClick.bind(this);\n this.element.addEventListener(CLICK, this.onElementClick);\n this.onElementMouseDown = this.onElementMouseDown.bind(this);\n this.element.addEventListener(MOUSE_DOWN, this.onElementMouseDown);\n this.element.addEventListener(TOUCH_START, this.onElementMouseDown);\n this.onElementMouseUp = this.onElementMouseUp.bind(this);\n this.element.addEventListener(MOUSE_UP, this.onElementMouseUp);\n this.onElementInput = this.onElementInput.bind(this);\n this.element.addEventListener(INPUT, this.onElementInput);\n this.onElementKeyDown = this.onElementKeyDown.bind(this);\n this.element.addEventListener(KEY_DOWN, this.onElementKeyDown);\n this.onElementFocus = this.onElementFocus.bind(this);\n this.element.addEventListener(FOCUS, this.onElementFocus);\n this.onElementBlur = this.onElementBlur.bind(this);\n this.element.addEventListener(BLUR, this.onElementBlur);\n this.onElementChange = this.onElementChange.bind(this);\n this.element.addEventListener(CHANGE, this.onElementChange);\n this.onElementPaste = this.onElementPaste.bind(this);\n this.element.addEventListener(PASTE, this.onElementPaste);\n this.onElementMouseWheel = this.onElementMouseWheel.bind(this);\n this.element.addEventListener(MOUSE_SCROLL, this.onElementMouseWheel);\n this.element.addEventListener(MOUSE_WHEEL, this.onElementMouseWheel);\n };\n DateInput.prototype.unbindEvents = function () {\n this.element.removeEventListener(DRAG_START, this.onElementDragStart);\n this.element.removeEventListener(DROP, this.onElementDrop);\n this.element.removeEventListener(TOUCH_START, this.onElementMouseDown);\n this.element.removeEventListener(MOUSE_DOWN, this.onElementMouseDown);\n this.element.removeEventListener(MOUSE_UP, this.onElementMouseUp);\n this.element.removeEventListener(CLICK, this.onElementClick);\n this.element.removeEventListener(INPUT, this.onElementInput);\n this.element.removeEventListener(KEY_DOWN, this.onElementKeyDown);\n this.element.removeEventListener(FOCUS, this.onElementFocus);\n this.element.removeEventListener(BLUR, this.onElementBlur);\n this.element.removeEventListener(CHANGE, this.onElementChange);\n this.element.removeEventListener(PASTE, this.onElementPaste);\n this.element.removeEventListener(MOUSE_SCROLL, this.onElementMouseWheel);\n this.element.removeEventListener(MOUSE_WHEEL, this.onElementMouseWheel);\n };\n DateInput.prototype.setOptions = function (options, refresh) {\n if (refresh === void 0) { refresh = false; }\n this.options = deepExtend({}, this.options, options);\n this.setDateObjectOptions();\n if (refresh) {\n this.unbindEvents();\n this.init(this.element, this.options);\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.setDateObjectOptions = function () {\n if (this.dateObject) {\n var newOptions = this.getDateObjectOptions();\n this.dateObject.setOptions(newOptions);\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.resetLocale = function () {\n this.unbindEvents();\n this.init(this.element, this.options);\n };\n /**\n * @hidden\n */\n DateInput.prototype.isInCaretMode = function () {\n return this.interactionMode === DateInputInteractionMode.Caret;\n };\n DateInput.prototype.focus = function () {\n this.element.focus();\n if (this.options.selectNearestSegmentOnFocus) {\n this.selectNearestSegment(0);\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementDragStart = function (e) {\n e.preventDefault();\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementDrop = function (e) {\n e.preventDefault();\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementMouseDown = function () {\n this.mouseDownStarted = true;\n this.focusedPriorToMouseDown = this.isActive;\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementMouseUp = function (e) {\n this.mouseDownStarted = false;\n e.preventDefault();\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementClick = function (e) {\n this.mouseDownStarted = false;\n this.switchedPartOnPreviousKeyAction = false;\n var selection = this.selection;\n if (this.isInCaretMode()) {\n // explicitly refresh the input element value\n // caret mode can change the number of symbols in the element\n // thus clicking on a segment can result in incorrect selection\n this.forceUpdate();\n }\n if (e.detail === 3) {\n // when 3 clicks occur, leave the native event to handle the change\n // this results in selecting the whole element value\n }\n else {\n if (this.isActive && this.options.selectNearestSegmentOnFocus) {\n var selectionPresent = this.element.selectionStart !== this.element.selectionEnd;\n var placeholderToggled = isPresent(this.options.placeholder) &&\n !this.dateObject.hasValue() &&\n !this.focusedPriorToMouseDown;\n // focus first segment if the user hasn't selected something during mousedown and if the placeholder was just toggled\n var selectFirstSegment = !selectionPresent && placeholderToggled;\n var index = selectFirstSegment ? 0 : this.caret()[0];\n this.selectNearestSegment(index);\n }\n else {\n this.setSelection(this.selectionByIndex(selection.start));\n }\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementInput = function (e) {\n this.triggerInput({ event: e });\n if (!this.element || !this.dateObject) {\n return;\n }\n var switchedPartOnPreviousKeyAction = this.switchedPartOnPreviousKeyAction;\n if (this.isPasteInProgress) {\n if (this.options.allowCaretMode) {\n // pasting should leave the input with caret\n // thus allow direct input instead of selection mode\n this.resetSegmentValue = false;\n }\n this.updateOnPaste(e);\n this.isPasteInProgress = false;\n return;\n }\n var keyDownEvent = this.keyDownEvent || {};\n var isBackspaceKey = keyDownEvent.keyCode === KeyCode.BACKSPACE || keyDownEvent.key === Key.BACKSPACE;\n var isDeleteKey = keyDownEvent.keyCode === KeyCode.DELETE || keyDownEvent.key === Key.DELETE;\n var originalInteractionMode = this.interactionMode;\n if (this.options.allowCaretMode &&\n originalInteractionMode !== DateInputInteractionMode.Caret &&\n !isDeleteKey && !isBackspaceKey) {\n this.resetSegmentValue = true;\n }\n if (this.options.allowCaretMode) {\n this.interactionMode = DateInputInteractionMode.Caret;\n }\n else {\n this.interactionMode = DateInputInteractionMode.Selection;\n }\n var hasCaret = this.isInCaretMode();\n if (hasCaret && this.keyDownEvent.key === Key.SPACE) {\n // do not allow custom \"holes\" in the date segments\n this.restorePreviousInputEventState();\n return;\n }\n var oldExistingDateValue = this.dateObject && this.dateObject.getValue();\n var oldDateValue = this.dateObject ? this.dateObject.value : null;\n var _a = this.dateObject.getTextAndFormat(), currentText = _a.text, currentFormat = _a.format;\n this.currentFormat = currentFormat;\n var oldText = \"\";\n if (hasCaret) {\n if (isBackspaceKey || isDeleteKey) {\n oldText = this.previousElementValue;\n }\n else if (originalInteractionMode === DateInputInteractionMode.Caret) {\n oldText = this.previousElementValue;\n }\n else {\n oldText = currentText;\n }\n }\n else {\n oldText = currentText;\n }\n var newText = this.elementValue;\n var diff = approximateStringMatching({\n oldText: oldText,\n newText: newText,\n formatPattern: this.currentFormat,\n selectionStart: this.selection.start,\n isInCaretMode: hasCaret,\n keyEvent: this.keyDownEvent\n });\n if (diff && diff.length && diff[0] && diff[0][1] !== Constants.formatSeparator) {\n this.switchedPartOnPreviousKeyAction = false;\n }\n if (hasCaret && (!diff || diff.length === 0)) {\n this.restorePreviousInputEventState();\n return;\n }\n else if (hasCaret && diff.length === 1) {\n if (!diff[0] || !diff[0][0]) {\n this.restorePreviousInputEventState();\n return;\n }\n else if (hasCaret && diff[0] &&\n (diff[0][0] === Constants.formatSeparator || diff[0][1] === Constants.formatSeparator)) {\n this.restorePreviousInputEventState();\n return;\n }\n }\n var navigationOnly = (diff.length === 1 && diff[0][1] === Constants.formatSeparator);\n var parsePartsResults = [];\n var switchPart = false;\n var error = null;\n if (!navigationOnly) {\n for (var i = 0; i < diff.length; i++) {\n var parsePartResult = this.dateObject.parsePart({\n symbol: diff[i][0],\n currentChar: diff[i][1],\n resetSegmentValue: this.resetSegmentValue,\n cycleSegmentValue: !this.isInCaretMode(),\n rawTextValue: this.element.value,\n isDeleting: isBackspaceKey || isDeleteKey,\n originalFormat: this.currentFormat\n });\n parsePartsResults.push(parsePartResult);\n if (!parsePartResult.value) {\n error = { type: \"parse\" };\n }\n switchPart = parsePartResult.switchToNext;\n }\n }\n if (!this.options.autoSwitchParts) {\n switchPart = false;\n }\n this.resetSegmentValue = false;\n var hasFixedFormat = this.options.format === this.currentFormat ||\n // all not fixed formats are 1 symbol, e.g. \"d\"\n (isPresent(this.options.format) && this.options.format.length > 1);\n var lastParseResult = parsePartsResults[parsePartsResults.length - 1];\n var lastParseResultHasNoValue = lastParseResult && !isPresent(lastParseResult.value);\n var parsingFailedOnDelete = (hasCaret && (isBackspaceKey || isDeleteKey) && lastParseResultHasNoValue);\n var resetPart = lastParseResult ? lastParseResult.resetPart : false;\n var newExistingDateValue = this.dateObject.getValue();\n var hasExistingDateValueChanged = !isEqual(oldExistingDateValue, newExistingDateValue);\n var newDateValue = this.dateObject.value;\n var symbolForSelection;\n var currentSelection = this.selection;\n if (hasCaret) {\n var diffChar = diff && diff.length > 0 ? diff[0][0] : null;\n var hasLeadingZero = this.dateObject.getLeadingZero()[diffChar];\n if (diff.length && diff[0][0] !== Constants.formatSeparator) {\n if (switchPart) {\n this.forceUpdateWithSelection();\n this.switchDateSegment(1);\n }\n else if (resetPart) {\n symbolForSelection = this.currentFormat[currentSelection.start];\n if (symbolForSelection) {\n this.forceUpdate();\n this.setSelection(this.selectionBySymbol(symbolForSelection));\n }\n else {\n this.restorePreviousInputEventState();\n }\n }\n else if (parsingFailedOnDelete) {\n this.forceUpdate();\n if (diff.length && diff[0][0] !== Constants.formatSeparator) {\n this.setSelection(this.selectionBySymbol(diff[0][0]));\n }\n }\n else if (lastParseResultHasNoValue) {\n if (e.data === \"0\" && hasLeadingZero) {\n // do not reset element value on a leading zero\n // wait for consecutive input to determine the value\n }\n else if (isPresent(oldExistingDateValue) && !isPresent(newExistingDateValue)) {\n this.restorePreviousInputEventState();\n }\n else if (!isPresent(oldExistingDateValue) && isPresent(newExistingDateValue)) {\n this.forceUpdateWithSelection();\n }\n else if (isPresent(oldExistingDateValue) && isPresent(newExistingDateValue)) {\n if (hasExistingDateValueChanged) {\n this.forceUpdateWithSelection();\n }\n else {\n this.restorePreviousInputEventState();\n }\n }\n else if (!isPresent(oldExistingDateValue) && !isPresent(newExistingDateValue)) {\n this.forceUpdateWithSelection();\n }\n else if (oldDateValue !== newDateValue) {\n // this can happen on auto correct when no valid value is parsed\n }\n else {\n this.restorePreviousInputEventState();\n }\n }\n else if (!lastParseResultHasNoValue) {\n // the user types a valid but incomplete date (e.g. year \"123\" with format \"yyyy\")\n // let them continue typing, but refresh for not fixed formats\n if (!hasFixedFormat) {\n this.forceUpdateWithSelection();\n }\n }\n }\n else {\n if (!this.options.autoSwitchParts && diff[0][1] === Constants.formatSeparator) {\n // do not change the selection when a separator is pressed\n // this should happen only if autoSwitchKeys contains the separator explicitly\n }\n else {\n this.setSelection(this.selectionBySymbol(diff[0][0]));\n }\n }\n }\n else if (!hasCaret) {\n this.forceUpdate();\n if (diff.length && diff[0][0] !== Constants.formatSeparator) {\n this.setSelection(this.selectionBySymbol(diff[0][0]));\n }\n if (this.options.autoSwitchParts) {\n if (navigationOnly) {\n this.resetSegmentValue = true;\n if (!switchedPartOnPreviousKeyAction) {\n this.switchDateSegment(1);\n }\n this.switchedPartOnPreviousKeyAction = true;\n }\n else if (switchPart) {\n this.switchDateSegment(1);\n this.switchedPartOnPreviousKeyAction = true;\n }\n }\n else {\n if (lastParseResult && lastParseResult.switchToNext) {\n // the value is complete and should be switched, but the \"autoSwitchParts\" option prevents this\n // ensure that the segment value can be reset on next input\n this.resetSegmentValue = true;\n }\n else if (navigationOnly) {\n this.resetSegmentValue = true;\n if (!switchedPartOnPreviousKeyAction) {\n this.switchDateSegment(1);\n }\n this.switchedPartOnPreviousKeyAction = true;\n }\n }\n if (isBackspaceKey && this.options.selectPreviousSegmentOnBackspace) {\n // kendo angular have this UX\n this.switchDateSegment(-1);\n }\n }\n this.tryTriggerValueChange({\n oldValue: oldExistingDateValue,\n event: e\n });\n this.triggerInputEnd({ event: e, error: error });\n if (hasCaret) {\n // a format like \"F\" can dynamically change the resolved format pattern based on the value, e.g.\n // \"Tuesday, February 1, 2022 3:04:05 AM\" becomes\n // \"Wednesday, February 2, 2022 3:04:05 AM\" giving a diff of 2 (\"Tuesday\".length - \"Wednesday\".length)\n this.setTextAndFormat();\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementFocus = function (e) {\n if (this.triggerFocus({ event: e })) {\n return;\n }\n this.isActive = true;\n this.interactionMode = DateInputInteractionMode.None;\n this.switchedPartOnPreviousKeyAction = false;\n this.refreshElementValue();\n if (!this.mouseDownStarted) {\n this.caret(0, this.elementValue.length);\n }\n this.mouseDownStarted = false;\n this.triggerFocusEnd({ event: e });\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementBlur = function (e) {\n this.resetSegmentValue = true;\n this.isActive = false;\n if (this.triggerBlur({ event: e })) {\n return;\n }\n if (this.options.autoFill) {\n this.autoFill();\n }\n this.interactionMode = DateInputInteractionMode.None;\n this.switchedPartOnPreviousKeyAction = false;\n this.refreshElementValue();\n this.triggerBlurEnd({ event: e });\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementChange = function (e) {\n this.triggerChange({ event: e });\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementKeyDown = function (e) {\n if (this.triggerKeyDown({ event: e })) {\n return;\n }\n var _a = this.selection, start = _a.start, end = _a.end;\n this.keyDownEvent = e;\n this.previousElementValue = this.element.value;\n this.previousElementSelection = { start: start, end: end };\n if (this.keyEventMatchesAutoSwitchKeys(e)) {\n var isTabKey = e.keyCode === KeyCode.TAB;\n if (isTabKey) {\n var _b = this.selection, selectionStart = _b.start, selectionEnd = _b.end;\n if (e.shiftKey && isTabKey) {\n this.switchDateSegment(-1);\n }\n else {\n this.switchDateSegment(1);\n }\n if (selectionStart !== this.selection.start || selectionEnd !== this.selection.end) {\n // when the selection changes, prevent the default Tab behavior\n e.preventDefault();\n return;\n }\n }\n else {\n // do not allow the \"input\" event to be triggered\n e.preventDefault();\n this.switchDateSegment(1);\n return;\n }\n }\n var symbol = this.currentFormat[this.selection.start];\n var step = this.getStepFromSymbol(symbol);\n var shouldPreventDefault = false;\n if (e.altKey || e.ctrlKey || e.metaKey || e.keyCode === KeyCode.TAB) {\n return;\n }\n switch (e.keyCode) {\n case KeyCode.ARROW_LEFT:\n this.switchDateSegment(-1);\n shouldPreventDefault = true;\n this.switchedPartOnPreviousKeyAction = false;\n break;\n case KeyCode.ARROW_UP:\n this.modifyDateSegmentValue(step, symbol, event);\n shouldPreventDefault = true;\n this.switchedPartOnPreviousKeyAction = false;\n break;\n case KeyCode.ARROW_RIGHT:\n this.switchDateSegment(1);\n shouldPreventDefault = true;\n this.switchedPartOnPreviousKeyAction = false;\n break;\n case KeyCode.ARROW_DOWN:\n this.modifyDateSegmentValue(-step, symbol, event);\n shouldPreventDefault = true;\n this.switchedPartOnPreviousKeyAction = false;\n break;\n case KeyCode.ENTER:\n // todo: handle \"change\" event\n break;\n case KeyCode.HOME:\n this.selectNearestSegment(0);\n shouldPreventDefault = true;\n this.switchedPartOnPreviousKeyAction = false;\n this.resetSegmentValue = true;\n break;\n case KeyCode.END:\n this.selectNearestSegment(this.elementValue.length);\n shouldPreventDefault = true;\n this.switchedPartOnPreviousKeyAction = false;\n this.resetSegmentValue = true;\n break;\n default:\n // allow the \"input\" event to handle the change\n return;\n }\n if (shouldPreventDefault) {\n e.preventDefault();\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementPaste = function () {\n this.isPasteInProgress = true;\n };\n /**\n * @hidden\n */\n DateInput.prototype.onElementMouseWheel = function (e) {\n if (!this.options.enableMouseWheel || this.triggerMouseWheel({ event: e })) {\n return;\n }\n if (!this.isActive) {\n return;\n }\n var event = e;\n if (event.shiftKey) {\n this.switchDateSegment((event.wheelDelta || -event.detail) > 0 ? -1 : 1);\n }\n else {\n this.modifyDateSegmentValue((event.wheelDelta || -event.detail) > 0 ? 1 : -1);\n }\n event.returnValue = false;\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n };\n DateInput.prototype.updateOnPaste = function (e) {\n var value = this.intl.parseDate(this.elementValue, this.inputFormat) || this.value;\n if (isPresent(value) && this.dateObject.shouldNormalizeCentury()) {\n value = this.dateObject.normalizeCentury(value);\n }\n var oldDateObjectValue = this.dateObject && this.dateObject.getValue();\n this.writeValue(value);\n this.tryTriggerValueChange({\n oldValue: oldDateObjectValue,\n event: e\n });\n };\n Object.defineProperty(DateInput.prototype, \"elementValue\", {\n get: function () {\n return (this.element || {}).value || '';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInput.prototype, \"inputFormat\", {\n get: function () {\n if (!this.options.format) {\n return Constants.defaultDateFormat;\n }\n if (typeof this.options.format === 'string') {\n return this.options.format;\n }\n else {\n return this.options.format.inputFormat;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInput.prototype, \"displayFormat\", {\n get: function () {\n if (!this.options.format) {\n return Constants.defaultDateFormat;\n }\n if (typeof this.options.format === 'string') {\n return this.options.format;\n }\n else {\n return this.options.format.displayFormat;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInput.prototype, \"selection\", {\n get: function () {\n var returnValue = { start: 0, end: 0 };\n if (this.element !== null && this.element.selectionStart !== undefined) {\n returnValue = {\n start: this.element.selectionStart,\n end: this.element.selectionEnd\n };\n }\n return returnValue;\n },\n enumerable: true,\n configurable: true\n });\n DateInput.prototype.setSelection = function (selection) {\n if (this.element && document.activeElement === this.element) {\n this.element.setSelectionRange(selection.start, selection.end);\n if (selection.start !== selection.end) {\n this.interactionMode = DateInputInteractionMode.Selection;\n }\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.selectionBySymbol = function (symbol) {\n var start = -1;\n var end = 0;\n for (var i = 0; i < this.currentFormat.length; i++) {\n if (this.currentFormat[i] === symbol) {\n end = i + 1;\n if (start === -1) {\n start = i;\n }\n }\n }\n if (start < 0) {\n start = 0;\n }\n if (!this.options.autoCorrectParts && this.currentFormat.length !== this.currentText.length) {\n if (this.currentFormat.length < this.currentText.length) {\n end += this.currentText.length - this.currentFormat.length;\n }\n else {\n end = Math.max(0, end - (this.currentFormat.length - this.currentText.length));\n }\n }\n return { start: start, end: end };\n };\n /**\n * @hidden\n */\n DateInput.prototype.selectionByIndex = function (index) {\n var selection = { start: index, end: index };\n for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {\n if (i < this.currentFormat.length && this.currentFormat[i] !== Constants.formatSeparator) {\n selection = this.selectionBySymbol(this.currentFormat[i]);\n break;\n }\n if (j >= 0 && this.currentFormat[j] !== Constants.formatSeparator) {\n selection = this.selectionBySymbol(this.currentFormat[j]);\n break;\n }\n }\n return selection;\n };\n DateInput.prototype.switchDateSegment = function (offset) {\n var selection = this.selection;\n if (this.isInCaretMode()) {\n var start = selection.start;\n var currentSymbol = this.currentFormat[start - 1];\n var symbol = \"\";\n var symbolCandidate = \"\";\n if (offset < 0) {\n for (var i = start + offset; i >= 0; i--) {\n symbolCandidate = this.currentFormat[i];\n if (symbolCandidate !== Constants.formatSeparator &&\n symbolCandidate !== currentSymbol) {\n start = i;\n symbol = symbolCandidate;\n break;\n }\n }\n }\n else {\n for (var i = start + offset; i < this.currentFormat.length; i++) {\n symbolCandidate = this.currentFormat[i];\n if (symbolCandidate !== Constants.formatSeparator &&\n symbolCandidate !== currentSymbol) {\n start = i;\n symbol = symbolCandidate;\n break;\n }\n }\n }\n if (symbol) {\n this.forceUpdate();\n this.setSelection(this.selectionBySymbol(symbol));\n this.interactionMode = DateInputInteractionMode.Selection;\n return;\n }\n }\n this.interactionMode = DateInputInteractionMode.None;\n var _a = this.selection, selectionStart = _a.start, selectionEnd = _a.end;\n if (selectionStart < selectionEnd &&\n this.currentFormat[selectionStart] !== this.currentFormat[selectionEnd - 1]) {\n this.setSelection(this.selectionByIndex(offset > 0 ? selectionStart : selectionEnd - 1));\n this.resetSegmentValue = true;\n this.interactionMode = DateInputInteractionMode.None;\n return;\n }\n var previousFormatSymbol = this.currentFormat[selectionStart];\n var a = selectionStart + offset;\n while (a > 0 && a < this.currentFormat.length) {\n if (this.currentFormat[a] !== previousFormatSymbol &&\n this.currentFormat[a] !== Constants.formatSeparator) {\n break;\n }\n a += offset;\n }\n if (this.currentFormat[a] === Constants.formatSeparator) {\n // no known symbol is found\n return;\n }\n var b = a;\n while (b >= 0 && b < this.currentFormat.length) {\n if (this.currentFormat[b] !== this.currentFormat[a]) {\n break;\n }\n b += offset;\n }\n if (a > b && (b + 1 !== selectionStart || a + 1 !== selectionEnd)) {\n this.setSelection({ start: b + 1, end: a + 1 });\n this.resetSegmentValue = true;\n }\n else if (a < b && (a !== selectionStart || b !== selectionEnd)) {\n this.setSelection({ start: a, end: b });\n this.resetSegmentValue = true;\n }\n this.interactionMode = DateInputInteractionMode.None;\n };\n DateInput.prototype.modifyDateSegmentValue = function (offset, symbol, event) {\n if (symbol === void 0) { symbol = \"\"; }\n if (event === void 0) { event = {}; }\n if (!this.dateObject || this.options.readonly) {\n return;\n }\n var oldValue = this.value;\n var step = DEFAULT_SEGMENT_STEP * offset;\n var caret = this.caret();\n symbol = symbol || this.currentFormat[caret[0]];\n if (symbol === \"S\" && !this.options.steps.millisecond) {\n var msDigits = millisecondDigitsInFormat(this.inputFormat);\n step = millisecondStepFor(msDigits);\n }\n this.dateObject.modifyPart(symbol, step);\n this.tryTriggerValueChange({\n oldValue: oldValue,\n event: event\n });\n this.forceUpdate();\n this.setSelection(this.selectionBySymbol(symbol));\n };\n /**\n * @hidden\n */\n DateInput.prototype.tryTriggerValueChange = function (args) {\n if (args === void 0) { args = { oldValue: null, event: {} }; }\n if (!isEqual(this.value, args.oldValue)) {\n return this.triggerValueChange(args);\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerValueChange = function (args) {\n if (args === void 0) { args = { oldValue: null, event: {} }; }\n return this.trigger(VALUE_CHANGE, extend(args, {\n value: this.value\n }));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerInput = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(INPUT, extend(args, {\n value: this.value\n }));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerInputEnd = function (args) {\n if (args === void 0) { args = { event: {}, error: null }; }\n return this.trigger(INPUT_END, extend(args, {\n value: this.value\n }));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerFocus = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(FOCUS, extend({}, args));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerFocusEnd = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(FOCUS_END, extend({}, args));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerBlur = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(BLUR, extend({}, args));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerBlurEnd = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(BLUR_END, extend({}, args));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerChange = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(CHANGE, extend(args, {\n value: this.value\n }));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerKeyDown = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(KEY_DOWN, extend({}, args));\n };\n /**\n * @hidden\n */\n DateInput.prototype.triggerMouseWheel = function (args) {\n if (args === void 0) { args = { event: {} }; }\n return this.trigger(MOUSE_WHEEL, extend({}, args));\n };\n /**\n * @hidden\n */\n DateInput.prototype.forceUpdate = function () {\n this.setTextAndFormat();\n this.refreshElementValue();\n };\n /**\n * @hidden\n */\n DateInput.prototype.forceUpdateWithSelection = function () {\n var _a = this.selection, start = _a.start, end = _a.end;\n var elementValueLength = this.elementValue.length;\n this.forceUpdate();\n var selectionOffset = this.elementValue.length - elementValueLength;\n this.setSelection({\n start: start + selectionOffset,\n end: end + selectionOffset\n });\n };\n /**\n * @hidden\n */\n DateInput.prototype.setTextAndFormat = function () {\n var _a = this.dateObject.getTextAndFormat(), currentText = _a.text, currentFormat = _a.format;\n this.currentFormat = currentFormat;\n this.currentText = currentText;\n };\n /**\n * @hidden\n */\n DateInput.prototype.setElementValue = function (value) {\n this.element.value = value;\n };\n /**\n * @hidden\n */\n DateInput.prototype.getStepFromSymbol = function (symbol) {\n /* eslint-disable no-fallthrough */\n switch (symbol) {\n case \"S\":\n return Number(this.options.steps.millisecond);\n case \"s\":\n return Number(this.options.steps.second);\n case \"m\":\n return Number(this.options.steps.minute);\n // represents hour as value from 01 through 12\n case \"h\":\n // represents hour as value from 01 through 23\n case \"H\":\n return Number(this.options.steps.hour);\n case \"M\":\n return Number(this.options.steps.month);\n // there is no 'D' format specifier for day\n case \"d\":\n // used for formats such as \"EEEE, MMMM d, yyyy\",\n // where \"EEEE\" stands for full name of the day e.g. Monday\n case \"E\":\n return Number(this.options.steps.day);\n // there is no 'Y' format specifier for year\n case \"y\":\n return Number(this.options.steps.year);\n default:\n return DEFAULT_SEGMENT_STEP;\n }\n /* eslint-enable no-fallthrough */\n };\n /**\n * @hidden\n */\n DateInput.prototype.restorePreviousInputEventState = function () {\n this.restorePreviousElementValue();\n this.restorePreviousElementSelection();\n };\n /**\n * @hidden\n */\n DateInput.prototype.restorePreviousElementValue = function () {\n this.setElementValue(this.previousElementValue || '');\n };\n /**\n * @hidden\n */\n DateInput.prototype.restorePreviousElementSelection = function () {\n var _a = this.previousElementSelection, start = _a.start, end = _a.end;\n this.setSelection({ start: start || 0, end: end || 0 });\n };\n DateInput.prototype.writeValue = function (value) {\n this.verifyValue(value);\n this.dateObject = this.getDateObject(value);\n this.refreshElementValue();\n };\n DateInput.prototype.verifyValue = function (value) {\n if (value && !isValidDate(value)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance.\");\n }\n };\n DateInput.prototype.refreshElementValue = function () {\n var start = this.caret()[0];\n var element = this.element;\n var format = this.isActive ? this.inputFormat : this.displayFormat;\n var _a = this.dateObject.getTextAndFormat(format), currentText = _a.text, currentFormat = _a.format;\n this.currentFormat = currentFormat;\n this.currentText = currentText;\n var hasPlaceholder = this.options.hasPlaceholder || isPresent(this.options.placeholder);\n var showPlaceholder = !this.isActive &&\n hasPlaceholder &&\n !this.dateObject.hasValue();\n if (hasPlaceholder && isPresent(this.options.placeholder)) {\n element.placeholder = this.options.placeholder;\n }\n var newElementValue = showPlaceholder ? \"\" : currentText;\n this.previousElementValue = this.elementValue;\n this.setElementValue(newElementValue);\n if (this.isActive && !this.options.allowCaretMode && this.options.selectNearestSegmentOnFocus) {\n this.selectNearestSegment(start);\n }\n };\n /**\n * @hidden\n */\n DateInput.prototype.caret = function (start, end) {\n if (end === void 0) { end = start; }\n var isPosition = start !== undefined;\n var returnValue = [start, start];\n var element = this.element;\n if (isPosition && (this.options.disabled || this.options.readonly)) {\n return undefined;\n }\n try {\n if (element.selectionStart !== undefined) {\n if (isPosition) {\n if (isDocumentAvailable() && document.activeElement !== element) {\n element.focus();\n }\n element.setSelectionRange(start, end);\n }\n returnValue = [element.selectionStart, element.selectionEnd];\n }\n }\n catch (e) {\n returnValue = [];\n }\n return returnValue;\n };\n DateInput.prototype.selectNearestSegment = function (index) {\n // Finds the nearest (in both directions) known part.\n for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {\n if (i < this.currentFormat.length && this.currentFormat[i] !== \"_\") {\n this.selectDateSegment(this.currentFormat[i]);\n return;\n }\n if (j >= 0 && this.currentFormat[j] !== \"_\") {\n this.selectDateSegment(this.currentFormat[j]);\n return;\n }\n }\n };\n DateInput.prototype.selectDateSegment = function (symbol) {\n var begin = -1;\n var end = 0;\n for (var i = 0; i < this.currentFormat.length; i++) {\n if (this.currentFormat[i] === symbol) {\n end = i + 1;\n if (begin === -1) {\n begin = i;\n }\n }\n }\n if (begin < 0) {\n begin = 0;\n }\n this.caret(0, 0);\n this.caret(begin, end);\n };\n /**\n * @hidden\n */\n DateInput.prototype.getDateObject = function (value) {\n var leadingZero = ((this.dateObject || {}) || null).leadingZero;\n this.options.value = value;\n var dateObject = this.createDateObject();\n dateObject.setLeadingZero(this.isActive ? leadingZero : null);\n return dateObject;\n };\n /* tslint:disable:align */\n /**\n * @hidden\n */\n DateInput.prototype.createDateObject = function () {\n var defaultOptions = this.getDateObjectOptions();\n var dateObject = new DateObject(extend({}, defaultOptions));\n return dateObject;\n };\n /**\n * @hidden\n */\n DateInput.prototype.getDateObjectOptions = function () {\n var newOptions = {\n intlService: this.options.intlService,\n formatPlaceholder: this.options.formatPlaceholder ? this.options.formatPlaceholder : 'formatPattern',\n format: this.inputFormat,\n cycleTime: this.options.cycleTime,\n twoDigitYearMax: this.options.twoDigitYearMax,\n autoCorrectParts: this.options.autoCorrectParts,\n value: this.options.value\n };\n return newOptions;\n };\n /* tslint:enable:align */\n /**\n * @hidden\n */\n DateInput.prototype.keyEventMatchesAutoSwitchKeys = function (keyObject) {\n var autoSwitchKeys = (this.options.autoSwitchKeys || [])\n .map(function (x) { return x.toString().toLowerCase().trim(); });\n if (autoSwitchKeys.indexOf(keyObject.keyCode.toString()) >= 0 ||\n autoSwitchKeys.indexOf(keyObject.keyCode) >= 0 ||\n autoSwitchKeys.indexOf(keyObject.key.toLowerCase().trim()) >= 0) {\n return true;\n }\n return false;\n };\n /**\n * @hidden\n */\n DateInput.prototype.autoFill = function () {\n var dateObject = this.dateObject, currentDate = new Date(), day, month, year, hours, minutes, seconds;\n if (dateObject.date || dateObject.month || dateObject.year || dateObject.hours || dateObject.minutes || dateObject.seconds) {\n year = dateObject.year ? dateObject.value.getFullYear() : currentDate.getFullYear(),\n month = dateObject.month ? dateObject.value.getMonth() : currentDate.getMonth(),\n day = dateObject.date ? dateObject.value.getDate() : currentDate.getDate(),\n hours = dateObject.hours ? dateObject.value.getHours() : currentDate.getHours(),\n minutes = dateObject.minutes ? dateObject.value.getMinutes() : currentDate.getMinutes(),\n seconds = dateObject.seconds ? dateObject.value.getSeconds() : currentDate.getSeconds();\n dateObject.setValue(new Date(year, month, day, hours, minutes, seconds));\n this.refreshElementValue();\n this.triggerChange();\n }\n };\n return DateInput;\n }(Observable));\n\n var __meta__ = {\n id: \"dateinputcommon\",\n name: \"DateInputCommon\",\n category: \"web\",\n description: \"This is the common package for date editing accross all kendo flavours\",\n depends: [\"core\"]\n };\n\n (function($, undefined$1) {\n kendo.ui.DateInputCommon = DateInput;\n })(window.kendo.jQuery);\n var kendo$1 = kendo;\n\n return kendo$1;\n\n}));\n"]}