{"version":3,"sources":["node_modules/primeng/fesm2022/primeng-inputmask.mjs","src/app/shared/pipes/phone-mask.pipe.ts","node_modules/@maskito/core/index.esm.js","node_modules/@maskito/angular/fesm2022/maskito-angular.mjs"],"sourcesContent":["import * as i1 from '@angular/common';\nimport { isPlatformBrowser, CommonModule } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { Injectable, forwardRef, EventEmitter, inject, booleanAttribute, numberAttribute, ViewChild, ContentChildren, ContentChild, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { getUserAgent, isClient } from '@primeuix/utils';\nimport { SharedModule, PrimeTemplate } from 'primeng/api';\nimport { AutoFocus } from 'primeng/autofocus';\nimport { BaseComponent } from 'primeng/basecomponent';\nimport { TimesIcon } from 'primeng/icons';\nimport { InputText } from 'primeng/inputtext';\nimport { BaseStyle } from 'primeng/base';\nconst _c0 = [\"clearicon\"];\nconst _c1 = [\"input\"];\nfunction InputMask_ng_container_2_TimesIcon_1_Template(rf, ctx) {\n if (rf & 1) {\n const _r2 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"TimesIcon\", 5);\n i0.ɵɵlistener(\"click\", function InputMask_ng_container_2_TimesIcon_1_Template_TimesIcon_click_0_listener() {\n i0.ɵɵrestoreView(_r2);\n const ctx_r2 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r2.clear());\n });\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n i0.ɵɵproperty(\"styleClass\", \"p-inputmask-clear-icon\");\n i0.ɵɵattribute(\"data-pc-section\", \"clearIcon\");\n }\n}\nfunction InputMask_ng_container_2_span_2_1_ng_template_0_Template(rf, ctx) {}\nfunction InputMask_ng_container_2_span_2_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, InputMask_ng_container_2_span_2_1_ng_template_0_Template, 0, 0, \"ng-template\");\n }\n}\nfunction InputMask_ng_container_2_span_2_Template(rf, ctx) {\n if (rf & 1) {\n const _r4 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"span\", 6);\n i0.ɵɵlistener(\"click\", function InputMask_ng_container_2_span_2_Template_span_click_0_listener() {\n i0.ɵɵrestoreView(_r4);\n const ctx_r2 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r2.clear());\n });\n i0.ɵɵtemplate(1, InputMask_ng_container_2_span_2_1_Template, 1, 0, null, 7);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r2 = i0.ɵɵnextContext(2);\n i0.ɵɵattribute(\"data-pc-section\", \"clearIcon\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r2.clearIconTemplate || ctx_r2._clearIconTemplate);\n }\n}\nfunction InputMask_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, InputMask_ng_container_2_TimesIcon_1_Template, 1, 2, \"TimesIcon\", 3)(2, InputMask_ng_container_2_span_2_Template, 2, 2, \"span\", 4);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r2 = i0.ɵɵnextContext();\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx_r2.clearIconTemplate && !ctx_r2._clearIconTemplate);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx_r2.clearIconTemplate || ctx_r2._clearIconTemplate);\n }\n}\nconst theme = ({\n dt\n}) => `\np-inputmask {\n position: relative;\n}\n\n.p-inputmask-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n cursor: pointer;\n inset-inline-end: ${dt('form.field.padding.x')};\n color: ${dt('form.field.icon.color')};\n}\n\np-inputmask.ng-invalid.ng-dirty > .p-inputtext {\n border-color: ${dt('inputtext.invalid.border.color')};\n}\n\np-inputmask.ng-invalid.ng-dirty > .p-inputtext:enabled:focus {\n border-color: ${dt('inputtext.focus.border.color')};\n}\n\np-inputmask.ng-invalid.ng-dirty > .p-inputtext::placeholder {\n color: ${dt('inputtext.invalid.placeholder.color')};\n}\n`;\nconst classes = {\n root: ({\n instance\n }) => ({\n 'p-inputmask': true,\n 'p-filled': instance.variant ? instance.variant === 'filled' : instance.config.inputStyle() === 'filled'\n })\n};\nlet InputMaskStyle = /*#__PURE__*/(() => {\n class InputMaskStyle extends BaseStyle {\n name = 'inputmask';\n theme = theme;\n classes = classes;\n static ɵfac = /* @__PURE__ */(() => {\n let ɵInputMaskStyle_BaseFactory;\n return function InputMaskStyle_Factory(__ngFactoryType__) {\n return (ɵInputMaskStyle_BaseFactory || (ɵInputMaskStyle_BaseFactory = i0.ɵɵgetInheritedFactory(InputMaskStyle)))(__ngFactoryType__ || InputMaskStyle);\n };\n })();\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: InputMaskStyle,\n factory: InputMaskStyle.ɵfac\n });\n }\n return InputMaskStyle;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n *\n * InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.\n *\n * [Live Demo](https://www.primeng.org/inputmask/)\n *\n * @module inputmaskstyle\n *\n */\nvar InputMaskClasses = /*#__PURE__*/function (InputMaskClasses) {\n /**\n * Class name of the root element\n */\n InputMaskClasses[\"root\"] = \"p-inputmask\";\n return InputMaskClasses;\n}(InputMaskClasses || {});\n/*\n Port of jQuery MaskedInput by DigitalBush as a Native Angular2 Component in Typescript without jQuery\n https://github.com/digitalBush/jquery.maskedinput/\n\n Copyright (c) 2007-2014 Josh Bush (digitalbush.com)\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the \"Software\"), to deal in the Software without\n restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the\n Software is furnished to do so, subject to the following\n conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n*/\nconst INPUTMASK_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputMask),\n multi: true\n};\n/**\n * InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.\n * @group Components\n */\nlet InputMask = /*#__PURE__*/(() => {\n class InputMask extends BaseComponent {\n /**\n * HTML5 input type.\n * @group Props\n */\n type = 'text';\n /**\n * Placeholder character in mask, default is underscore.\n * @group Props\n */\n slotChar = '_';\n /**\n * Clears the incomplete value on blur.\n * @group Props\n */\n autoClear = true;\n /**\n * When enabled, a clear icon is displayed to clear the value.\n * @group Props\n */\n showClear = false;\n /**\n * Inline style of the input field.\n * @group Props\n */\n style;\n /**\n * Identifier of the focus input to match a label defined for the component.\n * @group Props\n */\n inputId;\n /**\n * Style class of the input field.\n * @group Props\n */\n styleClass;\n /**\n * Advisory information to display on input.\n * @group Props\n */\n placeholder;\n /**\n * Defines the size of the component.\n * @group Props\n */\n size;\n /**\n * Maximum number of character allows in the input field.\n * @group Props\n */\n maxlength;\n /**\n * Specifies tab order of the element.\n * @group Props\n */\n tabindex;\n /**\n * Title text of the input text.\n * @group Props\n */\n title;\n /**\n * Specifies the input variant of the component.\n * @group Props\n */\n variant;\n /**\n * Used to define a string that labels the input element.\n * @group Props\n */\n ariaLabel;\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @group Props\n */\n ariaLabelledBy;\n /**\n * Used to indicate that user input is required on an element before a form can be submitted.\n * @group Props\n */\n ariaRequired;\n /**\n * When present, it specifies that the element value cannot be altered.\n * @group Props\n */\n disabled;\n /**\n * When present, it specifies that an input field is read-only.\n * @group Props\n */\n readonly;\n /**\n * Defines if ngModel sets the raw unmasked value to bound value or the formatted mask value.\n * @group Props\n */\n unmask;\n /**\n * Name of the input field.\n * @group Props\n */\n name;\n /**\n * When present, it specifies that an input field must be filled out before submitting the form.\n * @group Props\n */\n required;\n /**\n * Regex pattern for alpha characters\n * @group Props\n */\n characterPattern = '[A-Za-z]';\n /**\n * When present, the input gets a focus automatically on load.\n * @group Props\n */\n autofocus;\n /**\n * When present, the input gets a focus automatically on load.\n * @group Props\n * @deprecated Use autofocus property instead.\n */\n set autoFocus(value) {\n this.autofocus = value;\n console.log('autoFocus is deprecated. Use autofocus property instead.');\n }\n /**\n * Used to define a string that autocomplete attribute the current element.\n * @group Props\n */\n autocomplete;\n /**\n * When present, it specifies that whether to clean buffer value from model.\n * @group Props\n */\n keepBuffer = false;\n /**\n * Mask pattern.\n * @group Props\n */\n get mask() {\n return this._mask;\n }\n set mask(val) {\n this._mask = val;\n this.initMask();\n this.writeValue('');\n this.onModelChange(this.value);\n }\n /**\n * Callback to invoke when the mask is completed.\n * @group Emits\n */\n onComplete = new EventEmitter();\n /**\n * Callback to invoke when the component receives focus.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n onFocus = new EventEmitter();\n /**\n * Callback to invoke when the component loses focus.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n onBlur = new EventEmitter();\n /**\n * Callback to invoke on input.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n onInput = new EventEmitter();\n /**\n * Callback to invoke on input key press.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n onKeydown = new EventEmitter();\n /**\n * Callback to invoke when input field is cleared.\n * @group Emits\n */\n onClear = new EventEmitter();\n /**\n * Template of the clear icon.\n * @group Templates\n */\n clearIconTemplate;\n templates;\n inputViewChild;\n value;\n _mask;\n onModelChange = () => {};\n onModelTouched = () => {};\n input;\n filled;\n defs;\n tests;\n partialPosition;\n firstNonMaskPos;\n lastRequiredNonMaskPos;\n len;\n oldVal;\n buffer;\n defaultBuffer;\n focusText;\n caretTimeoutId;\n androidChrome = true;\n focused;\n get inputClass() {\n return this._componentStyle.classes.root({\n instance: this\n });\n }\n _componentStyle = inject(InputMaskStyle);\n ngOnInit() {\n super.ngOnInit();\n if (isPlatformBrowser(this.platformId)) {\n let ua = navigator.userAgent;\n this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);\n }\n this.initMask();\n }\n _clearIconTemplate;\n ngAfterContentInit() {\n this.templates.forEach(item => {\n switch (item.getType()) {\n case 'clearicon':\n this._clearIconTemplate = item.template;\n break;\n }\n });\n }\n initMask() {\n this.tests = [];\n this.partialPosition = this.mask.length;\n this.len = this.mask.length;\n this.firstNonMaskPos = null;\n this.defs = {\n '9': '[0-9]',\n a: this.characterPattern,\n '*': `${this.characterPattern}|[0-9]`\n };\n let maskTokens = this.mask.split('');\n for (let i = 0; i < maskTokens.length; i++) {\n let c = maskTokens[i];\n if (c == '?') {\n this.len--;\n this.partialPosition = i;\n } else if (this.defs[c]) {\n this.tests.push(new RegExp(this.defs[c]));\n if (this.firstNonMaskPos === null) {\n this.firstNonMaskPos = this.tests.length - 1;\n }\n if (i < this.partialPosition) {\n this.lastRequiredNonMaskPos = this.tests.length - 1;\n }\n } else {\n this.tests.push(null);\n }\n }\n this.buffer = [];\n for (let i = 0; i < maskTokens.length; i++) {\n let c = maskTokens[i];\n if (c != '?') {\n if (this.defs[c]) this.buffer.push(this.getPlaceholder(i));else this.buffer.push(c);\n }\n }\n this.defaultBuffer = this.buffer.join('');\n }\n writeValue(value) {\n this.value = value;\n if (this.inputViewChild && this.inputViewChild.nativeElement) {\n if (this.value == undefined || this.value == null) this.inputViewChild.nativeElement.value = '';else this.inputViewChild.nativeElement.value = this.value;\n this.checkVal();\n this.focusText = this.inputViewChild.nativeElement.value;\n this.updateFilledState();\n }\n }\n registerOnChange(fn) {\n this.onModelChange = fn;\n }\n registerOnTouched(fn) {\n this.onModelTouched = fn;\n }\n setDisabledState(val) {\n this.disabled = val;\n this.cd.markForCheck();\n }\n caret(first, last) {\n let range, begin, end;\n if (!this.inputViewChild?.nativeElement.offsetParent || this.inputViewChild.nativeElement !== this.inputViewChild.nativeElement.ownerDocument.activeElement) {\n return;\n }\n if (typeof first == 'number') {\n begin = first;\n end = typeof last === 'number' ? last : begin;\n if (this.inputViewChild.nativeElement.setSelectionRange) {\n this.inputViewChild.nativeElement.setSelectionRange(begin, end);\n } else if (this.inputViewChild.nativeElement['createTextRange']) {\n range = this.inputViewChild.nativeElement['createTextRange']();\n range.collapse(true);\n range.moveEnd('character', end);\n range.moveStart('character', begin);\n range.select();\n }\n } else {\n if (this.inputViewChild.nativeElement.setSelectionRange) {\n begin = this.inputViewChild.nativeElement.selectionStart;\n end = this.inputViewChild.nativeElement.selectionEnd;\n } else if (this.document && this.document['selection'].createRange) {\n range = this.document.createRange();\n begin = 0 - range.duplicate().moveStart('character', -100000);\n end = begin + range.text.length;\n }\n return {\n begin: begin,\n end: end\n };\n }\n }\n isCompleted() {\n let completed;\n for (let i = this.firstNonMaskPos; i <= this.lastRequiredNonMaskPos; i++) {\n if (this.tests[i] && this.buffer[i] === this.getPlaceholder(i)) {\n return false;\n }\n }\n return true;\n }\n getPlaceholder(i) {\n if (i < this.slotChar.length) {\n return this.slotChar.charAt(i);\n }\n return this.slotChar.charAt(0);\n }\n seekNext(pos) {\n while (++pos < this.len && !this.tests[pos]);\n return pos;\n }\n seekPrev(pos) {\n while (--pos >= 0 && !this.tests[pos]);\n return pos;\n }\n shiftL(begin, end) {\n let i, j;\n if (begin < 0) {\n return;\n }\n for (i = begin, j = this.seekNext(end); i < this.len; i++) {\n if (this.tests[i]) {\n if (j < this.len && this.tests[i].test(this.buffer[j])) {\n this.buffer[i] = this.buffer[j];\n this.buffer[j] = this.getPlaceholder(j);\n } else {\n break;\n }\n j = this.seekNext(j);\n }\n }\n this.writeBuffer();\n this.caret(Math.max(this.firstNonMaskPos, begin));\n }\n shiftR(pos) {\n let i, c, j, t;\n for (i = pos, c = this.getPlaceholder(pos); i < this.len; i++) {\n if (this.tests[i]) {\n j = this.seekNext(i);\n t = this.buffer[i];\n this.buffer[i] = c;\n if (j < this.len && this.tests[j].test(t)) {\n c = t;\n } else {\n break;\n }\n }\n }\n }\n handleAndroidInput(e) {\n var curVal = this.inputViewChild?.nativeElement.value;\n var pos = this.caret();\n if (this.oldVal && this.oldVal.length && this.oldVal.length > curVal.length) {\n // a deletion or backspace happened\n this.checkVal(true);\n while (pos.begin > 0 && !this.tests[pos.begin - 1]) pos.begin--;\n if (pos.begin === 0) {\n while (pos.begin < this.firstNonMaskPos && !this.tests[pos.begin]) pos.begin++;\n }\n setTimeout(() => {\n this.caret(pos.begin, pos.begin);\n this.updateModel(e);\n if (this.isCompleted()) {\n this.onComplete.emit();\n }\n }, 0);\n } else {\n this.checkVal(true);\n while (pos.begin < this.len && !this.tests[pos.begin]) pos.begin++;\n setTimeout(() => {\n this.caret(pos.begin, pos.begin);\n this.updateModel(e);\n if (this.isCompleted()) {\n this.onComplete.emit();\n }\n }, 0);\n }\n }\n onInputBlur(e) {\n this.focused = false;\n this.onModelTouched();\n if (!this.keepBuffer) {\n this.checkVal();\n }\n this.updateFilledState();\n this.onBlur.emit(e);\n if (this.inputViewChild?.nativeElement.value != this.focusText || this.inputViewChild?.nativeElement.value != this.value) {\n this.updateModel(e);\n let event = this.document.createEvent('HTMLEvents');\n event.initEvent('change', true, false);\n this.inputViewChild?.nativeElement.dispatchEvent(event);\n }\n }\n onInputKeydown(e) {\n if (this.readonly) {\n return;\n }\n let k = e.which || e.keyCode,\n pos,\n begin,\n end;\n let iPhone;\n if (isPlatformBrowser(this.platformId)) {\n iPhone = /iphone/i.test(getUserAgent());\n }\n this.oldVal = this.inputViewChild?.nativeElement.value;\n this.onKeydown.emit(e);\n //backspace, delete, and escape get special treatment\n if (k === 8 || k === 46 || iPhone && k === 127) {\n pos = this.caret();\n begin = pos.begin;\n end = pos.end;\n if (end - begin === 0) {\n begin = k !== 46 ? this.seekPrev(begin) : end = this.seekNext(begin - 1);\n end = k === 46 ? this.seekNext(end) : end;\n }\n this.clearBuffer(begin, end);\n if (this.keepBuffer) {\n this.shiftL(begin, end - 2);\n } else {\n this.shiftL(begin, end - 1);\n }\n this.updateModel(e);\n this.onInput.emit(e);\n e.preventDefault();\n } else if (k === 13) {\n // enter\n this.onInputBlur(e);\n this.updateModel(e);\n } else if (k === 27) {\n // escape\n this.inputViewChild.nativeElement.value = this.focusText;\n this.caret(0, this.checkVal());\n this.updateModel(e);\n e.preventDefault();\n }\n }\n onKeyPress(e) {\n if (this.readonly) {\n return;\n }\n var k = e.which || e.keyCode,\n pos = this.caret(),\n p,\n c,\n next,\n completed;\n if (e.ctrlKey || e.altKey || e.metaKey || k < 32 || k > 34 && k < 41) {\n //Ignore\n return;\n } else if (k && k !== 13) {\n if (pos.end - pos.begin !== 0) {\n this.clearBuffer(pos.begin, pos.end);\n this.shiftL(pos.begin, pos.end - 1);\n }\n p = this.seekNext(pos.begin - 1);\n if (p < this.len) {\n c = String.fromCharCode(k);\n if (this.tests[p].test(c)) {\n this.shiftR(p);\n this.buffer[p] = c;\n this.writeBuffer();\n next = this.seekNext(p);\n if (isClient() && /android/i.test(getUserAgent())) {\n let proxy = () => {\n this.caret(next);\n };\n setTimeout(proxy, 0);\n } else {\n this.caret(next);\n }\n if (pos.begin <= this.lastRequiredNonMaskPos) {\n completed = this.isCompleted();\n }\n this.onInput.emit(e);\n }\n }\n e.preventDefault();\n }\n this.updateModel(e);\n this.updateFilledState();\n if (completed) {\n this.onComplete.emit();\n }\n }\n clearBuffer(start, end) {\n if (!this.keepBuffer) {\n let i;\n for (i = start; i < end && i < this.len; i++) {\n if (this.tests[i]) {\n this.buffer[i] = this.getPlaceholder(i);\n }\n }\n }\n }\n writeBuffer() {\n this.inputViewChild.nativeElement.value = this.buffer.join('');\n }\n checkVal(allow) {\n //try to place characters where they belong\n let test = this.inputViewChild?.nativeElement.value,\n lastMatch = -1,\n i,\n c,\n pos;\n for (i = 0, pos = 0; i < this.len; i++) {\n if (this.tests[i]) {\n this.buffer[i] = this.getPlaceholder(i);\n while (pos++ < test.length) {\n c = test.charAt(pos - 1);\n if (this.tests[i].test(c)) {\n if (!this.keepBuffer) {\n this.buffer[i] = c;\n }\n lastMatch = i;\n break;\n }\n }\n if (pos > test.length) {\n this.clearBuffer(i + 1, this.len);\n break;\n }\n } else {\n if (this.buffer[i] === test.charAt(pos)) {\n pos++;\n }\n if (i < this.partialPosition) {\n lastMatch = i;\n }\n }\n }\n if (allow) {\n this.writeBuffer();\n } else if (lastMatch + 1 < this.partialPosition) {\n if (this.autoClear || this.buffer.join('') === this.defaultBuffer) {\n // Invalid value. Remove it and replace it with the\n // mask, which is the default behavior.\n if (this.inputViewChild?.nativeElement.value) this.inputViewChild.nativeElement.value = '';\n this.clearBuffer(0, this.len);\n } else {\n // Invalid value, but we opt to show the value to the\n // user and allow them to correct their mistake.\n this.writeBuffer();\n }\n } else {\n this.writeBuffer();\n this.inputViewChild.nativeElement.value = this.inputViewChild?.nativeElement.value.substring(0, lastMatch + 1);\n }\n return this.partialPosition ? i : this.firstNonMaskPos;\n }\n onInputFocus(event) {\n if (this.readonly) {\n return;\n }\n this.focused = true;\n clearTimeout(this.caretTimeoutId);\n let pos;\n this.focusText = this.inputViewChild?.nativeElement.value;\n pos = this.keepBuffer ? this.inputViewChild?.nativeElement.value.length : this.checkVal();\n this.caretTimeoutId = setTimeout(() => {\n if (this.inputViewChild?.nativeElement !== this.inputViewChild?.nativeElement.ownerDocument.activeElement) {\n return;\n }\n this.writeBuffer();\n if (pos == this.mask?.replace('?', '').length) {\n this.caret(0, pos);\n } else {\n this.caret(pos);\n }\n }, 10);\n this.onFocus.emit(event);\n }\n onInputChange(event) {\n if (this.androidChrome) this.handleAndroidInput(event);else this.handleInputChange(event);\n this.onInput.emit(event);\n }\n handleInputChange(event) {\n if (this.readonly) {\n return;\n }\n setTimeout(() => {\n var pos = this.checkVal(true);\n this.caret(pos);\n this.updateModel(event);\n if (this.isCompleted()) {\n this.onComplete.emit();\n }\n }, 0);\n }\n getUnmaskedValue() {\n let unmaskedBuffer = [];\n for (let i = 0; i < this.buffer.length; i++) {\n let c = this.buffer[i];\n if (this.tests[i] && c != this.getPlaceholder(i)) {\n unmaskedBuffer.push(c);\n }\n }\n return unmaskedBuffer.join('');\n }\n updateModel(e) {\n const updatedValue = this.unmask ? this.getUnmaskedValue() : e.target.value;\n if (updatedValue !== null || updatedValue !== undefined) {\n this.value = updatedValue;\n this.onModelChange(this.value);\n }\n }\n updateFilledState() {\n this.filled = this.inputViewChild?.nativeElement && this.inputViewChild.nativeElement.value != '';\n }\n focus() {\n this.inputViewChild?.nativeElement.focus();\n }\n clear() {\n this.inputViewChild.nativeElement.value = '';\n this.value = null;\n this.onModelChange(this.value);\n this.onClear.emit();\n }\n static ɵfac = /* @__PURE__ */(() => {\n let ɵInputMask_BaseFactory;\n return function InputMask_Factory(__ngFactoryType__) {\n return (ɵInputMask_BaseFactory || (ɵInputMask_BaseFactory = i0.ɵɵgetInheritedFactory(InputMask)))(__ngFactoryType__ || InputMask);\n };\n })();\n static ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: InputMask,\n selectors: [[\"p-inputmask\"], [\"p-inputMask\"], [\"p-input-mask\"]],\n contentQueries: function InputMask_ContentQueries(rf, ctx, dirIndex) {\n if (rf & 1) {\n i0.ɵɵcontentQuery(dirIndex, _c0, 4);\n i0.ɵɵcontentQuery(dirIndex, PrimeTemplate, 4);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.clearIconTemplate = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templates = _t);\n }\n },\n viewQuery: function InputMask_Query(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵviewQuery(_c1, 7);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputViewChild = _t.first);\n }\n },\n inputs: {\n type: \"type\",\n slotChar: \"slotChar\",\n autoClear: [2, \"autoClear\", \"autoClear\", booleanAttribute],\n showClear: [2, \"showClear\", \"showClear\", booleanAttribute],\n style: \"style\",\n inputId: \"inputId\",\n styleClass: \"styleClass\",\n placeholder: \"placeholder\",\n size: \"size\",\n maxlength: [2, \"maxlength\", \"maxlength\", numberAttribute],\n tabindex: \"tabindex\",\n title: \"title\",\n variant: \"variant\",\n ariaLabel: \"ariaLabel\",\n ariaLabelledBy: \"ariaLabelledBy\",\n ariaRequired: [2, \"ariaRequired\", \"ariaRequired\", booleanAttribute],\n disabled: [2, \"disabled\", \"disabled\", booleanAttribute],\n readonly: [2, \"readonly\", \"readonly\", booleanAttribute],\n unmask: [2, \"unmask\", \"unmask\", booleanAttribute],\n name: \"name\",\n required: [2, \"required\", \"required\", booleanAttribute],\n characterPattern: \"characterPattern\",\n autofocus: [2, \"autofocus\", \"autofocus\", booleanAttribute],\n autoFocus: [2, \"autoFocus\", \"autoFocus\", booleanAttribute],\n autocomplete: \"autocomplete\",\n keepBuffer: [2, \"keepBuffer\", \"keepBuffer\", booleanAttribute],\n mask: \"mask\"\n },\n outputs: {\n onComplete: \"onComplete\",\n onFocus: \"onFocus\",\n onBlur: \"onBlur\",\n onInput: \"onInput\",\n onKeydown: \"onKeydown\",\n onClear: \"onClear\"\n },\n features: [i0.ɵɵProvidersFeature([INPUTMASK_VALUE_ACCESSOR, InputMaskStyle]), i0.ɵɵInputTransformsFeature, i0.ɵɵInheritDefinitionFeature],\n decls: 3,\n vars: 24,\n consts: [[\"input\", \"\"], [\"pInputText\", \"\", 3, \"focus\", \"blur\", \"keydown\", \"keypress\", \"input\", \"paste\", \"ngClass\", \"ngStyle\", \"pSize\", \"disabled\", \"readonly\", \"variant\", \"pAutoFocus\"], [4, \"ngIf\"], [3, \"styleClass\", \"click\", 4, \"ngIf\"], [\"class\", \"p-inputmask-clear-icon\", 3, \"click\", 4, \"ngIf\"], [3, \"click\", \"styleClass\"], [1, \"p-inputmask-clear-icon\", 3, \"click\"], [4, \"ngTemplateOutlet\"]],\n template: function InputMask_Template(rf, ctx) {\n if (rf & 1) {\n const _r1 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"input\", 1, 0);\n i0.ɵɵlistener(\"focus\", function InputMask_Template_input_focus_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.onInputFocus($event));\n })(\"blur\", function InputMask_Template_input_blur_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.onInputBlur($event));\n })(\"keydown\", function InputMask_Template_input_keydown_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.onInputKeydown($event));\n })(\"keypress\", function InputMask_Template_input_keypress_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.onKeyPress($event));\n })(\"input\", function InputMask_Template_input_input_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.onInputChange($event));\n })(\"paste\", function InputMask_Template_input_paste_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.handleInputChange($event));\n });\n i0.ɵɵelementEnd();\n i0.ɵɵtemplate(2, InputMask_ng_container_2_Template, 3, 2, \"ng-container\", 2);\n }\n if (rf & 2) {\n i0.ɵɵclassMap(ctx.styleClass);\n i0.ɵɵproperty(\"ngClass\", ctx.inputClass)(\"ngStyle\", ctx.style)(\"pSize\", ctx.size)(\"disabled\", ctx.disabled)(\"readonly\", ctx.readonly)(\"variant\", ctx.variant)(\"pAutoFocus\", ctx.autofocus);\n i0.ɵɵattribute(\"id\", ctx.inputId)(\"type\", ctx.type)(\"name\", ctx.name)(\"placeholder\", ctx.placeholder)(\"title\", ctx.title)(\"autocomplete\", ctx.autocomplete)(\"maxlength\", ctx.maxlength)(\"tabindex\", ctx.tabindex)(\"aria-label\", ctx.ariaLabel)(\"aria-labelledBy\", ctx.ariaLabelledBy)(\"aria-required\", ctx.ariaRequired)(\"required\", ctx.required)(\"data-pc-name\", \"inputmask\")(\"data-pc-section\", \"root\");\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", ctx.value != null && ctx.filled && ctx.showClear && !ctx.disabled);\n }\n },\n dependencies: [CommonModule, i1.NgClass, i1.NgIf, i1.NgTemplateOutlet, i1.NgStyle, InputText, AutoFocus, TimesIcon, SharedModule],\n encapsulation: 2,\n changeDetection: 0\n });\n }\n return InputMask;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet InputMaskModule = /*#__PURE__*/(() => {\n class InputMaskModule {\n static ɵfac = function InputMaskModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || InputMaskModule)();\n };\n static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: InputMaskModule\n });\n static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n imports: [InputMask, SharedModule, SharedModule]\n });\n }\n return InputMaskModule;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { INPUTMASK_VALUE_ACCESSOR, InputMask, InputMaskClasses, InputMaskModule, InputMaskStyle };\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { MaskitoOptions } from '@maskito/core';\n\n@Pipe({\n name: 'phoneMask',\n standalone: true,\n})\nexport class PhoneMaskPipe implements PipeTransform {\n transform(pattern: string): MaskitoOptions {\n if (!pattern) return this.getDefaultConfig();\n\n const prefixMatch = pattern.match(/\\\\\\+(\\d+)|(\\d+)/);\n if (!prefixMatch) return this.getDefaultConfig();\n\n const prefix = prefixMatch[1] || prefixMatch[2];\n\n return {\n mask: ['+', ...prefix.split(''), ' ', /\\d/, /\\d/, /\\d/, ' ', /\\d/, /\\d/, /\\d/, ' ', /\\d/, /\\d/, /\\d/, /\\d/],\n preprocessors: [\n ({ data, elementState }) => ({\n elementState,\n data: data.replace(/\\D/g, ''),\n }),\n ],\n postprocessors: [\n elementState => ({\n ...elementState,\n value: elementState.value.startsWith(`+${prefix}`) ? elementState.value : `+${prefix}` + elementState.value.slice(prefix.length),\n }),\n ],\n };\n }\n\n private getDefaultConfig(): MaskitoOptions {\n return {\n mask: [],\n preprocessors: [],\n postprocessors: [],\n };\n }\n}\n","function getContentEditableSelection(element) {\n const {\n anchorOffset = 0,\n focusOffset = 0\n } = element.ownerDocument.getSelection() || {};\n const from = Math.min(anchorOffset, focusOffset);\n const to = Math.max(anchorOffset, focusOffset);\n return [from, to];\n}\nfunction setContentEditableSelection(element, [from, to]) {\n var _a, _b, _c, _d;\n const document = element.ownerDocument;\n const range = document.createRange();\n range.setStart(element.firstChild || element, Math.min(from, (_b = (_a = element.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0));\n range.setEnd(element.lastChild || element, Math.min(to, (_d = (_c = element.textContent) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0));\n const selection = document.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\nclass ContentEditableAdapter {\n constructor(element) {\n this.element = element;\n this.maxLength = Infinity;\n }\n get value() {\n return this.element.innerText.replace(/\\n\\n$/, '\\n');\n }\n set value(value) {\n // Setting into innerHTML of element with `white-space: pre;` style\n this.element.innerHTML = value.replace(/\\n$/, '\\n\\n');\n }\n get selectionStart() {\n return getContentEditableSelection(this.element)[0];\n }\n get selectionEnd() {\n return getContentEditableSelection(this.element)[1];\n }\n setSelectionRange(from, to) {\n setContentEditableSelection(this.element, [from !== null && from !== void 0 ? from : 0, to !== null && to !== void 0 ? to : 0]);\n }\n select() {\n this.setSelectionRange(0, this.value.length);\n }\n}\nfunction maskitoAdaptContentEditable(element) {\n const adapter = new ContentEditableAdapter(element);\n return new Proxy(element, {\n get(target, prop) {\n if (prop in adapter) {\n return adapter[prop];\n }\n const nativeProperty = target[prop];\n return typeof nativeProperty === 'function' ? nativeProperty.bind(target) : nativeProperty;\n },\n // eslint-disable-next-line @typescript-eslint/max-params\n set(target, prop, val, receiver) {\n return Reflect.set(prop in adapter ? adapter : target, prop, val, receiver);\n }\n });\n}\nconst MASKITO_DEFAULT_ELEMENT_PREDICATE = e => e.isContentEditable ? maskitoAdaptContentEditable(e) : e.querySelector('input,textarea') || e;\nconst MASKITO_DEFAULT_OPTIONS = {\n mask: /^.*$/,\n preprocessors: [],\n postprocessors: [],\n plugins: [],\n overwriteMode: 'shift'\n};\nclass MaskHistory {\n constructor() {\n this.now = null;\n this.past = [];\n this.future = [];\n }\n undo() {\n const state = this.past.pop();\n if (state && this.now) {\n this.future.push(this.now);\n this.updateElement(state, 'historyUndo');\n }\n }\n redo() {\n const state = this.future.pop();\n if (state && this.now) {\n this.past.push(this.now);\n this.updateElement(state, 'historyRedo');\n }\n }\n updateHistory(state) {\n if (!this.now) {\n this.now = state;\n return;\n }\n const isValueChanged = this.now.value !== state.value;\n const isSelectionChanged = this.now.selection.some((item, index) => item !== state.selection[index]);\n if (!isValueChanged && !isSelectionChanged) {\n return;\n }\n if (isValueChanged) {\n this.past.push(this.now);\n this.future = [];\n }\n this.now = state;\n }\n updateElement(state, inputType) {\n this.now = state;\n this.updateElementState(state, {\n inputType,\n data: null\n });\n }\n}\nfunction areElementValuesEqual(sampleState, ...states) {\n return states.every(({\n value\n }) => value === sampleState.value);\n}\nfunction areElementStatesEqual(sampleState, ...states) {\n return states.every(({\n value,\n selection\n }) => value === sampleState.value && selection[0] === sampleState.selection[0] && selection[1] === sampleState.selection[1]);\n}\nfunction applyOverwriteMode({\n value,\n selection\n}, newCharacters, mode) {\n const [from, to] = selection;\n const computedMode = typeof mode === 'function' ? mode({\n value,\n selection\n }) : mode;\n return {\n value,\n selection: computedMode === 'replace' ? [from, Math.max(from + newCharacters.length, to)] : [from, to]\n };\n}\nfunction isFixedCharacter(char) {\n return typeof char === 'string';\n}\n\n// eslint-disable-next-line @typescript-eslint/max-params\nfunction getLeadingFixedCharacters(mask, validatedValuePart, newCharacter, initialElementState) {\n let leadingFixedCharacters = '';\n for (let i = validatedValuePart.length; i < mask.length; i++) {\n const charConstraint = mask[i] || '';\n const isInitiallyExisted = (initialElementState === null || initialElementState === void 0 ? void 0 : initialElementState.value[i]) === charConstraint;\n if (!isFixedCharacter(charConstraint) || charConstraint === newCharacter && !isInitiallyExisted) {\n return leadingFixedCharacters;\n }\n leadingFixedCharacters += charConstraint;\n }\n return leadingFixedCharacters;\n}\nfunction validateValueWithMask(value, maskExpression) {\n if (Array.isArray(maskExpression)) {\n return value.length === maskExpression.length && Array.from(value).every((char, i) => {\n const charConstraint = maskExpression[i] || '';\n return isFixedCharacter(charConstraint) ? char === charConstraint : char.match(charConstraint);\n });\n }\n return maskExpression.test(value);\n}\nfunction guessValidValueByPattern(elementState, mask, initialElementState) {\n let maskedFrom = null;\n let maskedTo = null;\n const maskedValue = Array.from(elementState.value).reduce((validatedCharacters, char, charIndex) => {\n const leadingCharacters = getLeadingFixedCharacters(mask, validatedCharacters, char, initialElementState);\n const newValidatedChars = validatedCharacters + leadingCharacters;\n const charConstraint = mask[newValidatedChars.length] || '';\n if (maskedFrom === null && charIndex >= elementState.selection[0]) {\n maskedFrom = newValidatedChars.length;\n }\n if (maskedTo === null && charIndex >= elementState.selection[1]) {\n maskedTo = newValidatedChars.length;\n }\n if (isFixedCharacter(charConstraint)) {\n return newValidatedChars + charConstraint;\n }\n return char.match(charConstraint) ? newValidatedChars + char : newValidatedChars;\n }, '');\n const trailingFixedCharacters = getLeadingFixedCharacters(mask, maskedValue, '', initialElementState);\n return {\n value: validateValueWithMask(maskedValue + trailingFixedCharacters, mask) ? maskedValue + trailingFixedCharacters : maskedValue,\n selection: [maskedFrom !== null && maskedFrom !== void 0 ? maskedFrom : maskedValue.length, maskedTo !== null && maskedTo !== void 0 ? maskedTo : maskedValue.length]\n };\n}\nfunction guessValidValueByRegExp({\n value,\n selection\n}, maskRegExp) {\n const [from, to] = selection;\n let newFrom = from;\n let newTo = to;\n const validatedValue = Array.from(value).reduce((validatedValuePart, char, i) => {\n const newPossibleValue = validatedValuePart + char;\n if (from === i) {\n newFrom = validatedValuePart.length;\n }\n if (to === i) {\n newTo = validatedValuePart.length;\n }\n return newPossibleValue.match(maskRegExp) ? newPossibleValue : validatedValuePart;\n }, '');\n return {\n value: validatedValue,\n selection: [Math.min(newFrom, validatedValue.length), Math.min(newTo, validatedValue.length)]\n };\n}\nfunction calibrateValueByMask(elementState, mask, initialElementState = null) {\n if (validateValueWithMask(elementState.value, mask)) {\n return elementState;\n }\n const {\n value,\n selection\n } = Array.isArray(mask) ? guessValidValueByPattern(elementState, mask, initialElementState) : guessValidValueByRegExp(elementState, mask);\n return {\n selection,\n value: Array.isArray(mask) ? value.slice(0, mask.length) : value\n };\n}\nfunction removeFixedMaskCharacters(initialElementState, mask) {\n if (!Array.isArray(mask)) {\n return initialElementState;\n }\n const [from, to] = initialElementState.selection;\n const selection = [];\n const unmaskedValue = Array.from(initialElementState.value).reduce((rawValue, char, i) => {\n const charConstraint = mask[i] || '';\n if (i === from) {\n selection.push(rawValue.length);\n }\n if (i === to) {\n selection.push(rawValue.length);\n }\n return isFixedCharacter(charConstraint) && charConstraint === char ? rawValue : rawValue + char;\n }, '');\n if (selection.length < 2) {\n selection.push(...new Array(2 - selection.length).fill(unmaskedValue.length));\n }\n return {\n value: unmaskedValue,\n selection: [selection[0], selection[1]]\n };\n}\nclass MaskModel {\n constructor(initialElementState, maskOptions) {\n this.initialElementState = initialElementState;\n this.maskOptions = maskOptions;\n this.value = '';\n this.selection = [0, 0];\n const {\n value,\n selection\n } = calibrateValueByMask(this.initialElementState, this.getMaskExpression(this.initialElementState));\n this.value = value;\n this.selection = selection;\n }\n addCharacters([from, to], newCharacters) {\n const {\n value,\n maskOptions\n } = this;\n const maskExpression = this.getMaskExpression({\n value: value.slice(0, from) + newCharacters + value.slice(to),\n selection: [from + newCharacters.length, from + newCharacters.length]\n });\n const initialElementState = {\n value,\n selection: [from, to]\n };\n const unmaskedElementState = removeFixedMaskCharacters(initialElementState, maskExpression);\n const [unmaskedFrom, unmaskedTo] = applyOverwriteMode(unmaskedElementState, newCharacters, maskOptions.overwriteMode).selection;\n const newUnmaskedLeadingValuePart = unmaskedElementState.value.slice(0, unmaskedFrom) + newCharacters;\n const newCaretIndex = newUnmaskedLeadingValuePart.length;\n const maskedElementState = calibrateValueByMask({\n value: newUnmaskedLeadingValuePart + unmaskedElementState.value.slice(unmaskedTo),\n selection: [newCaretIndex, newCaretIndex]\n }, maskExpression, initialElementState);\n const isInvalidCharsInsertion = value.slice(0, from) === calibrateValueByMask({\n value: newUnmaskedLeadingValuePart,\n selection: [newCaretIndex, newCaretIndex]\n }, maskExpression, initialElementState).value;\n if (isInvalidCharsInsertion || areElementStatesEqual(this, maskedElementState) // If typing new characters does not change value\n ) {\n throw new Error('Invalid mask value');\n }\n this.value = maskedElementState.value;\n this.selection = maskedElementState.selection;\n }\n deleteCharacters([from, to]) {\n if (from === to || !to) {\n return;\n }\n const {\n value\n } = this;\n const maskExpression = this.getMaskExpression({\n value: value.slice(0, from) + value.slice(to),\n selection: [from, from]\n });\n const initialElementState = {\n value,\n selection: [from, to]\n };\n const unmaskedElementState = removeFixedMaskCharacters(initialElementState, maskExpression);\n const [unmaskedFrom, unmaskedTo] = unmaskedElementState.selection;\n const newUnmaskedValue = unmaskedElementState.value.slice(0, unmaskedFrom) + unmaskedElementState.value.slice(unmaskedTo);\n const maskedElementState = calibrateValueByMask({\n value: newUnmaskedValue,\n selection: [unmaskedFrom, unmaskedFrom]\n }, maskExpression, initialElementState);\n this.value = maskedElementState.value;\n this.selection = maskedElementState.selection;\n }\n getMaskExpression(elementState) {\n const {\n mask\n } = this.maskOptions;\n return typeof mask === 'function' ? mask(elementState) : mask;\n }\n}\nclass EventListener {\n constructor(element) {\n this.element = element;\n this.listeners = [];\n }\n listen(eventType, fn, options) {\n const untypedFn = fn;\n this.element.addEventListener(eventType, untypedFn, options);\n this.listeners.push(() => this.element.removeEventListener(eventType, untypedFn, options));\n }\n destroy() {\n this.listeners.forEach(stopListen => stopListen());\n }\n}\nconst HotkeyModifier = {\n CTRL: 1 << 0,\n ALT: 1 << 1,\n SHIFT: 1 << 2,\n META: 1 << 3\n};\n// TODO add variants that can be processed correctly\nconst HotkeyCode = {\n Y: 89,\n Z: 90\n};\n/**\n * Checks if the passed keyboard event match the required hotkey.\n *\n * @example\n * input.addEventListener('keydown', (event) => {\n * if (isHotkey(event, HotkeyModifier.CTRL | HotkeyModifier.SHIFT, HotkeyCode.Z)) {\n * // redo hotkey pressed\n * }\n * })\n *\n * @return will return `true` only if the {@link HotkeyCode} matches and only the necessary\n * {@link HotkeyModifier modifiers} have been pressed\n */\nfunction isHotkey(event, modifiers, hotkeyCode) {\n return event.ctrlKey === !!(modifiers & HotkeyModifier.CTRL) && event.altKey === !!(modifiers & HotkeyModifier.ALT) && event.shiftKey === !!(modifiers & HotkeyModifier.SHIFT) && event.metaKey === !!(modifiers & HotkeyModifier.META) &&\n /**\n * We intentionally use legacy {@link KeyboardEvent#keyCode `keyCode`} property. It is more\n * \"keyboard-layout\"-independent than {@link KeyboardEvent#key `key`} or {@link KeyboardEvent#code `code`} properties.\n * @see {@link https://github.com/taiga-family/maskito/issues/315 `KeyboardEvent#code` issue}\n */\n event.keyCode === hotkeyCode;\n}\nfunction isRedo(event) {\n return isHotkey(event, HotkeyModifier.CTRL, HotkeyCode.Y) ||\n // Windows\n isHotkey(event, HotkeyModifier.CTRL | HotkeyModifier.SHIFT, HotkeyCode.Z) ||\n // Windows & Android\n isHotkey(event, HotkeyModifier.META | HotkeyModifier.SHIFT, HotkeyCode.Z) // macOS & iOS\n ;\n}\nfunction isUndo(event) {\n return isHotkey(event, HotkeyModifier.CTRL, HotkeyCode.Z) ||\n // Windows & Android\n isHotkey(event, HotkeyModifier.META, HotkeyCode.Z) // macOS & iOS\n ;\n}\n\n/**\n * Sets value to element, and dispatches input event\n * if you passed ELementState, it also sets selection range\n *\n * @example\n * maskitoUpdateElement(input, newValue);\n * maskitoUpdateElement(input, elementState);\n *\n * @see {@link https://github.com/taiga-family/maskito/issues/804 issue}\n *\n * @return void\n */\nfunction maskitoUpdateElement(element, valueOrElementState) {\n var _a;\n const initialValue = element.value;\n if (typeof valueOrElementState === 'string') {\n element.value = valueOrElementState;\n } else {\n const [from, to] = valueOrElementState.selection;\n element.value = valueOrElementState.value;\n if (element.matches(':focus')) {\n (_a = element.setSelectionRange) === null || _a === void 0 ? void 0 : _a.call(element, from, to);\n }\n }\n if (element.value !== initialValue) {\n element.dispatchEvent(new Event('input',\n /**\n * React handles this event only on bubbling phase\n *\n * here is the list of events that are processed in the capture stage, others are processed in the bubbling stage\n * https://github.com/facebook/react/blob/cb2439624f43c510007f65aea5c50a8bb97917e4/packages/react-dom-bindings/src/events/DOMPluginEventSystem.js#L222\n */\n {\n bubbles: true\n }));\n }\n}\nfunction getLineSelection({\n value,\n selection\n}, isForward) {\n const [from, to] = selection;\n if (from !== to) {\n return [from, to];\n }\n const nearestBreak = isForward ? value.slice(from).indexOf('\\n') + 1 || value.length : value.slice(0, to).lastIndexOf('\\n') + 1;\n const selectFrom = isForward ? from : nearestBreak;\n const selectTo = isForward ? nearestBreak : to;\n return [selectFrom, selectTo];\n}\nfunction getNotEmptySelection({\n value,\n selection\n}, isForward) {\n const [from, to] = selection;\n if (from !== to) {\n return [from, to];\n }\n const notEmptySelection = isForward ? [from, to + 1] : [from - 1, to];\n return notEmptySelection.map(x => Math.min(Math.max(x, 0), value.length));\n}\nconst TRAILING_SPACES_REG = /\\s+$/g;\nconst LEADING_SPACES_REG = /^\\s+/g;\nconst SPACE_REG = /\\s/;\nfunction getWordSelection({\n value,\n selection\n}, isForward) {\n const [from, to] = selection;\n if (from !== to) {\n return [from, to];\n }\n if (isForward) {\n const valueAfterSelectionStart = value.slice(from);\n const [leadingSpaces] = valueAfterSelectionStart.match(LEADING_SPACES_REG) || [''];\n const nearestWordEndIndex = valueAfterSelectionStart.trimStart().search(SPACE_REG);\n return [from, nearestWordEndIndex !== -1 ? from + leadingSpaces.length + nearestWordEndIndex : value.length];\n }\n const valueBeforeSelectionEnd = value.slice(0, to);\n const [trailingSpaces] = valueBeforeSelectionEnd.match(TRAILING_SPACES_REG) || [''];\n const selectedWordLength = valueBeforeSelectionEnd.trimEnd().split('').reverse().findIndex(char => SPACE_REG.exec(char));\n return [selectedWordLength !== -1 ? to - trailingSpaces.length - selectedWordLength : 0, to];\n}\n\n/* eslint-disable @typescript-eslint/no-restricted-types */\n/**\n * @internal\n */\nfunction maskitoPipe(processors = []) {\n return (initialData, ...readonlyArgs) => processors.reduce((data, fn) => Object.assign(Object.assign({}, data), fn(data, ...readonlyArgs)), initialData);\n}\nfunction maskitoTransform(valueOrState, maskitoOptions) {\n const options = Object.assign(Object.assign({}, MASKITO_DEFAULT_OPTIONS), maskitoOptions);\n const preprocessor = maskitoPipe(options.preprocessors);\n const postprocessor = maskitoPipe(options.postprocessors);\n const initialElementState = typeof valueOrState === 'string' ? {\n value: valueOrState,\n selection: [0, 0]\n } : valueOrState;\n const {\n elementState\n } = preprocessor({\n elementState: initialElementState,\n data: ''\n }, 'validation');\n const maskModel = new MaskModel(elementState, options);\n const {\n value,\n selection\n } = postprocessor(maskModel, initialElementState);\n return typeof valueOrState === 'string' ? value : {\n value,\n selection\n };\n}\nclass Maskito extends MaskHistory {\n constructor(element, maskitoOptions) {\n super();\n this.element = element;\n this.maskitoOptions = maskitoOptions;\n this.isTextArea = this.element.nodeName === 'TEXTAREA';\n this.eventListener = new EventListener(this.element);\n this.options = Object.assign(Object.assign({}, MASKITO_DEFAULT_OPTIONS), this.maskitoOptions);\n this.upcomingElementState = null;\n this.preprocessor = maskitoPipe(this.options.preprocessors);\n this.postprocessor = maskitoPipe(this.options.postprocessors);\n this.teardowns = this.options.plugins.map(plugin => plugin(this.element, this.options));\n this.updateHistory(this.elementState);\n this.eventListener.listen('keydown', event => {\n if (isRedo(event)) {\n event.preventDefault();\n return this.redo();\n }\n if (isUndo(event)) {\n event.preventDefault();\n return this.undo();\n }\n });\n this.eventListener.listen('beforeinput', event => {\n var _a, _b, _c;\n const isForward = event.inputType.includes('Forward');\n this.updateHistory(this.elementState);\n switch (event.inputType) {\n case 'deleteByCut':\n case 'deleteContentBackward':\n case 'deleteContentForward':\n return this.handleDelete({\n event,\n isForward,\n selection: getNotEmptySelection(this.elementState, isForward)\n });\n case 'deleteHardLineBackward':\n case 'deleteHardLineForward':\n case 'deleteSoftLineBackward':\n case 'deleteSoftLineForward':\n return this.handleDelete({\n event,\n isForward,\n selection: getLineSelection(this.elementState, isForward),\n force: true\n });\n case 'deleteWordBackward':\n case 'deleteWordForward':\n return this.handleDelete({\n event,\n isForward,\n selection: getWordSelection(this.elementState, isForward),\n force: true\n });\n case 'historyRedo':\n event.preventDefault();\n return this.redo();\n // historyUndo/historyRedo will not be triggered if value was modified programmatically\n case 'historyUndo':\n event.preventDefault();\n return this.undo();\n case 'insertCompositionText':\n return;\n // will be handled inside `compositionend` event\n case 'insertLineBreak':\n case 'insertParagraph':\n return this.handleEnter(event);\n case 'insertReplacementText':\n /**\n * According {@link https://www.w3.org/TR/input-events-2 W3C specification}:\n * > `insertReplacementText` – insert or replace existing text by means of a spell checker,\n * > auto-correct, writing suggestions or similar.\n * ___\n * Firefox emits `insertReplacementText` event for its suggestion/autofill and for spell checker.\n * However, it is impossible to detect which part of the textfield value is going to be replaced\n * (`selectionStart` and `selectionEnd` just equal to the last caret position).\n * ___\n * Chrome does not fire `beforeinput` event for its suggestion/autofill.\n * It emits only `input` event with `inputType` and `data` set to `undefined`.\n * ___\n * All these browser limitations make us to validate the result value later in `input` event.\n */\n return;\n case 'insertFromDrop':\n case 'insertFromPaste':\n case 'insertText':\n default:\n return this.handleInsert(event, (_c = (_a = event.data) !== null && _a !== void 0 ? _a :\n // `event.data` for `contentEditable` is always `null` for paste/drop events\n (_b = event.dataTransfer) === null || _b === void 0 ? void 0 : _b.getData('text/plain')) !== null && _c !== void 0 ? _c : '');\n }\n });\n this.eventListener.listen('input', () => {\n if (this.upcomingElementState) {\n this.updateElementState(this.upcomingElementState);\n this.upcomingElementState = null;\n }\n }, {\n capture: true\n });\n this.eventListener.listen('input', ({\n inputType\n }) => {\n if (inputType === 'insertCompositionText') {\n return; // will be handled inside `compositionend` event\n }\n this.ensureValueFitsMask();\n this.updateHistory(this.elementState);\n });\n this.eventListener.listen('compositionend', () => {\n this.ensureValueFitsMask();\n this.updateHistory(this.elementState);\n });\n }\n destroy() {\n this.eventListener.destroy();\n this.teardowns.forEach(teardown => teardown === null || teardown === void 0 ? void 0 : teardown());\n }\n updateElementState({\n value,\n selection\n }, eventInit) {\n const initialValue = this.elementState.value;\n this.updateValue(value);\n this.updateSelectionRange(selection);\n if (eventInit && initialValue !== value) {\n this.dispatchInputEvent(eventInit);\n }\n }\n get elementState() {\n const {\n value,\n selectionStart,\n selectionEnd\n } = this.element;\n return {\n value,\n selection: [selectionStart !== null && selectionStart !== void 0 ? selectionStart : 0, selectionEnd !== null && selectionEnd !== void 0 ? selectionEnd : 0]\n };\n }\n get maxLength() {\n const {\n maxLength\n } = this.element;\n return maxLength === -1 ? Infinity : maxLength;\n }\n updateSelectionRange([from, to]) {\n var _a;\n const {\n element\n } = this;\n if (element.matches(':focus') && (element.selectionStart !== from || element.selectionEnd !== to)) {\n (_a = element.setSelectionRange) === null || _a === void 0 ? void 0 : _a.call(element, from, to);\n }\n }\n updateValue(value) {\n this.element.value = value;\n }\n ensureValueFitsMask() {\n this.updateElementState(maskitoTransform(this.elementState, this.options), {\n inputType: 'insertText',\n data: null\n });\n }\n dispatchInputEvent(eventInit = {\n inputType: 'insertText',\n data: null\n }) {\n if (globalThis.InputEvent) {\n this.element.dispatchEvent(new InputEvent('input', Object.assign(Object.assign({}, eventInit), {\n bubbles: true,\n cancelable: false\n })));\n }\n }\n handleDelete({\n event,\n selection,\n isForward,\n force = false\n }) {\n const initialState = {\n value: this.elementState.value,\n selection\n };\n const [initialFrom, initialTo] = initialState.selection;\n const {\n elementState\n } = this.preprocessor({\n elementState: initialState,\n data: ''\n }, isForward ? 'deleteForward' : 'deleteBackward');\n const maskModel = new MaskModel(elementState, this.options);\n const [from, to] = elementState.selection;\n maskModel.deleteCharacters([from, to]);\n const newElementState = this.postprocessor(maskModel, initialState);\n const newPossibleValue = initialState.value.slice(0, initialFrom) + initialState.value.slice(initialTo);\n if (newPossibleValue === newElementState.value && !force && !this.element.isContentEditable) {\n return;\n }\n if (areElementValuesEqual(initialState, elementState, maskModel, newElementState)) {\n event.preventDefault();\n // User presses Backspace/Delete for the fixed value\n return this.updateSelectionRange(isForward ? [to, to] : [from, from]);\n }\n this.upcomingElementState = newElementState;\n }\n handleInsert(event, data) {\n const {\n options,\n maxLength,\n element,\n elementState: initialElementState\n } = this;\n const {\n elementState,\n data: insertedText = data\n } = this.preprocessor({\n data,\n elementState: initialElementState\n }, 'insert');\n const maskModel = new MaskModel(elementState, options);\n try {\n maskModel.addCharacters(elementState.selection, insertedText);\n } catch (_a) {\n return event.preventDefault();\n }\n const [from, to] = elementState.selection;\n const newPossibleValue = initialElementState.value.slice(0, from) + data + initialElementState.value.slice(to);\n const newElementState = this.postprocessor(maskModel, initialElementState);\n if (newElementState.value.length > maxLength) {\n return event.preventDefault();\n }\n if (newPossibleValue !== newElementState.value || element.isContentEditable) {\n this.upcomingElementState = newElementState;\n if (options.overwriteMode === 'replace' && newPossibleValue.length > maxLength) {\n /**\n * Browsers know nothing about Maskito and its `overwriteMode`.\n * When textfield value length is already equal to attribute `maxlength`,\n * pressing any key (even with valid value) does not emit `input` event.\n */\n this.dispatchInputEvent({\n inputType: 'insertText',\n data\n });\n }\n }\n }\n handleEnter(event) {\n if (this.isTextArea || this.element.isContentEditable) {\n this.handleInsert(event, '\\n');\n }\n }\n}\nfunction maskitoChangeEventPlugin() {\n return element => {\n if (element.isContentEditable) {\n return;\n }\n let value = element.value;\n const valueListener = () => {\n value = element.value;\n };\n const blurListener = () => {\n if (element.value !== value) {\n element.dispatchEvent(new Event('change', {\n bubbles: true\n }));\n }\n };\n element.addEventListener('focus', valueListener);\n element.addEventListener('change', valueListener);\n element.addEventListener('blur', blurListener);\n return () => {\n element.removeEventListener('focus', valueListener);\n element.removeEventListener('change', valueListener);\n element.removeEventListener('blur', blurListener);\n };\n };\n}\nfunction maskitoInitialCalibrationPlugin(customOptions) {\n return (element, options) => {\n var _a, _b;\n const from = (_a = element.selectionStart) !== null && _a !== void 0 ? _a : 0;\n const to = (_b = element.selectionEnd) !== null && _b !== void 0 ? _b : 0;\n maskitoUpdateElement(element, {\n value: maskitoTransform(element.value, customOptions || options),\n selection: [from, to]\n });\n };\n}\nfunction maskitoStrictCompositionPlugin() {\n return (element, maskitoOptions) => {\n const listener = event => {\n var _a, _b;\n if (event.inputType !== 'insertCompositionText') {\n return;\n }\n const selection = [(_a = element.selectionStart) !== null && _a !== void 0 ? _a : 0, (_b = element.selectionEnd) !== null && _b !== void 0 ? _b : 0];\n const elementState = {\n selection,\n value: element.value\n };\n const validatedState = maskitoTransform(elementState, maskitoOptions);\n if (!areElementStatesEqual(elementState, validatedState)) {\n event.preventDefault();\n maskitoUpdateElement(element, validatedState);\n }\n };\n element.addEventListener('input', listener);\n return () => element.removeEventListener('input', listener);\n };\n}\nexport { MASKITO_DEFAULT_ELEMENT_PREDICATE, MASKITO_DEFAULT_OPTIONS, Maskito, maskitoAdaptContentEditable, maskitoChangeEventPlugin, maskitoInitialCalibrationPlugin, maskitoPipe, maskitoStrictCompositionPlugin, maskitoTransform, maskitoUpdateElement };","import * as i0 from '@angular/core';\nimport { inject, ElementRef, NgZone, Directive, Input, Pipe } from '@angular/core';\nimport { DefaultValueAccessor } from '@angular/forms';\nimport { MASKITO_DEFAULT_ELEMENT_PREDICATE, maskitoTransform, Maskito, MASKITO_DEFAULT_OPTIONS } from '@maskito/core';\nlet MaskitoDirective = /*#__PURE__*/(() => {\n class MaskitoDirective {\n constructor() {\n this.elementRef = inject(ElementRef).nativeElement;\n this.ngZone = inject(NgZone);\n this.maskedElement = null;\n this.options = null;\n this.elementPredicate = MASKITO_DEFAULT_ELEMENT_PREDICATE;\n const accessor = inject(DefaultValueAccessor, {\n self: true,\n optional: true\n });\n if (accessor) {\n const original = accessor.writeValue.bind(accessor);\n accessor.writeValue = value => {\n original(this.options ? maskitoTransform(String(value ?? ''), this.options) : value);\n };\n }\n }\n async ngOnChanges() {\n const {\n elementPredicate,\n options,\n maskedElement,\n elementRef,\n ngZone\n } = this;\n maskedElement?.destroy();\n if (!options) {\n return;\n }\n const predicateResult = await elementPredicate(elementRef);\n if (this.elementPredicate !== elementPredicate || this.options !== options) {\n // Ignore the result of the predicate if the\n // maskito element (or its options) has changed before the predicate was resolved.\n return;\n }\n ngZone.runOutsideAngular(() => {\n this.maskedElement = new Maskito(predicateResult, options);\n });\n }\n ngOnDestroy() {\n this.maskedElement?.destroy();\n }\n static {\n this.ɵfac = function MaskitoDirective_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || MaskitoDirective)();\n };\n }\n static {\n this.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: MaskitoDirective,\n selectors: [[\"\", \"maskito\", \"\"]],\n inputs: {\n options: [0, \"maskito\", \"options\"],\n elementPredicate: [0, \"maskitoElement\", \"elementPredicate\"]\n },\n features: [i0.ɵɵNgOnChangesFeature]\n });\n }\n }\n return MaskitoDirective;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet MaskitoPipe = /*#__PURE__*/(() => {\n class MaskitoPipe {\n transform(value, maskitoOptions) {\n return maskitoTransform(String(value ?? ''), maskitoOptions ?? MASKITO_DEFAULT_OPTIONS);\n }\n static {\n this.ɵfac = function MaskitoPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || MaskitoPipe)();\n };\n }\n static {\n this.ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({\n name: \"maskito\",\n type: MaskitoPipe,\n pure: true\n });\n }\n }\n return MaskitoPipe;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MaskitoDirective, MaskitoPipe };\n"],"mappings":"mpBAYA,IAAMA,GAAM,CAAC,WAAW,EAClBC,GAAM,CAAC,OAAO,EACpB,SAASC,GAA8CC,EAAIC,EAAK,CAC9D,GAAID,EAAK,EAAG,CACV,IAAME,EAASC,EAAiB,EAC7BC,EAAe,EAAG,YAAa,CAAC,EAChCC,EAAW,QAAS,UAAoF,CACtGC,EAAcJ,CAAG,EACpB,IAAMK,EAAYC,EAAc,CAAC,EACjC,OAAUC,EAAYF,EAAO,MAAM,CAAC,CACtC,CAAC,EACEG,EAAa,CAClB,CACIV,EAAK,IACJW,EAAW,aAAc,wBAAwB,EACjDC,EAAY,kBAAmB,WAAW,EAEjD,CACA,SAASC,GAAyDb,EAAIC,EAAK,CAAC,CAC5E,SAASa,GAA2Cd,EAAIC,EAAK,CACvDD,EAAK,GACJe,EAAW,EAAGF,GAA0D,EAAG,EAAG,aAAa,CAElG,CACA,SAASG,GAAyChB,EAAIC,EAAK,CACzD,GAAID,EAAK,EAAG,CACV,IAAMiB,EAASd,EAAiB,EAC7BC,EAAe,EAAG,OAAQ,CAAC,EAC3BC,EAAW,QAAS,UAA0E,CAC5FC,EAAcW,CAAG,EACpB,IAAMV,EAAYC,EAAc,CAAC,EACjC,OAAUC,EAAYF,EAAO,MAAM,CAAC,CACtC,CAAC,EACEQ,EAAW,EAAGD,GAA4C,EAAG,EAAG,KAAM,CAAC,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C9C,KAAMnB,EACN,UAAW,CAAC,CAAC,GAAI,UAAW,EAAE,CAAC,EAC/B,OAAQ,CACN,QAAS,CAAC,EAAG,UAAW,SAAS,EACjC,iBAAkB,CAAC,EAAG,iBAAkB,kBAAkB,CAC5D,EACA,SAAU,CAAIoB,EAAoB,CACpC,CAAC,CACH,CACF,CACA,OAAOpB,CACT,GAAG","names":["_c0","_c1","InputMask_ng_container_2_TimesIcon_1_Template","rf","ctx","_r2","ɵɵgetCurrentView","ɵɵelementStart","ɵɵlistener","ɵɵrestoreView","ctx_r2","ɵɵnextContext","ɵɵresetView","ɵɵelementEnd","ɵɵproperty","ɵɵattribute","InputMask_ng_container_2_span_2_1_ng_template_0_Template","InputMask_ng_container_2_span_2_1_Template","ɵɵtemplate","InputMask_ng_container_2_span_2_Template","_r4","ɵɵadvance","InputMask_ng_container_2_Template","ɵɵelementContainerStart","ɵɵelementContainerEnd","theme","dt","classes","instance","InputMaskStyle","BaseStyle","ɵInputMaskStyle_BaseFactory","__ngFactoryType__","ɵɵgetInheritedFactory","ɵɵdefineInjectable","INPUTMASK_VALUE_ACCESSOR","NG_VALUE_ACCESSOR","forwardRef","InputMask","BaseComponent","value","val","EventEmitter","inject","InputMaskStyle","isPlatformBrowser","ua","item","maskTokens","i","c","fn","first","last","range","begin","end","completed","pos","j","t","e","curVal","event","k","iPhone","getUserAgent","p","next","isClient","start","allow","test","lastMatch","unmaskedBuffer","updatedValue","ɵInputMask_BaseFactory","__ngFactoryType__","ɵɵgetInheritedFactory","ɵɵdefineComponent","rf","ctx","dirIndex","ɵɵcontentQuery","_c0","PrimeTemplate","_t","ɵɵqueryRefresh","ɵɵloadQuery","ɵɵviewQuery","_c1","booleanAttribute","numberAttribute","ɵɵProvidersFeature","ɵɵInputTransformsFeature","ɵɵInheritDefinitionFeature","_r1","ɵɵgetCurrentView","ɵɵelementStart","ɵɵlistener","$event","ɵɵrestoreView","ɵɵresetView","ɵɵelementEnd","ɵɵtemplate","InputMask_ng_container_2_Template","ɵɵclassMap","ɵɵproperty","ɵɵattribute","ɵɵadvance","CommonModule","NgClass","NgIf","NgTemplateOutlet","NgStyle","InputText","AutoFocus","TimesIcon","SharedModule","InputMaskModule","ɵɵdefineNgModule","ɵɵdefineInjector","PhoneMaskPipe","transform","pattern","getDefaultConfig","prefixMatch","match","prefix","mask","split","preprocessors","data","elementState","replace","postprocessors","__spreadProps","__spreadValues","value","startsWith","slice","length","pure","getContentEditableSelection","element","anchorOffset","focusOffset","from","to","setContentEditableSelection","_a","_b","_c","_d","document","range","selection","ContentEditableAdapter","value","maskitoAdaptContentEditable","adapter","target","prop","nativeProperty","val","receiver","MASKITO_DEFAULT_ELEMENT_PREDICATE","e","MASKITO_DEFAULT_OPTIONS","MaskHistory","state","isValueChanged","isSelectionChanged","item","index","inputType","areElementValuesEqual","sampleState","states","areElementStatesEqual","applyOverwriteMode","newCharacters","mode","computedMode","isFixedCharacter","char","getLeadingFixedCharacters","mask","validatedValuePart","newCharacter","initialElementState","leadingFixedCharacters","i","charConstraint","isInitiallyExisted","validateValueWithMask","maskExpression","guessValidValueByPattern","elementState","maskedFrom","maskedTo","maskedValue","validatedCharacters","charIndex","leadingCharacters","newValidatedChars","trailingFixedCharacters","guessValidValueByRegExp","maskRegExp","newFrom","newTo","validatedValue","newPossibleValue","calibrateValueByMask","removeFixedMaskCharacters","unmaskedValue","rawValue","MaskModel","maskOptions","unmaskedElementState","unmaskedFrom","unmaskedTo","newUnmaskedLeadingValuePart","newCaretIndex","maskedElementState","newUnmaskedValue","EventListener","eventType","fn","options","untypedFn","stopListen","HotkeyModifier","HotkeyCode","isHotkey","event","modifiers","hotkeyCode","isRedo","isUndo","getLineSelection","value","selection","isForward","from","to","nearestBreak","getNotEmptySelection","x","TRAILING_SPACES_REG","LEADING_SPACES_REG","SPACE_REG","getWordSelection","valueAfterSelectionStart","leadingSpaces","nearestWordEndIndex","valueBeforeSelectionEnd","trailingSpaces","selectedWordLength","char","maskitoPipe","processors","initialData","readonlyArgs","data","fn","maskitoTransform","valueOrState","maskitoOptions","options","MASKITO_DEFAULT_OPTIONS","preprocessor","postprocessor","initialElementState","elementState","maskModel","MaskModel","Maskito","MaskHistory","element","EventListener","plugin","event","isRedo","isUndo","_a","_b","_c","inputType","teardown","eventInit","initialValue","selectionStart","selectionEnd","maxLength","force","initialState","initialFrom","initialTo","newElementState","areElementValuesEqual","insertedText","newPossibleValue","MaskitoDirective","inject","ElementRef","NgZone","MASKITO_DEFAULT_ELEMENT_PREDICATE","accessor","DefaultValueAccessor","original","value","maskitoTransform","__async","elementPredicate","options","maskedElement","elementRef","ngZone","predicateResult","Maskito","__ngFactoryType__","ɵɵdefineDirective","ɵɵNgOnChangesFeature"],"x_google_ignoreList":[0,2,3]}