@ldmjs/ui 2.0.0-beta.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ld-avatar.js +1 -1
- package/dist/components/ld-badge.js +1 -1
- package/dist/components/ld-breadcrumbs.js +1 -1
- package/dist/components/ld-button.js +1 -1
- package/dist/components/ld-calendar.js +1 -1
- package/dist/components/ld-checkbox.js +1 -1
- package/dist/components/ld-chip.js +1 -1
- package/dist/components/ld-combobox.js +1 -1
- package/dist/components/ld-data-iterator.js +1 -1
- package/dist/components/ld-datepicker.js +1 -1
- package/dist/components/ld-dialog.js +1 -1
- package/dist/components/ld-edit-list-box.js +1 -1
- package/dist/components/ld-edit-masked-text.js +1 -1
- package/dist/components/ld-edit-text.js +1 -1
- package/dist/components/ld-expansion-panel.js +1 -1
- package/dist/components/ld-expansion-panels.js +1 -1
- package/dist/components/ld-icon.js +1 -1
- package/dist/components/ld-loader.js +1 -1
- package/dist/components/ld-page-toolbar.js +1 -1
- package/dist/components/ld-pager.js +1 -1
- package/dist/components/ld-progress.js +1 -1
- package/dist/components/ld-radiobutton.js +1 -1
- package/dist/components/ld-radiogroup.js +1 -1
- package/dist/components/ld-select-list-box.js +1 -1
- package/dist/components/ld-select.js +1 -1
- package/dist/components/ld-slider.js +1 -1
- package/dist/components/ld-splitter.js +1 -1
- package/dist/components/ld-step.js +1 -1
- package/dist/components/ld-switch.js +1 -1
- package/dist/components/ld-tab.js +1 -1
- package/dist/components/ld-tabs.js +1 -1
- package/dist/components/ld-text-markup.js +1 -1
- package/dist/components/ld-text-viewer.js +1 -1
- package/dist/components/ld-textarea.js +1 -1
- package/dist/components/ld-timepicker.js +1 -1
- package/dist/components/ld-toggle-buttons.js +1 -1
- package/dist/components/ld-uploader.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/imask.js +1 -1
- package/dist/lib/runtime-template.js +1 -1
- package/dist/lib/toastification.js +1 -1
- package/dist/scss/_badge.scss +121 -45
- package/dist/scss/_buttons.scss +48 -3
- package/dist/scss/_calendar.scss +1 -3
- package/dist/scss/_chip.scss +126 -23
- package/dist/scss/_inputs.scss +122 -80
- package/dist/scss/_tabs.scss +113 -117
- package/dist/scss/index.scss +0 -1
- package/dist/scss/utils.scss +6 -0
- package/dist/types/options.d.ts +1 -1
- package/dist/utils/validators.js +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("./components/ld-avatar.js"),require("./components/ld-badge.js"),require("./components/ld-breadcrumbs.js"),require("./components/ld-button.js"),require("./components/ld-calendar.js"),require("./components/ld-checkbox.js"),require("./components/ld-chip.js"),require("./components/ld-combobox.js"),require("./components/ld-data-iterator.js"),require("./components/ld-datepicker.js"),require("./components/ld-dialog.js"),require("./components/ld-edit-list-box.js"),require("./components/ld-edit-masked-text.js"),require("./components/ld-edit-text.js"),require("./components/ld-expansion-panel.js"),require("./components/ld-expansion-panels.js"),require("./components/ld-icon.js"),require("./components/ld-loader.js"),require("./components/ld-page-toolbar.js"),require("./components/ld-pager.js"),require("./components/ld-progress.js"),require("./components/ld-radiobutton.js"),require("./components/ld-radiogroup.js"),require("./components/ld-select-list-box.js"),require("./components/ld-select.js"),require("./components/ld-slider.js"),require("./components/ld-splitter.js"),require("./components/ld-step.js"),require("./components/ld-switch.js"),require("./components/ld-tab.js"),require("./components/ld-tabs.js"),require("./components/ld-text-markup.js"),require("./components/ld-text-viewer.js"),require("./components/ld-textarea.js"),require("./components/ld-timepicker.js"),require("./components/ld-toggle-buttons.js"),require("./components/ld-uploader.js"),require("./lib/toastification.js"),require("./utils/validators.js"),require("@ldmjs/core"),require("@ldmjs/datatable"),require("vue"),require("vue-class-component"),require("vue-property-decorator")):"function"===typeof define&&define.amd?define(["./components/ld-avatar.js","./components/ld-badge.js","./components/ld-breadcrumbs.js","./components/ld-button.js","./components/ld-calendar.js","./components/ld-checkbox.js","./components/ld-chip.js","./components/ld-combobox.js","./components/ld-data-iterator.js","./components/ld-datepicker.js","./components/ld-dialog.js","./components/ld-edit-list-box.js","./components/ld-edit-masked-text.js","./components/ld-edit-text.js","./components/ld-expansion-panel.js","./components/ld-expansion-panels.js","./components/ld-icon.js","./components/ld-loader.js","./components/ld-page-toolbar.js","./components/ld-pager.js","./components/ld-progress.js","./components/ld-radiobutton.js","./components/ld-radiogroup.js","./components/ld-select-list-box.js","./components/ld-select.js","./components/ld-slider.js","./components/ld-splitter.js","./components/ld-step.js","./components/ld-switch.js","./components/ld-tab.js","./components/ld-tabs.js","./components/ld-text-markup.js","./components/ld-text-viewer.js","./components/ld-textarea.js","./components/ld-timepicker.js","./components/ld-toggle-buttons.js","./components/ld-uploader.js","./lib/toastification.js","./utils/validators.js","@ldmjs/core","@ldmjs/datatable","vue","vue-class-component","vue-property-decorator"],t):"object"===typeof exports?exports["ldmui"]=t(require("./components/ld-avatar.js"),require("./components/ld-badge.js"),require("./components/ld-breadcrumbs.js"),require("./components/ld-button.js"),require("./components/ld-calendar.js"),require("./components/ld-checkbox.js"),require("./components/ld-chip.js"),require("./components/ld-combobox.js"),require("./components/ld-data-iterator.js"),require("./components/ld-datepicker.js"),require("./components/ld-dialog.js"),require("./components/ld-edit-list-box.js"),require("./components/ld-edit-masked-text.js"),require("./components/ld-edit-text.js"),require("./components/ld-expansion-panel.js"),require("./components/ld-expansion-panels.js"),require("./components/ld-icon.js"),require("./components/ld-loader.js"),require("./components/ld-page-toolbar.js"),require("./components/ld-pager.js"),require("./components/ld-progress.js"),require("./components/ld-radiobutton.js"),require("./components/ld-radiogroup.js"),require("./components/ld-select-list-box.js"),require("./components/ld-select.js"),require("./components/ld-slider.js"),require("./components/ld-splitter.js"),require("./components/ld-step.js"),require("./components/ld-switch.js"),require("./components/ld-tab.js"),require("./components/ld-tabs.js"),require("./components/ld-text-markup.js"),require("./components/ld-text-viewer.js"),require("./components/ld-textarea.js"),require("./components/ld-timepicker.js"),require("./components/ld-toggle-buttons.js"),require("./components/ld-uploader.js"),require("./lib/toastification.js"),require("./utils/validators.js"),require("@ldmjs/core"),require("@ldmjs/datatable"),require("vue"),require("vue-class-component"),require("vue-property-decorator")):e["ldmui"]=t(e["./components/ld-avatar.js"],e["./components/ld-badge.js"],e["./components/ld-breadcrumbs.js"],e["./components/ld-button.js"],e["./components/ld-calendar.js"],e["./components/ld-checkbox.js"],e["./components/ld-chip.js"],e["./components/ld-combobox.js"],e["./components/ld-data-iterator.js"],e["./components/ld-datepicker.js"],e["./components/ld-dialog.js"],e["./components/ld-edit-list-box.js"],e["./components/ld-edit-masked-text.js"],e["./components/ld-edit-text.js"],e["./components/ld-expansion-panel.js"],e["./components/ld-expansion-panels.js"],e["./components/ld-icon.js"],e["./components/ld-loader.js"],e["./components/ld-page-toolbar.js"],e["./components/ld-pager.js"],e["./components/ld-progress.js"],e["./components/ld-radiobutton.js"],e["./components/ld-radiogroup.js"],e["./components/ld-select-list-box.js"],e["./components/ld-select.js"],e["./components/ld-slider.js"],e["./components/ld-splitter.js"],e["./components/ld-step.js"],e["./components/ld-switch.js"],e["./components/ld-tab.js"],e["./components/ld-tabs.js"],e["./components/ld-text-markup.js"],e["./components/ld-text-viewer.js"],e["./components/ld-textarea.js"],e["./components/ld-timepicker.js"],e["./components/ld-toggle-buttons.js"],e["./components/ld-uploader.js"],e["./lib/toastification.js"],e["./utils/validators.js"],e["@ldmjs/core"],e["@ldmjs/datatable"],e["vue"],e["vue-class-component"],e["vue-property-decorator"])})(self,(e,t,r,o,n,i,s,a,l,d,c,u,p,_,m,g,h,b,f,x,w,j,v,q,k,y,D,A,C,M,S,T,O,z,B,P,I,R,V,$,E,N,F,L)=>(()=>{"use strict";var U={395:e=>{e.exports=i},732:e=>{e.exports=P},832:e=>{e.exports=C},839:t=>{t.exports=e},934:e=>{e.exports=$},950:e=>{e.exports=d},958:e=>{e.exports=O},1031:e=>{e.exports=u},1397:e=>{e.exports=JSON.parse('{"ru":{"Hours":"Часы","Minutes":"Минуты","Seconds":"Секунды","Jan":"Январь","Feb":"Февраль","Mar":"Март","Apr":"Апрель","May":"Май","Jun":"Июнь","Jul":"Июль","Aug":"Август","Sep":"Сентябрь","Oct":"Октябрь","Nov":"Ноябрь","Dec":"Декабрь","Mon":"Пн","Tue":"Вт","Wed":"Ср","Thu":"Чт","Fri":"Пт","Sat":"Сб","Sun":"Вс","Hide tabs":"Скрыть вкладки","Show tabs":"Показать вкладки","Expand":"Развернуть","Collapsed windows":"Свернутые окна","Close":"Закрыть","Close all":"Закрыть все","Hide password":"Скрыть пароль","Show password":"Показать пароль","Text":"Текст","Preview":"Превью","Bold":"Полужирный","Underline":"Подчеркнутый","Italic":"Курсив","No data":"Нет данных","No Elements":"Нет элементов для отображения","Loading":"Идет загрузка...","Search":"Идет поиск...","No Search Result":"Поиск не дал результатов","Help":"Справка","Reqiured Message":"Это поле обязательно","Timepicker Placeholder":"ЧЧ:ММ","Uploader Required Message":"Добавьте файл","Uploader Placeholder":"Выберите файл или перетащите в эту область","Uploader File Size Overflow":"Этот файл слишком большой","Uploader Load Error":"Ошибка загрузки файла","Uploader Load Abort":"Загузка файла отменена","Uploader Load Timed Out":"Истекло время ожидания ответа от сервера","Dialog Close":"Закрыть","Dialog Save":"Сохранить","Dialog Select":"Выбрать","Dialog Confirm":"Да","Dialog Reject":"Нет","Dialog Cancel":"Отменить","Dialog Go Back":"Назад","Dialog Close Confirm Title":"Закрыть окно?","Dialog Close Confirm Text":"Внесенные данные будут безвозвратно утеряны. Вы уверены, что хотите закрыть окно?","Dialog Close All Confirm Title":"Вы уверены, что хотите закрыть все окна?","Dialog Close All Confirm Text":"Возможно, вами были внесены изменения","Dialog Close Parent Confrim Title":"Завершить сценарий","Dialog Close Parent Confrim Text":"Внесенные данные будут безвозвратно утеряны. Вы уверены, что хотите закрыть все окна и завершить сценарий?"}}')},2059:e=>{e.exports=t},2159:e=>{e.exports=M},2380:e=>{e.exports=N},2748:e=>{e.exports=k},2864:e=>{e.exports=o},2894:e=>{e.exports=_},3034:e=>{e.exports=A},3052:e=>{e.exports=S},3120:e=>{e.exports=T},3139:e=>{e.exports=j},4108:e=>{e.exports=m},4326:e=>{e.exports=I},4394:e=>{e.exports=n},4451:e=>{e.exports=E},4538:e=>{e.exports=p},4605:e=>{e.exports=B},5070:e=>{e.exports=L},5165:e=>{e.exports=a},5269:e=>{e.exports=D},5445:e=>{e.exports=w},5475:e=>{e.exports=q},5482:e=>{e.exports=s},5647:e=>{e.exports=y},6466:e=>{e.exports=v},6561:e=>{e.exports=b},6963:e=>{e.exports=h},7032:e=>{e.exports=c},7313:e=>{e.exports=l},7353:e=>{e.exports=g},7775:e=>{e.exports=f},7807:e=>{e.exports=x},8070:e=>{e.exports=z},8179:e=>{e.exports=JSON.parse('{"en":{"Hours":"","Minutes":"","Seconds":"","Hide tabs":"","Show tabs":"","Expand":"","Collapsed windows":"","Close":"","Close all":"","Hide password":"","Show password":"","Text":"","Preview":"","No data":""}}')},9119:e=>{e.exports=V},9299:e=>{e.exports=F},9356:e=>{e.exports=r},9471:e=>{e.exports=R}},Z={};function __webpack_require__(e){var t=Z[e];if(void 0!==t)return t.exports;var r=Z[e]={exports:{}};return U[e](r,r.exports,__webpack_require__),r.exports}(()=>{__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return __webpack_require__.d(t,{a:t}),t}})(),(()=>{__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var H={};__webpack_require__.r(H),__webpack_require__.d(H,{AlertDialog:()=>AlertDialog,ConfirmDialog:()=>ConfirmDialog,CreateEditDialog:()=>CreateEditDialog,DialogManager:()=>DialogManager,InfoDialog:()=>InfoDialog,ModalButton:()=>hr,ModalType:()=>br,PromptDialog:()=>PromptDialog,SelectDialog:()=>SelectDialog,ValidateMixin:()=>ValidateMixin,ValidateMixinOptions:()=>gr,alphaNumRule:()=>jr.alphaNumRule,alphaRule:()=>jr.alphaRule,awaiting:()=>awaiting,base64:()=>ir,base64ToBlob:()=>base64ToBlob,base64ToUint8Array:()=>base64ToUint8Array,betweenRule:()=>jr.betweenRule,cookie:()=>sr,datetime:()=>lr,decimalRule:()=>jr.decimalRule,deepValueGetter:()=>deepValueGetter,default:()=>qr,defaults:()=>ur,delay:()=>delay,emailRule:()=>jr.emailRule,fileToArrayBuffer:()=>fileToArrayBuffer,fileToBase64:()=>fileToBase64,files:()=>cr,hexToArrayBuffer:()=>hexToArrayBuffer,integerRule:()=>jr.integerRule,ipAddressRule:()=>jr.ipAddressRule,isDefined:()=>isDefined,isObjectEmpty:()=>isObjectEmpty,ldmuii18n:()=>yr,macAddressRule:()=>jr.macAddressRule,maxLengthRule:()=>jr.maxLengthRule,maxValueRule:()=>jr.maxValueRule,minValueRule:()=>jr.minValueRule,numericRule:()=>jr.numericRule,phoneRule:()=>jr.phoneRule,pluralizeNoun:()=>pluralizeNoun,removeDuplicates:()=>removeDuplicates,requiredRule:()=>jr.requiredRule,strings:()=>ar,uidGen:()=>uidGen,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToHex:()=>uint8ArrayToHex,urlRegexp:()=>dr,urlRule:()=>jr.urlRule,validators:()=>jr.validators});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{awaiting:()=>awaiting,base64:()=>ir,base64ToBlob:()=>base64ToBlob,base64ToUint8Array:()=>base64ToUint8Array,cookie:()=>sr,datetime:()=>lr,deepValueGetter:()=>deepValueGetter,delay:()=>delay,fileToArrayBuffer:()=>fileToArrayBuffer,fileToBase64:()=>fileToBase64,files:()=>cr,hexToArrayBuffer:()=>hexToArrayBuffer,isDefined:()=>isDefined,isObjectEmpty:()=>isObjectEmpty,pluralizeNoun:()=>pluralizeNoun,removeDuplicates:()=>removeDuplicates,strings:()=>ar,uidGen:()=>uidGen,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToHex:()=>uint8ArrayToHex,urlRegexp:()=>dr});var Y=__webpack_require__(934),W=__webpack_require__(2380);const J={beforeMount(e,t){const r="--active",o=t.value;e.classList[o?"add":"remove"](r)},updated(e,t){const r="--active",o=t.value;e.classList[o?"add":"remove"](r)}};var K=__webpack_require__(839),Q=__webpack_require__.n(K);function reg(e,t){e.component(t.aliases["ld-avatar"],Q())}const X=reg;var ee=__webpack_require__(2059),te=__webpack_require__.n(ee);function ld_badge_reg(e,t){e.component(t.aliases["ld-badge"],te())}const re=ld_badge_reg;var oe=__webpack_require__(9356),ne=__webpack_require__.n(oe);function ld_breadcrumbs_reg(e,t){ne().props={...ne().props,home:{default:t.LdBreadcrumbs?.home?t.LdBreadcrumbs?.home:null}},e.component(t.aliases["ld-breadcrumbs"],ne())}const ie=ld_breadcrumbs_reg;var se=__webpack_require__(2864),ae=__webpack_require__.n(se);function ld_button_reg(e,t){e.component(t.aliases["ld-button"],ae())}const le=ld_button_reg;var de=__webpack_require__(4394),ce=__webpack_require__.n(de);function ld_calendar_reg(e,t){e.component(t.aliases["ld-calendar"],ce())}const ue=ld_calendar_reg;var pe=__webpack_require__(395),_e=__webpack_require__.n(pe);function ld_checkbox_reg(e,t){e.component(t.aliases["ld-checkbox"],_e())}const me=ld_checkbox_reg;var ge=__webpack_require__(5482),he=__webpack_require__.n(ge);function ld_chip_reg(e,t){e.component(t.aliases["ld-chip"],he())}const be=ld_chip_reg;var fe=__webpack_require__(5165),xe=__webpack_require__.n(fe);function ld_combobox_reg(e,t){e.component(t.aliases["ld-combobox"],xe())}const we=ld_combobox_reg;var je=__webpack_require__(7313),ve=__webpack_require__.n(je);function ld_data_iterator_reg(e,t){e.component(t.aliases["ld-data-iterator"],ve())}const qe=ld_data_iterator_reg;var ke=__webpack_require__(4451),ye=__webpack_require__.n(ke);function ld_datatable_reg(e,t){e.component(t.aliases["ld-datatable"],ye())}const De=ld_datatable_reg;var Ae=__webpack_require__(950),Ce=__webpack_require__.n(Ae);function ld_datepicker_reg(e,t){e.component(t.aliases["ld-datepicker"],Ce())}const Me=ld_datepicker_reg;var Se=__webpack_require__(7032),Te=__webpack_require__.n(Se);function ld_dialog_reg(e,t){e.component(t.aliases["ld-dialog"],Te())}const Oe=ld_dialog_reg;var ze=__webpack_require__(1031),Be=__webpack_require__.n(ze);function ld_edit_list_box_reg(e,t){e.component(t.aliases["ld-edit-list-box"],Be())}const Pe=ld_edit_list_box_reg;var Ie=__webpack_require__(4538),Re=__webpack_require__.n(Ie);function ld_edit_masked_text_reg(e,t){e.component(t.aliases["ld-edit-masked-text"],Re())}const Ve=ld_edit_masked_text_reg;var $e=__webpack_require__(2894),Ee=__webpack_require__.n($e);function ld_edit_text_reg(e,t){e.component(t.aliases["ld-edit-text"],Ee())}const Ne=ld_edit_text_reg;var Fe=__webpack_require__(4108),Le=__webpack_require__.n(Fe);function ld_expansion_panel_reg(e,t){e.component(t.aliases["ld-expansion-panel"],Le())}const Ue=ld_expansion_panel_reg;var Ze=__webpack_require__(7353),He=__webpack_require__.n(Ze);function ld_expansion_panels_reg(e,t){e.component(t.aliases["ld-expansion-panels"],He())}const Ge=ld_expansion_panels_reg;var Ye=__webpack_require__(6963),We=__webpack_require__.n(Ye);function ld_icon_reg(e,t){We().props={...We().props,path:{default:t.LdIcon?.path??"icons"},map:{default:t.LdIcon?.map??{icons:[]}}},e.component(t.aliases["ld-icon"],We())}const Je=ld_icon_reg;var Ke=__webpack_require__(6561),Qe=__webpack_require__.n(Ke);function ld_loader_reg(e,t){e.component(t.aliases["ld-loader"],Qe())}const Xe=ld_loader_reg;var et=__webpack_require__(7775),tt=__webpack_require__.n(et);function ld_page_toolbar_reg(e,t){e.component(t.aliases["ld-page-toolbar"],tt())}const rt=ld_page_toolbar_reg;var ot=__webpack_require__(7807),nt=__webpack_require__.n(ot);function ld_pager_reg(e,t){e.component(t.aliases["ld-pager"],nt())}const it=ld_pager_reg;var st=__webpack_require__(5445),at=__webpack_require__.n(st);function ld_progress_reg(e,t){e.component(t.aliases["ld-progress"],at())}const lt=ld_progress_reg;var dt=__webpack_require__(3139),ct=__webpack_require__.n(dt);function ld_radiobutton_reg(e,t){e.component(t.aliases["ld-radiobutton"],ct())}const ut=ld_radiobutton_reg;var pt=__webpack_require__(6466),_t=__webpack_require__.n(pt);function ld_radiogroup_reg(e,t){e.component(t.aliases["ld-radiogroup"],_t())}const mt=ld_radiogroup_reg;var gt=__webpack_require__(2748),ht=__webpack_require__.n(gt);function ld_select_reg(e,t){e.component(t.aliases["ld-select"],ht())}const bt=ld_select_reg;var ft=__webpack_require__(5475),xt=__webpack_require__.n(ft);function ld_select_list_box_reg(e,t){e.component(t.aliases["ld-select-list-box"],xt())}const wt=ld_select_list_box_reg;var jt=__webpack_require__(5647),vt=__webpack_require__.n(jt);function ld_slider_reg(e,t){e.component(t.aliases["ld-slider"],vt())}const qt=ld_slider_reg;var kt=__webpack_require__(5269),yt=__webpack_require__.n(kt);function ld_splitter_reg(e,t){e.component(t.aliases["ld-splitter"],yt())}const Dt=ld_splitter_reg;var At=__webpack_require__(3034),Ct=__webpack_require__.n(At);function ld_step_reg(e,t){e.component(t.aliases["ld-step"],Ct())}const Mt=ld_step_reg;var St=__webpack_require__(832),Tt=__webpack_require__.n(St);function ld_switch_reg(e,t){e.component(t.aliases["ld-switch"],Tt())}const Ot=ld_switch_reg;var zt=__webpack_require__(2159),Bt=__webpack_require__.n(zt);function ld_tab_reg(e,t){e.component(t.aliases["ld-tab"],Bt())}const Pt=ld_tab_reg;var It=__webpack_require__(3052),Rt=__webpack_require__.n(It);function ld_tabs_reg(e,t){Rt().props={...Rt().props,header:{default:t.LdTabs?.header}},e.component(t.aliases["ld-tabs"],Rt())}const Vt=ld_tabs_reg;var $t=__webpack_require__(3120),Et=__webpack_require__.n($t);function ld_text_markup_reg(e,t){e.component(t.aliases["ld-text-markup"],Et())}const Nt=ld_text_markup_reg;var Ft=__webpack_require__(958),Lt=__webpack_require__.n(Ft);function ld_text_viewer_reg(e,t){e.component(t.aliases["ld-text-viewer"],Lt())}const Ut=ld_text_viewer_reg;var Zt=__webpack_require__(8070),Ht=__webpack_require__.n(Zt);function ld_textarea_reg(e,t){e.component(t.aliases["ld-textarea"],Ht())}const Gt=ld_textarea_reg;var Yt=__webpack_require__(4605),Wt=__webpack_require__.n(Yt);function ld_timepicker_reg(e,t){e.component(t.aliases["ld-timepicker"],Wt())}const Jt=ld_timepicker_reg;var Kt=__webpack_require__(732),Qt=__webpack_require__.n(Kt);function ld_toggle_buttons_reg(e,t){e.component(t.aliases["ld-toggle-buttons"],Qt())}const Xt=ld_toggle_buttons_reg;var er=__webpack_require__(4326),tr=__webpack_require__.n(er);function ld_uploader_reg(e,t){e.component(t.aliases["ld-uploader"],tr())}const rr=ld_uploader_reg;var or=__webpack_require__(9471),nr=__webpack_require__.n(or);async function awaiting(e){let t=null;const r=0;let o=null;const n=new Promise(e=>{t=e});o=setInterval(()=>{const n=e();(r>100||Boolean(n))&&(clearInterval(o),t(n??!0))},100),await n}class Base64Util{_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";encode(e){let t,r,o,n,i,s,a,l="",d=0;e=Base64Util._utf8_encode(e);while(d<e.length)t=e.charCodeAt(d++),r=e.charCodeAt(d++),o=e.charCodeAt(d++),n=t>>2,i=(3&t)<<4|r>>4,s=(15&r)<<2|o>>6,a=63&o,isNaN(r)?s=a=64:isNaN(o)&&(a=64),l=l+this._keyStr.charAt(n)+this._keyStr.charAt(i)+this._keyStr.charAt(s)+this._keyStr.charAt(a);return l}decode(e){let t,r,o,n,i,s,a,l="",d=0;e=e.replace(/[^\d+/=A-Za-z]/g,"");while(d<e.length)n=this._keyStr.indexOf(e.charAt(d++)),i=this._keyStr.indexOf(e.charAt(d++)),s=this._keyStr.indexOf(e.charAt(d++)),a=this._keyStr.indexOf(e.charAt(d++)),t=n<<2|i>>4,r=(15&i)<<4|s>>2,o=(3&s)<<6|a,l+=String.fromCharCode(t),64!==s&&(l+=String.fromCharCode(r)),64!==a&&(l+=String.fromCharCode(o));return l=Base64Util._utf8_decode(l),l}static _utf8_encode(e){e=e.replace(/\r\n/g,"\n");let t="";for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);o<128?t+=String.fromCharCode(o):o>127&&o<2048?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t}static _utf8_decode(e){let t="",r=0,o=0,n=0,i=0;while(r<e.length)o=e.charCodeAt(r),o<128?(t+=String.fromCharCode(o),r++):o>191&&o<224?(n=e.charCodeAt(r+1),t+=String.fromCharCode((31&o)<<6|63&n),r+=2):(n=e.charCodeAt(r+1),i=e.charCodeAt(r+2),t+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&i),r+=3);return t}isValid(e){const t=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/gim;return t.test(e)}}const ir=new Base64Util;class Cookie{get(e){const t=e.replace(/([$()*+./?[\\\]^{|}])/g,"\\$1"),r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r&&r[1]&&r[1].length?r[1]:null}set(e,t,r){let o=0;switch(r){case"day":o=864e5;break;case"month":o=2592e6;break}let n="";o&&(o=Date.now()+o,n=new Date(o).toUTCString()),document.cookie=e+"="+t+"; path=/; expires="+n}delete(e){document.cookie=e+"=; path=/; expires=-1"}}const sr=new Cookie;function fileToArrayBuffer(e){return new Promise(t=>{const r=new FileReader;r.onloadend=function(){t(r.result)},r.readAsArrayBuffer(e)})}function fileToBase64(e){return new Promise((t,r)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{let e=String(o.result);e.includes(",")&&(e=e.split(",")[1]),t(e)},o.onerror=e=>r(e)})}function base64ToUint8Array(e){if(!e.trim())return null;const t=window.atob(e);let r=t.length;const o=new Uint8Array(r);while(r--)o[r]=t.charCodeAt(r);return o}function base64ToBlob(e,t=512){const r=window.atob(e),o=[];for(let e=0;e<r.length;e+=t){const n=r.slice(e,e+t),i=new Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);const s=new Uint8Array(i);o.push(s)}return new Blob(o)}function uint8ArrayToHex(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r]<0?e[r]+256:e[r];t.push((o>>>4).toString(16)),t.push((15&o).toString(16))}return t.join("")}function hexToArrayBuffer(e){if(e=e.replace(/^0x/,""),e.length%2!==0)return console.log("WARNING: expecting an even number of characters in the hexString"),null;const t=e.match(/[\sg-z]/i);if(t)return console.log("WARNING: found non-hex characters",t),null;const r=e.match(/[\da-f]{2}/gi),o=[];for(const e of r)o.push(parseInt(e,16));return o}function uint8ArrayToBase64(e){const t=e.reduce((e,t)=>e+String.fromCharCode.apply(null,[t]),"");return window.btoa(t)}function deepValueGetter(e,t){if(null===e)return"";if(!e||!t)return e;const r=e[t];if(void 0!==r)return r;let o=e;const n=t.split(".");if(n.length)for(const e of n)if(o=o[e],void 0===o||null===o)return"";return o}function removeDuplicates(e,t){const r=[];return e.map(e=>r.includes(deepValueGetter(e,t))?null:(r.push(deepValueGetter(e,t)),e)).filter(e=>Boolean(e))}async function delay(e){return new Promise(t=>setTimeout(()=>t(),e))}function isDefined(e){const t="number"===typeof e&&isNaN(e);return null!==e&&void 0!==e&&!t}function isObjectEmpty(e){for(const t in e)return!1;return!0}function pluralizeNoun(e,t,r,o,n=!0){if(!e)return"";let i;return i="string"===typeof e?Number(e.match(/\d+\.?\d*/g)):Math.abs(e),i%=100,i>=5&&i<=20?n?`${e} ${o}`:`${o}`:(i%=10,1===i?n?`${e} ${t}`:`${t}`:i>=2&&i<=4?n?`${e} ${r}`:`${r}`:n?`${e} ${o}`:`${o}`)}class Strings{camelCase(e){return e=e.replace(/[^\d A-Za-z]/g," "),e=e.replace(/([a-z](?=[A-Z]))/g,"$1 "),e=e.replace(/([^\d A-Za-z])|^\d+/g,"").trim().toLowerCase(),e=e.replace(/([\d ]+)([A-Za-z])/g,(e,t,r)=>t.trim()+r.toUpperCase()),e}capitalize(e){if(!e)return e;const t=e[0],r=e.substring(1);return`${t.toUpperCase()}${r}`}}const ar=new Strings;class Datetime{toDate(e){return e instanceof Date?e:Array.isArray(e)?new Date(e[0],e[1],e[2]):"number"===typeof e||"string"===typeof e?new Date(e):"object"===typeof e&&"year"in e&&"month"in e&&"date"in e?new Date(e.year,e.month,e.date,e.hours,e.minutes,e.seconds,e.ms):e}localToISO(e,t="ru"){const{d:r,m:o,y:n,hh:i,mm:s,ss:a}=this.parseDate(e,t);if(r&&o&&n){let e=`${n}-${o}-${r}`;return e=i&&s?`${e}T${i}:${s}:${a||"00"}`:`${e}T00:00:00`,e}return""}dateToLocal(e,t="ru"){const r=this.toDate(e);return this.formatDate(r,"ru"===t?"DD.MM.YYYY":"MM/DD/YYYY")}compare(e,t,r=!0){if(!e||!t)return NaN;if(e=this.toDate(e),t=this.toDate(t),r){const r=e?this.toDate(e).valueOf():0,o=t?this.toDate(t).valueOf():0;return isFinite(r)&&isFinite(o)?Number(r>o)-Number(r<o):NaN}let o=0;return e.getDate()!==t.getDate()&&(o=e.getDate()>t.getDate()?1:-1),e.getMonth()!==t.getMonth()&&(o=e.getMonth()>t.getMonth()?1:-1),e.getFullYear()!==t.getFullYear()&&(o=e.getFullYear()>t.getFullYear()?1:-1),o}toServerString(e){if(!e)return null;const t=-e.getTimezoneOffset(),r=t>=0?"+":"-",pad=function(e){const t=Math.abs(Math.floor(e));return(t<10?"0":"")+t};return`${e.getFullYear()}-${pad(e.getMonth()+1)}-${pad(e.getDate())}T${pad(e.getHours())}:${pad(e.getMinutes())}:${pad(e.getSeconds())}${r}${pad(t/60)}:${pad(t%60)}`}formatDate(e,t){const r=String(e.getDate()),o=String(e.getMonth()+1),n=String(e.getFullYear()),i=String(e.getHours()),s=String(e.getMinutes()),a=String(e.getSeconds());return t.replace(/DD/g,this.leaderZero(r)).replace(/MM/g,this.leaderZero(o)).replace(/YYYY/g,n).replace(/hh/g,this.leaderZero(i)).replace(/mm/g,this.leaderZero(s)).replace(/ss/g,this.leaderZero(a))}leaderZero(e){return"number"===typeof e&&(e=String(e)),1===e.length?"0"+e:e}parseDate(e,t="ru"){let r=null;if("ru"===t&&(r=/^(\d\d?).(\d\d?).(\d\d\d?\d?)(, )?(\d\d)?:?(\d\d)?$/.exec(e)),"en"===t&&(r=/^(\d\d?)\/(\d\d?)\/(\d\d\d?\d?)$/.exec(e)),!r)return null;const o={d:null,m:null,y:null,hh:null,mm:null,ss:null};return r[1]&&(o["ru"===t?"d":"m"]=this.leaderZero(r[1])),r[2]&&(o["ru"===t?"m":"d"]=this.leaderZero(r[2])),r[3]&&(o["y"]=r[3]),r[5]&&(o["hh"]=this.leaderZero(r[5])),r[6]&&(o["mm"]=this.leaderZero(r[6])),r[7]&&(o["ss"]=this.leaderZero(r[7])),o}}const lr=new Datetime;function uidGen(e=6,t){let r="",o="";switch(t){case"a-z":o="abcdefghijklmnopqrstuvwxyz";break;case"A-Z":o="ABCDEFGHIJKLMNOPQRSTUWVXYZ";break;case"0-9":o="1234567890";break;case"a-zA-Z":o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUWVXYZ";break;case"a-z0-9":o="abcdefghijklmnopqrstuvwxyz1234567890";break;case"A-Z0-9":o="ABCDEFGHIJKLMNOPQRSTUWVXYZ1234567890";break;default:o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUWVXYZ1234567890"}for(let t=0;t<e;t++)r+=o.charAt(Math.floor(Math.random()*o.length));return"0-9"===t?Number(r):r}const dr=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\\[\]{};:'".,<>?«»“”‘’]))/i;class Files{getExtension(e){return e?e.slice((e.lastIndexOf(".")-1>>>0)+2).toLowerCase():""}getFileName(e){if(!e)return"";const t=this.getExtension(e);return e.slice(0,-t.length-1)}formatSize(e,t=2){if(!e)return"0 Bytes";if("string"===typeof e&&(e=Number(e)),Number.isNaN(e)||0===e)return"0 Bytes";const r=1024,o=t<=0?0:t||2,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,i)).toFixed(o))+n[i]}}const cr=new Files,ur={global:{ripple:!1,density:"compact"},VToolbar:{height:60,density:"default"},VTooltip:{scrollStrategy:"close",location:"bottom",contentClass:["bg-dark","ld-tooltip"],noClickAnimation:!0,openDelay:600},VContainer:{fluid:!0},VBtn:{elevation:0},VList:{lines:!1,elevation:0},VMenu:{transition:"toggle-slide-y-transition",location:"bottom"}};var pr=__webpack_require__(9299),_r=__webpack_require__(5070),__decorate=function(e,t,r,o){var n,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(i<3?n(s):i>3?n(t,r,s):n(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},__metadata=function(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)};function validate(){const e=this.inputs.filter(e=>e.validate&&!e.validate(!0)).length;return!e}function register(e,t){t&&(this.section=t),this.section&&e.validate&&(e.__cardSection=this.section);const r=this.watchInput(e);this.inputs.push(e),this.watchers.push(r)}function unregister(e){const t=this.inputs.find(t=>t.uid===e.uid);if(!t)return;const r=this.watchers.find(e=>e.uid===t.uid);r&&(r.valid&&r.valid(),r.shouldValidate&&r.shouldValidate());let o=0;o=this.watchers.findIndex(e=>e.uid===t.uid),this.watchers.splice(o,1),o=this.inputs.findIndex(e=>e.uid===t.uid),this.inputs.splice(o,1),delete this.errorBag[t.uid]}function validateSection(e){const t=this.inputs.filter(t=>t.__cardSection==e&&t.validate&&!t.validate(!0)).length;return!t}function watchInput(e){const watcher=e=>e.$watch("hasError",t=>{this.errorBag[e.uid]=t},{immediate:!0}),t={uid:e.uid,valid:null,shouldValidate:null};return this.lazyValidation?t.shouldValidate=e.$watch("shouldValidate",r=>{r&&(Object.prototype.hasOwnProperty.call(this.errorBag,e.uid)||(t.valid=watcher(e)))}):t.valid=watcher(e),t}function validate_mixin_reset(){for(let e=this.inputs.length;e>=0;e--)this.inputs[e].reset();this.lazyValidation&&setTimeout(()=>{this.errorBag={}},0)}function resetValidation(){for(let e=this.inputs.length;e>=0;e--)this.inputs[e].resetValidation();this.lazyValidation&&setTimeout(()=>{this.errorBag={}},0)}function onErrorBagChanged(){if(this.errorBag){const e=Object.values(this.errorBag).includes(!0);this.isValid=!e}else this.isValid=!0}const mr={data(){return{inputs:[],watchers:[],errorBag:{},lazyValidation:!1,isValid:!0,section:null,customValidateFunc:null}},watch:{errorBag:{deep:!0,immediate:!0,handler(){return onErrorBagChanged.bind(this)()}}},provide(){return{form:{register:register.bind(this),unregister:unregister.bind(this)}}},methods:{validate(){let e=!0;this.customValidateFunc&&(e=this.customValidateFunc());const t="boolean"===typeof e&&e;return!!t&&validate.bind(this)()},register(e,t){return register.bind(this)(e,t)},unregister(e){return unregister.bind(this)(e)},validateSection(e){return validateSection.bind(this)(e)},watchInput(e){return watchInput.bind(this)(e)},reset(){return validate_mixin_reset.bind(this)()},resetValidation(){return resetValidation.bind(this)()}}};class ValidateMixin extends pr.Vue{inputs=[];watchers=[];errorBag={};lazyValidation=!1;isValid=!0;section=null;customValidateFunc;form={register:this.register.bind(this),unregister:this.unregister.bind(this)};onErrorBagChanged(){return onErrorBagChanged.bind(this)()}validate(){let e=!0;this.customValidateFunc&&(e=this.customValidateFunc());const t="boolean"===typeof e&&e;return!!t&&validate.bind(this)()}register(e,t){return register.bind(this)(e,t)}unregister(e){return unregister.bind(this)(e)}validateSection(e){return validateSection.bind(this)(e)}watchInput(e){return watchInput.bind(this)(e)}reset(){return validate_mixin_reset.bind(this)()}resetValidation(){return resetValidation.bind(this)()}}__decorate([(0,_r.Provide)(),__metadata("design:type",Object)],ValidateMixin.prototype,"form",void 0),__decorate([(0,_r.Watch)("errorBag",{deep:!0,immediate:!0}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],ValidateMixin.prototype,"onErrorBagChanged",null);const gr=mr;var hr,br;(function(e){e[e["Ok"]=0]="Ok",e[e["Cancel"]=1]="Cancel"})(hr||(hr={})),function(e){e[e["Alert"]=0]="Alert",e[e["Prompt"]=1]="Prompt",e[e["Info"]=2]="Info",e[e["Confirm"]=3]="Confirm",e[e["Select"]=4]="Select",e[e["CreateEdit"]=5]="CreateEdit"}(br||(br={}));const fr=17,xr=25,wr=68;class DialogManager{_visibled=[];_minimized=[];_viewPortWidth;static _id="";constructor(){this._viewPortWidth=window.innerWidth,window.addEventListener("resize",this.onResizeHandler.bind(this))}setMinimized(e){this._minimized=e}modalIdentity(e,t){return!(!e.hostObject||!t)&&(e.hostObject?.id===t?.id&&e.hostObject?.contentType===t?.contentType&&e.hostObject?.kind===t?.kind)}tryToOpen(e){const t=this._visibled.concat(this._minimized).find(t=>this.modalIdentity(t,e));return!t}dialogCreated(e){e&&(e.el=document.querySelector(`.${this.uniqKey(e)}`),this.shiftLeft(e),this.refreshPositions())}dialogModalChanged(e,t=null){if(e)if(e.noModal){let t,r=!1;const resizeEnd=()=>{clearTimeout(t),o.unobserve(e.el),this.refreshPositions(),r=!0},o=new window.ResizeObserver(e=>{window.requestAnimationFrame(()=>{if(!Array.isArray(e)||!e.length)return null;e.length&&e[0].contentRect&&(clearTimeout(t),t=setTimeout(resizeEnd,50))})});o.observe(e.el),setTimeout(()=>{r||this.refreshPositions()},300)}else this.setDialogModal(e,t)}dialogProcessing(e){e&&(e.minimized=!0,this.dialogMinimizeChanged(e))}dialogMinimizeChanged(e){if(e)if(e.minimized){e.noModal||(e._wasModal=!0,e.noModal=!0);const t=this._visibled.findIndex(t=>this.modalIdentity(t,e.hostObject));t>-1&&this._visibled.splice(t,1),this.addToMinimized(e),this.refreshPositions()}else this.removeFromMinimized(e),this.toggleDialogShow(e),this.shiftLeft(e),e._wasModal&&(e.noModal=!1,delete e._wasModal),e.noModal?this.refreshPositions():this.setDialogModal(e)}dialogClosed(e){try{if(this.removeFromMinimized(e))return;const t=this._visibled.findIndex(t=>this.modalIdentity(t,e.hostObject));t>-1&&(this._visibled.splice(t,1),this.refreshPositions())}finally{DialogManager._id=""}}activate(e){let t=this._minimized.findIndex(t=>t===e),r=null;t>-1&&(r=this._minimized[t],this._minimized.splice(t,1)),r?(r.minimized=!1,this.dialogMinimizeChanged(r),this.refreshPositions()):(t=this._visibled.findIndex(t=>this.modalIdentity(t,e.hostObject)),t>-1&&this._visibled.splice(t,1),this.shiftLeft(e),this.refreshPositions())}onResizeHandler(){this._viewPortWidth=window.innerWidth,this.refreshPositions()}setParentDialog(e){for(const t of this._visibled.reverse())t.visible&&(e.hostObject.parentId=t.id)}hideDialog(e){const t=this._visibled.findIndex(t=>t.id===e);t>-1&&(this._visibled[t].visible=!1)}showDialog(e){const t=this._visibled.findIndex(t=>t.id===e);t>-1&&(this._visibled[t].visible=!0)}getParents(e){const t=[];let r=e.hostObject.parentId;while(r){const e=this._visibled.findIndex(e=>e.id===r);e>-1?(t.push(this._visibled[e]),r=this._visibled[e].hostObject?.parentId):r=null}return t}shiftLeft(e){this._visibled.push(e)}refreshPositions(){let e=0,t=-1,r=this._viewPortWidth;for(let o=this._visibled.length-1;o>=0;o--){const n=this._visibled[o];if(!n.noModal)continue;const i=n.el.clientWidth+fr;if(r<i){const e=this._visibled.shift();e.el.style.bottom="unset",e.el.style.right="unset",setTimeout(()=>{this.addToMinimized(e)},1)}else e=xr+i*++t,r-=xr+i,n.el.style.margin="0",n.el.style.position="absolute",n.el.style.bottom=`${wr}px`,n.el.style.right=`${e}px`,n.el.classList.remove("ld-dialog-content--hidden")}}setDialogModal(e,t=null){e&&(e.el.style.position="relative",e.el.style.top="unset",e.el.style.left="unset",e.el.style.bottom="unset",e.el.style.right="unset",e.el.parentElement.style.justifyContent="center",e.el.parentElement.style.alignItems="center")}addToMinimized(e){this.toggleDialogShow(e),e.minimized=!0,this._minimized.unshift(e)}removeFromMinimized(e){const t=this._minimized.findIndex(t=>this.modalIdentity(t,e.hostObject));return t>-1&&(this._minimized.splice(t,1),!0)}toggleDialogShow(e){"none"!==e.el.parentElement.style.display?(e._lastDisplayProp=e.el.parentElement.style.display,e.el.parentElement.style.display="none"):e.el.parentElement.style.display=e._lastDisplayProp}uniqKey(e){return`dlg-${e.id}`}static id(e){return DialogManager._id=e,DialogManager}static exec(e,t){switch(e.__constructor){case"AlertDialog":return DialogManager.alert(e);case"PromptDialog":return DialogManager.prompt(e);case"ConfirmDialog":return DialogManager.confirm(e);case"InfoDialog":return DialogManager.info(e,t);case"SelectDialog":return DialogManager.select(e,t);case"CreateEditDialog":return DialogManager.createEdit(e,t)}return null}static alert(e){const t={...e,type:br.Alert,managerId:DialogManager._id};return DialogManager.execAsync(t)}static prompt(e){const t={...e,type:br.Prompt,managerId:DialogManager._id};return DialogManager.execAsync(t)}static confirm(e){const t={...e,type:br.Confirm,closable:!0,managerId:DialogManager._id};return DialogManager.execAsync(t)}static info(e,t){const r={...e,type:br.Info,managerId:DialogManager._id};return r.hostObject||(r.hostObject={id:uidGen(6,"0-9"),contentType:0,kind:1}),DialogManager.execAsync(r,t)}static select(e,t){const r={...e,type:br.Select,managerId:DialogManager._id};return r.hostObject||(r.hostObject={id:uidGen(6,"0-9"),contentType:0,kind:1}),DialogManager.execAsync(r,t)}static createEdit(e,t){const r={...e,type:br.CreateEdit,managerId:DialogManager._id};return r.hostObject||(r.hostObject={id:uidGen(6,"0-9"),contentType:0,kind:1}),DialogManager.execAsync(r,t)}static execAsync(e,t){return new Promise(r=>{e.resolveFunction=r;let o=null;const n=e.managerId||"";t instanceof Function&&(o=async r=>{if(r.id===e.hostObject.id&&t instanceof Function){const r=await t();Y.eventBus.$off("dialog:created"+n,o),Y.eventBus.$emit("dialog:props"+n,r,e.hostObject)}},Y.eventBus.$on("dialog:created"+n,o)),Y.eventBus.$emit("dialog:open"+n,e)})}}class Dialog{title;content;pressEnterAsOk;pressEscAsCancel;hostObject;size;width;height;align;constructor(e){this.title=e.title,this.content=e.content,this.pressEnterAsOk=!1!==e.pressEnterAsOk,this.pressEscAsCancel=!1!==e.pressEscAsCancel,this.hostObject=e.hostObject,this.size=e.size||"s",this.width=e.width,this.height=e.height,this.align=e.align}}class AlertDialog extends Dialog{__constructor;constructor(e){super({...e}),this.__constructor="AlertDialog"}}class PromptDialog extends Dialog{__constructor;constructor(e){super({...e}),this.__constructor="PromptDialog"}}class InteractiveDialog extends Dialog{loading;fullHeight;closable;hideFooter;constructor(e){super({...e}),this.loading=e.loading,this.fullHeight=e.fullHeight,this.closable=e.closable,this.hideFooter=e.hideFooter}}class ConfirmDialog extends InteractiveDialog{__constructor;okResult;cancelResult;constructor(e){super({...e}),this.__constructor="ConfirmDialog",this.okResult=e.okResult,this.cancelResult=e.cancelResult}}class InfoDialog extends InteractiveDialog{__constructor;component;componentProps;minimizable;description;help;constructor(e){super({...e}),this.__constructor="InfoDialog",this.component=e.component,this.componentProps=e.componentProps,this.minimizable=e.minimizable,this.description=e.description,this.help=e.help}}class SelectDialog extends InteractiveDialog{__constructor;component;componentProps;selectAsOk;help;constructor(e){super({...e}),this.__constructor="SelectDialog",this.component=e.component,this.componentProps=e.componentProps,this.selectAsOk=e.selectAsOk,this.help=e.help}}class CreateEditDialog extends InteractiveDialog{__constructor;component;componentProps;darkTitle;expandable;minimizable;collapsedSize;expandedSize;expanded;description;noModal;help;constructor(e){super({...e}),this.__constructor="CreateEditDialog",this.component=e.component,this.componentProps=e.componentProps,this.darkTitle=e.darkTitle,this.expandable=e.expandable,this.minimizable=e.minimizable,this.collapsedSize=e.collapsedSize,this.expandedSize=e.expandedSize,this.expanded=e.expanded,this.description=e.description,this.noModal=e.noModal,this.help=e.help}}var jr=__webpack_require__(9119);const vr={install(e,t){t||(t={}),t.language=t.language??"ru",t.prefix=t.prefix??"ld",t.aliases||(t.aliases={}),["ld-button","ld-toggle-buttons","ld-icon","ld-chip","ld-badge","ld-avatar","ld-splitter","ld-loader","ld-progress","ld-breadcrumbs","ld-edit-text","ld-datepicker","ld-calendar","ld-tab","ld-tabs","ld-page-toolbar","ld-select-list-box","ld-checkbox","ld-radiobutton","ld-radiogroup","ld-textarea","ld-select","ld-combobox","ld-timepicker","ld-text-viewer","ld-edit-masked-text","ld-text-markup","ld-switch","ld-dialog","ld-data-iterator","ld-pager","ld-edit-list-box","ld-uploader","ld-step","ld-slider","ld-datatable","ld-expansion-panel","ld-expansion-panels"].forEach(e=>{t.aliases?.[e]||(t.aliases[e]=e.replace("ld",t.prefix))}),e.config.globalProperties.$utils={...G},t.LdPager?.entityName instanceof Function&&e.provide("ldPagerOptions",{entityName:t.LdPager?.entityName}),e.config.globalProperties.$ldmui={options:(0,W.reactive)(t)};const r=__webpack_require__(1397).ru;e.config.globalProperties.$ldmuii18n={library:r,gettext:e=>r[e]??e},e.directive("active",J);const o={position:or.POSITION.BOTTOM_RIGHT,timeout:5e3,draggable:!1,newestOnTop:!0,pauseOnFocusLoss:!1,pauseOnHover:!1,hideProgressBar:!0};e.use(nr(),o);const n=document.createElement("style");n.innerHTML=(0,Y.generatePalette)(),n.id="ldmui-palette",document.body.appendChild(n),Je(e,t),Xe(e,t),be(e,t),re(e,t),le(e,t),X(e,t),Dt(e,t),Xt(e,t),ie(e,t),Ne(e,t),Me(e,t),ue(e,t),Pt(e,t),Vt(e,t),rt(e,t),wt(e,t),me(e,t),ut(e,t),mt(e,t),Gt(e,t),bt(e,t),we(e,t),Jt(e,t),Ut(e,t),Ve(e,t),Nt(e,t),Ot(e,t),Oe(e,t),qe(e,t),it(e,t),Pe(e,t),rr(e,t),lt(e,t),Mt(e,t),qt(e,t),De(e,t),Ue(e,t),Ge(e,t)}},qr=vr,kr=new Map;kr.set("en",()=>__webpack_require__(8179)),kr.set("ru",()=>__webpack_require__(1397));const yr={install(e,t){let r=e.config?.globalProperties?.$ldmui?.options?.language||"en",o={};try{if(!t)throw new Error("locale not defined");const e=JSON.parse(t);if(o=e[r],!o)throw new Error("locale not defined")}catch(e){r=kr.has(r)?r:"en";const t=kr.get(r);o=t()[r]}function gettext(e){return this.library[e]||e}e.config.globalProperties.$ldmuii18n={library:o,gettext:null},e.config.globalProperties.$ldmuii18n.gettext=gettext.bind(e.config.globalProperties.$ldmuii18n)}};return H})());
|
|
1
|
+
(function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("./components/ld-avatar.js"),require("./components/ld-badge.js"),require("./components/ld-breadcrumbs.js"),require("./components/ld-button.js"),require("./components/ld-calendar.js"),require("./components/ld-checkbox.js"),require("./components/ld-chip.js"),require("./components/ld-combobox.js"),require("./components/ld-data-iterator.js"),require("./components/ld-datepicker.js"),require("./components/ld-dialog.js"),require("./components/ld-edit-list-box.js"),require("./components/ld-edit-masked-text.js"),require("./components/ld-edit-text.js"),require("./components/ld-expansion-panel.js"),require("./components/ld-expansion-panels.js"),require("./components/ld-icon.js"),require("./components/ld-loader.js"),require("./components/ld-page-toolbar.js"),require("./components/ld-pager.js"),require("./components/ld-progress.js"),require("./components/ld-radiobutton.js"),require("./components/ld-radiogroup.js"),require("./components/ld-select-list-box.js"),require("./components/ld-select.js"),require("./components/ld-slider.js"),require("./components/ld-splitter.js"),require("./components/ld-step.js"),require("./components/ld-switch.js"),require("./components/ld-tab.js"),require("./components/ld-tabs.js"),require("./components/ld-text-markup.js"),require("./components/ld-text-viewer.js"),require("./components/ld-textarea.js"),require("./components/ld-timepicker.js"),require("./components/ld-toggle-buttons.js"),require("./components/ld-uploader.js"),require("./lib/toastification.js"),require("./utils/validators.js"),require("@ldmjs/core"),require("@ldmjs/datatable"),require("vue"),require("vue-class-component"),require("vue-property-decorator")):"function"===typeof define&&define.amd?define(["./components/ld-avatar.js","./components/ld-badge.js","./components/ld-breadcrumbs.js","./components/ld-button.js","./components/ld-calendar.js","./components/ld-checkbox.js","./components/ld-chip.js","./components/ld-combobox.js","./components/ld-data-iterator.js","./components/ld-datepicker.js","./components/ld-dialog.js","./components/ld-edit-list-box.js","./components/ld-edit-masked-text.js","./components/ld-edit-text.js","./components/ld-expansion-panel.js","./components/ld-expansion-panels.js","./components/ld-icon.js","./components/ld-loader.js","./components/ld-page-toolbar.js","./components/ld-pager.js","./components/ld-progress.js","./components/ld-radiobutton.js","./components/ld-radiogroup.js","./components/ld-select-list-box.js","./components/ld-select.js","./components/ld-slider.js","./components/ld-splitter.js","./components/ld-step.js","./components/ld-switch.js","./components/ld-tab.js","./components/ld-tabs.js","./components/ld-text-markup.js","./components/ld-text-viewer.js","./components/ld-textarea.js","./components/ld-timepicker.js","./components/ld-toggle-buttons.js","./components/ld-uploader.js","./lib/toastification.js","./utils/validators.js","@ldmjs/core","@ldmjs/datatable","vue","vue-class-component","vue-property-decorator"],t):"object"===typeof exports?exports["ldmui"]=t(require("./components/ld-avatar.js"),require("./components/ld-badge.js"),require("./components/ld-breadcrumbs.js"),require("./components/ld-button.js"),require("./components/ld-calendar.js"),require("./components/ld-checkbox.js"),require("./components/ld-chip.js"),require("./components/ld-combobox.js"),require("./components/ld-data-iterator.js"),require("./components/ld-datepicker.js"),require("./components/ld-dialog.js"),require("./components/ld-edit-list-box.js"),require("./components/ld-edit-masked-text.js"),require("./components/ld-edit-text.js"),require("./components/ld-expansion-panel.js"),require("./components/ld-expansion-panels.js"),require("./components/ld-icon.js"),require("./components/ld-loader.js"),require("./components/ld-page-toolbar.js"),require("./components/ld-pager.js"),require("./components/ld-progress.js"),require("./components/ld-radiobutton.js"),require("./components/ld-radiogroup.js"),require("./components/ld-select-list-box.js"),require("./components/ld-select.js"),require("./components/ld-slider.js"),require("./components/ld-splitter.js"),require("./components/ld-step.js"),require("./components/ld-switch.js"),require("./components/ld-tab.js"),require("./components/ld-tabs.js"),require("./components/ld-text-markup.js"),require("./components/ld-text-viewer.js"),require("./components/ld-textarea.js"),require("./components/ld-timepicker.js"),require("./components/ld-toggle-buttons.js"),require("./components/ld-uploader.js"),require("./lib/toastification.js"),require("./utils/validators.js"),require("@ldmjs/core"),require("@ldmjs/datatable"),require("vue"),require("vue-class-component"),require("vue-property-decorator")):e["ldmui"]=t(e["./components/ld-avatar.js"],e["./components/ld-badge.js"],e["./components/ld-breadcrumbs.js"],e["./components/ld-button.js"],e["./components/ld-calendar.js"],e["./components/ld-checkbox.js"],e["./components/ld-chip.js"],e["./components/ld-combobox.js"],e["./components/ld-data-iterator.js"],e["./components/ld-datepicker.js"],e["./components/ld-dialog.js"],e["./components/ld-edit-list-box.js"],e["./components/ld-edit-masked-text.js"],e["./components/ld-edit-text.js"],e["./components/ld-expansion-panel.js"],e["./components/ld-expansion-panels.js"],e["./components/ld-icon.js"],e["./components/ld-loader.js"],e["./components/ld-page-toolbar.js"],e["./components/ld-pager.js"],e["./components/ld-progress.js"],e["./components/ld-radiobutton.js"],e["./components/ld-radiogroup.js"],e["./components/ld-select-list-box.js"],e["./components/ld-select.js"],e["./components/ld-slider.js"],e["./components/ld-splitter.js"],e["./components/ld-step.js"],e["./components/ld-switch.js"],e["./components/ld-tab.js"],e["./components/ld-tabs.js"],e["./components/ld-text-markup.js"],e["./components/ld-text-viewer.js"],e["./components/ld-textarea.js"],e["./components/ld-timepicker.js"],e["./components/ld-toggle-buttons.js"],e["./components/ld-uploader.js"],e["./lib/toastification.js"],e["./utils/validators.js"],e["@ldmjs/core"],e["@ldmjs/datatable"],e["vue"],e["vue-class-component"],e["vue-property-decorator"])})(self,(e,t,r,o,i,n,s,a,l,d,c,u,p,_,m,g,h,b,f,x,w,j,v,q,k,y,D,A,C,M,S,T,z,B,O,P,I,R,V,$,E,N,F,L)=>(()=>{"use strict";var U={839(t){t.exports=e},2059(e){e.exports=t},9356(e){e.exports=r},2864(e){e.exports=o},4394(e){e.exports=i},395(e){e.exports=n},5482(e){e.exports=s},5165(e){e.exports=a},7313(e){e.exports=l},950(e){e.exports=d},7032(e){e.exports=c},1031(e){e.exports=u},4538(e){e.exports=p},2894(e){e.exports=_},4108(e){e.exports=m},7353(e){e.exports=g},6963(e){e.exports=h},6561(e){e.exports=b},7775(e){e.exports=f},7807(e){e.exports=x},5445(e){e.exports=w},3139(e){e.exports=j},6466(e){e.exports=v},5475(e){e.exports=q},2748(e){e.exports=k},5647(e){e.exports=y},5269(e){e.exports=D},3034(e){e.exports=A},832(e){e.exports=C},2159(e){e.exports=M},3052(e){e.exports=S},3120(e){e.exports=T},958(e){e.exports=z},8070(e){e.exports=B},4605(e){e.exports=O},732(e){e.exports=P},4326(e){e.exports=I},9471(e){e.exports=R},9119(e){e.exports=V},934(e){e.exports=$},4451(e){e.exports=E},2380(e){e.exports=N},9299(e){e.exports=F},5070(e){e.exports=L},8179(e){e.exports=JSON.parse('{"en":{"Hours":"","Minutes":"","Seconds":"","Hide tabs":"","Show tabs":"","Expand":"","Collapsed windows":"","Close":"","Close all":"","Hide password":"","Show password":"","Text":"","Preview":"","No data":""}}')},1397(e){e.exports=JSON.parse('{"ru":{"Hours":"Часы","Minutes":"Минуты","Seconds":"Секунды","Jan":"Январь","Feb":"Февраль","Mar":"Март","Apr":"Апрель","May":"Май","Jun":"Июнь","Jul":"Июль","Aug":"Август","Sep":"Сентябрь","Oct":"Октябрь","Nov":"Ноябрь","Dec":"Декабрь","Mon":"Пн","Tue":"Вт","Wed":"Ср","Thu":"Чт","Fri":"Пт","Sat":"Сб","Sun":"Вс","Hide tabs":"Скрыть вкладки","Show tabs":"Показать вкладки","Expand":"Развернуть","Collapsed windows":"Свернутые окна","Close":"Закрыть","Close all":"Закрыть все","Hide password":"Скрыть пароль","Show password":"Показать пароль","Text":"Текст","Preview":"Превью","Bold":"Полужирный","Underline":"Подчеркнутый","Italic":"Курсив","No data":"Нет данных","No Elements":"Нет элементов для отображения","Loading":"Идет загрузка...","Search":"Идет поиск...","No Search Result":"Поиск не дал результатов","Help":"Справка","Reqiured Message":"Это поле обязательно","Timepicker Placeholder":"ЧЧ:ММ","Uploader Required Message":"Добавьте файл","Uploader Placeholder":"Выберите файл или перетащите в эту область","Uploader File Size Overflow":"Этот файл слишком большой","Uploader Load Error":"Ошибка загрузки файла","Uploader Load Abort":"Загузка файла отменена","Uploader Load Timed Out":"Истекло время ожидания ответа от сервера","Dialog Close":"Закрыть","Dialog Save":"Сохранить","Dialog Select":"Выбрать","Dialog Confirm":"Да","Dialog Reject":"Нет","Dialog Cancel":"Отменить","Dialog Go Back":"Назад","Dialog Close Confirm Title":"Закрыть окно?","Dialog Close Confirm Text":"Внесенные данные будут безвозвратно утеряны. Вы уверены, что хотите закрыть окно?","Dialog Close All Confirm Title":"Вы уверены, что хотите закрыть все окна?","Dialog Close All Confirm Text":"Возможно, вами были внесены изменения","Dialog Close Parent Confrim Title":"Завершить сценарий","Dialog Close Parent Confrim Text":"Внесенные данные будут безвозвратно утеряны. Вы уверены, что хотите закрыть все окна и завершить сценарий?"}}')}},Z={};function __webpack_require__(e){var t=Z[e];if(void 0!==t)return t.exports;var r=Z[e]={exports:{}};return U[e](r,r.exports,__webpack_require__),r.exports}(()=>{__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return __webpack_require__.d(t,{a:t}),t}})(),(()=>{__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var H={};__webpack_require__.r(H),__webpack_require__.d(H,{AlertDialog:()=>AlertDialog,ConfirmDialog:()=>ConfirmDialog,CreateEditDialog:()=>CreateEditDialog,DialogManager:()=>DialogManager,InfoDialog:()=>InfoDialog,ModalButton:()=>hr,ModalType:()=>br,PromptDialog:()=>PromptDialog,SelectDialog:()=>SelectDialog,ValidateMixin:()=>ValidateMixin,ValidateMixinOptions:()=>gr,alphaNumRule:()=>jr.alphaNumRule,alphaRule:()=>jr.alphaRule,awaiting:()=>awaiting,base64:()=>nr,base64ToBlob:()=>base64ToBlob,base64ToUint8Array:()=>base64ToUint8Array,betweenRule:()=>jr.betweenRule,cookie:()=>sr,datetime:()=>lr,decimalRule:()=>jr.decimalRule,deepValueGetter:()=>deepValueGetter,default:()=>qr,defaults:()=>ur,delay:()=>delay,emailRule:()=>jr.emailRule,fileToArrayBuffer:()=>fileToArrayBuffer,fileToBase64:()=>fileToBase64,files:()=>cr,hexToArrayBuffer:()=>hexToArrayBuffer,integerRule:()=>jr.integerRule,ipAddressRule:()=>jr.ipAddressRule,isDefined:()=>isDefined,isObjectEmpty:()=>isObjectEmpty,ldmuii18n:()=>yr,macAddressRule:()=>jr.macAddressRule,maxLengthRule:()=>jr.maxLengthRule,maxValueRule:()=>jr.maxValueRule,minValueRule:()=>jr.minValueRule,numericRule:()=>jr.numericRule,phoneRule:()=>jr.phoneRule,pluralizeNoun:()=>pluralizeNoun,removeDuplicates:()=>removeDuplicates,requiredRule:()=>jr.requiredRule,strings:()=>ar,uidGen:()=>uidGen,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToHex:()=>uint8ArrayToHex,urlRegexp:()=>dr,urlRule:()=>jr.urlRule,validators:()=>jr.validators});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{awaiting:()=>awaiting,base64:()=>nr,base64ToBlob:()=>base64ToBlob,base64ToUint8Array:()=>base64ToUint8Array,cookie:()=>sr,datetime:()=>lr,deepValueGetter:()=>deepValueGetter,delay:()=>delay,fileToArrayBuffer:()=>fileToArrayBuffer,fileToBase64:()=>fileToBase64,files:()=>cr,hexToArrayBuffer:()=>hexToArrayBuffer,isDefined:()=>isDefined,isObjectEmpty:()=>isObjectEmpty,pluralizeNoun:()=>pluralizeNoun,removeDuplicates:()=>removeDuplicates,strings:()=>ar,uidGen:()=>uidGen,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToHex:()=>uint8ArrayToHex,urlRegexp:()=>dr});var Y=__webpack_require__(934),W=__webpack_require__(2380);const J={beforeMount(e,t){const r="--active",o=t.value;e.classList[o?"add":"remove"](r)},updated(e,t){const r="--active",o=t.value;e.classList[o?"add":"remove"](r)}};var K=__webpack_require__(839),Q=__webpack_require__.n(K);function reg(e,t){e.component(t.aliases["ld-avatar"],Q())}const X=reg;var ee=__webpack_require__(2059),te=__webpack_require__.n(ee);function ld_badge_reg(e,t){e.component(t.aliases["ld-badge"],te())}const re=ld_badge_reg;var oe=__webpack_require__(9356),ie=__webpack_require__.n(oe);function ld_breadcrumbs_reg(e,t){ie().props={...ie().props,home:{default:t.LdBreadcrumbs?.home?t.LdBreadcrumbs?.home:null}},e.component(t.aliases["ld-breadcrumbs"],ie())}const ne=ld_breadcrumbs_reg;var se=__webpack_require__(2864),ae=__webpack_require__.n(se);function ld_button_reg(e,t){e.component(t.aliases["ld-button"],ae())}const le=ld_button_reg;var de=__webpack_require__(4394),ce=__webpack_require__.n(de);function ld_calendar_reg(e,t){e.component(t.aliases["ld-calendar"],ce())}const ue=ld_calendar_reg;var pe=__webpack_require__(395),_e=__webpack_require__.n(pe);function ld_checkbox_reg(e,t){e.component(t.aliases["ld-checkbox"],_e())}const me=ld_checkbox_reg;var ge=__webpack_require__(5482),he=__webpack_require__.n(ge);function ld_chip_reg(e,t){e.component(t.aliases["ld-chip"],he())}const be=ld_chip_reg;var fe=__webpack_require__(5165),xe=__webpack_require__.n(fe);function ld_combobox_reg(e,t){e.component(t.aliases["ld-combobox"],xe())}const we=ld_combobox_reg;var je=__webpack_require__(7313),ve=__webpack_require__.n(je);function ld_data_iterator_reg(e,t){e.component(t.aliases["ld-data-iterator"],ve())}const qe=ld_data_iterator_reg;var ke=__webpack_require__(4451),ye=__webpack_require__.n(ke);function ld_datatable_reg(e,t){e.component(t.aliases["ld-datatable"],ye())}const De=ld_datatable_reg;var Ae=__webpack_require__(950),Ce=__webpack_require__.n(Ae);function ld_datepicker_reg(e,t){e.component(t.aliases["ld-datepicker"],Ce())}const Me=ld_datepicker_reg;var Se=__webpack_require__(7032),Te=__webpack_require__.n(Se);function ld_dialog_reg(e,t){e.component(t.aliases["ld-dialog"],Te())}const ze=ld_dialog_reg;var Be=__webpack_require__(1031),Oe=__webpack_require__.n(Be);function ld_edit_list_box_reg(e,t){e.component(t.aliases["ld-edit-list-box"],Oe())}const Pe=ld_edit_list_box_reg;var Ie=__webpack_require__(4538),Re=__webpack_require__.n(Ie);function ld_edit_masked_text_reg(e,t){e.component(t.aliases["ld-edit-masked-text"],Re())}const Ve=ld_edit_masked_text_reg;var $e=__webpack_require__(2894),Ee=__webpack_require__.n($e);function ld_edit_text_reg(e,t){e.component(t.aliases["ld-edit-text"],Ee())}const Ne=ld_edit_text_reg;var Fe=__webpack_require__(4108),Le=__webpack_require__.n(Fe);function ld_expansion_panel_reg(e,t){e.component(t.aliases["ld-expansion-panel"],Le())}const Ue=ld_expansion_panel_reg;var Ze=__webpack_require__(7353),He=__webpack_require__.n(Ze);function ld_expansion_panels_reg(e,t){e.component(t.aliases["ld-expansion-panels"],He())}const Ge=ld_expansion_panels_reg;var Ye=__webpack_require__(6963),We=__webpack_require__.n(Ye);function ld_icon_reg(e,t){We().props={...We().props,path:{default:t.LdIcon?.path??"icons"},map:{default:t.LdIcon?.map??{icons:[]}}},e.component(t.aliases["ld-icon"],We())}const Je=ld_icon_reg;var Ke=__webpack_require__(6561),Qe=__webpack_require__.n(Ke);function ld_loader_reg(e,t){e.component(t.aliases["ld-loader"],Qe())}const Xe=ld_loader_reg;var et=__webpack_require__(7775),tt=__webpack_require__.n(et);function ld_page_toolbar_reg(e,t){e.component(t.aliases["ld-page-toolbar"],tt())}const rt=ld_page_toolbar_reg;var ot=__webpack_require__(7807),it=__webpack_require__.n(ot);function ld_pager_reg(e,t){e.component(t.aliases["ld-pager"],it())}const nt=ld_pager_reg;var st=__webpack_require__(5445),at=__webpack_require__.n(st);function ld_progress_reg(e,t){e.component(t.aliases["ld-progress"],at())}const lt=ld_progress_reg;var dt=__webpack_require__(3139),ct=__webpack_require__.n(dt);function ld_radiobutton_reg(e,t){e.component(t.aliases["ld-radiobutton"],ct())}const ut=ld_radiobutton_reg;var pt=__webpack_require__(6466),_t=__webpack_require__.n(pt);function ld_radiogroup_reg(e,t){e.component(t.aliases["ld-radiogroup"],_t())}const mt=ld_radiogroup_reg;var gt=__webpack_require__(2748),ht=__webpack_require__.n(gt);function ld_select_reg(e,t){e.component(t.aliases["ld-select"],ht())}const bt=ld_select_reg;var ft=__webpack_require__(5475),xt=__webpack_require__.n(ft);function ld_select_list_box_reg(e,t){e.component(t.aliases["ld-select-list-box"],xt())}const wt=ld_select_list_box_reg;var jt=__webpack_require__(5647),vt=__webpack_require__.n(jt);function ld_slider_reg(e,t){e.component(t.aliases["ld-slider"],vt())}const qt=ld_slider_reg;var kt=__webpack_require__(5269),yt=__webpack_require__.n(kt);function ld_splitter_reg(e,t){e.component(t.aliases["ld-splitter"],yt())}const Dt=ld_splitter_reg;var At=__webpack_require__(3034),Ct=__webpack_require__.n(At);function ld_step_reg(e,t){e.component(t.aliases["ld-step"],Ct())}const Mt=ld_step_reg;var St=__webpack_require__(832),Tt=__webpack_require__.n(St);function ld_switch_reg(e,t){e.component(t.aliases["ld-switch"],Tt())}const zt=ld_switch_reg;var Bt=__webpack_require__(2159),Ot=__webpack_require__.n(Bt);function ld_tab_reg(e,t){e.component(t.aliases["ld-tab"],Ot())}const Pt=ld_tab_reg;var It=__webpack_require__(3052),Rt=__webpack_require__.n(It);function ld_tabs_reg(e,t){Rt().props={...Rt().props,header:{default:t.LdTabs?.header}},e.component(t.aliases["ld-tabs"],Rt())}const Vt=ld_tabs_reg;var $t=__webpack_require__(3120),Et=__webpack_require__.n($t);function ld_text_markup_reg(e,t){e.component(t.aliases["ld-text-markup"],Et())}const Nt=ld_text_markup_reg;var Ft=__webpack_require__(958),Lt=__webpack_require__.n(Ft);function ld_text_viewer_reg(e,t){e.component(t.aliases["ld-text-viewer"],Lt())}const Ut=ld_text_viewer_reg;var Zt=__webpack_require__(8070),Ht=__webpack_require__.n(Zt);function ld_textarea_reg(e,t){e.component(t.aliases["ld-textarea"],Ht())}const Gt=ld_textarea_reg;var Yt=__webpack_require__(4605),Wt=__webpack_require__.n(Yt);function ld_timepicker_reg(e,t){e.component(t.aliases["ld-timepicker"],Wt())}const Jt=ld_timepicker_reg;var Kt=__webpack_require__(732),Qt=__webpack_require__.n(Kt);function ld_toggle_buttons_reg(e,t){e.component(t.aliases["ld-toggle-buttons"],Qt())}const Xt=ld_toggle_buttons_reg;var er=__webpack_require__(4326),tr=__webpack_require__.n(er);function ld_uploader_reg(e,t){e.component(t.aliases["ld-uploader"],tr())}const rr=ld_uploader_reg;var or=__webpack_require__(9471),ir=__webpack_require__.n(or);async function awaiting(e){let t=null;const r=0;let o=null;const i=new Promise(e=>{t=e});o=setInterval(()=>{const i=e();(r>100||Boolean(i))&&(clearInterval(o),t(i??!0))},100),await i}class Base64Util{_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";encode(e){let t,r,o,i,n,s,a,l="",d=0;e=Base64Util._utf8_encode(e);while(d<e.length)t=e.charCodeAt(d++),r=e.charCodeAt(d++),o=e.charCodeAt(d++),i=t>>2,n=(3&t)<<4|r>>4,s=(15&r)<<2|o>>6,a=63&o,isNaN(r)?s=a=64:isNaN(o)&&(a=64),l=l+this._keyStr.charAt(i)+this._keyStr.charAt(n)+this._keyStr.charAt(s)+this._keyStr.charAt(a);return l}decode(e){let t,r,o,i,n,s,a,l="",d=0;e=e.replace(/[^\d+/=A-Za-z]/g,"");while(d<e.length)i=this._keyStr.indexOf(e.charAt(d++)),n=this._keyStr.indexOf(e.charAt(d++)),s=this._keyStr.indexOf(e.charAt(d++)),a=this._keyStr.indexOf(e.charAt(d++)),t=i<<2|n>>4,r=(15&n)<<4|s>>2,o=(3&s)<<6|a,l+=String.fromCharCode(t),64!==s&&(l+=String.fromCharCode(r)),64!==a&&(l+=String.fromCharCode(o));return l=Base64Util._utf8_decode(l),l}static _utf8_encode(e){e=e.replace(/\r\n/g,"\n");let t="";for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);o<128?t+=String.fromCharCode(o):o>127&&o<2048?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128))}return t}static _utf8_decode(e){let t="",r=0,o=0,i=0,n=0;while(r<e.length)o=e.charCodeAt(r),o<128?(t+=String.fromCharCode(o),r++):o>191&&o<224?(i=e.charCodeAt(r+1),t+=String.fromCharCode((31&o)<<6|63&i),r+=2):(i=e.charCodeAt(r+1),n=e.charCodeAt(r+2),t+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&n),r+=3);return t}isValid(e){const t=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/gim;return t.test(e)}}const nr=new Base64Util;class Cookie{get(e){const t=e.replace(/([$()*+./?[\\\]^{|}])/g,"\\$1"),r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r&&r[1]&&r[1].length?r[1]:null}set(e,t,r){let o=0;switch(r){case"day":o=864e5;break;case"month":o=2592e6;break}let i="";o&&(o=Date.now()+o,i=new Date(o).toUTCString()),document.cookie=e+"="+t+"; path=/; expires="+i}delete(e){document.cookie=e+"=; path=/; expires=-1"}}const sr=new Cookie;function fileToArrayBuffer(e){return new Promise(t=>{const r=new FileReader;r.onloadend=function(){t(r.result)},r.readAsArrayBuffer(e)})}function fileToBase64(e){return new Promise((t,r)=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{let e=String(o.result);e.includes(",")&&(e=e.split(",")[1]),t(e)},o.onerror=e=>r(e)})}function base64ToUint8Array(e){if(!e.trim())return null;const t=window.atob(e);let r=t.length;const o=new Uint8Array(r);while(r--)o[r]=t.charCodeAt(r);return o}function base64ToBlob(e,t=512){const r=window.atob(e),o=[];for(let e=0;e<r.length;e+=t){const i=r.slice(e,e+t),n=new Array(i.length);for(let e=0;e<i.length;e++)n[e]=i.charCodeAt(e);const s=new Uint8Array(n);o.push(s)}return new Blob(o)}function uint8ArrayToHex(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r]<0?e[r]+256:e[r];t.push((o>>>4).toString(16)),t.push((15&o).toString(16))}return t.join("")}function hexToArrayBuffer(e){if(e=e.replace(/^0x/,""),e.length%2!==0)return console.log("WARNING: expecting an even number of characters in the hexString"),null;const t=e.match(/[\sg-z]/i);if(t)return console.log("WARNING: found non-hex characters",t),null;const r=e.match(/[\da-f]{2}/gi),o=[];for(const e of r)o.push(parseInt(e,16));return o}function uint8ArrayToBase64(e){const t=e.reduce((e,t)=>e+String.fromCharCode.apply(null,[t]),"");return window.btoa(t)}function deepValueGetter(e,t){if(null===e)return"";if(!e||!t)return e;const r=e[t];if(void 0!==r)return r;let o=e;const i=t.split(".");if(i.length)for(const e of i)if(o=o[e],void 0===o||null===o)return"";return o}function removeDuplicates(e,t){const r=[];return e.map(e=>r.includes(deepValueGetter(e,t))?null:(r.push(deepValueGetter(e,t)),e)).filter(e=>Boolean(e))}async function delay(e){return new Promise(t=>setTimeout(()=>t(),e))}function isDefined(e){const t="number"===typeof e&&isNaN(e);return null!==e&&void 0!==e&&!t}function isObjectEmpty(e){for(const t in e)return!1;return!0}function pluralizeNoun(e,t,r,o,i=!0){if(!e)return"";let n;return n="string"===typeof e?Number(e.match(/\d+\.?\d*/g)):Math.abs(e),n%=100,n>=5&&n<=20?i?`${e} ${o}`:`${o}`:(n%=10,1===n?i?`${e} ${t}`:`${t}`:n>=2&&n<=4?i?`${e} ${r}`:`${r}`:i?`${e} ${o}`:`${o}`)}class Strings{camelCase(e){return e=e.replace(/[^\d A-Za-z]/g," "),e=e.replace(/([a-z](?=[A-Z]))/g,"$1 "),e=e.replace(/([^\d A-Za-z])|^\d+/g,"").trim().toLowerCase(),e=e.replace(/([\d ]+)([A-Za-z])/g,(e,t,r)=>t.trim()+r.toUpperCase()),e}capitalize(e){if(!e)return e;const t=e[0],r=e.substring(1);return`${t.toUpperCase()}${r}`}}const ar=new Strings;class Datetime{toDate(e){return e instanceof Date?e:Array.isArray(e)?new Date(e[0],e[1],e[2]):"number"===typeof e||"string"===typeof e?new Date(e):"object"===typeof e&&"year"in e&&"month"in e&&"date"in e?new Date(e.year,e.month,e.date,e.hours,e.minutes,e.seconds,e.ms):e}localToISO(e,t="ru"){const{d:r,m:o,y:i,hh:n,mm:s,ss:a}=this.parseDate(e,t);if(r&&o&&i){let e=`${i}-${o}-${r}`;return e=n&&s?`${e}T${n}:${s}:${a||"00"}`:`${e}T00:00:00`,e}return""}dateToLocal(e,t="ru"){const r=this.toDate(e);return this.formatDate(r,"ru"===t?"DD.MM.YYYY":"MM/DD/YYYY")}compare(e,t,r=!0){if(!e||!t)return NaN;if(e=this.toDate(e),t=this.toDate(t),r){const r=e?this.toDate(e).valueOf():0,o=t?this.toDate(t).valueOf():0;return isFinite(r)&&isFinite(o)?Number(r>o)-Number(r<o):NaN}let o=0;return e.getDate()!==t.getDate()&&(o=e.getDate()>t.getDate()?1:-1),e.getMonth()!==t.getMonth()&&(o=e.getMonth()>t.getMonth()?1:-1),e.getFullYear()!==t.getFullYear()&&(o=e.getFullYear()>t.getFullYear()?1:-1),o}toServerString(e){if(!e)return null;const t=-e.getTimezoneOffset(),r=t>=0?"+":"-",pad=function(e){const t=Math.abs(Math.floor(e));return(t<10?"0":"")+t};return`${e.getFullYear()}-${pad(e.getMonth()+1)}-${pad(e.getDate())}T${pad(e.getHours())}:${pad(e.getMinutes())}:${pad(e.getSeconds())}${r}${pad(t/60)}:${pad(t%60)}`}formatDate(e,t){const r=String(e.getDate()),o=String(e.getMonth()+1),i=String(e.getFullYear()),n=String(e.getHours()),s=String(e.getMinutes()),a=String(e.getSeconds());return t.replace(/DD/g,this.leaderZero(r)).replace(/MM/g,this.leaderZero(o)).replace(/YYYY/g,i).replace(/hh/g,this.leaderZero(n)).replace(/mm/g,this.leaderZero(s)).replace(/ss/g,this.leaderZero(a))}leaderZero(e){return"number"===typeof e&&(e=String(e)),1===e.length?"0"+e:e}parseDate(e,t="ru"){let r=null;if("ru"===t&&(r=/^(\d\d?).(\d\d?).(\d\d\d?\d?)(, )?(\d\d)?:?(\d\d)?$/.exec(e)),"en"===t&&(r=/^(\d\d?)\/(\d\d?)\/(\d\d\d?\d?)$/.exec(e)),!r)return null;const o={d:null,m:null,y:null,hh:null,mm:null,ss:null};return r[1]&&(o["ru"===t?"d":"m"]=this.leaderZero(r[1])),r[2]&&(o["ru"===t?"m":"d"]=this.leaderZero(r[2])),r[3]&&(o["y"]=r[3]),r[5]&&(o["hh"]=this.leaderZero(r[5])),r[6]&&(o["mm"]=this.leaderZero(r[6])),r[7]&&(o["ss"]=this.leaderZero(r[7])),o}}const lr=new Datetime;function uidGen(e=6,t){let r="",o="";switch(t){case"a-z":o="abcdefghijklmnopqrstuvwxyz";break;case"A-Z":o="ABCDEFGHIJKLMNOPQRSTUWVXYZ";break;case"0-9":o="1234567890";break;case"a-zA-Z":o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUWVXYZ";break;case"a-z0-9":o="abcdefghijklmnopqrstuvwxyz1234567890";break;case"A-Z0-9":o="ABCDEFGHIJKLMNOPQRSTUWVXYZ1234567890";break;default:o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUWVXYZ1234567890"}for(let t=0;t<e;t++)r+=o.charAt(Math.floor(Math.random()*o.length));return"0-9"===t?Number(r):r}const dr=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\\[\]{};:'".,<>?«»“”‘’]))/i;class Files{getExtension(e){return e?e.slice((e.lastIndexOf(".")-1>>>0)+2).toLowerCase():""}getFileName(e){if(!e)return"";const t=this.getExtension(e);return e.slice(0,-t.length-1)}formatSize(e,t=2){if(!e)return"0 Bytes";if("string"===typeof e&&(e=Number(e)),Number.isNaN(e)||0===e)return"0 Bytes";const r=1024,o=t<=0?0:t||2,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,n)).toFixed(o))+i[n]}}const cr=new Files,ur={global:{ripple:!1,density:"compact"},VToolbar:{height:60,density:"default"},VTooltip:{scrollStrategy:"close",location:"bottom",contentClass:["bg-dark","ld-tooltip"],noClickAnimation:!0,openDelay:600},VContainer:{fluid:!0},VBtn:{elevation:0},VList:{lines:!1,elevation:0},VMenu:{transition:"toggle-slide-y-transition",location:"bottom"}};var pr=__webpack_require__(9299),_r=__webpack_require__(5070),__decorate=function(e,t,r,o){var i,n=arguments.length,s=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,r,s):i(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},__metadata=function(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)};function validate(){const e=this.inputs.filter(e=>e.validate&&!e.validate(!0)).length;return!e}function register(e,t){t&&(this.section=t),this.section&&e.validate&&(e.__cardSection=this.section);const r=this.watchInput(e);this.inputs.push(e),this.watchers.push(r)}function unregister(e){const t=this.inputs.find(t=>t.uid===e.uid);if(!t)return;const r=this.watchers.find(e=>e.uid===t.uid);r&&(r.valid&&r.valid(),r.shouldValidate&&r.shouldValidate());let o=0;o=this.watchers.findIndex(e=>e.uid===t.uid),this.watchers.splice(o,1),o=this.inputs.findIndex(e=>e.uid===t.uid),this.inputs.splice(o,1),delete this.errorBag[t.uid]}function validateSection(e){const t=this.inputs.filter(t=>t.__cardSection==e&&t.validate&&!t.validate(!0)).length;return!t}function watchInput(e){const watcher=e=>e.$watch("hasError",t=>{this.errorBag[e.uid]=t},{immediate:!0}),t={uid:e.uid,valid:null,shouldValidate:null};return this.lazyValidation?t.shouldValidate=e.$watch("shouldValidate",r=>{r&&(Object.prototype.hasOwnProperty.call(this.errorBag,e.uid)||(t.valid=watcher(e)))}):t.valid=watcher(e),t}function validate_mixin_reset(){for(let e=this.inputs.length;e>=0;e--)this.inputs[e].reset();this.lazyValidation&&setTimeout(()=>{this.errorBag={}},0)}function resetValidation(){for(let e=this.inputs.length;e>=0;e--)this.inputs[e].resetValidation();this.lazyValidation&&setTimeout(()=>{this.errorBag={}},0)}function onErrorBagChanged(){if(this.errorBag){const e=Object.values(this.errorBag).includes(!0);this.isValid=!e}else this.isValid=!0}const mr={data(){return{inputs:[],watchers:[],errorBag:{},lazyValidation:!1,isValid:!0,section:null,customValidateFunc:null}},watch:{errorBag:{deep:!0,immediate:!0,handler(){return onErrorBagChanged.bind(this)()}}},provide(){return{form:{register:register.bind(this),unregister:unregister.bind(this)}}},methods:{validate(){let e=!0;this.customValidateFunc&&(e=this.customValidateFunc());const t="boolean"===typeof e&&e;return!!t&&validate.bind(this)()},register(e,t){return register.bind(this)(e,t)},unregister(e){return unregister.bind(this)(e)},validateSection(e){return validateSection.bind(this)(e)},watchInput(e){return watchInput.bind(this)(e)},reset(){return validate_mixin_reset.bind(this)()},resetValidation(){return resetValidation.bind(this)()}}};class ValidateMixin extends pr.Vue{inputs=[];watchers=[];errorBag={};lazyValidation=!1;isValid=!0;section=null;customValidateFunc;form={register:this.register.bind(this),unregister:this.unregister.bind(this)};onErrorBagChanged(){return onErrorBagChanged.bind(this)()}validate(){let e=!0;this.customValidateFunc&&(e=this.customValidateFunc());const t="boolean"===typeof e&&e;return!!t&&validate.bind(this)()}register(e,t){return register.bind(this)(e,t)}unregister(e){return unregister.bind(this)(e)}validateSection(e){return validateSection.bind(this)(e)}watchInput(e){return watchInput.bind(this)(e)}reset(){return validate_mixin_reset.bind(this)()}resetValidation(){return resetValidation.bind(this)()}}__decorate([(0,_r.Provide)(),__metadata("design:type",Object)],ValidateMixin.prototype,"form",void 0),__decorate([(0,_r.Watch)("errorBag",{deep:!0,immediate:!0}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],ValidateMixin.prototype,"onErrorBagChanged",null);const gr=mr;var hr,br;(function(e){e[e["Ok"]=0]="Ok",e[e["Cancel"]=1]="Cancel"})(hr||(hr={})),function(e){e[e["Alert"]=0]="Alert",e[e["Prompt"]=1]="Prompt",e[e["Info"]=2]="Info",e[e["Confirm"]=3]="Confirm",e[e["Select"]=4]="Select",e[e["CreateEdit"]=5]="CreateEdit"}(br||(br={}));const fr=17,xr=25,wr=68;class DialogManager{_visibled=[];_minimized=[];_viewPortWidth;static _id="";constructor(){this._viewPortWidth=window.innerWidth,window.addEventListener("resize",this.onResizeHandler.bind(this))}setMinimized(e){this._minimized=e}modalIdentity(e,t){return!(!e.hostObject||!t)&&(e.hostObject?.id===t?.id&&e.hostObject?.contentType===t?.contentType&&e.hostObject?.kind===t?.kind)}tryToOpen(e){const t=this._visibled.concat(this._minimized).find(t=>this.modalIdentity(t,e));return!t}dialogCreated(e){e&&(e.el=document.querySelector(`.${this.uniqKey(e)}`),this.shiftLeft(e),this.refreshPositions())}dialogModalChanged(e,t=null){if(e)if(e.noModal){let t,r=!1;const resizeEnd=()=>{clearTimeout(t),o.unobserve(e.el),this.refreshPositions(),r=!0},o=new window.ResizeObserver(e=>{window.requestAnimationFrame(()=>{if(!Array.isArray(e)||!e.length)return null;e.length&&e[0].contentRect&&(clearTimeout(t),t=setTimeout(resizeEnd,50))})});o.observe(e.el),setTimeout(()=>{r||this.refreshPositions()},300)}else this.setDialogModal(e,t)}dialogProcessing(e){e&&(e.minimized=!0,this.dialogMinimizeChanged(e))}dialogMinimizeChanged(e){if(e)if(e.minimized){e.noModal||(e._wasModal=!0,e.noModal=!0);const t=this._visibled.findIndex(t=>this.modalIdentity(t,e.hostObject));t>-1&&this._visibled.splice(t,1),this.addToMinimized(e),this.refreshPositions()}else this.removeFromMinimized(e),this.toggleDialogShow(e),this.shiftLeft(e),e._wasModal&&(e.noModal=!1,delete e._wasModal),e.noModal?this.refreshPositions():this.setDialogModal(e),setTimeout(()=>{const t=e.managerId||"";Y.eventBus.$emit("dialog:maximized"+t,e)},100)}dialogClosed(e){try{if(this.removeFromMinimized(e))return;const t=this._visibled.findIndex(t=>this.modalIdentity(t,e.hostObject));t>-1&&(this._visibled.splice(t,1),this.refreshPositions())}finally{DialogManager._id=""}}activate(e){let t=this._minimized.findIndex(t=>t===e),r=null;t>-1&&(r=this._minimized[t],this._minimized.splice(t,1)),r?(r.minimized=!1,this.dialogMinimizeChanged(r),this.refreshPositions()):(t=this._visibled.findIndex(t=>this.modalIdentity(t,e.hostObject)),t>-1&&this._visibled.splice(t,1),this.shiftLeft(e),this.refreshPositions())}onResizeHandler(){this._viewPortWidth=window.innerWidth,this.refreshPositions()}setParentDialog(e){for(const t of this._visibled.reverse())t.visible&&(e.hostObject.parentId=t.id)}hideDialog(e){const t=this._visibled.findIndex(t=>t.id===e);t>-1&&(this._visibled[t].visible=!1)}showDialog(e){const t=this._visibled.findIndex(t=>t.id===e);t>-1&&(this._visibled[t].visible=!0)}getParents(e){const t=[];let r=e.hostObject.parentId;while(r){const e=this._visibled.findIndex(e=>e.id===r);e>-1?(t.push(this._visibled[e]),r=this._visibled[e].hostObject?.parentId):r=null}return t}shiftLeft(e){this._visibled.push(e)}refreshPositions(){let e=0,t=-1,r=this._viewPortWidth;for(let o=this._visibled.length-1;o>=0;o--){const i=this._visibled[o];if(!i.noModal)continue;const n=i.el.clientWidth+fr;if(r<n){const e=this._visibled.shift();e.el.style.bottom="unset",e.el.style.right="unset",setTimeout(()=>{this.addToMinimized(e)},1)}else e=xr+n*++t,r-=xr+n,i.el.style.margin="0",i.el.style.position="absolute",i.el.style.bottom=`${wr}px`,i.el.style.right=`${e}px`,i.el.classList.remove("ld-dialog-content--hidden")}}setDialogModal(e,t=null){e&&(e.el.style.position="relative",e.el.style.top="unset",e.el.style.left="unset",e.el.style.bottom="unset",e.el.style.right="unset")}addToMinimized(e){this.toggleDialogShow(e),e.minimized=!0,this._minimized.unshift(e)}removeFromMinimized(e){const t=this._minimized.findIndex(t=>this.modalIdentity(t,e.hostObject));return t>-1&&(this._minimized.splice(t,1),!0)}toggleDialogShow(e){"none"!==e.el.parentElement.style.display?(e._lastDisplayProp=e.el.parentElement.style.display,e.el.parentElement.style.display="none"):e.el.parentElement.style.display=e._lastDisplayProp}uniqKey(e){return`dlg-${e.id}`}static id(e){return DialogManager._id=e,DialogManager}static exec(e,t){switch(e.__constructor){case"AlertDialog":return DialogManager.alert(e);case"PromptDialog":return DialogManager.prompt(e);case"ConfirmDialog":return DialogManager.confirm(e);case"InfoDialog":return DialogManager.info(e,t);case"SelectDialog":return DialogManager.select(e,t);case"CreateEditDialog":return DialogManager.createEdit(e,t)}return null}static alert(e){const t={...e,type:br.Alert,managerId:DialogManager._id};return DialogManager.execAsync(t)}static prompt(e){const t={...e,type:br.Prompt,managerId:DialogManager._id};return DialogManager.execAsync(t)}static confirm(e){const t={...e,type:br.Confirm,closable:!0,managerId:DialogManager._id};return DialogManager.execAsync(t)}static info(e,t){const r={...e,type:br.Info,managerId:DialogManager._id};return r.hostObject||(r.hostObject={id:uidGen(6,"0-9"),contentType:0,kind:1}),DialogManager.execAsync(r,t)}static select(e,t){const r={...e,type:br.Select,managerId:DialogManager._id};return r.hostObject||(r.hostObject={id:uidGen(6,"0-9"),contentType:0,kind:1}),DialogManager.execAsync(r,t)}static createEdit(e,t){const r={...e,type:br.CreateEdit,managerId:DialogManager._id};return r.hostObject||(r.hostObject={id:uidGen(6,"0-9"),contentType:0,kind:1}),DialogManager.execAsync(r,t)}static execAsync(e,t){return new Promise(r=>{e.resolveFunction=r;let o=null;const i=e.managerId||"";t instanceof Function&&(o=async r=>{if(r.id===e.hostObject.id&&t instanceof Function){const r=await t();Y.eventBus.$off("dialog:created"+i,o),Y.eventBus.$emit("dialog:props"+i,r,e.hostObject)}},Y.eventBus.$on("dialog:created"+i,o)),Y.eventBus.$emit("dialog:open"+i,e)})}}class Dialog{title;content;pressEnterAsOk;pressEscAsCancel;hostObject;size;width;height;align;constructor(e){this.title=e.title,this.content=e.content,this.pressEnterAsOk=!1!==e.pressEnterAsOk,this.pressEscAsCancel=!1!==e.pressEscAsCancel,this.hostObject=e.hostObject,this.size=e.size||"s",this.width=e.width,this.height=e.height,this.align=e.align}}class AlertDialog extends Dialog{__constructor;constructor(e){super({...e}),this.__constructor="AlertDialog"}}class PromptDialog extends Dialog{__constructor;constructor(e){super({...e}),this.__constructor="PromptDialog"}}class InteractiveDialog extends Dialog{loading;fullHeight;closable;hideFooter;constructor(e){super({...e}),this.loading=e.loading,this.fullHeight=e.fullHeight,this.closable=e.closable,this.hideFooter=e.hideFooter}}class ConfirmDialog extends InteractiveDialog{__constructor;okResult;cancelResult;constructor(e){super({...e}),this.__constructor="ConfirmDialog",this.okResult=e.okResult,this.cancelResult=e.cancelResult}}class InfoDialog extends InteractiveDialog{__constructor;component;componentProps;minimizable;description;help;constructor(e){super({...e}),this.__constructor="InfoDialog",this.component=e.component,this.componentProps=e.componentProps,this.minimizable=e.minimizable,this.description=e.description,this.help=e.help}}class SelectDialog extends InteractiveDialog{__constructor;component;componentProps;selectAsOk;help;constructor(e){super({...e}),this.__constructor="SelectDialog",this.component=e.component,this.componentProps=e.componentProps,this.selectAsOk=e.selectAsOk,this.help=e.help}}class CreateEditDialog extends InteractiveDialog{__constructor;component;componentProps;darkTitle;expandable;minimizable;collapsedSize;expandedSize;expanded;description;noModal;help;constructor(e){super({...e}),this.__constructor="CreateEditDialog",this.component=e.component,this.componentProps=e.componentProps,this.darkTitle=e.darkTitle,this.expandable=e.expandable,this.minimizable=e.minimizable,this.collapsedSize=e.collapsedSize,this.expandedSize=e.expandedSize,this.expanded=e.expanded,this.description=e.description,this.noModal=e.noModal,this.help=e.help}}var jr=__webpack_require__(9119);const vr={install(e,t){t||(t={}),t.language=t.language??"ru",t.prefix=t.prefix??"ld",t.aliases||(t.aliases={}),["ld-button","ld-toggle-buttons","ld-icon","ld-chip","ld-badge","ld-avatar","ld-splitter","ld-loader","ld-progress","ld-breadcrumbs","ld-edit-text","ld-datepicker","ld-calendar","ld-tab","ld-tabs","ld-page-toolbar","ld-select-list-box","ld-checkbox","ld-radiobutton","ld-radiogroup","ld-textarea","ld-select","ld-combobox","ld-timepicker","ld-text-viewer","ld-edit-masked-text","ld-text-markup","ld-switch","ld-dialog","ld-data-iterator","ld-pager","ld-edit-list-box","ld-uploader","ld-step","ld-slider","ld-datatable","ld-expansion-panel","ld-expansion-panels"].forEach(e=>{t.aliases?.[e]||(t.aliases[e]=e.replace("ld",t.prefix))}),e.config.globalProperties.$utils={...G},t.LdPager?.entityName instanceof Function&&e.provide("ldPagerOptions",{entityName:t.LdPager?.entityName}),e.config.globalProperties.$ldmui={options:(0,W.reactive)(t)};const r=__webpack_require__(1397).ru;e.config.globalProperties.$ldmuii18n={library:r,gettext:e=>r[e]??e},e.directive("active",J);const o={position:or.POSITION.BOTTOM_RIGHT,timeout:5e3,draggable:!1,newestOnTop:!0,pauseOnFocusLoss:!1,pauseOnHover:!1,hideProgressBar:!0};e.use(ir(),o);const i=document.createElement("style");i.innerHTML=(0,Y.generatePalette)(),i.id="ldmui-palette",document.body.appendChild(i),Je(e,t),Xe(e,t),be(e,t),re(e,t),le(e,t),X(e,t),Dt(e,t),Xt(e,t),ne(e,t),Ne(e,t),Me(e,t),ue(e,t),Pt(e,t),Vt(e,t),rt(e,t),wt(e,t),me(e,t),ut(e,t),mt(e,t),Gt(e,t),bt(e,t),we(e,t),Jt(e,t),Ut(e,t),Ve(e,t),Nt(e,t),zt(e,t),ze(e,t),qe(e,t),nt(e,t),Pe(e,t),rr(e,t),lt(e,t),Mt(e,t),qt(e,t),De(e,t),Ue(e,t),Ge(e,t)}},qr=vr,kr=new Map;kr.set("en",()=>__webpack_require__(8179)),kr.set("ru",()=>__webpack_require__(1397));const yr={install(e,t){let r=e.config?.globalProperties?.$ldmui?.options?.language||"en",o={};try{if(!t)throw new Error("locale not defined");const e=JSON.parse(t);if(o=e[r],!o)throw new Error("locale not defined")}catch(e){r=kr.has(r)?r:"en";const t=kr.get(r);o=t()[r]}function gettext(e){return this.library[e]||e}e.config.globalProperties.$ldmuii18n={library:o,gettext:null},e.config.globalProperties.$ldmuii18n.gettext=gettext.bind(e.config.globalProperties.$ldmuii18n)}};return H})());
|
package/dist/lib/imask.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,e=>(()=>{"use strict";var t={2380:t=>{t.exports=e}},s={};function __webpack_require__(e){var a=s[e];if(void 0!==a)return a.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,__webpack_require__),i.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var s in t)__webpack_require__.o(t,s)&&!__webpack_require__.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};function isString(e){return"string"===typeof e||e instanceof String}function isObject(e){var t;return"object"===typeof e&&null!=e&&"Object"===(null==e||null==(t=e.constructor)?void 0:t.name)}function pick(e,t){return Array.isArray(t)?pick(e,(e,s)=>t.includes(s)):Object.entries(e).reduce((e,s)=>{let[a,i]=s;return t(i,a)&&(e[a]=i),e},{})}__webpack_require__.r(a),__webpack_require__.d(a,{IMask:()=>IMask,IMaskComponent:()=>_,IMaskDirective:()=>v,IMaskProps:()=>c,useIMask:()=>useIMask});const i={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function forceDirection(e){switch(e){case i.LEFT:return i.FORCE_LEFT;case i.RIGHT:return i.FORCE_RIGHT;default:return e}}function escapeRegExp(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function objectIncludes(e,t){if(t===e)return!0;const s=Array.isArray(t),a=Array.isArray(e);let i;if(s&&a){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!objectIncludes(t[i],e[i]))return!1;return!0}if(s!=a)return!1;if(t&&e&&"object"===typeof t&&"object"===typeof e){const s=t instanceof Date,a=e instanceof Date;if(s&&a)return t.getTime()==e.getTime();if(s!=a)return!1;const n=t instanceof RegExp,u=e instanceof RegExp;if(n&&u)return t.toString()==e.toString();if(n!=u)return!1;const r=Object.keys(t);for(i=0;i<r.length;i++)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=0;i<r.length;i++)if(!objectIncludes(e[r[i]],t[r[i]]))return!1;return!0}return!(!t||!e||"function"!==typeof t||"function"!==typeof e)&&t.toString()===e.toString()}class ActionDetails{constructor(e){Object.assign(this,e);while(this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos))--this.oldSelection.start;if(this.insertedCount)while(this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end))this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?i.NONE:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?i.LEFT:i.RIGHT}}function IMask(e,t){return new IMask.InputMask(e,t)}function maskedClass(e){if(null==e)throw new Error("mask property should be defined");return e instanceof RegExp?IMask.MaskedRegExp:isString(e)?IMask.MaskedPattern:e===Date?IMask.MaskedDate:e===Number?IMask.MaskedNumber:Array.isArray(e)||e===Array?IMask.MaskedDynamic:IMask.Masked&&e.prototype instanceof IMask.Masked?e:IMask.Masked&&e instanceof IMask.Masked?e.constructor:e instanceof Function?IMask.MaskedFunction:(console.warn("Mask not found for mask",e),IMask.Masked)}function normalizeOpts(e){if(!e)throw new Error("Options in not defined");if(IMask.Masked){if(e.prototype instanceof IMask.Masked)return{mask:e};const{mask:t,...s}=e instanceof IMask.Masked?{mask:e}:isObject(e)&&e.mask instanceof IMask.Masked?e:{};if(t){const e=t.mask;return{...pick(t,(e,t)=>!t.startsWith("_")),mask:t.constructor,_mask:e,...s}}}return isObject(e)?{...e}:{mask:e}}function createMask(e){if(IMask.Masked&&e instanceof IMask.Masked)return e;const t=normalizeOpts(e),s=maskedClass(t.mask);if(!s)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===s&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new s(t)}IMask.createMask=createMask;class MaskElement{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}IMask.MaskElement=MaskElement;const n=90,u=89;class HTMLMaskElement extends MaskElement{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return null!=(e=null==(t=(s=this.input).getRootNode)?void 0:t.call(s))?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(e.keyCode===n&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===u&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&e.keyCode===n&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(e.isComposing||this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}IMask.HTMLMaskElement=HTMLMaskElement;class HTMLInputMaskElement extends HTMLMaskElement{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}IMask.HTMLMaskElement=HTMLMaskElement;class HTMLContenteditableMaskElement extends HTMLMaskElement{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,a=t&&t.focusOffset;return null==a||null==s||s<a?s:a}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,a=t&&t.focusOffset;return null==a||null==s||s>a?s:a}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);const a=this.rootElement,i=a.getSelection&&a.getSelection();i&&(i.removeAllRanges(),i.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}IMask.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;class InputHistory{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>InputHistory.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}InputHistory.MAX_LENGTH=100;class InputMask{constructor(e,t){this.el=e instanceof MaskElement?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new HTMLContenteditableMaskElement(e):new HTMLInputMaskElement(e),this.masked=createMask(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new InputHistory,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof IMask.Masked)&&this.masked.constructor===maskedClass(e))return void this.masked.updateOptions({mask:e});const t=e instanceof IMask.Masked?e:createMask({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const s=this._listeners[e];s&&s.forEach(e=>e(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,s=this.masked.value,a=this.masked.rawInputValue,i=this.displayValue,n=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==a;this._unmaskedValue=t,this._value=s,this._rawInputValue=a,this.el.value!==i&&(this.el.value=i),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),n&&this._fireChangeEvents(),this._historyChanging||!n&&!this.history.isEmpty||this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...s}=e,a=!this.maskEquals(t),i=this.masked.optionsIsChanged(s);a&&(this.mask=t),i&&this.masked.updateOptions(s),(a||i)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,i.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new ActionDetails({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,a=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,n=s===this.masked.rawInputValue?t.removeDirection:i.NONE;let u=this.masked.nearestInputPos(t.startChangePos+a,n);n!==i.NONE&&(u=this.masked.nearestInputPos(u,i.NONE)),this.updateControl(u),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}IMask.InputMask=InputMask;class ChangeDetails{static normalize(e){return Array.isArray(e)?e:[e,new ChangeDetails]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}IMask.ChangeDetails=ChangeDetails;class ContinuousTailDetails{constructor(e,t,s){void 0===e&&(e=""),void 0===t&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Masked{constructor(e){this._value="",this._update({...Masked.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new ContinuousTailDetails(this.extractInput(e,t),e)}appendTail(e){return isString(e)&&(e=new ContinuousTailDetails(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new ChangeDetails({inserted:e,rawInserted:e})):new ChangeDetails}_appendChar(e,t,s){void 0===t&&(t={});const a=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&"pad"===this.autofix)){const s=this.state;this.state=a;let n=this.pad(t);const u=this._appendCharRaw(e,t);n=n.aggregate(u),u.rawInserted||n.equals(i)?i=n:this.state=s}if(i.inserted){let e,n=!1!==this.doValidate(t);if(n&&null!=s){const t=this.state;if(!0===this.overwrite){e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.unshift(this.displayValue.length-i.tailShift)}let a=this.appendTail(s);if(n=a.rawInserted.length===s.toString().length,(!n||!a.inserted)&&"shift"===this.overwrite){this.state=t,e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.shift();a=this.appendTail(s),n=a.rawInserted.length===s.toString().length}n&&a.inserted&&(this.state=t)}n||(i=new ChangeDetails,this.state=a,s&&e&&(s.state=e))}return i}_appendPlaceholder(){return new ChangeDetails}_appendEager(){return new ChangeDetails}append(e,t,s){if(!isString(e))throw new Error("value should be string");const a=isString(s)?new ContinuousTailDetails(String(s)):s;let i;null!=t&&t.tail&&(t._beforeTailState=this.state),[e,i]=this.doPrepare(e,t);for(let s=0;s<e.length;++s){const n=this._appendChar(e[s],t,a);if(!n.rawInserted&&!this.doSkipInvalid(e[s],t,a))break;i.aggregate(n)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&i.aggregate(this._appendEager()),null!=a&&(i.tailShift+=this.appendTail(a).tailShift),i}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new ChangeDetails}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,s=this.value,a=e();return this.rawInputValue=t,this.value&&this.value!==s&&0===s.indexOf(this.value)&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return Boolean(this.skipInvalid)}doPrepare(e,t){return void 0===t&&(t={}),ChangeDetails.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),ChangeDetails.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,a,n){void 0===s&&(s=""),void 0===a&&(a=i.NONE),void 0===n&&(n={input:!0});const u=e+t,r=this.extractTail(u),l=!0===this.eager||"remove"===this.eager;let o;l&&(a=forceDirection(a),o=this.extractInput(0,u,{raw:!0}));let h=e;const d=new ChangeDetails;if(a!==i.NONE&&(h=this.nearestInputPos(e,t>1&&0!==e&&!l?i.NONE:a),d.tailShift=h-e),d.aggregate(this.remove(h)),l&&a!==i.NONE&&o===this.rawInputValue)if(a===i.FORCE_LEFT){let e;while(o===this.rawInputValue&&(e=this.displayValue.length))d.aggregate(new ChangeDetails({tailShift:-1})).aggregate(this.remove(e-1))}else a===i.FORCE_RIGHT&&r.unshift();return d.aggregate(this.append(s,n,r))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!objectIncludes(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||Masked.EMPTY_VALUES.includes(e)&&Masked.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new ChangeDetails}}Masked.DEFAULTS={skipInvalid:!0},Masked.EMPTY_VALUES=[void 0,null,""],IMask.Masked=Masked;class ChunksTailDetails{constructor(e,t){void 0===e&&(e=[]),void 0===t&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=isString(e)?new ContinuousTailDetails(String(e)):e;const t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof ContinuousTailDetails)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof ChunksTailDetails){if(null==e.stop){let t;while(e.chunks.length&&null==e.chunks[0].stop)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof IMask.MaskedPattern)){const t=new ContinuousTailDetails(this.toString());return t.appendTo(e)}const t=new ChangeDetails;for(let s=0;s<this.chunks.length;++s){const a=this.chunks[s],i=e._mapPosToBlock(e.displayValue.length),n=a.stop;let u;if(null!=n&&(!i||i.index<=n)&&((a instanceof ChunksTailDetails||e._stops.indexOf(n)>=0)&&t.aggregate(e._appendPlaceholder(n)),u=a instanceof ChunksTailDetails&&e._blocks[n]),u){const s=u.appendTail(a);t.aggregate(s);const i=a.toString().slice(s.rawInserted.length);i&&t.aggregate(e.append(i,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(e=>{const t="chunks"in e?new ChunksTailDetails:new ContinuousTailDetails;return t.state=e,t})}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";const t=null!=e?e-this.from:e;let s=0;while(s<this.chunks.length){const e=this.chunks[s],a=e.unshift(t);if(e.toString()){if(!a)break;++s}else this.chunks.splice(s,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;while(0<=e){const t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class PatternCursor{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:a}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,i.FORCE_LEFT),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,i.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,i.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,i.FORCE_RIGHT),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,i.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,i.NONE),!0})}}class PatternFixedDefinition{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new ChangeDetails}nearestInputPos(e,t){void 0===t&&(t=i.NONE);const s=0,a=this._value.length;switch(t){case i.LEFT:case i.FORCE_LEFT:return s;case i.NONE:case i.RIGHT:case i.FORCE_RIGHT:default:return a}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),void 0===s&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new ChangeDetails;const s=!0===this.eager||"append"===this.eager,a=this.char===e,i=a&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,n=new ChangeDetails({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new ChangeDetails;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new ContinuousTailDetails("")}appendTail(e){return isString(e)&&(e=new ContinuousTailDetails(String(e))),e.appendTo(this)}append(e,t,s){const a=this._appendChar(e[0],t);return null!=s&&(a.tailShift+=this.appendTail(s).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=Boolean(e._rawInputValue)}pad(e){return this._appendPlaceholder()}}class PatternInputDefinition{constructor(e){const{parent:t,isOptional:s,placeholderChar:a,displayChar:i,lazy:n,eager:u,...r}=e;this.masked=createMask(r),Object.assign(this,{parent:t,isOptional:s,placeholderChar:a,displayChar:i,lazy:n,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),0===e&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new ChangeDetails}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new ChangeDetails;const s=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(t));return a.inserted&&!1===this.doValidate(t)&&(a=new ChangeDetails,this.masked.state=s),a.inserted||this.isOptional||this.lazy||t.input||(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=Boolean(a.inserted),a}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ChangeDetails:(this.isFilled=!0,new ChangeDetails({inserted:this.placeholderChar}))}_appendEager(){return new ChangeDetails}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){void 0===t&&(t=i.NONE);const s=0,a=this.value.length,n=Math.min(Math.max(e,s),a);switch(t){case i.LEFT:case i.FORCE_LEFT:return this.isComplete?n:s;case i.RIGHT:case i.FORCE_RIGHT:return this.isComplete?n:a;case i.NONE:default:return n}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new ChangeDetails}}PatternInputDefinition.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class MaskedRegExp extends Masked{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}IMask.MaskedRegExp=MaskedRegExp;class MaskedPattern extends Masked{constructor(e){super({...MaskedPattern.DEFAULTS,...e,definitions:Object.assign({},PatternInputDefinition.DEFAULT_DEFINITIONS,null==e?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let s=!1,a=!1;for(let i=0;i<t.length;++i){if(this.blocks){const e=t.slice(i),s=Object.keys(this.blocks).filter(t=>0===e.indexOf(t));s.sort((e,t)=>t.length-e.length);const a=s[0];if(a){const{expose:e,repeat:t,...s}=normalizeOpts(this.blocks[a]),n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...s,repeat:t,parent:this},u=null!=t?new IMask.RepeatBlock(n):createMask(n);u&&(this._blocks.push(u),e&&(this.exposeBlock=u),this._maskedBlocks[a]||(this._maskedBlocks[a]=[]),this._maskedBlocks[a].push(this._blocks.length-1)),i+=a.length-1;continue}}let n=t[i],u=n in e;if(n===MaskedPattern.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===n||"}"===n){s=!s;continue}if("["===n||"]"===n){a=!a;continue}if(n===MaskedPattern.ESCAPE_CHAR){if(++i,n=t[i],!n)break;u=!1}const r=u?new PatternInputDefinition({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...normalizeOpts(e[n]),parent:this}):new PatternFixedDefinition({char:n,eager:this.eager,isUnmasking:s});this._blocks.push(r)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e)return void this.reset();const{_blocks:t,...s}=e;this._blocks.forEach((e,s)=>e.state=t[s]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new ChangeDetails;let s=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==s)return t;this._blocks[s].isFilled&&++s;for(let e=s;e<this._blocks.length;++e){const s=this._blocks[e]._appendEager();if(!s.inserted)break;t.aggregate(s)}return t}_appendCharRaw(e,t){void 0===t&&(t={});const s=this._mapPosToBlock(this.displayValue.length),a=new ChangeDetails;if(!s)return a;for(let n,u=s.index;n=this._blocks[u];++u){var i;const s=n._appendChar(e,{...t,_beforeTailState:null==(i=t._beforeTailState)||null==(i=i._blocks)?void 0:i[u]});if(a.aggregate(s),s.consumed)break}return a}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const s=new ChunksTailDetails;return e===t||this._forEachBlocksInRange(e,t,(e,t,a,i)=>{const n=e.extractTail(a,i);n.stop=this._findStopBefore(t),n.from=this._blockStartPos(t),n instanceof ChunksTailDetails&&(n.blockIndex=t),s.extend(n)}),s}extractInput(e,t,s){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),void 0===s&&(s={}),e===t)return"";let a="";return this._forEachBlocksInRange(e,t,(e,t,i,n)=>{a+=e.extractInput(i,n,s)}),a}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){const a=this._stops[s];if(!(a<=e))break;t=a}return t}_appendPlaceholder(e){const t=new ChangeDetails;if(this.lazy&&null==e)return t;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;const a=s.index,i=null!=e?e:this._blocks.length;return this._blocks.slice(a,i).forEach(s=>{var a;s.lazy&&null==e||t.aggregate(s._appendPlaceholder(null==(a=s._blocks)?void 0:a.length))}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){const a=this._blocks[s],i=t.length;if(t+=a.displayValue,e<=t.length)return{index:s,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+t.displayValue.length,0)}_forEachBlocksInRange(e,t,s){void 0===t&&(t=this.displayValue.length);const a=this._mapPosToBlock(e);if(a){const e=this._mapPosToBlock(t),i=e&&a.index===e.index,n=a.offset,u=e&&i?e.offset:this._blocks[a.index].displayValue.length;if(s(this._blocks[a.index],a.index,n,u),e&&!i){for(let t=a.index+1;t<e.index;++t)s(this._blocks[t],t,0,this._blocks[t].displayValue.length);s(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(e,t,a,i)=>{s.aggregate(e.remove(a,i))}),s}nearestInputPos(e,t){if(void 0===t&&(t=i.NONE),!this._blocks.length)return 0;const s=new PatternCursor(this,e);if(t===i.NONE)return s.pushRightBeforeInput()?s.pos:(s.popState(),s.pushLeftBeforeInput()?s.pos:this.displayValue.length);if(t===i.LEFT||t===i.FORCE_LEFT){if(t===i.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===i.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e)return s.pos;if(s.popState(),s.ok&&s.pos<=e)return s.pos;s.popState()}return s.ok?s.pos:t===i.FORCE_LEFT?0:(s.popState(),s.ok?s.pos:(s.popState(),s.ok?s.pos:0))}return t===i.RIGHT||t===i.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:t===i.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok?s.pos:(s.popState(),s.ok?s.pos:this.nearestInputPos(e,i.LEFT)))):e}totalInputPositions(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(e,t,a,i)=>{s+=e.totalInputPositions(a,i)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(e){const t=new ChangeDetails;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}MaskedPattern.DEFAULTS={...Masked.DEFAULTS,lazy:!0,placeholderChar:"_"},MaskedPattern.STOP_CHAR="`",MaskedPattern.ESCAPE_CHAR="\\",MaskedPattern.InputDefinition=PatternInputDefinition,MaskedPattern.FixedDefinition=PatternFixedDefinition,IMask.MaskedPattern=MaskedPattern;class MaskedRange extends MaskedPattern{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:s=this.from||0,maxLength:a=this.maxLength||0,autofix:i=this.autofix,...n}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,a),this.autofix=i;const u=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0");let l=0;while(l<r.length&&r[l]===u[l])++l;n.mask=r.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(e){let t="",s="";const[,a,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(a.length)+i,s="9".repeat(a.length)+i),t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[t,s]}doPrepareChar(e,t){let s;return void 0===t&&(t={}),[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const s=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[i,n]=this.boundaries(this.value+e);return Number(n)<this.from?super._appendCharRaw(s[this.value.length],t):Number(i)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(a[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value,s=t.search(/[^0]/);if(-1===s&&t.length<=this._matchFrom)return!0;const[a,i]=this.boundaries(t);return this.from<=Number(i)&&Number(a)<=this.to&&super.doValidate(e)}pad(e){const t=new ChangeDetails;if(this.value.length===this.maxLength)return t;const s=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let s=0;s<a;++s)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(e=>this._appendCharRaw(e))}return t}}IMask.MaskedRange=MaskedRange;const r="d{.}`m{.}`Y";class MaskedDate extends MaskedPattern{static extractPatternOptions(e){const{mask:t,pattern:s,...a}=e;return{...a,mask:isString(t)?t:s}}constructor(e){super(MaskedDate.extractPatternOptions({...MaskedDate.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:s,blocks:a,...i}={...MaskedDate.DEFAULTS,...e},n=Object.assign({},MaskedDate.GET_DEFAULT_BLOCKS());e.min&&(n.Y.from=e.min.getFullYear()),e.max&&(n.Y.to=e.max.getFullYear()),e.min&&e.max&&n.Y.from===n.Y.to&&(n.m.from=e.min.getMonth()+1,n.m.to=e.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=e.min.getDate(),n.d.to=e.max.getDate())),Object.assign(n,this.blocks,a),super._update({...i,mask:isString(t)?t:s,blocks:n})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(MaskedDate.extractPatternOptions(e))}}MaskedDate.GET_DEFAULT_BLOCKS=()=>({d:{mask:MaskedRange,from:1,to:31,maxLength:2},m:{mask:MaskedRange,from:1,to:12,maxLength:2},Y:{mask:MaskedRange,from:1900,to:9999}}),MaskedDate.DEFAULTS={...MaskedPattern.DEFAULTS,mask:Date,pattern:r,format:(e,t)=>{if(!e)return"";const s=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=e.getFullYear();return[s,a,i].join(".")},parse:(e,t)=>{const[s,a,i]=e.split(".").map(Number);return new Date(i,a-1,s)}},IMask.MaskedDate=MaskedDate;class MaskedDynamic extends Masked{constructor(e){super({...MaskedDynamic.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(e=>{const{expose:t,...s}=normalizeOpts(e),a=createMask({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return t&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,t){void 0===t&&(t={});const s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){void 0===e&&(e=""),void 0===t&&(t={}),void 0===s&&(s="");const a=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,i=this.rawInputValue,n=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:i,u=i.slice(n.length),r=this.currentMask,l=new ChangeDetails,o=null==r?void 0:r.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==r?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-a.length),u&&(l.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),l}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new ChangeDetails;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(s=e._beforeTailState)?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return void 0===t&&(t={}),void 0===s&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){void 0===t&&(t={});let[s,a]=super.doPrepare(e,t);if(this.currentMask){let e;[s,e]=super.doPrepare(s,this.currentMaskFlags(t)),a=a.aggregate(e)}return[s,a]}doPrepareChar(e,t){void 0===t&&(t={});let[s,a]=super.doPrepareChar(e,t);if(this.currentMask){let e;[s,e]=super.doPrepareChar(s,this.currentMaskFlags(t)),a=a.aggregate(e)}return[s,a]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask)return this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,void this._applyDispatch();let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){const s=new ChangeDetails;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:s,currentMask:a,...i}=e;t&&this.compiledMasks.forEach((e,s)=>e.state=t[s]),null!=s&&(this.currentMask=s,this.currentMask.state=a),super.state=i}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;const{mask:a,...i}=e[s];return objectIncludes(t,i)&&t.maskEquals(a)}):super.maskEquals(e)}typedValueEquals(e){var t;return Boolean(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}MaskedDynamic.DEFAULTS={...Masked.DEFAULTS,dispatch:(e,t,s,a)=>{if(!t.compiledMasks.length)return;const n=t.rawInputValue,u=t.compiledMasks.map((u,r)=>{const l=t.currentMask===u,o=l?u.displayValue.length:u.nearestInputPos(u.displayValue.length,i.FORCE_LEFT);return u.rawInputValue!==n?(u.reset(),u.append(n,{raw:!0})):l||u.remove(o),u.append(e,t.currentMaskFlags(s)),u.appendTail(a),{index:r,weight:u.rawInputValue.length,totalInputPositions:u.totalInputPositions(0,Math.max(o,u.nearestInputPos(u.displayValue.length,i.FORCE_LEFT)))}});return u.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[u[0].index]}},IMask.MaskedDynamic=MaskedDynamic;class MaskedEnum extends MaskedPattern{constructor(e){super({...MaskedEnum.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...s}=e;if(t){const e=t.map(e=>e.length),a=Math.min(...e),i=Math.max(...e)-a;s.mask="*".repeat(a),i&&(s.mask+="["+"*".repeat(i)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){void 0===t&&(t={});const s=Math.min(this.nearestInputPos(0,i.FORCE_RIGHT),this.value.length),a=this.enum.filter(t=>this.matchValue(t,this.unmaskedValue+e,s));if(a.length){1===a.length&&this._forEachBlocksInRange(0,this.value.length,(e,s)=>{const i=a[0][s];s>=this.value.length||i===e.value||(e.reset(),e._appendChar(i,t))});const e=super._appendCharRaw(a[0][this.value.length],t);return 1===a.length&&a[0].slice(this.unmaskedValue.length).split("").forEach(t=>e.aggregate(super._appendCharRaw(t))),e}return new ChangeDetails({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new ContinuousTailDetails("",e)}remove(e,t){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new ChangeDetails;const s=Math.min(super.nearestInputPos(0,i.FORCE_RIGHT),this.value.length);let a;for(a=e;a>=0;--a){const e=this.enum.filter(e=>this.matchValue(e,this.value.slice(s,a),s));if(e.length>1)break}const n=super.remove(a,t);return n.tailShift+=a-e,n}get isComplete(){return this.enum.indexOf(this.value)>=0}}MaskedEnum.DEFAULTS={...MaskedPattern.DEFAULTS,matchValue:(e,t,s)=>e.indexOf(t,s)===s},IMask.MaskedEnum=MaskedEnum;class MaskedFunction extends Masked{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}var l;IMask.MaskedFunction=MaskedFunction;class MaskedNumber extends Masked{constructor(e){super({...MaskedNumber.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",s=(this.scale?"("+escapeRegExp(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(escapeRegExp).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});const[s,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(a.skip=!0),!s||this.allowPositive||this.value||"-"===s||a.aggregate(this._appendChar("-")),[s,a]}_separatorsCount(e,t){void 0===t&&(t=!1);let s=0;for(let a=0;a<e;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){void 0===t&&(t={});const s=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const n=this.number;let u,r=!isNaN(n),l=!1;if(r){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):r=!1),r&&(r=Boolean(this._value.match(this._numberRegExp)))}r?u=new ChangeDetails({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,u=new ChangeDetails),this._value=this._insertThousandsSeparators(this._value);const o=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,h=this._separatorsCountFromSlice(o);return u.tailShift+=(h-a)*this.thousandsSeparator.length,u}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,t){const s=this._findSeparatorAround(e);s>=0&&(e=s);const a=this._findSeparatorAround(t);return a>=0&&(t=a+this.thousandsSeparator.length),[e,t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const s=this.value.slice(0,e),a=this.value.slice(t),i=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+a));const n=this._separatorsCountFromSlice(s);return new ChangeDetails({tailShift:(n-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case i.NONE:case i.LEFT:case i.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const a=s+this.thousandsSeparator.length;if(e<a||this.value.length<=a||t===i.FORCE_LEFT)return s}break}case i.RIGHT:case i.FORCE_RIGHT:{const t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,s,a)=>t+a),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){void 0===t&&(t={});const a=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===MaskedNumber.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,MaskedNumber.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||MaskedNumber.EMPTY_VALUES.includes(e)&&MaskedNumber.EMPTY_VALUES.includes(this.typedValue))&&!(0===e&&""===this.value)}}l=MaskedNumber,MaskedNumber.UNMASKED_RADIX=".",MaskedNumber.EMPTY_VALUES=[...Masked.EMPTY_VALUES,0],MaskedNumber.DEFAULTS={...Masked.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[l.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},IMask.MaskedNumber=MaskedNumber;const o={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function createPipe(e,t,s){void 0===t&&(t=o.MASKED),void 0===s&&(s=o.MASKED);const a=createMask(e);return e=>a.runIsolated(a=>(a[t]=e,a[s]))}function pipe(e,t,s,a){return createPipe(t,s,a)(e)}IMask.PIPE_TYPE=o,IMask.createPipe=createPipe,IMask.pipe=pipe;class RepeatBlock extends MaskedPattern{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,a;const{repeat:i,...n}=normalizeOpts(e);this._blockOpts=Object.assign({},this._blockOpts,n);const u=createMask(this._blockOpts);this.repeat=null!=(t=null!=(s=null!=i?i:u.repeat)?s:this.repeat)?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(a=this._blocks)?void 0:a.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(createMask(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});const s=new ChangeDetails;for(let r,l,o=null!=(a=null==(i=this._mapPosToBlock(this.displayValue.length))?void 0:i.index)?a:Math.max(this._blocks.length-1,0);r=null!=(n=this._blocks[o])?n:l=!l&&this._allocateBlock(o);++o){var a,i,n,u;const h=r._appendChar(e,{...t,_beforeTailState:null==(u=t._beforeTailState)||null==(u=u._blocks)?void 0:u[o]});if(h.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,t){var s,a;void 0===e&&(e=0);const i=Math.max((null==(s=this._mapPosToBlock(e))?void 0:s.index)||0,this.repeatFrom,0);let n;null!=t&&(n=null==(a=this._mapPosToBlock(t))?void 0:a.index),null==n&&(n=this._blocks.length-1);let u=0;for(let e=n;i<=e;--e,++u)if(this._blocks[e].unmaskedValue)break;u&&(this._blocks.splice(n-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return void 0===e&&(e=0),null==t&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}IMask.RepeatBlock=RepeatBlock;try{globalThis.IMask=IMask}catch{}var h=__webpack_require__(2380),d=!0,p=void 0;var c={mask:void 0,prepare:Function,prepareChar:Function,validate:Function,commit:Function,overwrite:{type:Boolean,required:!1,default:void 0},eager:{required:!1,default:void 0,validator:e=>["append","remove"].includes(e)||"boolean"===typeof e},skipInvalid:{type:Boolean,required:!1,default:void 0},placeholderChar:String,displayChar:String,lazy:{type:Boolean,required:!1,default:void 0},definitions:Object,blocks:Object,enum:Array,maxLength:Number,from:Number,to:Number,pattern:String,format:Function,parse:Function,autofix:{required:!1,default:void 0,validator:e=>"pad"===e||"boolean"===typeof e},radix:String,thousandsSeparator:String,mapToRadix:Array,scale:Number,normalizeZeros:{type:Boolean,required:!1,default:void 0},padFractionalZeros:{type:Boolean,required:!1,default:void 0},min:[Number,Date],max:[Number,Date],dispatch:Function};function useIMask(e,t){let{emit:s,onAccept:a,onComplete:i,defaultValue:n,defaultUnmaskedValue:u,defaultTypedValue:r}=void 0===t?{}:t;const l=(0,h.isRef)(e)?e:(0,h.ref)(e),o=(0,h.ref)(),d=(0,h.ref)(),p=(0,h.ref)(""),c=(0,h.ref)(""),k=(0,h.ref)();let m,g=p.value,_=c.value,v=k.value;function storeLastAcceptedValues(){v=k.value=d.value.typedValue,_=c.value=d.value.unmaskedValue,g=p.value=d.value.value}function _onAccept(e){storeLastAcceptedValues(),s&&(s("accept",p.value,e),s("accept:masked",p.value,e),s("accept:typed",k.value,e),s("accept:unmasked",c.value,e)),null==a||a(e)}function _onComplete(e){s&&(s("complete",d.value.value,e),s("complete:masked",d.value.value,e),s("complete:typed",d.value.typedValue,e),s("complete:unmasked",d.value.unmaskedValue,e)),null==i||i(e)}const updateUnmaskedValue=()=>{d.value&&void 0!==c.value&&(_!==c.value&&(d.value.unmaskedValue=c.value,d.value.unmaskedValue!==c.value&&_onAccept()),_=void 0)};(0,h.watch)(c,updateUnmaskedValue);const updateMaskedValue=()=>{d.value&&void 0!==p.value&&(g!==p.value&&(d.value.value=p.value,d.value.value!==p.value&&_onAccept()),g=void 0)};(0,h.watch)(p,updateMaskedValue);const updateTypedValue=()=>{d.value&&void 0!==k.value&&(v!==k.value&&(d.value.typedValue=k.value,d.value.masked.typedValueEquals(k.value)||_onAccept()),v=void 0)};function _initMask(){m=o.value;const e=l.value;m&&null!=e&&e.mask&&(d.value=IMask(m,e),void 0!==n&&(p.value=n),void 0!==u&&(c.value=u),void 0!==r&&(k.value=r),updateUnmaskedValue(),updateMaskedValue(),updateTypedValue(),storeLastAcceptedValues(),d.value.on("accept",_onAccept).on("complete",_onComplete))}function _destroyMask(){var e;null==(e=d.value)||e.destroy(),d.value=void 0}return(0,h.watch)(k,updateTypedValue),(0,h.onMounted)(_initMask),(0,h.onUnmounted)(_destroyMask),(0,h.watch)([o,l],()=>{const e=o.value,t=l.value;null!=t&&t.mask&&e===m||_destroyMask(),e&&(d.value?d.value.updateOptions(t):_initMask())}),{el:o,mask:(0,h.readonly)(d),masked:p,unmasked:c,typed:k}}function extractOptionsFromProps(e,t){return e={...e},Object.keys(e).forEach(s=>{(void 0===e[s]||t.includes(s))&&delete e[s]}),e}const k=["typed","unmasked","value","modelValue"];var m=(0,h.defineComponent)({name:"imask-input",inheritAttrs:!1,props:{modelValue:String,value:String,unmasked:String,typed:{validator:()=>!0},...c},emits:["update:modelValue","update:masked","update:value","update:unmasked","update:typed","accept","accept:value","accept:masked","accept:unmasked","accept:typed","complete","complete:value","complete:masked","complete:unmasked","complete:typed"],setup(e,t){let{attrs:s,emit:a}=t;const{el:i,mask:n,masked:u,unmasked:r,typed:l}=useIMask(extractOptionsFromProps(e,k),{emit:a,onAccept:e=>{const t=u.value;a("accept:value",t,e),a("update:value",t,e),a("update:masked",t,e),a("update:modelValue",t,e),a("update:unmasked",r.value,e),a("update:typed",l.value,e)},onComplete:e=>{a("complete:value",u.value,e)}}),o=(0,h.toRef)(e,"value"),d=(0,h.toRef)(e,"modelValue"),p=(0,h.toRef)(e,"unmasked"),c=(0,h.toRef)(e,"typed");return u.value=d.value||o.value||"",r.value=p.value||"",l.value=c.value,(0,h.watch)(o,e=>u.value=e),(0,h.watch)(d,e=>u.value=e),(0,h.watch)(p,e=>r.value=e),(0,h.watch)(c,e=>l.value=e),()=>{const t={...s,value:null!=e.value?e.value:null!=e.modelValue?e.modelValue:n.value?n.value.displayValue:"",ref:i};return e.mask||(t.onInput=e=>{a("update:modelValue",e.target.value),a("update:value",e.target.value)}),(0,h.h)("input",t)}}}),g=null==p?void 0:p.extend({name:"imask-input",data(){return{}},render(e){const t={domProps:{value:this.maskRef?this.maskRef.value:this.value},on:{...this.$listeners}};return this.$props.mask?delete t.on.input:t.on.input=e=>this.$emit("input",e.target.value),e("input",t)},mounted(){this.$props.mask&&this._initMask()},destroyed(){this._destroyMask()},computed:{maskOptions(){return extractOptionsFromProps(this.$props,["value","unmask"])}},watch:{$props:{handler(e){const t=this.maskOptions;t.mask?this.maskRef?(this.maskRef.updateOptions(t),"value"in e&&this._updateValue()):(this._initMask(t),e.value!==this._maskValue()&&this._onAccept()):(this._destroyMask(),"value"in e&&(this.$el.value=e.value))},deep:!0}},methods:{_maskValue(){var e,t,s;return"typed"===this.unmask?null==(e=this.maskRef)?void 0:e.typedValue:this.unmask?null==(t=this.maskRef)?void 0:t.unmaskedValue:null==(s=this.maskRef)?void 0:s.value},_updateValue(){if(!this.maskRef)return;const e=null==this.value&&"typed"!==this.unmask?"":this.value;"typed"===this.unmask?this.maskRef.typedValue=e:this.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e},_onAccept(){const e=this._maskValue();this.$emit("input",e),this.$emit("accept",e)},_onComplete(){this.$emit("complete",this._maskValue())},_initMask(e){e||(e=this.maskOptions),this.maskRef=IMask(this.$el,e).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),this._updateValue()},_destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}},props:{value:{},unmask:{validator:e=>"typed"===e||"boolean"===typeof e},...c}}),_=d?m:g,v={name:"imask",[d?"beforeMount":"bind"]:(e,t)=>{let{value:s}=t;s&&initMask(e,s)},[d?"updated":"update"]:(e,t)=>{let{value:s}=t;s?e.maskRef?(e.maskRef.updateOptions(s),e.value!==e.maskRef.value&&e.maskRef._onChange()):initMask(e,s):destroyMask(e)},[d?"unmounted":"unbind"]:e=>{destroyMask(e)}};function fireEvent(e,t,s){const a=document.createEvent("CustomEvent");a.initCustomEvent(t,!0,!0,s),e.dispatchEvent(a)}function initMask(e,t){e.maskRef=IMask(e,t).on("accept",()=>fireEvent(e,"accept",e.maskRef)).on("complete",()=>fireEvent(e,"complete",e.maskRef))}function destroyMask(e){e.maskRef&&(e.maskRef.destroy(),delete e.maskRef)}return a})());
|
|
1
|
+
(function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,e=>(()=>{"use strict";var t={2380(t){t.exports=e}},s={};function __webpack_require__(e){var a=s[e];if(void 0!==a)return a.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,__webpack_require__),i.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var s in t)__webpack_require__.o(t,s)&&!__webpack_require__.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};function isString(e){return"string"===typeof e||e instanceof String}function isObject(e){var t;return"object"===typeof e&&null!=e&&"Object"===(null==e||null==(t=e.constructor)?void 0:t.name)}function pick(e,t){return Array.isArray(t)?pick(e,(e,s)=>t.includes(s)):Object.entries(e).reduce((e,s)=>{let[a,i]=s;return t(i,a)&&(e[a]=i),e},{})}__webpack_require__.r(a),__webpack_require__.d(a,{IMask:()=>IMask,IMaskComponent:()=>_,IMaskDirective:()=>v,IMaskProps:()=>c,useIMask:()=>useIMask});const i={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function forceDirection(e){switch(e){case i.LEFT:return i.FORCE_LEFT;case i.RIGHT:return i.FORCE_RIGHT;default:return e}}function escapeRegExp(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function objectIncludes(e,t){if(t===e)return!0;const s=Array.isArray(t),a=Array.isArray(e);let i;if(s&&a){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!objectIncludes(t[i],e[i]))return!1;return!0}if(s!=a)return!1;if(t&&e&&"object"===typeof t&&"object"===typeof e){const s=t instanceof Date,a=e instanceof Date;if(s&&a)return t.getTime()==e.getTime();if(s!=a)return!1;const n=t instanceof RegExp,u=e instanceof RegExp;if(n&&u)return t.toString()==e.toString();if(n!=u)return!1;const r=Object.keys(t);for(i=0;i<r.length;i++)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=0;i<r.length;i++)if(!objectIncludes(e[r[i]],t[r[i]]))return!1;return!0}return!(!t||!e||"function"!==typeof t||"function"!==typeof e)&&t.toString()===e.toString()}class ActionDetails{constructor(e){Object.assign(this,e);while(this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos))--this.oldSelection.start;if(this.insertedCount)while(this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end))this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?i.NONE:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?i.LEFT:i.RIGHT}}function IMask(e,t){return new IMask.InputMask(e,t)}function maskedClass(e){if(null==e)throw new Error("mask property should be defined");return e instanceof RegExp?IMask.MaskedRegExp:isString(e)?IMask.MaskedPattern:e===Date?IMask.MaskedDate:e===Number?IMask.MaskedNumber:Array.isArray(e)||e===Array?IMask.MaskedDynamic:IMask.Masked&&e.prototype instanceof IMask.Masked?e:IMask.Masked&&e instanceof IMask.Masked?e.constructor:e instanceof Function?IMask.MaskedFunction:(console.warn("Mask not found for mask",e),IMask.Masked)}function normalizeOpts(e){if(!e)throw new Error("Options in not defined");if(IMask.Masked){if(e.prototype instanceof IMask.Masked)return{mask:e};const{mask:t,...s}=e instanceof IMask.Masked?{mask:e}:isObject(e)&&e.mask instanceof IMask.Masked?e:{};if(t){const e=t.mask;return{...pick(t,(e,t)=>!t.startsWith("_")),mask:t.constructor,_mask:e,...s}}}return isObject(e)?{...e}:{mask:e}}function createMask(e){if(IMask.Masked&&e instanceof IMask.Masked)return e;const t=normalizeOpts(e),s=maskedClass(t.mask);if(!s)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===s&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new s(t)}IMask.createMask=createMask;class MaskElement{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}IMask.MaskElement=MaskElement;const n=90,u=89;class HTMLMaskElement extends MaskElement{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return null!=(e=null==(t=(s=this.input).getRootNode)?void 0:t.call(s))?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(e.keyCode===n&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===u&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&e.keyCode===n&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(e.isComposing||this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}IMask.HTMLMaskElement=HTMLMaskElement;class HTMLInputMaskElement extends HTMLMaskElement{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}IMask.HTMLMaskElement=HTMLMaskElement;class HTMLContenteditableMaskElement extends HTMLMaskElement{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,a=t&&t.focusOffset;return null==a||null==s||s<a?s:a}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,a=t&&t.focusOffset;return null==a||null==s||s>a?s:a}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);const a=this.rootElement,i=a.getSelection&&a.getSelection();i&&(i.removeAllRanges(),i.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}IMask.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;class InputHistory{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>InputHistory.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}InputHistory.MAX_LENGTH=100;class InputMask{constructor(e,t){this.el=e instanceof MaskElement?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new HTMLContenteditableMaskElement(e):new HTMLInputMaskElement(e),this.masked=createMask(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new InputHistory,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof IMask.Masked)&&this.masked.constructor===maskedClass(e))return void this.masked.updateOptions({mask:e});const t=e instanceof IMask.Masked?e:createMask({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const s=this._listeners[e];s&&s.forEach(e=>e(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,s=this.masked.value,a=this.masked.rawInputValue,i=this.displayValue,n=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==a;this._unmaskedValue=t,this._value=s,this._rawInputValue=a,this.el.value!==i&&(this.el.value=i),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),n&&this._fireChangeEvents(),this._historyChanging||!n&&!this.history.isEmpty||this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...s}=e,a=!this.maskEquals(t),i=this.masked.optionsIsChanged(s);a&&(this.mask=t),i&&this.masked.updateOptions(s),(a||i)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,i.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new ActionDetails({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,a=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,n=s===this.masked.rawInputValue?t.removeDirection:i.NONE;let u=this.masked.nearestInputPos(t.startChangePos+a,n);n!==i.NONE&&(u=this.masked.nearestInputPos(u,i.NONE)),this.updateControl(u),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}IMask.InputMask=InputMask;class ChangeDetails{static normalize(e){return Array.isArray(e)?e:[e,new ChangeDetails]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}IMask.ChangeDetails=ChangeDetails;class ContinuousTailDetails{constructor(e,t,s){void 0===e&&(e=""),void 0===t&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Masked{constructor(e){this._value="",this._update({...Masked.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new ContinuousTailDetails(this.extractInput(e,t),e)}appendTail(e){return isString(e)&&(e=new ContinuousTailDetails(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new ChangeDetails({inserted:e,rawInserted:e})):new ChangeDetails}_appendChar(e,t,s){void 0===t&&(t={});const a=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&"pad"===this.autofix)){const s=this.state;this.state=a;let n=this.pad(t);const u=this._appendCharRaw(e,t);n=n.aggregate(u),u.rawInserted||n.equals(i)?i=n:this.state=s}if(i.inserted){let e,n=!1!==this.doValidate(t);if(n&&null!=s){const t=this.state;if(!0===this.overwrite){e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.unshift(this.displayValue.length-i.tailShift)}let a=this.appendTail(s);if(n=a.rawInserted.length===s.toString().length,(!n||!a.inserted)&&"shift"===this.overwrite){this.state=t,e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.shift();a=this.appendTail(s),n=a.rawInserted.length===s.toString().length}n&&a.inserted&&(this.state=t)}n||(i=new ChangeDetails,this.state=a,s&&e&&(s.state=e))}return i}_appendPlaceholder(){return new ChangeDetails}_appendEager(){return new ChangeDetails}append(e,t,s){if(!isString(e))throw new Error("value should be string");const a=isString(s)?new ContinuousTailDetails(String(s)):s;let i;null!=t&&t.tail&&(t._beforeTailState=this.state),[e,i]=this.doPrepare(e,t);for(let s=0;s<e.length;++s){const n=this._appendChar(e[s],t,a);if(!n.rawInserted&&!this.doSkipInvalid(e[s],t,a))break;i.aggregate(n)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&i.aggregate(this._appendEager()),null!=a&&(i.tailShift+=this.appendTail(a).tailShift),i}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new ChangeDetails}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,s=this.value,a=e();return this.rawInputValue=t,this.value&&this.value!==s&&0===s.indexOf(this.value)&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return Boolean(this.skipInvalid)}doPrepare(e,t){return void 0===t&&(t={}),ChangeDetails.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),ChangeDetails.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,a,n){void 0===s&&(s=""),void 0===a&&(a=i.NONE),void 0===n&&(n={input:!0});const u=e+t,r=this.extractTail(u),l=!0===this.eager||"remove"===this.eager;let o;l&&(a=forceDirection(a),o=this.extractInput(0,u,{raw:!0}));let h=e;const d=new ChangeDetails;if(a!==i.NONE&&(h=this.nearestInputPos(e,t>1&&0!==e&&!l?i.NONE:a),d.tailShift=h-e),d.aggregate(this.remove(h)),l&&a!==i.NONE&&o===this.rawInputValue)if(a===i.FORCE_LEFT){let e;while(o===this.rawInputValue&&(e=this.displayValue.length))d.aggregate(new ChangeDetails({tailShift:-1})).aggregate(this.remove(e-1))}else a===i.FORCE_RIGHT&&r.unshift();return d.aggregate(this.append(s,n,r))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!objectIncludes(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||Masked.EMPTY_VALUES.includes(e)&&Masked.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new ChangeDetails}}Masked.DEFAULTS={skipInvalid:!0},Masked.EMPTY_VALUES=[void 0,null,""],IMask.Masked=Masked;class ChunksTailDetails{constructor(e,t){void 0===e&&(e=[]),void 0===t&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=isString(e)?new ContinuousTailDetails(String(e)):e;const t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof ContinuousTailDetails)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof ChunksTailDetails){if(null==e.stop){let t;while(e.chunks.length&&null==e.chunks[0].stop)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof IMask.MaskedPattern)){const t=new ContinuousTailDetails(this.toString());return t.appendTo(e)}const t=new ChangeDetails;for(let s=0;s<this.chunks.length;++s){const a=this.chunks[s],i=e._mapPosToBlock(e.displayValue.length),n=a.stop;let u;if(null!=n&&(!i||i.index<=n)&&((a instanceof ChunksTailDetails||e._stops.indexOf(n)>=0)&&t.aggregate(e._appendPlaceholder(n)),u=a instanceof ChunksTailDetails&&e._blocks[n]),u){const s=u.appendTail(a);t.aggregate(s);const i=a.toString().slice(s.rawInserted.length);i&&t.aggregate(e.append(i,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(e=>{const t="chunks"in e?new ChunksTailDetails:new ContinuousTailDetails;return t.state=e,t})}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";const t=null!=e?e-this.from:e;let s=0;while(s<this.chunks.length){const e=this.chunks[s],a=e.unshift(t);if(e.toString()){if(!a)break;++s}else this.chunks.splice(s,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;while(0<=e){const t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class PatternCursor{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:a}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,i.FORCE_LEFT),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,i.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,i.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,i.FORCE_RIGHT),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,i.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,i.NONE),!0})}}class PatternFixedDefinition{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new ChangeDetails}nearestInputPos(e,t){void 0===t&&(t=i.NONE);const s=0,a=this._value.length;switch(t){case i.LEFT:case i.FORCE_LEFT:return s;case i.NONE:case i.RIGHT:case i.FORCE_RIGHT:default:return a}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),void 0===s&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new ChangeDetails;const s=!0===this.eager||"append"===this.eager,a=this.char===e,i=a&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,n=new ChangeDetails({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new ChangeDetails;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new ContinuousTailDetails("")}appendTail(e){return isString(e)&&(e=new ContinuousTailDetails(String(e))),e.appendTo(this)}append(e,t,s){const a=this._appendChar(e[0],t);return null!=s&&(a.tailShift+=this.appendTail(s).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=Boolean(e._rawInputValue)}pad(e){return this._appendPlaceholder()}}class PatternInputDefinition{constructor(e){const{parent:t,isOptional:s,placeholderChar:a,displayChar:i,lazy:n,eager:u,...r}=e;this.masked=createMask(r),Object.assign(this,{parent:t,isOptional:s,placeholderChar:a,displayChar:i,lazy:n,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),0===e&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new ChangeDetails}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new ChangeDetails;const s=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(t));return a.inserted&&!1===this.doValidate(t)&&(a=new ChangeDetails,this.masked.state=s),a.inserted||this.isOptional||this.lazy||t.input||(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=Boolean(a.inserted),a}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ChangeDetails:(this.isFilled=!0,new ChangeDetails({inserted:this.placeholderChar}))}_appendEager(){return new ChangeDetails}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){void 0===t&&(t=i.NONE);const s=0,a=this.value.length,n=Math.min(Math.max(e,s),a);switch(t){case i.LEFT:case i.FORCE_LEFT:return this.isComplete?n:s;case i.RIGHT:case i.FORCE_RIGHT:return this.isComplete?n:a;case i.NONE:default:return n}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new ChangeDetails}}PatternInputDefinition.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class MaskedRegExp extends Masked{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}IMask.MaskedRegExp=MaskedRegExp;class MaskedPattern extends Masked{constructor(e){super({...MaskedPattern.DEFAULTS,...e,definitions:Object.assign({},PatternInputDefinition.DEFAULT_DEFINITIONS,null==e?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let s=!1,a=!1;for(let i=0;i<t.length;++i){if(this.blocks){const e=t.slice(i),s=Object.keys(this.blocks).filter(t=>0===e.indexOf(t));s.sort((e,t)=>t.length-e.length);const a=s[0];if(a){const{expose:e,repeat:t,...s}=normalizeOpts(this.blocks[a]),n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...s,repeat:t,parent:this},u=null!=t?new IMask.RepeatBlock(n):createMask(n);u&&(this._blocks.push(u),e&&(this.exposeBlock=u),this._maskedBlocks[a]||(this._maskedBlocks[a]=[]),this._maskedBlocks[a].push(this._blocks.length-1)),i+=a.length-1;continue}}let n=t[i],u=n in e;if(n===MaskedPattern.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===n||"}"===n){s=!s;continue}if("["===n||"]"===n){a=!a;continue}if(n===MaskedPattern.ESCAPE_CHAR){if(++i,n=t[i],!n)break;u=!1}const r=u?new PatternInputDefinition({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...normalizeOpts(e[n]),parent:this}):new PatternFixedDefinition({char:n,eager:this.eager,isUnmasking:s});this._blocks.push(r)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e)return void this.reset();const{_blocks:t,...s}=e;this._blocks.forEach((e,s)=>e.state=t[s]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new ChangeDetails;let s=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==s)return t;this._blocks[s].isFilled&&++s;for(let e=s;e<this._blocks.length;++e){const s=this._blocks[e]._appendEager();if(!s.inserted)break;t.aggregate(s)}return t}_appendCharRaw(e,t){void 0===t&&(t={});const s=this._mapPosToBlock(this.displayValue.length),a=new ChangeDetails;if(!s)return a;for(let n,u=s.index;n=this._blocks[u];++u){var i;const s=n._appendChar(e,{...t,_beforeTailState:null==(i=t._beforeTailState)||null==(i=i._blocks)?void 0:i[u]});if(a.aggregate(s),s.consumed)break}return a}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const s=new ChunksTailDetails;return e===t||this._forEachBlocksInRange(e,t,(e,t,a,i)=>{const n=e.extractTail(a,i);n.stop=this._findStopBefore(t),n.from=this._blockStartPos(t),n instanceof ChunksTailDetails&&(n.blockIndex=t),s.extend(n)}),s}extractInput(e,t,s){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),void 0===s&&(s={}),e===t)return"";let a="";return this._forEachBlocksInRange(e,t,(e,t,i,n)=>{a+=e.extractInput(i,n,s)}),a}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){const a=this._stops[s];if(!(a<=e))break;t=a}return t}_appendPlaceholder(e){const t=new ChangeDetails;if(this.lazy&&null==e)return t;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;const a=s.index,i=null!=e?e:this._blocks.length;return this._blocks.slice(a,i).forEach(s=>{var a;s.lazy&&null==e||t.aggregate(s._appendPlaceholder(null==(a=s._blocks)?void 0:a.length))}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){const a=this._blocks[s],i=t.length;if(t+=a.displayValue,e<=t.length)return{index:s,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+t.displayValue.length,0)}_forEachBlocksInRange(e,t,s){void 0===t&&(t=this.displayValue.length);const a=this._mapPosToBlock(e);if(a){const e=this._mapPosToBlock(t),i=e&&a.index===e.index,n=a.offset,u=e&&i?e.offset:this._blocks[a.index].displayValue.length;if(s(this._blocks[a.index],a.index,n,u),e&&!i){for(let t=a.index+1;t<e.index;++t)s(this._blocks[t],t,0,this._blocks[t].displayValue.length);s(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(e,t,a,i)=>{s.aggregate(e.remove(a,i))}),s}nearestInputPos(e,t){if(void 0===t&&(t=i.NONE),!this._blocks.length)return 0;const s=new PatternCursor(this,e);if(t===i.NONE)return s.pushRightBeforeInput()?s.pos:(s.popState(),s.pushLeftBeforeInput()?s.pos:this.displayValue.length);if(t===i.LEFT||t===i.FORCE_LEFT){if(t===i.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===i.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e)return s.pos;if(s.popState(),s.ok&&s.pos<=e)return s.pos;s.popState()}return s.ok?s.pos:t===i.FORCE_LEFT?0:(s.popState(),s.ok?s.pos:(s.popState(),s.ok?s.pos:0))}return t===i.RIGHT||t===i.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:t===i.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok?s.pos:(s.popState(),s.ok?s.pos:this.nearestInputPos(e,i.LEFT)))):e}totalInputPositions(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(e,t,a,i)=>{s+=e.totalInputPositions(a,i)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(e){const t=new ChangeDetails;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}MaskedPattern.DEFAULTS={...Masked.DEFAULTS,lazy:!0,placeholderChar:"_"},MaskedPattern.STOP_CHAR="`",MaskedPattern.ESCAPE_CHAR="\\",MaskedPattern.InputDefinition=PatternInputDefinition,MaskedPattern.FixedDefinition=PatternFixedDefinition,IMask.MaskedPattern=MaskedPattern;class MaskedRange extends MaskedPattern{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:s=this.from||0,maxLength:a=this.maxLength||0,autofix:i=this.autofix,...n}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,a),this.autofix=i;const u=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0");let l=0;while(l<r.length&&r[l]===u[l])++l;n.mask=r.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(e){let t="",s="";const[,a,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(a.length)+i,s="9".repeat(a.length)+i),t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[t,s]}doPrepareChar(e,t){let s;return void 0===t&&(t={}),[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const s=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[i,n]=this.boundaries(this.value+e);return Number(n)<this.from?super._appendCharRaw(s[this.value.length],t):Number(i)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(a[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value,s=t.search(/[^0]/);if(-1===s&&t.length<=this._matchFrom)return!0;const[a,i]=this.boundaries(t);return this.from<=Number(i)&&Number(a)<=this.to&&super.doValidate(e)}pad(e){const t=new ChangeDetails;if(this.value.length===this.maxLength)return t;const s=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let s=0;s<a;++s)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(e=>this._appendCharRaw(e))}return t}}IMask.MaskedRange=MaskedRange;const r="d{.}`m{.}`Y";class MaskedDate extends MaskedPattern{static extractPatternOptions(e){const{mask:t,pattern:s,...a}=e;return{...a,mask:isString(t)?t:s}}constructor(e){super(MaskedDate.extractPatternOptions({...MaskedDate.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:s,blocks:a,...i}={...MaskedDate.DEFAULTS,...e},n=Object.assign({},MaskedDate.GET_DEFAULT_BLOCKS());e.min&&(n.Y.from=e.min.getFullYear()),e.max&&(n.Y.to=e.max.getFullYear()),e.min&&e.max&&n.Y.from===n.Y.to&&(n.m.from=e.min.getMonth()+1,n.m.to=e.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=e.min.getDate(),n.d.to=e.max.getDate())),Object.assign(n,this.blocks,a),super._update({...i,mask:isString(t)?t:s,blocks:n})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(MaskedDate.extractPatternOptions(e))}}MaskedDate.GET_DEFAULT_BLOCKS=()=>({d:{mask:MaskedRange,from:1,to:31,maxLength:2},m:{mask:MaskedRange,from:1,to:12,maxLength:2},Y:{mask:MaskedRange,from:1900,to:9999}}),MaskedDate.DEFAULTS={...MaskedPattern.DEFAULTS,mask:Date,pattern:r,format:(e,t)=>{if(!e)return"";const s=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=e.getFullYear();return[s,a,i].join(".")},parse:(e,t)=>{const[s,a,i]=e.split(".").map(Number);return new Date(i,a-1,s)}},IMask.MaskedDate=MaskedDate;class MaskedDynamic extends Masked{constructor(e){super({...MaskedDynamic.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(e=>{const{expose:t,...s}=normalizeOpts(e),a=createMask({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return t&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,t){void 0===t&&(t={});const s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){void 0===e&&(e=""),void 0===t&&(t={}),void 0===s&&(s="");const a=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,i=this.rawInputValue,n=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:i,u=i.slice(n.length),r=this.currentMask,l=new ChangeDetails,o=null==r?void 0:r.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==r?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-a.length),u&&(l.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),l}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new ChangeDetails;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(s=e._beforeTailState)?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return void 0===t&&(t={}),void 0===s&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){void 0===t&&(t={});let[s,a]=super.doPrepare(e,t);if(this.currentMask){let e;[s,e]=super.doPrepare(s,this.currentMaskFlags(t)),a=a.aggregate(e)}return[s,a]}doPrepareChar(e,t){void 0===t&&(t={});let[s,a]=super.doPrepareChar(e,t);if(this.currentMask){let e;[s,e]=super.doPrepareChar(s,this.currentMaskFlags(t)),a=a.aggregate(e)}return[s,a]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask)return this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,void this._applyDispatch();let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){const s=new ChangeDetails;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:s,currentMask:a,...i}=e;t&&this.compiledMasks.forEach((e,s)=>e.state=t[s]),null!=s&&(this.currentMask=s,this.currentMask.state=a),super.state=i}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;const{mask:a,...i}=e[s];return objectIncludes(t,i)&&t.maskEquals(a)}):super.maskEquals(e)}typedValueEquals(e){var t;return Boolean(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}MaskedDynamic.DEFAULTS={...Masked.DEFAULTS,dispatch:(e,t,s,a)=>{if(!t.compiledMasks.length)return;const n=t.rawInputValue,u=t.compiledMasks.map((u,r)=>{const l=t.currentMask===u,o=l?u.displayValue.length:u.nearestInputPos(u.displayValue.length,i.FORCE_LEFT);return u.rawInputValue!==n?(u.reset(),u.append(n,{raw:!0})):l||u.remove(o),u.append(e,t.currentMaskFlags(s)),u.appendTail(a),{index:r,weight:u.rawInputValue.length,totalInputPositions:u.totalInputPositions(0,Math.max(o,u.nearestInputPos(u.displayValue.length,i.FORCE_LEFT)))}});return u.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[u[0].index]}},IMask.MaskedDynamic=MaskedDynamic;class MaskedEnum extends MaskedPattern{constructor(e){super({...MaskedEnum.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...s}=e;if(t){const e=t.map(e=>e.length),a=Math.min(...e),i=Math.max(...e)-a;s.mask="*".repeat(a),i&&(s.mask+="["+"*".repeat(i)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){void 0===t&&(t={});const s=Math.min(this.nearestInputPos(0,i.FORCE_RIGHT),this.value.length),a=this.enum.filter(t=>this.matchValue(t,this.unmaskedValue+e,s));if(a.length){1===a.length&&this._forEachBlocksInRange(0,this.value.length,(e,s)=>{const i=a[0][s];s>=this.value.length||i===e.value||(e.reset(),e._appendChar(i,t))});const e=super._appendCharRaw(a[0][this.value.length],t);return 1===a.length&&a[0].slice(this.unmaskedValue.length).split("").forEach(t=>e.aggregate(super._appendCharRaw(t))),e}return new ChangeDetails({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new ContinuousTailDetails("",e)}remove(e,t){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new ChangeDetails;const s=Math.min(super.nearestInputPos(0,i.FORCE_RIGHT),this.value.length);let a;for(a=e;a>=0;--a){const e=this.enum.filter(e=>this.matchValue(e,this.value.slice(s,a),s));if(e.length>1)break}const n=super.remove(a,t);return n.tailShift+=a-e,n}get isComplete(){return this.enum.indexOf(this.value)>=0}}MaskedEnum.DEFAULTS={...MaskedPattern.DEFAULTS,matchValue:(e,t,s)=>e.indexOf(t,s)===s},IMask.MaskedEnum=MaskedEnum;class MaskedFunction extends Masked{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}var l;IMask.MaskedFunction=MaskedFunction;class MaskedNumber extends Masked{constructor(e){super({...MaskedNumber.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",s=(this.scale?"("+escapeRegExp(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(escapeRegExp).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});const[s,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(a.skip=!0),!s||this.allowPositive||this.value||"-"===s||a.aggregate(this._appendChar("-")),[s,a]}_separatorsCount(e,t){void 0===t&&(t=!1);let s=0;for(let a=0;a<e;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){void 0===t&&(t={});const s=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const n=this.number;let u,r=!isNaN(n),l=!1;if(r){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):r=!1),r&&(r=Boolean(this._value.match(this._numberRegExp)))}r?u=new ChangeDetails({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,u=new ChangeDetails),this._value=this._insertThousandsSeparators(this._value);const o=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,h=this._separatorsCountFromSlice(o);return u.tailShift+=(h-a)*this.thousandsSeparator.length,u}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,t){const s=this._findSeparatorAround(e);s>=0&&(e=s);const a=this._findSeparatorAround(t);return a>=0&&(t=a+this.thousandsSeparator.length),[e,t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const s=this.value.slice(0,e),a=this.value.slice(t),i=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+a));const n=this._separatorsCountFromSlice(s);return new ChangeDetails({tailShift:(n-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case i.NONE:case i.LEFT:case i.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const a=s+this.thousandsSeparator.length;if(e<a||this.value.length<=a||t===i.FORCE_LEFT)return s}break}case i.RIGHT:case i.FORCE_RIGHT:{const t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,s,a)=>t+a),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){void 0===t&&(t={});const a=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===MaskedNumber.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,MaskedNumber.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(MaskedNumber.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||MaskedNumber.EMPTY_VALUES.includes(e)&&MaskedNumber.EMPTY_VALUES.includes(this.typedValue))&&!(0===e&&""===this.value)}}l=MaskedNumber,MaskedNumber.UNMASKED_RADIX=".",MaskedNumber.EMPTY_VALUES=[...Masked.EMPTY_VALUES,0],MaskedNumber.DEFAULTS={...Masked.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[l.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},IMask.MaskedNumber=MaskedNumber;const o={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function createPipe(e,t,s){void 0===t&&(t=o.MASKED),void 0===s&&(s=o.MASKED);const a=createMask(e);return e=>a.runIsolated(a=>(a[t]=e,a[s]))}function pipe(e,t,s,a){return createPipe(t,s,a)(e)}IMask.PIPE_TYPE=o,IMask.createPipe=createPipe,IMask.pipe=pipe;class RepeatBlock extends MaskedPattern{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,a;const{repeat:i,...n}=normalizeOpts(e);this._blockOpts=Object.assign({},this._blockOpts,n);const u=createMask(this._blockOpts);this.repeat=null!=(t=null!=(s=null!=i?i:u.repeat)?s:this.repeat)?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(a=this._blocks)?void 0:a.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(createMask(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});const s=new ChangeDetails;for(let r,l,o=null!=(a=null==(i=this._mapPosToBlock(this.displayValue.length))?void 0:i.index)?a:Math.max(this._blocks.length-1,0);r=null!=(n=this._blocks[o])?n:l=!l&&this._allocateBlock(o);++o){var a,i,n,u;const h=r._appendChar(e,{...t,_beforeTailState:null==(u=t._beforeTailState)||null==(u=u._blocks)?void 0:u[o]});if(h.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,t){var s,a;void 0===e&&(e=0);const i=Math.max((null==(s=this._mapPosToBlock(e))?void 0:s.index)||0,this.repeatFrom,0);let n;null!=t&&(n=null==(a=this._mapPosToBlock(t))?void 0:a.index),null==n&&(n=this._blocks.length-1);let u=0;for(let e=n;i<=e;--e,++u)if(this._blocks[e].unmaskedValue)break;u&&(this._blocks.splice(n-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return void 0===e&&(e=0),null==t&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}IMask.RepeatBlock=RepeatBlock;try{globalThis.IMask=IMask}catch{}var h=__webpack_require__(2380),d=!0,p=void 0;var c={mask:void 0,prepare:Function,prepareChar:Function,validate:Function,commit:Function,overwrite:{type:Boolean,required:!1,default:void 0},eager:{required:!1,default:void 0,validator:e=>["append","remove"].includes(e)||"boolean"===typeof e},skipInvalid:{type:Boolean,required:!1,default:void 0},placeholderChar:String,displayChar:String,lazy:{type:Boolean,required:!1,default:void 0},definitions:Object,blocks:Object,enum:Array,maxLength:Number,from:Number,to:Number,pattern:String,format:Function,parse:Function,autofix:{required:!1,default:void 0,validator:e=>"pad"===e||"boolean"===typeof e},radix:String,thousandsSeparator:String,mapToRadix:Array,scale:Number,normalizeZeros:{type:Boolean,required:!1,default:void 0},padFractionalZeros:{type:Boolean,required:!1,default:void 0},min:[Number,Date],max:[Number,Date],dispatch:Function};function useIMask(e,t){let{emit:s,onAccept:a,onComplete:i,defaultValue:n,defaultUnmaskedValue:u,defaultTypedValue:r}=void 0===t?{}:t;const l=(0,h.isRef)(e)?e:(0,h.ref)(e),o=(0,h.ref)(),d=(0,h.ref)(),p=(0,h.ref)(""),c=(0,h.ref)(""),k=(0,h.ref)();let m,g=p.value,_=c.value,v=k.value;function storeLastAcceptedValues(){v=k.value=d.value.typedValue,_=c.value=d.value.unmaskedValue,g=p.value=d.value.value}function _onAccept(e){storeLastAcceptedValues(),s&&(s("accept",p.value,e),s("accept:masked",p.value,e),s("accept:typed",k.value,e),s("accept:unmasked",c.value,e)),null==a||a(e)}function _onComplete(e){s&&(s("complete",d.value.value,e),s("complete:masked",d.value.value,e),s("complete:typed",d.value.typedValue,e),s("complete:unmasked",d.value.unmaskedValue,e)),null==i||i(e)}const updateUnmaskedValue=()=>{d.value&&void 0!==c.value&&(_!==c.value&&(d.value.unmaskedValue=c.value,d.value.unmaskedValue!==c.value&&_onAccept()),_=void 0)};(0,h.watch)(c,updateUnmaskedValue);const updateMaskedValue=()=>{d.value&&void 0!==p.value&&(g!==p.value&&(d.value.value=p.value,d.value.value!==p.value&&_onAccept()),g=void 0)};(0,h.watch)(p,updateMaskedValue);const updateTypedValue=()=>{d.value&&void 0!==k.value&&(v!==k.value&&(d.value.typedValue=k.value,d.value.masked.typedValueEquals(k.value)||_onAccept()),v=void 0)};function _initMask(){m=o.value;const e=l.value;m&&null!=e&&e.mask&&(d.value=IMask(m,e),void 0!==n&&(p.value=n),void 0!==u&&(c.value=u),void 0!==r&&(k.value=r),updateUnmaskedValue(),updateMaskedValue(),updateTypedValue(),storeLastAcceptedValues(),d.value.on("accept",_onAccept).on("complete",_onComplete))}function _destroyMask(){var e;null==(e=d.value)||e.destroy(),d.value=void 0}return(0,h.watch)(k,updateTypedValue),(0,h.onMounted)(_initMask),(0,h.onUnmounted)(_destroyMask),(0,h.watch)([o,l],()=>{const e=o.value,t=l.value;null!=t&&t.mask&&e===m||_destroyMask(),e&&(d.value?d.value.updateOptions(t):_initMask())}),{el:o,mask:(0,h.readonly)(d),masked:p,unmasked:c,typed:k}}function extractOptionsFromProps(e,t){return e={...e},Object.keys(e).forEach(s=>{(void 0===e[s]||t.includes(s))&&delete e[s]}),e}const k=["typed","unmasked","value","modelValue"];var m=(0,h.defineComponent)({name:"imask-input",inheritAttrs:!1,props:{modelValue:String,value:String,unmasked:String,typed:{validator:()=>!0},...c},emits:["update:modelValue","update:masked","update:value","update:unmasked","update:typed","accept","accept:value","accept:masked","accept:unmasked","accept:typed","complete","complete:value","complete:masked","complete:unmasked","complete:typed"],setup(e,t){let{attrs:s,emit:a}=t;const{el:i,mask:n,masked:u,unmasked:r,typed:l}=useIMask(extractOptionsFromProps(e,k),{emit:a,onAccept:e=>{const t=u.value;a("accept:value",t,e),a("update:value",t,e),a("update:masked",t,e),a("update:modelValue",t,e),a("update:unmasked",r.value,e),a("update:typed",l.value,e)},onComplete:e=>{a("complete:value",u.value,e)}}),o=(0,h.toRef)(e,"value"),d=(0,h.toRef)(e,"modelValue"),p=(0,h.toRef)(e,"unmasked"),c=(0,h.toRef)(e,"typed");return u.value=d.value||o.value||"",r.value=p.value||"",l.value=c.value,(0,h.watch)(o,e=>u.value=e),(0,h.watch)(d,e=>u.value=e),(0,h.watch)(p,e=>r.value=e),(0,h.watch)(c,e=>l.value=e),()=>{const t={...s,value:null!=e.value?e.value:null!=e.modelValue?e.modelValue:n.value?n.value.displayValue:"",ref:i};return e.mask||(t.onInput=e=>{a("update:modelValue",e.target.value),a("update:value",e.target.value)}),(0,h.h)("input",t)}}}),g=null==p?void 0:p.extend({name:"imask-input",data(){return{}},render(e){const t={domProps:{value:this.maskRef?this.maskRef.value:this.value},on:{...this.$listeners}};return this.$props.mask?delete t.on.input:t.on.input=e=>this.$emit("input",e.target.value),e("input",t)},mounted(){this.$props.mask&&this._initMask()},destroyed(){this._destroyMask()},computed:{maskOptions(){return extractOptionsFromProps(this.$props,["value","unmask"])}},watch:{$props:{handler(e){const t=this.maskOptions;t.mask?this.maskRef?(this.maskRef.updateOptions(t),"value"in e&&this._updateValue()):(this._initMask(t),e.value!==this._maskValue()&&this._onAccept()):(this._destroyMask(),"value"in e&&(this.$el.value=e.value))},deep:!0}},methods:{_maskValue(){var e,t,s;return"typed"===this.unmask?null==(e=this.maskRef)?void 0:e.typedValue:this.unmask?null==(t=this.maskRef)?void 0:t.unmaskedValue:null==(s=this.maskRef)?void 0:s.value},_updateValue(){if(!this.maskRef)return;const e=null==this.value&&"typed"!==this.unmask?"":this.value;"typed"===this.unmask?this.maskRef.typedValue=e:this.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e},_onAccept(){const e=this._maskValue();this.$emit("input",e),this.$emit("accept",e)},_onComplete(){this.$emit("complete",this._maskValue())},_initMask(e){e||(e=this.maskOptions),this.maskRef=IMask(this.$el,e).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),this._updateValue()},_destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}},props:{value:{},unmask:{validator:e=>"typed"===e||"boolean"===typeof e},...c}}),_=d?m:g,v={name:"imask",[d?"beforeMount":"bind"]:(e,t)=>{let{value:s}=t;s&&initMask(e,s)},[d?"updated":"update"]:(e,t)=>{let{value:s}=t;s?e.maskRef?(e.maskRef.updateOptions(s),e.value!==e.maskRef.value&&e.maskRef._onChange()):initMask(e,s):destroyMask(e)},[d?"unmounted":"unbind"]:e=>{destroyMask(e)}};function fireEvent(e,t,s){const a=document.createEvent("CustomEvent");a.initCustomEvent(t,!0,!0,s),e.dispatchEvent(a)}function initMask(e,t){e.maskRef=IMask(e,t).on("accept",()=>fireEvent(e,"accept",e.maskRef)).on("complete",()=>fireEvent(e,"complete",e.maskRef))}function destroyMask(e){e.maskRef&&(e.maskRef.destroy(),delete e.maskRef)}return a})());
|