@verdocs/web-sdk 5.0.73 → 5.0.74
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/cjs/{utils-Bxil_g6M.js → utils-DCB8q98B.js} +6 -2
- package/dist/cjs/utils-DCB8q98B.js.map +1 -0
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -5
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-kba-dialog_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +1 -5
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js.map +1 -1
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/{p-Clok0sKa.js → p-BqWxusTA.js} +4 -4
- package/dist/components/{p-Clok0sKa.js.map → p-BqWxusTA.js.map} +1 -1
- package/dist/components/p-CDTU_UJD.js.map +1 -1
- package/dist/components/{p-CG2DS0Ct.js → p-CLHwiJsu.js} +3 -3
- package/dist/components/{p-CG2DS0Ct.js.map → p-CLHwiJsu.js.map} +1 -1
- package/dist/components/{p-B3KdiIa6.js → p-CWHHlD3o.js} +3 -3
- package/dist/components/{p-B3KdiIa6.js.map → p-CWHHlD3o.js.map} +1 -1
- package/dist/components/{p-rafg8cJv.js → p-Cfx8TNcj.js} +4 -4
- package/dist/components/{p-rafg8cJv.js.map → p-Cfx8TNcj.js.map} +1 -1
- package/dist/components/{p-D-4uVyuT.js → p-CpHTrnj5.js} +3 -3
- package/dist/components/{p-D-4uVyuT.js.map → p-CpHTrnj5.js.map} +1 -1
- package/dist/components/{p-DDMPZ6xr.js → p-D38Lnu3J.js} +3 -3
- package/dist/components/{p-DDMPZ6xr.js.map → p-D38Lnu3J.js.map} +1 -1
- package/dist/components/{p-DA5NR945.js → p-De7UWCgq.js} +3 -7
- package/dist/components/p-De7UWCgq.js.map +1 -0
- package/dist/components/{p-rIIybUCF.js → p-DsBOZHKo.js} +6 -2
- package/dist/components/{p-rIIybUCF.js.map → p-DsBOZHKo.js.map} +1 -1
- package/dist/components/{p-DcAnGvC8.js → p-eiHT7SZQ.js} +5 -5
- package/dist/components/{p-DcAnGvC8.js.map → p-eiHT7SZQ.js.map} +1 -1
- package/dist/components/{p-BFgewNxB.js → p-iOb94GB3.js} +4 -4
- package/dist/components/{p-BFgewNxB.js.map → p-iOb94GB3.js.map} +1 -1
- package/dist/components/p-z0ZD30Bi.js.map +1 -1
- package/dist/components/verdocs-build.js +6 -6
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +2 -2
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-quick-filter.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +3 -3
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/{utils-CbfXTNEw.js → utils-DmfOx9Ey.js} +6 -2
- package/dist/esm/utils-DmfOx9Ey.js.map +1 -0
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +1 -5
- package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm/verdocs-kba-dialog_3.entry.js +1 -1
- package/dist/esm/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/{utils-CbfXTNEw.js → utils-DmfOx9Ey.js} +2 -2
- package/dist/esm-es5/utils-DmfOx9Ey.js.map +1 -0
- package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-kba-dialog_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-5af5bd43.entry.js → p-0bb8015d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7e91292a.entry.js → p-13c9ac73.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-3bf5dfcb.system.entry.js → p-1653b309.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-8bee83ad.entry.js → p-1718b823.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-3e4a6587.system.entry.js → p-2a183b90.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-b78fa925.entry.js → p-3b68bc50.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-3b68bc50.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-ff182af0.entry.js → p-43326217.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-77cb64e8.system.entry.js → p-44de70af.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-04421e78.system.entry.js → p-524c1693.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7926e0ed.entry.js → p-5d4a9e54.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5f2740be.entry.js → p-65f4a435.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ba007f95.system.entry.js → p-68b0e020.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-db22e373.system.entry.js → p-6d8c780d.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d73e5d98.system.entry.js → p-9f2bde83.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-DwVINdLf.system.js.map → p-BEa6VFpF.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-DFxwv7XE.system.js.map → p-Bh0IfLXk.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-BxWHy8GG.system.js.map → p-BqV2sLyM.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-C4Tt0CYc.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-8wtUCSj6.system.js.map → p-C99h0Uet.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-CalyeRmL.system.js → p-CD5uiThi.system.js} +3 -3
- package/dist/verdocs-web-sdk/p-CD5uiThi.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-Bf0islHu.system.js.map → p-CWs7NRzr.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-CwXSduhy.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-CTKsneFq.system.js.map → p-Cz3XayQm.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-CeQPkjRM.system.js.map → p-DRzyvgiA.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-SFqGy6JR.system.js.map → p-EQbSTcUE.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-7c58a33b.system.entry.js → p-a2ba1316.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-a2ba1316.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-d8a89fb3.entry.js → p-bb96a9af.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-aa3436c1.entry.js → p-d3d531e3.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b29ae6dd.system.entry.js → p-e5f90a18.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-Bf-kinKl.js → p-fL0BKEnm.js} +2 -2
- package/dist/verdocs-web-sdk/p-fL0BKEnm.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/utils-Bxil_g6M.js.map +0 -1
- package/dist/components/p-DA5NR945.js.map +0 -1
- package/dist/esm/utils-CbfXTNEw.js.map +0 -1
- package/dist/esm-es5/utils-CbfXTNEw.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7c58a33b.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Bf-kinKl.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CalyeRmL.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-b78fa925.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-vPV-UVh5.system.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-5af5bd43.entry.js.map → p-0bb8015d.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7e91292a.entry.js.map → p-13c9ac73.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3bf5dfcb.system.entry.js.map → p-1653b309.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8bee83ad.entry.js.map → p-1718b823.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3e4a6587.system.entry.js.map → p-2a183b90.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ff182af0.entry.js.map → p-43326217.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-77cb64e8.system.entry.js.map → p-44de70af.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-04421e78.system.entry.js.map → p-524c1693.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7926e0ed.entry.js.map → p-5d4a9e54.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-5f2740be.entry.js.map → p-65f4a435.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ba007f95.system.entry.js.map → p-68b0e020.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-db22e373.system.entry.js.map → p-6d8c780d.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d73e5d98.system.entry.js.map → p-9f2bde83.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d8a89fb3.entry.js.map → p-bb96a9af.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-aa3436c1.entry.js.map → p-d3d531e3.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b29ae6dd.system.entry.js.map → p-e5f90a18.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(i,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)if(Object.prototype.hasOwnProperty.call(i,e))t[e]=i[e]};return t(i,e)};return function(i,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(i,e);function n(){this.constructor=i}i.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++){i=arguments[e];for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s))t[s]=i[s]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,i,e,n){function s(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{o(n.next(t))}catch(t){r(t)}}function a(t){try{o(n["throw"](t))}catch(t){r(t)}}function o(t){t.done?e(t.value):s(t.value).then(u,a)}o((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(t){return function(i){return o([t,i])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(e=0)),e)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;s=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){e.label=a[1];break}if(a[0]===6&&e.label<r[1]){e.label=r[1];r=a;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(a);break}if(r[2])e.ops.pop();e.trys.pop();continue}a=i.call(t,e)}catch(t){a=[6,t];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __rest=this&&this.__rest||function(t,i){var e={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i.indexOf(n)<0)e[n]=t[n];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++){if(i.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s]))e[n[s]]=t[n[s]]}return e};var __spreadArray=this&&this.__spreadArray||function(t,i,e){if(e||arguments.length===2)for(var n=0,s=i.length,r;n<s;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return t.concat(r||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-CF7i8guW.js";import{verifySigner,VerdocsEndpoint,getEnvelope,getDocumentDownloadLink,cancelEnvelope,userCanCancelEnvelope,integerSequence}from"@verdocs/js-sdk";import{D as DefaultEndpoint}from"./Environment-C_Xku1v2.js";import{V as VerdocsToast}from"./Toast-CyvDgtoV.js";import{s as saveEnvelopesAsZip}from"./utils-CbfXTNEw.js";import{S as SDKError}from"./errors-C1sRVZWv.js";import{S as Store}from"./Datastore-C_IIZj49.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-Dl7Xw8F0.js";function isString(t){return typeof t==="string"||t instanceof String}function isObject(t){var i;return typeof t==="object"&&t!=null&&(t==null||(i=t.constructor)==null?void 0:i.name)==="Object"}function pick(t,i){if(Array.isArray(i))return pick(t,(function(t,e){return i.includes(e)}));return Object.entries(t).reduce((function(t,e){var n=e[0],s=e[1];if(i(s,n))t[n]=s;return t}),{})}var DIRECTION={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function forceDirection(t){switch(t){case DIRECTION.LEFT:return DIRECTION.FORCE_LEFT;case DIRECTION.RIGHT:return DIRECTION.FORCE_RIGHT;default:return t}}function escapeRegExp(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function objectIncludes(t,i){if(i===t)return true;var e=Array.isArray(i),n=Array.isArray(t);var s;if(e&&n){if(i.length!=t.length)return false;for(s=0;s<i.length;s++)if(!objectIncludes(i[s],t[s]))return false;return true}if(e!=n)return false;if(i&&t&&typeof i==="object"&&typeof t==="object"){var r=i instanceof Date,u=t instanceof Date;if(r&&u)return i.getTime()==t.getTime();if(r!=u)return false;var a=i instanceof RegExp,o=t instanceof RegExp;if(a&&o)return i.toString()==t.toString();if(a!=o)return false;var h=Object.keys(i);for(s=0;s<h.length;s++)if(!Object.prototype.hasOwnProperty.call(t,h[s]))return false;for(s=0;s<h.length;s++)if(!objectIncludes(t[h[s]],i[h[s]]))return false;return true}else if(i&&t&&typeof i==="function"&&typeof t==="function"){return i.toString()===t.toString()}return false}var ActionDetails=function(){function t(t){Object.assign(this,t);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)){if(this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end)++this.oldSelection.end;else++this.cursorPos}}}Object.defineProperty(t.prototype,"startChangePos",{get:function(){return Math.min(this.cursorPos,this.oldSelection.start)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"insertedCount",{get:function(){return this.cursorPos-this.startChangePos},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"inserted",{get:function(){return this.value.substr(this.startChangePos,this.insertedCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"removedCount",{get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"removed",{get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"head",{get:function(){return this.value.substring(0,this.startChangePos)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tail",{get:function(){return this.value.substring(this.startChangePos+this.insertedCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"removeDirection",{get:function(){if(!this.removedCount||this.insertedCount)return DIRECTION.NONE;return(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?DIRECTION.RIGHT:DIRECTION.LEFT},enumerable:false,configurable:true});return t}();function IMask(t,i){return new IMask.InputMask(t,i)}function maskedClass(t){if(t==null)throw new Error("mask property should be defined");if(t instanceof RegExp)return IMask.MaskedRegExp;if(isString(t))return IMask.MaskedPattern;if(t===Date)return IMask.MaskedDate;if(t===Number)return IMask.MaskedNumber;if(Array.isArray(t)||t===Array)return IMask.MaskedDynamic;if(IMask.Masked&&t.prototype instanceof IMask.Masked)return t;if(IMask.Masked&&t instanceof IMask.Masked)return t.constructor;if(t instanceof Function)return IMask.MaskedFunction;console.warn("Mask not found for mask",t);return IMask.Masked}function normalizeOpts(t){if(!t)throw new Error("Options in not defined");if(IMask.Masked){if(t.prototype instanceof IMask.Masked)return{mask:t};var i=t instanceof IMask.Masked?{mask:t}:isObject(t)&&t.mask instanceof IMask.Masked?t:{},e=i.mask,n=e===void 0?undefined:e,s=__rest(i,["mask"]);if(n){var r=n.mask;return __assign(__assign(__assign({},pick(n,(function(t,i){return!i.startsWith("_")}))),{mask:n.constructor,_mask:r}),s)}}if(!isObject(t))return{mask:t};return __assign({},t)}function createMask(t){if(IMask.Masked&&t instanceof IMask.Masked)return t;var i=normalizeOpts(t);var e=maskedClass(i.mask);if(!e)throw new Error("Masked class is not found for provided mask "+i.mask+", appropriate module needs to be imported manually before creating mask.");if(i.mask===e)delete i.mask;if(i._mask){i.mask=i._mask;delete i._mask}return new e(i)}IMask.createMask=createMask;var MaskElement=function(){function t(){}Object.defineProperty(t.prototype,"selectionStart",{get:function(){var t;try{t=this._unsafeSelectionStart}catch(t){}return t!=null?t:this.value.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectionEnd",{get:function(){var t;try{t=this._unsafeSelectionEnd}catch(t){}return t!=null?t:this.value.length},enumerable:false,configurable:true});t.prototype.select=function(t,i){if(t==null||i==null||t===this.selectionStart&&i===this.selectionEnd)return;try{this._unsafeSelect(t,i)}catch(t){}};Object.defineProperty(t.prototype,"isActive",{get:function(){return false},enumerable:false,configurable:true});return t}();IMask.MaskElement=MaskElement;var KEY_Z=90;var KEY_Y=89;var HTMLMaskElement=function(t){__extends(i,t);function i(i){var e=t.call(this)||this;e.input=i;e._onKeydown=e._onKeydown.bind(e);e._onInput=e._onInput.bind(e);e._onBeforeinput=e._onBeforeinput.bind(e);e._onCompositionEnd=e._onCompositionEnd.bind(e);return e}Object.defineProperty(i.prototype,"rootElement",{get:function(){var t,i,e;return(t=(i=(e=this.input).getRootNode)==null?void 0:i.call(e))!=null?t:document},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isActive",{get:function(){return this.input===this.rootElement.activeElement},enumerable:false,configurable:true});i.prototype.bindEvents=function(t){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",t.drop);this.input.addEventListener("click",t.click);this.input.addEventListener("focus",t.focus);this.input.addEventListener("blur",t.commit);this._handlers=t};i.prototype._onKeydown=function(t){if(this._handlers.redo&&(t.keyCode===KEY_Z&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===KEY_Y&&t.ctrlKey)){t.preventDefault();return this._handlers.redo(t)}if(this._handlers.undo&&t.keyCode===KEY_Z&&(t.metaKey||t.ctrlKey)){t.preventDefault();return this._handlers.undo(t)}if(!t.isComposing)this._handlers.selectionChange(t)};i.prototype._onBeforeinput=function(t){if(t.inputType==="historyUndo"&&this._handlers.undo){t.preventDefault();return this._handlers.undo(t)}if(t.inputType==="historyRedo"&&this._handlers.redo){t.preventDefault();return this._handlers.redo(t)}};i.prototype._onCompositionEnd=function(t){this._handlers.input(t)};i.prototype._onInput=function(t){if(!t.isComposing)this._handlers.input(t)};i.prototype.unbindEvents=function(){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={}};return i}(MaskElement);IMask.HTMLMaskElement=HTMLMaskElement;var HTMLInputMaskElement=function(t){__extends(i,t);function i(i){var e=t.call(this,i)||this;e.input=i;return e}Object.defineProperty(i.prototype,"_unsafeSelectionStart",{get:function(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"_unsafeSelectionEnd",{get:function(){return this.input.selectionEnd},enumerable:false,configurable:true});i.prototype._unsafeSelect=function(t,i){this.input.setSelectionRange(t,i)};Object.defineProperty(i.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:false,configurable:true});return i}(HTMLMaskElement);IMask.HTMLMaskElement=HTMLMaskElement;var HTMLContenteditableMaskElement=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(i.prototype,"_unsafeSelectionStart",{get:function(){var t=this.rootElement;var i=t.getSelection&&t.getSelection();var e=i&&i.anchorOffset;var n=i&&i.focusOffset;if(n==null||e==null||e<n){return e}return n},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"_unsafeSelectionEnd",{get:function(){var t=this.rootElement;var i=t.getSelection&&t.getSelection();var e=i&&i.anchorOffset;var n=i&&i.focusOffset;if(n==null||e==null||e>n){return e}return n},enumerable:false,configurable:true});i.prototype._unsafeSelect=function(t,i){if(!this.rootElement.createRange)return;var e=this.rootElement.createRange();e.setStart(this.input.firstChild||this.input,t);e.setEnd(this.input.lastChild||this.input,i);var n=this.rootElement;var s=n.getSelection&&n.getSelection();if(s){s.removeAllRanges();s.addRange(e)}};Object.defineProperty(i.prototype,"value",{get:function(){return this.input.textContent||""},set:function(t){this.input.textContent=t},enumerable:false,configurable:true});return i}(HTMLMaskElement);IMask.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;var InputHistory=function(){function t(){this.states=[];this.currentIndex=0}Object.defineProperty(t.prototype,"currentState",{get:function(){return this.states[this.currentIndex]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.states.length===0},enumerable:false,configurable:true});t.prototype.push=function(i){if(this.currentIndex<this.states.length-1)this.states.length=this.currentIndex+1;this.states.push(i);if(this.states.length>t.MAX_LENGTH)this.states.shift();this.currentIndex=this.states.length-1};t.prototype.go=function(t){this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1);return this.currentState};t.prototype.undo=function(){return this.go(-1)};t.prototype.redo=function(){return this.go(1)};t.prototype.clear=function(){this.states.length=0;this.currentIndex=0};return t}();InputHistory.MAX_LENGTH=100;var InputMask=function(){function t(t,i){this.el=t instanceof MaskElement?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new HTMLContenteditableMaskElement(t):new HTMLInputMaskElement(t);this.masked=createMask(i);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()}t.prototype.maskEquals=function(t){var i;return t==null||((i=this.masked)==null?void 0:i.maskEquals(t))};Object.defineProperty(t.prototype,"mask",{get:function(){return this.masked.mask},set:function(t){if(this.maskEquals(t))return;if(!(t instanceof IMask.Masked)&&this.masked.constructor===maskedClass(t)){this.masked.updateOptions({mask:t});return}var i=t instanceof IMask.Masked?t:createMask({mask:t});i.unmaskedValue=this.masked.unmaskedValue;this.masked=i},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){if(this.value===t)return;this.masked.value=t;this.updateControl("auto")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this._unmaskedValue},set:function(t){if(this.unmaskedValue===t)return;this.masked.unmaskedValue=t;this.updateControl("auto")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this._rawInputValue},set:function(t){if(this.rawInputValue===t)return;this.masked.rawInputValue=t;this.updateControl();this.alignCursor()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"typedValue",{get:function(){return this.masked.typedValue},set:function(t){if(this.masked.typedValueEquals(t))return;this.masked.typedValue=t;this.updateControl("auto")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.masked.displayValue},enumerable:false,configurable:true});t.prototype._bindEvents=function(){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})};t.prototype._unbindEvents=function(){if(this.el)this.el.unbindEvents()};t.prototype._fireEvent=function(t,i){var e=this._listeners[t];if(!e)return;e.forEach((function(t){return t(i)}))};Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"cursorPos",{get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){if(!this.el||!this.el.isActive)return;this.el.select(t,t);this._saveSelection()},enumerable:false,configurable:true});t.prototype._saveSelection=function(){if(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}};t.prototype.updateValue=function(){this.masked.value=this.el.value;this._value=this.masked.value;this._unmaskedValue=this.masked.unmaskedValue;this._rawInputValue=this.masked.rawInputValue};t.prototype.updateControl=function(t){var i=this.masked.unmaskedValue;var e=this.masked.value;var n=this.masked.rawInputValue;var s=this.displayValue;var r=this.unmaskedValue!==i||this.value!==e||this._rawInputValue!==n;this._unmaskedValue=i;this._value=e;this._rawInputValue=n;if(this.el.value!==s)this.el.value=s;if(t==="auto")this.alignCursor();else if(t!=null)this.cursorPos=t;if(r)this._fireChangeEvents();if(!this._historyChanging&&(r||this.history.isEmpty))this.history.push({unmaskedValue:i,selection:{start:this.selectionStart,end:this.cursorPos}})};t.prototype.updateOptions=function(t){var i=t.mask,e=__rest(t,["mask"]);var n=!this.maskEquals(i);var s=this.masked.optionsIsChanged(e);if(n)this.mask=i;if(s)this.masked.updateOptions(e);if(n||s)this.updateControl()};t.prototype.updateCursor=function(t){if(t==null)return;this.cursorPos=t;this._delayUpdateCursor(t)};t.prototype._delayUpdateCursor=function(t){var i=this;this._abortUpdateCursor();this._changingCursorPos=t;this._cursorChanging=setTimeout((function(){if(!i.el)return;i.cursorPos=i._changingCursorPos;i._abortUpdateCursor()}),10)};t.prototype._fireChangeEvents=function(){this._fireEvent("accept",this._inputEvent);if(this.masked.isComplete)this._fireEvent("complete",this._inputEvent)};t.prototype._abortUpdateCursor=function(){if(this._cursorChanging){clearTimeout(this._cursorChanging);delete this._cursorChanging}};t.prototype.alignCursor=function(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,DIRECTION.LEFT))};t.prototype.alignCursorFriendly=function(){if(this.selectionStart!==this.cursorPos)return;this.alignCursor()};t.prototype.on=function(t,i){if(!this._listeners[t])this._listeners[t]=[];this._listeners[t].push(i);return this};t.prototype.off=function(t,i){if(!this._listeners[t])return this;if(!i){delete this._listeners[t];return this}var e=this._listeners[t].indexOf(i);if(e>=0)this._listeners[t].splice(e,1);return this};t.prototype._onInput=function(t){this._inputEvent=t;this._abortUpdateCursor();var i=new ActionDetails({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection});var e=this.masked.rawInputValue;var n=this.masked.splice(i.startChangePos,i.removed.length,i.inserted,i.removeDirection,{input:true,raw:true}).offset;var s=e===this.masked.rawInputValue?i.removeDirection:DIRECTION.NONE;var r=this.masked.nearestInputPos(i.startChangePos+n,s);if(s!==DIRECTION.NONE)r=this.masked.nearestInputPos(r,DIRECTION.NONE);this.updateControl(r);delete this._inputEvent};t.prototype._onChange=function(){if(this.displayValue!==this.el.value)this.updateValue();this.masked.doCommit();this.updateControl();this._saveSelection()};t.prototype._onDrop=function(t){t.preventDefault();t.stopPropagation()};t.prototype._onFocus=function(t){this.alignCursorFriendly()};t.prototype._onClick=function(t){this.alignCursorFriendly()};t.prototype._onUndo=function(){this._applyHistoryState(this.history.undo())};t.prototype._onRedo=function(){this._applyHistoryState(this.history.redo())};t.prototype._applyHistoryState=function(t){if(!t)return;this._historyChanging=true;this.unmaskedValue=t.unmaskedValue;this.el.select(t.selection.start,t.selection.end);this._saveSelection();this._historyChanging=false};t.prototype.destroy=function(){this._unbindEvents();this._listeners.length=0;delete this.el};return t}();IMask.InputMask=InputMask;var ChangeDetails=function(){function t(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:false},t)}t.normalize=function(i){return Array.isArray(i)?i:[i,new t]};t.prototype.aggregate=function(t){this.inserted+=t.inserted;this.rawInserted+=t.rawInserted;this.tailShift+=t.tailShift;this.skip=this.skip||t.skip;return this};Object.defineProperty(t.prototype,"offset",{get:function(){return this.tailShift+this.inserted.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"consumed",{get:function(){return Boolean(this.rawInserted)||this.skip},enumerable:false,configurable:true});t.prototype.equals=function(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip};return t}();IMask.ChangeDetails=ChangeDetails;var ContinuousTailDetails=function(){function t(t,i,e){if(t===void 0){t=""}if(i===void 0){i=0}this.value=t;this.from=i;this.stop=e}t.prototype.toString=function(){return this.value};t.prototype.extend=function(t){this.value+=String(t)};t.prototype.appendTo=function(t){return t.append(this.toString(),{tail:true}).aggregate(t._appendPlaceholder())};Object.defineProperty(t.prototype,"state",{get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Object.assign(this,t)},enumerable:false,configurable:true});t.prototype.unshift=function(t){if(!this.value.length||t!=null&&this.from>=t)return"";var i=this.value[0];this.value=this.value.slice(1);return i};t.prototype.shift=function(){if(!this.value.length)return"";var t=this.value[this.value.length-1];this.value=this.value.slice(0,-1);return t};return t}();var Masked=function(){function t(i){this._value="";this._update(__assign(__assign({},t.DEFAULTS),i));this._initialized=true}t.prototype.updateOptions=function(t){if(!this.optionsIsChanged(t))return;this.withValueRefresh(this._update.bind(this,t))};t.prototype._update=function(t){Object.assign(this,t)};Object.defineProperty(t.prototype,"state",{get:function(){return{_value:this.value,_rawInputValue:this.rawInputValue}},set:function(t){this._value=t._value},enumerable:false,configurable:true});t.prototype.reset=function(){this._value=""};Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this.resolve(t,{input:true})},enumerable:false,configurable:true});t.prototype.resolve=function(t,i){if(i===void 0){i={input:true}}this.reset();this.append(t,i,"");this.doCommit()};Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this.value},set:function(t){this.resolve(t,{})},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"typedValue",{get:function(){return this.parse?this.parse(this.value,this):this.unmaskedValue},set:function(t){if(this.format){this.value=this.format(t,this)}else{this.unmaskedValue=String(t)}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this.extractInput(0,this.displayValue.length,{raw:true})},set:function(t){this.resolve(t,{raw:true})},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isComplete",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFilled",{get:function(){return this.isComplete},enumerable:false,configurable:true});t.prototype.nearestInputPos=function(t,i){return t};t.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return Math.min(this.displayValue.length,i-t)};t.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return this.displayValue.slice(t,i)};t.prototype.extractTail=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return new ContinuousTailDetails(this.extractInput(t,i),t)};t.prototype.appendTail=function(t){if(isString(t))t=new ContinuousTailDetails(String(t));return t.appendTo(this)};t.prototype._appendCharRaw=function(t,i){if(!t)return new ChangeDetails;this._value+=t;return new ChangeDetails({inserted:t,rawInserted:t})};t.prototype._appendChar=function(t,i,e){var n;if(i===void 0){i={}}var s=this.state;var r;n=this.doPrepareChar(t,i),t=n[0],r=n[1];if(t){r=r.aggregate(this._appendCharRaw(t,i));if(!r.rawInserted&&this.autofix==="pad"){var u=this.state;this.state=s;var a=this.pad(i);var o=this._appendCharRaw(t,i);a=a.aggregate(o);if(o.rawInserted||a.equals(r)){r=a}else{this.state=u}}}if(r.inserted){var h=void 0;var l=this.doValidate(i)!==false;if(l&&e!=null){var f=this.state;if(this.overwrite===true){h=e.state;for(var c=0;c<r.rawInserted.length;++c){e.unshift(this.displayValue.length-r.tailShift)}}var d=this.appendTail(e);l=d.rawInserted.length===e.toString().length;if(!(l&&d.inserted)&&this.overwrite==="shift"){this.state=f;h=e.state;for(var c=0;c<r.rawInserted.length;++c){e.shift()}d=this.appendTail(e);l=d.rawInserted.length===e.toString().length}if(l&&d.inserted)this.state=f}if(!l){r=new ChangeDetails;this.state=s;if(e&&h)e.state=h}}return r};t.prototype._appendPlaceholder=function(){return new ChangeDetails};t.prototype._appendEager=function(){return new ChangeDetails};t.prototype.append=function(t,i,e){var n;if(!isString(t))throw new Error("value should be string");var s=isString(e)?new ContinuousTailDetails(String(e)):e;if(i!=null&&i.tail)i._beforeTailState=this.state;var r;n=this.doPrepare(t,i),t=n[0],r=n[1];for(var u=0;u<t.length;++u){var a=this._appendChar(t[u],i,s);if(!a.rawInserted&&!this.doSkipInvalid(t[u],i,s))break;r.aggregate(a)}if((this.eager===true||this.eager==="append")&&i!=null&&i.input&&t){r.aggregate(this._appendEager())}if(s!=null){r.tailShift+=this.appendTail(s).tailShift}return r};t.prototype.remove=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}this._value=this.displayValue.slice(0,t)+this.displayValue.slice(i);return new ChangeDetails};t.prototype.withValueRefresh=function(t){if(this._refreshing||!this._initialized)return t();this._refreshing=true;var i=this.rawInputValue;var e=this.value;var n=t();this.rawInputValue=i;if(this.value&&this.value!==e&&e.indexOf(this.value)===0){this.append(e.slice(this.displayValue.length),{},"");this.doCommit()}delete this._refreshing;return n};t.prototype.runIsolated=function(t){if(this._isolated||!this._initialized)return t(this);this._isolated=true;var i=this.state;var e=t(this);this.state=i;delete this._isolated;return e};t.prototype.doSkipInvalid=function(t,i,e){return Boolean(this.skipInvalid)};t.prototype.doPrepare=function(t,i){if(i===void 0){i={}}return ChangeDetails.normalize(this.prepare?this.prepare(t,this,i):t)};t.prototype.doPrepareChar=function(t,i){if(i===void 0){i={}}return ChangeDetails.normalize(this.prepareChar?this.prepareChar(t,this,i):t)};t.prototype.doValidate=function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))};t.prototype.doCommit=function(){if(this.commit)this.commit(this.value,this)};t.prototype.splice=function(t,i,e,n,s){if(e===void 0){e=""}if(n===void 0){n=DIRECTION.NONE}if(s===void 0){s={input:true}}var r=t+i;var u=this.extractTail(r);var a=this.eager===true||this.eager==="remove";var o;if(a){n=forceDirection(n);o=this.extractInput(0,r,{raw:true})}var h=t;var l=new ChangeDetails;if(n!==DIRECTION.NONE){h=this.nearestInputPos(t,i>1&&t!==0&&!a?DIRECTION.NONE:n);l.tailShift=h-t}l.aggregate(this.remove(h));if(a&&n!==DIRECTION.NONE&&o===this.rawInputValue){if(n===DIRECTION.FORCE_LEFT){var f=void 0;while(o===this.rawInputValue&&(f=this.displayValue.length)){l.aggregate(new ChangeDetails({tailShift:-1})).aggregate(this.remove(f-1))}}else if(n===DIRECTION.FORCE_RIGHT){u.unshift()}}return l.aggregate(this.append(e,s,u))};t.prototype.maskEquals=function(t){return this.mask===t};t.prototype.optionsIsChanged=function(t){return!objectIncludes(this,t)};t.prototype.typedValueEquals=function(i){var e=this.typedValue;return i===e||t.EMPTY_VALUES.includes(i)&&t.EMPTY_VALUES.includes(e)||(this.format?this.format(i,this)===this.format(this.typedValue,this):false)};t.prototype.pad=function(t){return new ChangeDetails};return t}();Masked.DEFAULTS={skipInvalid:true};Masked.EMPTY_VALUES=[undefined,null,""];IMask.Masked=Masked;var ChunksTailDetails=function(){function t(t,i){if(t===void 0){t=[]}if(i===void 0){i=0}this.chunks=t;this.from=i}t.prototype.toString=function(){return this.chunks.map(String).join("")};t.prototype.extend=function(i){if(!String(i))return;i=isString(i)?new ContinuousTailDetails(String(i)):i;var e=this.chunks[this.chunks.length-1];var n=e&&(e.stop===i.stop||i.stop==null)&&i.from===e.from+e.toString().length;if(i instanceof ContinuousTailDetails){if(n){e.extend(i.toString())}else{this.chunks.push(i)}}else if(i instanceof t){if(i.stop==null){var s=void 0;while(i.chunks.length&&i.chunks[0].stop==null){s=i.chunks.shift();s.from+=i.from;this.extend(s)}}if(i.toString()){i.stop=i.blockIndex;this.chunks.push(i)}}};t.prototype.appendTo=function(i){if(!(i instanceof IMask.MaskedPattern)){var e=new ContinuousTailDetails(this.toString());return e.appendTo(i)}var n=new ChangeDetails;for(var s=0;s<this.chunks.length;++s){var r=this.chunks[s];var u=i._mapPosToBlock(i.displayValue.length);var a=r.stop;var o=void 0;if(a!=null&&(!u||u.index<=a)){if(r instanceof t||i._stops.indexOf(a)>=0){n.aggregate(i._appendPlaceholder(a))}o=r instanceof t&&i._blocks[a]}if(o){var h=o.appendTail(r);n.aggregate(h);var l=r.toString().slice(h.rawInserted.length);if(l)n.aggregate(i.append(l,{tail:true}))}else{n.aggregate(i.append(r.toString(),{tail:true}))}}return n};Object.defineProperty(t.prototype,"state",{get:function(){return{chunks:this.chunks.map((function(t){return t.state})),from:this.from,stop:this.stop,blockIndex:this.blockIndex}},set:function(i){var e=i.chunks,n=__rest(i,["chunks"]);Object.assign(this,n);this.chunks=e.map((function(i){var e="chunks"in i?new t:new ContinuousTailDetails;e.state=i;return e}))},enumerable:false,configurable:true});t.prototype.unshift=function(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";var i=t!=null?t-this.from:t;var e=0;while(e<this.chunks.length){var n=this.chunks[e];var s=n.unshift(i);if(n.toString()){if(!s)break;++e}else{this.chunks.splice(e,1)}if(s)return s}return""};t.prototype.shift=function(){if(!this.chunks.length)return"";var t=this.chunks.length-1;while(0<=t){var i=this.chunks[t];var e=i.shift();if(i.toString()){if(!e)break;--t}else{this.chunks.splice(t,1)}if(e)return e}return""};return t}();var PatternCursor=function(){function t(t,i){this.masked=t;this._log=[];var e=t._mapPosToBlock(i)||(i<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0}),n=e.offset,s=e.index;this.offset=n;this.index=s;this.ok=false}Object.defineProperty(t.prototype,"block",{get:function(){return this.masked._blocks[this.index]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"pos",{get:function(){return this.masked._blockStartPos(this.index)+this.offset},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"state",{get:function(){return{index:this.index,offset:this.offset,ok:this.ok}},set:function(t){Object.assign(this,t)},enumerable:false,configurable:true});t.prototype.pushState=function(){this._log.push(this.state)};t.prototype.popState=function(){var t=this._log.pop();if(t)this.state=t;return t};t.prototype.bindBlock=function(){if(this.block)return;if(this.index<0){this.index=0;this.offset=0}if(this.index>=this.masked._blocks.length){this.index=this.masked._blocks.length-1;this.offset=this.block.displayValue.length}};t.prototype._pushLeft=function(t){this.pushState();for(this.bindBlock();0<=this.index;--this.index,this.offset=((i=this.block)==null?void 0:i.displayValue.length)||0){var i;if(t())return this.ok=true}return this.ok=false};t.prototype._pushRight=function(t){this.pushState();for(this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0){if(t())return this.ok=true}return this.ok=false};t.prototype.pushLeftBeforeFilled=function(){var t=this;return this._pushLeft((function(){if(t.block.isFixed||!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.FORCE_LEFT);if(t.offset!==0)return true}))};t.prototype.pushLeftBeforeInput=function(){var t=this;return this._pushLeft((function(){if(t.block.isFixed)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.LEFT);return true}))};t.prototype.pushLeftBeforeRequired=function(){var t=this;return this._pushLeft((function(){if(t.block.isFixed||t.block.isOptional&&!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.LEFT);return true}))};t.prototype.pushRightBeforeFilled=function(){var t=this;return this._pushRight((function(){if(t.block.isFixed||!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.FORCE_RIGHT);if(t.offset!==t.block.value.length)return true}))};t.prototype.pushRightBeforeInput=function(){var t=this;return this._pushRight((function(){if(t.block.isFixed)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.NONE);return true}))};t.prototype.pushRightBeforeRequired=function(){var t=this;return this._pushRight((function(){if(t.block.isFixed||t.block.isOptional&&!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.NONE);return true}))};return t}();var PatternFixedDefinition=function(){function t(t){Object.assign(this,t);this._value="";this.isFixed=true}Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this.isUnmasking?this.value:""},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this._isRawInput?this.value:""},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.value},enumerable:false,configurable:true});t.prototype.reset=function(){this._isRawInput=false;this._value=""};t.prototype.remove=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}this._value=this._value.slice(0,t)+this._value.slice(i);if(!this._value)this._isRawInput=false;return new ChangeDetails};t.prototype.nearestInputPos=function(t,i){if(i===void 0){i=DIRECTION.NONE}var e=0;var n=this._value.length;switch(i){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return e;case DIRECTION.NONE:case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:default:return n}};t.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}return this._isRawInput?i-t:0};t.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this._value.length}if(e===void 0){e={}}return e.raw&&this._isRawInput&&this._value.slice(t,i)||""};Object.defineProperty(t.prototype,"isComplete",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFilled",{get:function(){return Boolean(this._value)},enumerable:false,configurable:true});t.prototype._appendChar=function(t,i){if(i===void 0){i={}}if(this.isFilled)return new ChangeDetails;var e=this.eager===true||this.eager==="append";var n=this.char===t;var s=n&&(this.isUnmasking||i.input||i.raw)&&(!i.raw||!e)&&!i.tail;var r=new ChangeDetails({inserted:this.char,rawInserted:s?this.char:""});this._value=this.char;this._isRawInput=s&&(i.raw||i.input);return r};t.prototype._appendEager=function(){return this._appendChar(this.char,{tail:true})};t.prototype._appendPlaceholder=function(){var t=new ChangeDetails;if(this.isFilled)return t;this._value=t.inserted=this.char;return t};t.prototype.extractTail=function(){return new ContinuousTailDetails("")};t.prototype.appendTail=function(t){if(isString(t))t=new ContinuousTailDetails(String(t));return t.appendTo(this)};t.prototype.append=function(t,i,e){var n=this._appendChar(t[0],i);if(e!=null){n.tailShift+=this.appendTail(e).tailShift}return n};t.prototype.doCommit=function(){};Object.defineProperty(t.prototype,"state",{get:function(){return{_value:this._value,_rawInputValue:this.rawInputValue}},set:function(t){this._value=t._value;this._isRawInput=Boolean(t._rawInputValue)},enumerable:false,configurable:true});t.prototype.pad=function(t){return this._appendPlaceholder()};return t}();var PatternInputDefinition=function(){function t(t){var i=t.parent,e=t.isOptional,n=t.placeholderChar,s=t.displayChar,r=t.lazy,u=t.eager,a=__rest(t,["parent","isOptional","placeholderChar","displayChar","lazy","eager"]);this.masked=createMask(a);Object.assign(this,{parent:i,isOptional:e,placeholderChar:n,displayChar:s,lazy:r,eager:u})}t.prototype.reset=function(){this.isFilled=false;this.masked.reset()};t.prototype.remove=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}if(t===0&&i>=1){this.isFilled=false;return this.masked.remove(t,i)}return new ChangeDetails};Object.defineProperty(t.prototype,"value",{get:function(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this.masked.unmaskedValue},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this.masked.rawInputValue},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.masked.value&&this.displayChar||this.value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isComplete",{get:function(){return Boolean(this.masked.value)||this.isOptional},enumerable:false,configurable:true});t.prototype._appendChar=function(t,i){if(i===void 0){i={}}if(this.isFilled)return new ChangeDetails;var e=this.masked.state;var n=this.masked._appendChar(t,this.currentMaskFlags(i));if(n.inserted&&this.doValidate(i)===false){n=new ChangeDetails;this.masked.state=e}if(!n.inserted&&!this.isOptional&&!this.lazy&&!i.input){n.inserted=this.placeholderChar}n.skip=!n.inserted&&!this.isOptional;this.isFilled=Boolean(n.inserted);return n};t.prototype.append=function(t,i,e){return this.masked.append(t,this.currentMaskFlags(i),e)};t.prototype._appendPlaceholder=function(){if(this.isFilled||this.isOptional)return new ChangeDetails;this.isFilled=true;return new ChangeDetails({inserted:this.placeholderChar})};t.prototype._appendEager=function(){return new ChangeDetails};t.prototype.extractTail=function(t,i){return this.masked.extractTail(t,i)};t.prototype.appendTail=function(t){return this.masked.appendTail(t)};t.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.masked.extractInput(t,i,e)};t.prototype.nearestInputPos=function(t,i){if(i===void 0){i=DIRECTION.NONE}var e=0;var n=this.value.length;var s=Math.min(Math.max(t,e),n);switch(i){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return this.isComplete?s:e;case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:return this.isComplete?s:n;case DIRECTION.NONE:default:return s}};t.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.value.slice(t,i).length};t.prototype.doValidate=function(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))};t.prototype.doCommit=function(){this.masked.doCommit()};Object.defineProperty(t.prototype,"state",{get:function(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}},set:function(t){this.masked.state=t.masked;this.isFilled=t.isFilled},enumerable:false,configurable:true});t.prototype.currentMaskFlags=function(t){var i;return __assign(__assign({},t),{_beforeTailState:(t==null||(i=t._beforeTailState)==null?void 0:i.masked)||(t==null?void 0:t._beforeTailState)})};t.prototype.pad=function(t){return new ChangeDetails};return t}();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]/,"*":/./};var MaskedRegExp=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=i.mask;if(e)i.validate=function(t){return t.search(e)>=0};t.prototype._update.call(this,i)};return i}(Masked);IMask.MaskedRegExp=MaskedRegExp;var MaskedPattern=function(t){__extends(i,t);function i(e){return t.call(this,__assign(__assign(__assign({},i.DEFAULTS),e),{definitions:Object.assign({},PatternInputDefinition.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)}))||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){i.definitions=Object.assign({},this.definitions,i.definitions);t.prototype._update.call(this,i);this._rebuildMask()};i.prototype._rebuildMask=function(){var t=this.definitions;this._blocks=[];this.exposeBlock=undefined;this._stops=[];this._maskedBlocks={};var e=this.mask;if(!e||!t)return;var n=false;var s=false;var r=function(r){if(u.blocks){var o=e.slice(r);var h=Object.keys(u.blocks).filter((function(t){return o.indexOf(t)===0}));h.sort((function(t,i){return i.length-t.length}));var l=h[0];if(l){var f=normalizeOpts(u.blocks[l]),c=f.expose,d=f.repeat,v=__rest(f,["expose","repeat"]);var b=__assign(__assign({lazy:u.lazy,eager:u.eager,placeholderChar:u.placeholderChar,displayChar:u.displayChar,overwrite:u.overwrite,autofix:u.autofix},v),{repeat:d,parent:u});var g=d!=null?new IMask.RepeatBlock(b):createMask(b);if(g){u._blocks.push(g);if(c)u.exposeBlock=g;if(!u._maskedBlocks[l])u._maskedBlocks[l]=[];u._maskedBlocks[l].push(u._blocks.length-1)}r+=l.length-1;return a=r,"continue"}}var p=e[r];var m=p in t;if(p===i.STOP_CHAR){u._stops.push(u._blocks.length);return a=r,"continue"}if(p==="{"||p==="}"){n=!n;return a=r,"continue"}if(p==="["||p==="]"){s=!s;return a=r,"continue"}if(p===i.ESCAPE_CHAR){++r;p=e[r];if(!p)return a=r,"break";m=false}var x=m?new PatternInputDefinition(__assign(__assign({isOptional:s,lazy:u.lazy,eager:u.eager,placeholderChar:u.placeholderChar,displayChar:u.displayChar},normalizeOpts(t[p])),{parent:u})):new PatternFixedDefinition({char:p,eager:u.eager,isUnmasking:n});u._blocks.push(x);a=r};var u=this,a;for(var o=0;o<e.length;++o){var h=r(o);o=a;if(h==="break")break}};Object.defineProperty(i.prototype,"state",{get:function(){return __assign(__assign({},t.prototype.state),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(i){if(!i){this.reset();return}var e=i._blocks,n=__rest(i,["_blocks"]);this._blocks.forEach((function(t,i){return t.state=e[i]}));t.prototype.state=n},enumerable:false,configurable:true});i.prototype.reset=function(){t.prototype.reset.call(this);this._blocks.forEach((function(t){return t.reset()}))};Object.defineProperty(i.prototype,"isComplete",{get:function(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((function(t){return t.isComplete}))},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isFilled",{get:function(){return this._blocks.every((function(t){return t.isFilled}))},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isFixed",{get:function(){return this._blocks.every((function(t){return t.isFixed}))},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isOptional",{get:function(){return this._blocks.every((function(t){return t.isOptional}))},enumerable:false,configurable:true});i.prototype.doCommit=function(){this._blocks.forEach((function(t){return t.doCommit()}));t.prototype.doCommit.call(this)};Object.defineProperty(i.prototype,"unmaskedValue",{get:function(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((function(t,i){return t+=i.unmaskedValue}),"")},set:function(i){if(this.exposeBlock){var e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=i;this.appendTail(e);this.doCommit()}else t.prototype.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"value",{get:function(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((function(t,i){return t+=i.value}),"")},set:function(i){if(this.exposeBlock){var e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=i;this.appendTail(e);this.doCommit()}else t.prototype.value=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.exposeBlock?this.exposeBlock.typedValue:t.prototype.typedValue},set:function(i){if(this.exposeBlock){var e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=i;this.appendTail(e);this.doCommit()}else t.prototype.typedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"displayValue",{get:function(){return this._blocks.reduce((function(t,i){return t+=i.displayValue}),"")},enumerable:false,configurable:true});i.prototype.appendTail=function(i){return t.prototype.appendTail.call(this,i).aggregate(this._appendPlaceholder())};i.prototype._appendEager=function(){var t;var i=new ChangeDetails;var e=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(e==null)return i;if(this._blocks[e].isFilled)++e;for(var n=e;n<this._blocks.length;++n){var s=this._blocks[n]._appendEager();if(!s.inserted)break;i.aggregate(s)}return i};i.prototype._appendCharRaw=function(t,i){if(i===void 0){i={}}var e=this._mapPosToBlock(this.displayValue.length);var n=new ChangeDetails;if(!e)return n;for(var s=e.index,r=void 0;r=this._blocks[s];++s){var u;var a=r._appendChar(t,__assign(__assign({},i),{_beforeTailState:(u=i._beforeTailState)==null||(u=u._blocks)==null?void 0:u[s]}));n.aggregate(a);if(a.consumed)break}return n};i.prototype.extractTail=function(t,i){var e=this;if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}var n=new ChunksTailDetails;if(t===i)return n;this._forEachBlocksInRange(t,i,(function(t,i,s,r){var u=t.extractTail(s,r);u.stop=e._findStopBefore(i);u.from=e._blockStartPos(i);if(u instanceof ChunksTailDetails)u.blockIndex=i;n.extend(u)}));return n};i.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}if(e===void 0){e={}}if(t===i)return"";var n="";this._forEachBlocksInRange(t,i,(function(t,i,s,r){n+=t.extractInput(s,r,e)}));return n};i.prototype._findStopBefore=function(t){var i;for(var e=0;e<this._stops.length;++e){var n=this._stops[e];if(n<=t)i=n;else break}return i};i.prototype._appendPlaceholder=function(t){var i=new ChangeDetails;if(this.lazy&&t==null)return i;var e=this._mapPosToBlock(this.displayValue.length);if(!e)return i;var n=e.index;var s=t!=null?t:this._blocks.length;this._blocks.slice(n,s).forEach((function(e){if(!e.lazy||t!=null){var n;i.aggregate(e._appendPlaceholder((n=e._blocks)==null?void 0:n.length))}}));return i};i.prototype._mapPosToBlock=function(t){var i="";for(var e=0;e<this._blocks.length;++e){var n=this._blocks[e];var s=i.length;i+=n.displayValue;if(t<=i.length){return{index:e,offset:t-s}}}};i.prototype._blockStartPos=function(t){return this._blocks.slice(0,t).reduce((function(t,i){return t+=i.displayValue.length}),0)};i.prototype._forEachBlocksInRange=function(t,i,e){if(i===void 0){i=this.displayValue.length}var n=this._mapPosToBlock(t);if(n){var s=this._mapPosToBlock(i);var r=s&&n.index===s.index;var u=n.offset;var a=s&&r?s.offset:this._blocks[n.index].displayValue.length;e(this._blocks[n.index],n.index,u,a);if(s&&!r){for(var o=n.index+1;o<s.index;++o){e(this._blocks[o],o,0,this._blocks[o].displayValue.length)}e(this._blocks[s.index],s.index,0,s.offset)}}};i.prototype.remove=function(i,e){if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}var n=t.prototype.remove.call(this,i,e);this._forEachBlocksInRange(i,e,(function(t,i,e,s){n.aggregate(t.remove(e,s))}));return n};i.prototype.nearestInputPos=function(t,i){if(i===void 0){i=DIRECTION.NONE}if(!this._blocks.length)return 0;var e=new PatternCursor(this,t);if(i===DIRECTION.NONE){if(e.pushRightBeforeInput())return e.pos;e.popState();if(e.pushLeftBeforeInput())return e.pos;return this.displayValue.length}if(i===DIRECTION.LEFT||i===DIRECTION.FORCE_LEFT){if(i===DIRECTION.LEFT){e.pushRightBeforeFilled();if(e.ok&&e.pos===t)return t;e.popState()}e.pushLeftBeforeInput();e.pushLeftBeforeRequired();e.pushLeftBeforeFilled();if(i===DIRECTION.LEFT){e.pushRightBeforeInput();e.pushRightBeforeRequired();if(e.ok&&e.pos<=t)return e.pos;e.popState();if(e.ok&&e.pos<=t)return e.pos;e.popState()}if(e.ok)return e.pos;if(i===DIRECTION.FORCE_LEFT)return 0;e.popState();if(e.ok)return e.pos;e.popState();if(e.ok)return e.pos;return 0}if(i===DIRECTION.RIGHT||i===DIRECTION.FORCE_RIGHT){e.pushRightBeforeInput();e.pushRightBeforeRequired();if(e.pushRightBeforeFilled())return e.pos;if(i===DIRECTION.FORCE_RIGHT)return this.displayValue.length;e.popState();if(e.ok)return e.pos;e.popState();if(e.ok)return e.pos;return this.nearestInputPos(t,DIRECTION.LEFT)}return t};i.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}var e=0;this._forEachBlocksInRange(t,i,(function(t,i,n,s){e+=t.totalInputPositions(n,s)}));return e};i.prototype.maskedBlock=function(t){return this.maskedBlocks(t)[0]};i.prototype.maskedBlocks=function(t){var i=this;var e=this._maskedBlocks[t];if(!e)return[];return e.map((function(t){return i._blocks[t]}))};i.prototype.pad=function(t){var i=new ChangeDetails;this._forEachBlocksInRange(0,this.displayValue.length,(function(e){return i.aggregate(e.pad(t))}));return i};return i}(Masked);MaskedPattern.DEFAULTS=__assign(__assign({},Masked.DEFAULTS),{lazy:true,placeholderChar:"_"});MaskedPattern.STOP_CHAR="`";MaskedPattern.ESCAPE_CHAR="\\";MaskedPattern.InputDefinition=PatternInputDefinition;MaskedPattern.FixedDefinition=PatternFixedDefinition;IMask.MaskedPattern=MaskedPattern;var MaskedRange=function(t){__extends(i,t);function i(i){return t.call(this,i)||this}Object.defineProperty(i.prototype,"_matchFrom",{get:function(){return this.maxLength-String(this.from).length},enumerable:false,configurable:true});i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=i.to,n=e===void 0?this.to||0:e,s=i.from,r=s===void 0?this.from||0:s,u=i.maxLength,a=u===void 0?this.maxLength||0:u,o=i.autofix,h=o===void 0?this.autofix:o,l=__rest(i,["to","from","maxLength","autofix"]);this.to=n;this.from=r;this.maxLength=Math.max(String(n).length,a);this.autofix=h;var f=String(this.from).padStart(this.maxLength,"0");var c=String(this.to).padStart(this.maxLength,"0");var d=0;while(d<c.length&&c[d]===f[d])++d;l.mask=c.slice(0,d).replace(/0/g,"\\0")+"0".repeat(this.maxLength-d);t.prototype._update.call(this,l)};Object.defineProperty(i.prototype,"isComplete",{get:function(){return t.prototype.isComplete&&Boolean(this.value)},enumerable:false,configurable:true});i.prototype.boundaries=function(t){var i="";var e="";var n=t.match(/^(\D*)(\d*)(\D*)/)||[],s=n[1],r=n[2];if(r){i="0".repeat(s.length)+r;e="9".repeat(s.length)+r}i=i.padEnd(this.maxLength,"0");e=e.padEnd(this.maxLength,"9");return[i,e]};i.prototype.doPrepareChar=function(i,e){var n;if(e===void 0){e={}}var s;n=t.prototype.doPrepareChar.call(this,i.replace(/\D/g,""),e),i=n[0],s=n[1];if(!i)s.skip=!this.isComplete;return[i,s]};i.prototype._appendCharRaw=function(i,e){if(e===void 0){e={}}if(!this.autofix||this.value.length+1>this.maxLength)return t.prototype._appendCharRaw.call(this,i,e);var n=String(this.from).padStart(this.maxLength,"0");var s=String(this.to).padStart(this.maxLength,"0");var r=this.boundaries(this.value+i),u=r[0],a=r[1];if(Number(a)<this.from)return t.prototype._appendCharRaw.call(this,n[this.value.length],e);if(Number(u)>this.to){if(!e.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength){return t.prototype._appendCharRaw.call(this,n[this.value.length],e).aggregate(this._appendCharRaw(i,e))}return t.prototype._appendCharRaw.call(this,s[this.value.length],e)}return t.prototype._appendCharRaw.call(this,i,e)};i.prototype.doValidate=function(i){var e=this.value;var n=e.search(/[^0]/);if(n===-1&&e.length<=this._matchFrom)return true;var s=this.boundaries(e),r=s[0],u=s[1];return this.from<=Number(u)&&Number(r)<=this.to&&t.prototype.doValidate.call(this,i)};i.prototype.pad=function(i){var e=this;var n=new ChangeDetails;if(this.value.length===this.maxLength)return n;var s=this.value;var r=this.maxLength-this.value.length;if(r){this.reset();for(var u=0;u<r;++u){n.aggregate(t.prototype._appendCharRaw.call(this,"0",i))}s.split("").forEach((function(t){return e._appendCharRaw(t)}))}return n};return i}(MaskedPattern);IMask.MaskedRange=MaskedRange;var DefaultPattern="d{.}`m{.}`Y";var MaskedDate=function(t){__extends(i,t);function i(e){return t.call(this,i.extractPatternOptions(__assign(__assign({},i.DEFAULTS),e)))||this}i.extractPatternOptions=function(t){var i=t.mask,e=t.pattern,n=__rest(t,["mask","pattern"]);return __assign(__assign({},n),{mask:isString(i)?i:e})};i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(e){var n=__assign(__assign({},i.DEFAULTS),e),s=n.mask,r=n.pattern,u=n.blocks,a=__rest(n,["mask","pattern","blocks"]);var o=Object.assign({},i.GET_DEFAULT_BLOCKS());if(e.min)o.Y.from=e.min.getFullYear();if(e.max)o.Y.to=e.max.getFullYear();if(e.min&&e.max&&o.Y.from===o.Y.to){o.m.from=e.min.getMonth()+1;o.m.to=e.max.getMonth()+1;if(o.m.from===o.m.to){o.d.from=e.min.getDate();o.d.to=e.max.getDate()}}Object.assign(o,this.blocks,u);t.prototype._update.call(this,__assign(__assign({},a),{mask:isString(s)?s:r,blocks:o}))};i.prototype.doValidate=function(i){var e=this.date;return t.prototype.doValidate.call(this,i)&&(!this.isComplete||this.isDateExist(this.value)&&e!=null&&(this.min==null||this.min<=e)&&(this.max==null||e<=this.max))};i.prototype.isDateExist=function(t){return this.format(this.parse(t,this),this).indexOf(t)>=0};Object.defineProperty(i.prototype,"date",{get:function(){return this.typedValue},set:function(t){this.typedValue=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.isComplete?t.prototype.typedValue:null},set:function(i){t.prototype.typedValue=i},enumerable:false,configurable:true});i.prototype.maskEquals=function(i){return i===Date||t.prototype.maskEquals.call(this,i)};i.prototype.optionsIsChanged=function(e){return t.prototype.optionsIsChanged.call(this,i.extractPatternOptions(e))};return i}(MaskedPattern);MaskedDate.GET_DEFAULT_BLOCKS=function(){return{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=__assign(__assign({},MaskedPattern.DEFAULTS),{mask:Date,pattern:DefaultPattern,format:function(t,i){if(!t)return"";var e=String(t.getDate()).padStart(2,"0");var n=String(t.getMonth()+1).padStart(2,"0");var s=t.getFullYear();return[e,n,s].join(".")},parse:function(t,i){var e=t.split(".").map(Number),n=e[0],s=e[1],r=e[2];return new Date(r,s-1,n)}});IMask.MaskedDate=MaskedDate;var MaskedDynamic=function(t){__extends(i,t);function i(e){var n=t.call(this,__assign(__assign({},i.DEFAULTS),e))||this;n.currentMask=undefined;return n}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=this;t.prototype._update.call(this,i);if("mask"in i){this.exposeMask=undefined;this.compiledMasks=Array.isArray(i.mask)?i.mask.map((function(t){var i=normalizeOpts(t),n=i.expose,s=__rest(i,["expose"]);var r=createMask(__assign({overwrite:e._overwrite,eager:e._eager,skipInvalid:e._skipInvalid},s));if(n)e.exposeMask=r;return r})):[]}};i.prototype._appendCharRaw=function(t,i){if(i===void 0){i={}}var e=this._applyDispatch(t,i);if(this.currentMask){e.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(i)))}return e};i.prototype._applyDispatch=function(t,i,e){if(t===void 0){t=""}if(i===void 0){i={}}if(e===void 0){e=""}var n=i.tail&&i._beforeTailState!=null?i._beforeTailState._value:this.value;var s=this.rawInputValue;var r=i.tail&&i._beforeTailState!=null?i._beforeTailState._rawInputValue:s;var u=s.slice(r.length);var a=this.currentMask;var o=new ChangeDetails;var h=a==null?void 0:a.state;this.currentMask=this.doDispatch(t,__assign({},i),e);if(this.currentMask){if(this.currentMask!==a){this.currentMask.reset();if(r){this.currentMask.append(r,{raw:true});o.tailShift=this.currentMask.value.length-n.length}if(u){o.tailShift+=this.currentMask.append(u,{raw:true,tail:true}).tailShift}}else if(h){this.currentMask.state=h}}return o};i.prototype._appendPlaceholder=function(){var t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendPlaceholder())}return t};i.prototype._appendEager=function(){var t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendEager())}return t};i.prototype.appendTail=function(i){var e=new ChangeDetails;if(i)e.aggregate(this._applyDispatch("",{},i));return e.aggregate(this.currentMask?this.currentMask.appendTail(i):t.prototype.appendTail.call(this,i))};i.prototype.currentMaskFlags=function(t){var i,e;return __assign(__assign({},t),{_beforeTailState:((i=t._beforeTailState)==null?void 0:i.currentMaskRef)===this.currentMask&&((e=t._beforeTailState)==null?void 0:e.currentMask)||t._beforeTailState})};i.prototype.doDispatch=function(t,i,e){if(i===void 0){i={}}if(e===void 0){e=""}return this.dispatch(t,this,i,e)};i.prototype.doValidate=function(i){return t.prototype.doValidate.call(this,i)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(i)))};i.prototype.doPrepare=function(i,e){var n;if(e===void 0){e={}}var s=t.prototype.doPrepare.call(this,i,e),r=s[0],u=s[1];if(this.currentMask){var a=void 0;n=t.prototype.doPrepare.call(this,r,this.currentMaskFlags(e)),r=n[0],a=n[1];u=u.aggregate(a)}return[r,u]};i.prototype.doPrepareChar=function(i,e){var n;if(e===void 0){e={}}var s=t.prototype.doPrepareChar.call(this,i,e),r=s[0],u=s[1];if(this.currentMask){var a=void 0;n=t.prototype.doPrepareChar.call(this,r,this.currentMaskFlags(e)),r=n[0],a=n[1];u=u.aggregate(a)}return[r,u]};i.prototype.reset=function(){var t;(t=this.currentMask)==null||t.reset();this.compiledMasks.forEach((function(t){return t.reset()}))};Object.defineProperty(i.prototype,"value",{get:function(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""},set:function(i){if(this.exposeMask){this.exposeMask.value=i;this.currentMask=this.exposeMask;this._applyDispatch()}else t.prototype.value=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"unmaskedValue",{get:function(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""},set:function(i){if(this.exposeMask){this.exposeMask.unmaskedValue=i;this.currentMask=this.exposeMask;this._applyDispatch()}else t.prototype.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""},set:function(t){if(this.exposeMask){this.exposeMask.typedValue=t;this.currentMask=this.exposeMask;this._applyDispatch();return}var i=String(t);if(this.currentMask){this.currentMask.typedValue=t;i=this.currentMask.unmaskedValue}this.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"displayValue",{get:function(){return this.currentMask?this.currentMask.displayValue:""},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isComplete",{get:function(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isComplete)},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isFilled",{get:function(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isFilled)},enumerable:false,configurable:true});i.prototype.remove=function(t,i){var e=new ChangeDetails;if(this.currentMask){e.aggregate(this.currentMask.remove(t,i)).aggregate(this._applyDispatch())}return e};Object.defineProperty(i.prototype,"state",{get:function(){var i;return __assign(__assign({},t.prototype.state),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((function(t){return t.state})),currentMaskRef:this.currentMask,currentMask:(i=this.currentMask)==null?void 0:i.state})},set:function(i){var e=i.compiledMasks,n=i.currentMaskRef,s=i.currentMask,r=__rest(i,["compiledMasks","currentMaskRef","currentMask"]);if(e)this.compiledMasks.forEach((function(t,i){return t.state=e[i]}));if(n!=null){this.currentMask=n;this.currentMask.state=s}t.prototype.state=r},enumerable:false,configurable:true});i.prototype.extractInput=function(t,i,e){return this.currentMask?this.currentMask.extractInput(t,i,e):""};i.prototype.extractTail=function(i,e){return this.currentMask?this.currentMask.extractTail(i,e):t.prototype.extractTail.call(this,i,e)};i.prototype.doCommit=function(){if(this.currentMask)this.currentMask.doCommit();t.prototype.doCommit.call(this)};i.prototype.nearestInputPos=function(i,e){return this.currentMask?this.currentMask.nearestInputPos(i,e):t.prototype.nearestInputPos.call(this,i,e)};Object.defineProperty(i.prototype,"overwrite",{get:function(){return this.currentMask?this.currentMask.overwrite:this._overwrite},set:function(t){this._overwrite=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"eager",{get:function(){return this.currentMask?this.currentMask.eager:this._eager},set:function(t){this._eager=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"skipInvalid",{get:function(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid},set:function(t){this._skipInvalid=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"autofix",{get:function(){return this.currentMask?this.currentMask.autofix:this._autofix},set:function(t){this._autofix=t},enumerable:false,configurable:true});i.prototype.maskEquals=function(i){return Array.isArray(i)?this.compiledMasks.every((function(t,e){if(!i[e])return;var n=i[e],s=n.mask,r=__rest(n,["mask"]);return objectIncludes(t,r)&&t.maskEquals(s)})):t.prototype.maskEquals.call(this,i)};i.prototype.typedValueEquals=function(t){var i;return Boolean((i=this.currentMask)==null?void 0:i.typedValueEquals(t))};return i}(Masked);MaskedDynamic.DEFAULTS=__assign(__assign({},Masked.DEFAULTS),{dispatch:function(t,i,e,n){if(!i.compiledMasks.length)return;var s=i.rawInputValue;var r=i.compiledMasks.map((function(r,u){var a=i.currentMask===r;var o=a?r.displayValue.length:r.nearestInputPos(r.displayValue.length,DIRECTION.FORCE_LEFT);if(r.rawInputValue!==s){r.reset();r.append(s,{raw:true})}else if(!a){r.remove(o)}r.append(t,i.currentMaskFlags(e));r.appendTail(n);return{index:u,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(o,r.nearestInputPos(r.displayValue.length,DIRECTION.FORCE_LEFT)))}}));r.sort((function(t,i){return i.weight-t.weight||i.totalInputPositions-t.totalInputPositions}));return i.compiledMasks[r[0].index]}});IMask.MaskedDynamic=MaskedDynamic;var MaskedEnum=function(t){__extends(i,t);function i(e){return t.call(this,__assign(__assign({},i.DEFAULTS),e))||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=i.enum,n=__rest(i,["enum"]);if(e){var s=e.map((function(t){return t.length}));var r=Math.min.apply(Math,s);var u=Math.max.apply(Math,s)-r;n.mask="*".repeat(r);if(u)n.mask+="["+"*".repeat(u)+"]";this.enum=e}t.prototype._update.call(this,n)};i.prototype._appendCharRaw=function(i,e){var n=this;if(e===void 0){e={}}var s=Math.min(this.nearestInputPos(0,DIRECTION.FORCE_RIGHT),this.value.length);var r=this.enum.filter((function(t){return n.matchValue(t,n.unmaskedValue+i,s)}));if(r.length){if(r.length===1){this._forEachBlocksInRange(0,this.value.length,(function(t,i){var s=r[0][i];if(i>=n.value.length||s===t.value)return;t.reset();t._appendChar(s,e)}))}var u=t.prototype._appendCharRaw.call(this,r[0][this.value.length],e);if(r.length===1){r[0].slice(this.unmaskedValue.length).split("").forEach((function(i){return u.aggregate(t.prototype._appendCharRaw.call(n,i))}))}return u}return new ChangeDetails({skip:!this.isComplete})};i.prototype.extractTail=function(t,i){if(t===void 0){t=0}return new ContinuousTailDetails("",t)};i.prototype.remove=function(i,e){var n=this;if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}if(i===e)return new ChangeDetails;var s=Math.min(t.prototype.nearestInputPos.call(this,0,DIRECTION.FORCE_RIGHT),this.value.length);var r;for(r=i;r>=0;--r){var u=this.enum.filter((function(t){return n.matchValue(t,n.value.slice(s,r),s)}));if(u.length>1)break}var a=t.prototype.remove.call(this,r,e);a.tailShift+=r-i;return a};Object.defineProperty(i.prototype,"isComplete",{get:function(){return this.enum.indexOf(this.value)>=0},enumerable:false,configurable:true});return i}(MaskedPattern);MaskedEnum.DEFAULTS=__assign(__assign({},MaskedPattern.DEFAULTS),{matchValue:function(t,i,e){return t.indexOf(i,e)===e}});IMask.MaskedEnum=MaskedEnum;var MaskedFunction=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){t.prototype._update.call(this,__assign(__assign({},i),{validate:i.mask}))};return i}(Masked);IMask.MaskedFunction=MaskedFunction;var _MaskedNumber;var MaskedNumber=function(t){__extends(i,t);function i(e){return t.call(this,__assign(__assign({},i.DEFAULTS),e))||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){t.prototype._update.call(this,i);this._updateRegExps()};i.prototype._updateRegExps=function(){var t="^"+(this.allowNegative?"[+|\\-]?":"");var i="\\d*";var e=(this.scale?"("+escapeRegExp(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+i+e);this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(escapeRegExp).join("")+"]","g");this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(this.thousandsSeparator),"g")};i.prototype._removeThousandsSeparators=function(t){return t.replace(this._thousandsSeparatorRegExp,"")};i.prototype._insertThousandsSeparators=function(t){var i=t.split(this.radix);i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator);return i.join(this.radix)};i.prototype.doPrepareChar=function(i,e){if(e===void 0){e={}}var n=t.prototype.doPrepareChar.call(this,this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?i.replace(this._mapToRadixRegExp,this.radix):i),e),s=n[0],r=n[1];if(i&&!s)r.skip=true;if(s&&!this.allowPositive&&!this.value&&s!=="-")r.aggregate(this._appendChar("-"));return[s,r]};i.prototype._separatorsCount=function(t,i){if(i===void 0){i=false}var e=0;for(var n=0;n<t;++n){if(this._value.indexOf(this.thousandsSeparator,n)===n){++e;if(i)t+=this.thousandsSeparator.length}}return e};i.prototype._separatorsCountFromSlice=function(t){if(t===void 0){t=this._value}return this._separatorsCount(this._removeThousandsSeparators(t).length,true)};i.prototype.extractInput=function(i,e,n){var s;if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}s=this._adjustRangeWithSeparators(i,e),i=s[0],e=s[1];return this._removeThousandsSeparators(t.prototype.extractInput.call(this,i,e,n))};i.prototype._appendCharRaw=function(t,e){if(e===void 0){e={}}var n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value;var s=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var r=this._value;this._value+=t;var u=this.number;var a=!isNaN(u);var o=false;if(a){var h=void 0;if(this.min!=null&&this.min<0&&this.number<this.min)h=this.min;if(this.max!=null&&this.max>0&&this.number>this.max)h=this.max;if(h!=null){if(this.autofix){this._value=this.format(h,this).replace(i.UNMASKED_RADIX,this.radix);o||(o=r===this._value&&!e.tail)}else{a=false}}a&&(a=Boolean(this._value.match(this._numberRegExp)))}var l;if(!a){this._value=r;l=new ChangeDetails}else{l=new ChangeDetails({inserted:this._value.slice(r.length),rawInserted:o?"":t,skip:o})}this._value=this._insertThousandsSeparators(this._value);var f=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value;var c=this._separatorsCountFromSlice(f);l.tailShift+=(c-s)*this.thousandsSeparator.length;return l};i.prototype._findSeparatorAround=function(t){if(this.thousandsSeparator){var i=t-this.thousandsSeparator.length+1;var e=this.value.indexOf(this.thousandsSeparator,i);if(e<=t)return e}return-1};i.prototype._adjustRangeWithSeparators=function(t,i){var e=this._findSeparatorAround(t);if(e>=0)t=e;var n=this._findSeparatorAround(i);if(n>=0)i=n+this.thousandsSeparator.length;return[t,i]};i.prototype.remove=function(t,i){var e;if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}e=this._adjustRangeWithSeparators(t,i),t=e[0],i=e[1];var n=this.value.slice(0,t);var s=this.value.slice(i);var r=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+s));var u=this._separatorsCountFromSlice(n);return new ChangeDetails({tailShift:(u-r)*this.thousandsSeparator.length})};i.prototype.nearestInputPos=function(t,i){if(!this.thousandsSeparator)return t;switch(i){case DIRECTION.NONE:case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:{var e=this._findSeparatorAround(t-1);if(e>=0){var n=e+this.thousandsSeparator.length;if(t<n||this.value.length<=n||i===DIRECTION.FORCE_LEFT){return e}}break}case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:{var s=this._findSeparatorAround(t);if(s>=0){return s+this.thousandsSeparator.length}}}return t};i.prototype.doCommit=function(){if(this.value){var i=this.number;var e=i;if(this.min!=null)e=Math.max(e,this.min);if(this.max!=null)e=Math.min(e,this.max);if(e!==i)this.unmaskedValue=this.format(e,this);var n=this.value;if(this.normalizeZeros)n=this._normalizeZeros(n);if(this.padFractionalZeros&&this.scale>0)n=this._padFractionalZeros(n);this._value=n}t.prototype.doCommit.call(this)};i.prototype._normalizeZeros=function(t){var i=this._removeThousandsSeparators(t).split(this.radix);i[0]=i[0].replace(/^(\D*)(0*)(\d*)/,(function(t,i,e,n){return i+n}));if(t.length&&!/\d$/.test(i[0]))i[0]=i[0]+"0";if(i.length>1){i[1]=i[1].replace(/0*$/,"");if(!i[1].length)i.length=1}return this._insertThousandsSeparators(i.join(this.radix))};i.prototype._padFractionalZeros=function(t){if(!t)return t;var i=t.split(this.radix);if(i.length<2)i.push("");i[1]=i[1].padEnd(this.scale,"0");return i.join(this.radix)};i.prototype.doSkipInvalid=function(e,n,s){if(n===void 0){n={}}var r=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===i.UNMASKED_RADIX||this.mapToRadix.includes(e));return t.prototype.doSkipInvalid.call(this,e,n,s)&&!r};Object.defineProperty(i.prototype,"unmaskedValue",{get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,i.UNMASKED_RADIX)},set:function(i){t.prototype.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.parse(this.unmaskedValue,this)},set:function(t){this.rawInputValue=this.format(t,this).replace(i.UNMASKED_RADIX,this.radix)},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"number",{get:function(){return this.typedValue},set:function(t){this.typedValue=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"allowNegative",{get:function(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"allowPositive",{get:function(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0},enumerable:false,configurable:true});i.prototype.typedValueEquals=function(e){return(t.prototype.typedValueEquals.call(this,e)||i.EMPTY_VALUES.includes(e)&&i.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")};return i}(Masked);_MaskedNumber=MaskedNumber;MaskedNumber.UNMASKED_RADIX=".";MaskedNumber.EMPTY_VALUES=__spreadArray(__spreadArray([],Masked.EMPTY_VALUES,true),[0],false);MaskedNumber.DEFAULTS=__assign(__assign({},Masked.DEFAULTS),{mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[_MaskedNumber.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:true,padFractionalZeros:false,parse:Number,format:function(t){return t.toLocaleString("en-US",{useGrouping:false,maximumFractionDigits:20})}});IMask.MaskedNumber=MaskedNumber;var PIPE_TYPE={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function createPipe(t,i,e){if(i===void 0){i=PIPE_TYPE.MASKED}if(e===void 0){e=PIPE_TYPE.MASKED}var n=createMask(t);return function(t){return n.runIsolated((function(n){n[i]=t;return n[e]}))}}function pipe(t,i,e,n){return createPipe(i,e,n)(t)}IMask.PIPE_TYPE=PIPE_TYPE;IMask.createPipe=createPipe;IMask.pipe=pipe;var RepeatBlock=function(t){__extends(i,t);function i(i){return t.call(this,i)||this}Object.defineProperty(i.prototype,"repeatFrom",{get:function(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===Infinity?0:this.repeat)!=null?t:0},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"repeatTo",{get:function(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:Infinity},enumerable:false,configurable:true});i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e,n,s;var r=normalizeOpts(i),u=r.repeat,a=__rest(r,["repeat"]);this._blockOpts=Object.assign({},this._blockOpts,a);var o=createMask(this._blockOpts);this.repeat=(e=(n=u!=null?u:o.repeat)!=null?n:this.repeat)!=null?e:Infinity;t.prototype._update.call(this,{mask:"m".repeat(Math.max(this.repeatTo===Infinity&&((s=this._blocks)==null?void 0:s.length)||0,this.repeatFrom)),blocks:{m:o},eager:o.eager,overwrite:o.overwrite,skipInvalid:o.skipInvalid,lazy:o.lazy,placeholderChar:o.placeholderChar,displayChar:o.displayChar})};i.prototype._allocateBlock=function(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===Infinity||this._blocks.length<this.repeatTo){this._blocks.push(createMask(this._blockOpts));this.mask+="m";return this._blocks[this._blocks.length-1]}};i.prototype._appendCharRaw=function(t,i){if(i===void 0){i={}}var e=new ChangeDetails;for(var n=(u=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?u:Math.max(this._blocks.length-1,0),s=void 0,r=void 0;s=(o=this._blocks[n])!=null?o:r=!r&&this._allocateBlock(n);++n){var u,a,o,h;var l=s._appendChar(t,__assign(__assign({},i),{_beforeTailState:(h=i._beforeTailState)==null||(h=h._blocks)==null?void 0:h[n]}));if(l.skip&&r){this._blocks.pop();this.mask=this.mask.slice(1);break}e.aggregate(l);if(l.consumed)break}return e};i.prototype._trimEmptyTail=function(t,i){var e,n;if(t===void 0){t=0}var s=Math.max(((e=this._mapPosToBlock(t))==null?void 0:e.index)||0,this.repeatFrom,0);var r;if(i!=null)r=(n=this._mapPosToBlock(i))==null?void 0:n.index;if(r==null)r=this._blocks.length-1;var u=0;for(var a=r;s<=a;--a,++u){if(this._blocks[a].unmaskedValue)break}if(u){this._blocks.splice(r-u+1,u);this.mask=this.mask.slice(u)}};i.prototype.reset=function(){t.prototype.reset.call(this);this._trimEmptyTail()};i.prototype.remove=function(i,e){if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}var n=t.prototype.remove.call(this,i,e);this._trimEmptyTail(i,e);return n};i.prototype.totalInputPositions=function(i,e){if(i===void 0){i=0}if(e==null&&this.repeatTo===Infinity)return Infinity;return t.prototype.totalInputPositions.call(this,i,e)};Object.defineProperty(i.prototype,"state",{get:function(){return t.prototype.state},set:function(i){this._blocks.length=i._blocks.length;this.mask=this.mask.slice(0,this._blocks.length);t.prototype.state=i},enumerable:false,configurable:true});return i}(MaskedPattern);IMask.RepeatBlock=RepeatBlock;try{globalThis.IMask=IMask}catch(t){}var verdocsKbaDialogCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-kba-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-kba-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:10px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-kba-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-kba-dialog .step{margin-left:6px;color:#666}verdocs-kba-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-kba-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-kba-dialog .help-icon{width:40px;height:40px}verdocs-kba-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-kba-dialog .help-text{font-weight:400}verdocs-kba-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-kba-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-kba-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-kba-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-kba-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-kba-dialog .field label{margin-top:4px;-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-kba-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-kba-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-kba-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-kba-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;font-size:14px;padding:0 5px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-kba-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-kba-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-kba-dialog .buttons verdocs-button{margin-left:16px}';var States={AL:"Alabama",AK:"Alaska",AS:"American Samoa",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FM:"Federated States Of Micronesia",FL:"Florida",GA:"Georgia",GU:"Guam",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MH:"Marshall Islands",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",MP:"Northern Mariana Islands",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PW:"Palau",PA:"Pennsylvania",PR:"Puerto Rico",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VI:"Virgin Islands",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"};var STATE_OPTIONS=Object.entries(States).map((function(t){var i=t[0],e=t[1];return{value:i,label:e}}));var QuestionIcon$1='<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>';var VerdocsKbaDialog=function(){function t(t){registerInstance(this,t);this.exit=createEvent(this,"exit");this.pinEntered=createEvent(this,"pinEntered");this.next=createEvent(this,"next");this.step=1;this.steps=3;this.helptitle="Previous Addresses";this.helptext="Please select the address below that you have most recently lived at.";this.mode="choice";this.label="PIN";this.placeholder="Enter your PIN...";this.recipient=null;this.choices=["553 Arbor Dr","18 Lacey Ln","23A Ball Ct","2375 Cavallo Blvd","23-1 RR-7","151 Boulder Rd"];this.agreed=false;this.response="";this.updatedRecipient=null;this.dobContainerId="verdocs-date-input-".concat(Math.random().toString(36).substring(2,11))}t.prototype.componentWillLoad=function(){this.updatedRecipient=__assign({},this.recipient||{})};t.prototype.componentDidRender=function(){IMask(document.getElementById(this.dobContainerId),{mask:Date,min:new Date(1920,0,1),max:new Date(2007,12,31),lazy:false,pattern:"m/d/Y",format:function(t){var i=t.getDate();var e=t.getMonth()+1;var n=t.getFullYear();if(i<10)i="0"+i;if(e<10)e="0"+e;return[e,i,n].join("/")},parse:function(t){var i=t.split("/");return new Date(i[2],i[0]-1,i[1])}})};t.prototype.handleCancel=function(){this.exit.emit()};t.prototype.handleDismiss=function(t){if(t.target.class==="background-overlay"){t.preventDefault();this.handleCancel()}};t.prototype.handleDone=function(){this.next.emit(this.response);this.response=""};t.prototype.handleConfirmID=function(){console.log("Confirm ID",this.updatedRecipient);this.next.emit(this.updatedRecipient)};t.prototype.render=function(){var t=this;var i,e,n,s,r,u,a,o,l,f,c,d,v,b;if(this.mode==="choice"){return h(Host,null,h("div",{class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Confirm Your Identity",this.steps>1?h("span",{class:"step"},"(",this.step,"/",this.steps,")"):h(Fragment,null)),!!this.helptitle&&h("div",{class:"help-box"},h("div",{class:"help-icon",innerHTML:QuestionIcon$1}),h("div",{class:"help-details"},h("div",{class:"help-title"},this.helptitle),h("div",{class:"help-text"},this.helptext))),h("div",{class:"choices"},this.choices.map((function(i){return h("div",{class:"choice ".concat(i===t.response?"selected":""),onClick:function(){console.log("Selected",i);t.response=i}},i)}))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return t.handleCancel()}}),h("verdocs-button",{label:this.step<this.steps?"Next":"Submit",onClick:function(){return t.handleDone()},disabled:!this.response})))))}if(this.mode==="identity"){return h(Host,null,h("div",{class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Confirm Your Identity"),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-first"},"Your Name:",h("span",{class:"required"},"*")),h("input",{required:true,type:"text",id:"verdocs-kba-first",name:"verdocs-kba-first",placeholder:"First name...",value:(i=this.updatedRecipient)===null||i===void 0?void 0:i.first_name,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{first_name:i.target.value})}}),h("input",{type:"text",id:"verdocs-kba-last",name:"verdocs-kba-last",placeholder:"Last name...",required:true,value:(e=this.updatedRecipient)===null||e===void 0?void 0:e.last_name,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{last_name:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-address"},"Address:",h("span",{class:"required"},"*")),h("input",{type:"text",id:"verdocs-kba-address",name:"verdocs-kba-address",placeholder:"Address...",value:(n=this.updatedRecipient)===null||n===void 0?void 0:n.address,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{address:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-city"},"City:"),h("input",{type:"text",id:"verdocs-kba-city",name:"verdocs-kba-city",placeholder:"City...",value:(s=this.updatedRecipient)===null||s===void 0?void 0:s.city,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{city:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-state"},"State:"),h("verdocs-select-input",{options:STATE_OPTIONS,value:(r=this.updatedRecipient)===null||r===void 0?void 0:r.state,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{state:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-zip"},"Zip Code:",h("span",{class:"required"},"*")),h("input",{type:"text",id:"verdocs-kba-zip",name:"verdocs-kba-zip",placeholder:"Zip Code...",required:true,value:(u=this.updatedRecipient)===null||u===void 0?void 0:u.zip,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{zip:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-ssn"},"SSN Last 4:",h("span",{class:"required"},"*")),h("input",{type:"text",id:"verdocs-kba-ssn",name:"verdocs-kba-ssn",placeholder:"Last 4 digits of your Social Security Number...",required:true,value:(a=this.updatedRecipient)===null||a===void 0?void 0:a.ssn_last_4,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{ssn_last_4:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:this.dobContainerId},"Date of Birth:",h("span",{class:"required"},"*")),h("input",{type:"text",value:((o=this.updatedRecipient)===null||o===void 0?void 0:o.dob)||"",id:this.dobContainerId,placeholder:"DOB...",onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{dob:i.target.value})}})),h("div",{class:"field"},h("label",null),h("verdocs-checkbox",{id:"verdocs-kba-agree",name:"verdocs-kba-agree",checked:this.agreed,onInput:function(i){return t.agreed=i.target.checked}}),h("span",null,"I agree to provide my personal information in order to validate my identity.")),h("div",{class:"buttons"},h("verdocs-button",{label:"Submit",onClick:function(){return t.handleConfirmID()},disabled:!this.agreed||!((l=this.updatedRecipient)===null||l===void 0?void 0:l.first_name)||!((f=this.updatedRecipient)===null||f===void 0?void 0:f.last_name)||!((c=this.updatedRecipient)===null||c===void 0?void 0:c.address)||!((d=this.updatedRecipient)===null||d===void 0?void 0:d.zip)||!((v=this.updatedRecipient)===null||v===void 0?void 0:v.ssn_last_4)||!((b=this.updatedRecipient)===null||b===void 0?void 0:b.dob)})))))}return h(Host,null,h("div",{class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Please Confirm Your Identity",this.steps>1?h("span",{class:"step"},"(",this.step,"/",this.steps,")"):h(Fragment,null)),!!this.helptitle&&h("div",{class:"help-box"},h("div",{class:"help-icon",innerHTML:QuestionIcon$1}),h("div",{class:"help-details"},h("div",{class:"help-title"},this.helptitle),h("div",{class:"help-text"},this.helptext))),h("div",{class:"input"},h("label",{htmlFor:"verdocs-kba-input"},this.label),h("input",{type:"text",id:"verdocs-kba-input",name:"verdocs-kba-input",placeholder:this.placeholder,value:this.response,onInput:function(i){return t.response=i.target.value}})),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return t.handleCancel()}}),h("verdocs-button",{label:"Submit",onClick:function(){return t.handleDone()},disabled:!this.response})))))};return t}();VerdocsKbaDialog.style=verdocsKbaDialogCss;var verdocsOtpDialogCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-otp-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-otp-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:10px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-otp-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-otp-dialog .step{margin-left:6px;color:#666}verdocs-otp-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-otp-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-otp-dialog .help-icon{width:40px;height:40px}verdocs-otp-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-otp-dialog .help-text{font-weight:400}verdocs-otp-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-otp-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-otp-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-otp-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-otp-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-otp-dialog .field label{-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-otp-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-otp-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-otp-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-otp-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;font-size:14px;padding:0 5px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-otp-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-otp-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-otp-dialog .buttons verdocs-button{margin-left:16px}';var QuestionIcon='<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>';var VerdocsOtpDialog=function(){function t(t){registerInstance(this,t);this.exit=createEvent(this,"exit");this.next=createEvent(this,"next");this.resendTimeout=null;this.endpoint=DefaultEndpoint;this.method="email";this.recipient=null;this.resendDisabled=true;this.response=""}t.prototype.componentDidLoad=function(){var t=this;this.startResendTimeout();setTimeout((function(){verifySigner(t.endpoint,{auth_method:t.method,code:"",resend:true}).then((function(i){console.log("Resend result",i);t.response=""})).catch((function(t){return console.log("Error resending code",t)}))}),1e3)};t.prototype.disconnectedCallback=function(){if(this.resendTimeout){clearTimeout(this.resendTimeout);this.resendTimeout=null}};t.prototype.handleCancel=function(){this.exit.emit()};t.prototype.handleDismiss=function(t){if(t.target.class==="background-overlay"){t.preventDefault();this.handleCancel()}};t.prototype.startResendTimeout=function(){var t=this;this.resendDisabled=true;if(this.resendTimeout){clearTimeout(this.resendTimeout)}this.resendTimeout=setTimeout((function(){t.resendDisabled=false}),3e4)};t.prototype.handleResend=function(){var t=this;this.startResendTimeout();verifySigner(this.endpoint,{auth_method:this.method,code:"",resend:true}).then((function(i){console.log("Resend result",i);t.response="";VerdocsToast("A new code has been sent.")})).catch((function(t){return console.log("Error resending code",t)}))};t.prototype.handleSubmit=function(){var t=this;this.startResendTimeout();verifySigner(this.endpoint,{auth_method:this.method,code:this.response}).then((function(i){console.log("Verification completed",i);t.next.emit({response:i});VerdocsToast("Thank you. Your verification was successful.")})).catch((function(t){VerdocsToast("Invalid verification code. Please try again.");console.log("Invalid code",t)}));this.response=""};t.prototype.render=function(){var t=this;return h(Host,{key:"e9936d57ff961236f26620800e7f315a715b50a0"},h("div",{key:"1db7981fcf3fde1a8999fbe7bf122cc0169011bc",class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{key:"8ef5993c5bcf1ac08abbcdda589530413c58bbdc",class:"dialog"},h("div",{key:"360f24b0eb2eb4a34d08080f36a1ee5a2aaa4774",class:"heading"},"Verification Required"),h("div",{key:"6d34ca6bf6ad50c39bb813c64b3acb7a4ee81c02",class:"help-box"},h("div",{key:"7b3afd68c4a705bc83f889ed3709ff51dd40758c",class:"help-icon",innerHTML:QuestionIcon}),h("div",{key:"34a04301351ce588ebf2f4cca678152e1486941a",class:"help-details"},h("div",{key:"bc9c4bc2ca0b6db46485c2f22b329cf25ffb97af",class:"help-title"},"Please verify your email address"),h("div",{key:"a45508806c35bb2d7d44d5a83e289dadb6584c84",class:"help-text"},"Check your email for a one-time code, and enter it below."))),h("div",{key:"8ca152850009203189a9a73c18f320989c97c741",class:"input"},h("label",{key:"4f6f6dcfd0502c69bab6c2fb7f319bcbf84645b6",htmlFor:"verdocs-otp-input"},"Code:"),h("input",{key:"6b859b0e73afe9963d6934d5b7efa921daf1c547",type:"text",id:"verdocs-otp-input",name:"verdocs-otp-input",placeholder:"Enter your one-time code...",value:this.response,onInput:function(i){return t.response=i.target.value}})),h("div",{key:"0d7f1f45563bd2a1f891efa639addf2eb62d5591",class:"buttons"},h("verdocs-button",{key:"55f8bb22817142e371420e0a5c15f133779fd6c9",label:"Cancel",variant:"outline",onClick:function(){return t.handleCancel()}}),h("verdocs-button",{key:"8ebbcc0fcd384a2600f92aeb8c832d46804185a4",label:"Resend",onClick:function(){return t.handleResend()},disabled:this.resendDisabled}),h("verdocs-button",{key:"af1bf5d46d21011fd13c0ad2c4af693c11ad2fe0",label:"Submit",onClick:function(){return t.handleSubmit()},disabled:!this.response})))))};return t}();VerdocsOtpDialog.style=verdocsOtpDialogCss;var verdocsViewCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;min-height:600px;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .document{-ms-flex:1;flex:1;width:100%;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;max-width:1200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view .document .inner{width:100%;max-width:1028px}verdocs-view .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}#verdocs-view-header{width:100%;color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 20px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}@media all and (max-width: 500px){#verdocs-view-header{padding:0 10px}}#verdocs-view-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media all and (max-width: 500px){#verdocs-view-header .inner{padding:0 10px}}#verdocs-view-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-view-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';var VerdocsView=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError");this.envelopeUpdated=createEvent(this,"envelopeUpdated");this.another=createEvent(this,"another");this.view=createEvent(this,"view");this.next=createEvent(this,"next");this.envelopeListenerId=null;this.endpoint=null;this.envelopeId="";this.headerTargetId=null;this.canceling=false;this.showCancelDone=false;this.showLoadError=false;this.loading=true;this.envelope=null}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n,s;return __generator(this,(function(r){switch(r.label){case 0:if(!this.endpoint){this.endpoint=VerdocsEndpoint.getDefault();this.endpoint.loadSession()}if(!this.envelopeId){console.error("[VIEW] Missing required envelopeId");return[2]}this.listenToEnvelope();if(!!this.envelope)return[3,4];r.label=1;case 1:r.trys.push([1,3,,4]);console.log("[VIEW] Loading envelope...");n=this;return[4,getEnvelope(this.endpoint,this.envelopeId)];case 2:n.envelope=r.sent();console.log("[VIEW] Loaded envelope",this.envelope);return[3,4];case 3:s=r.sent();this.showLoadError=true;(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(e=s.response)===null||e===void 0?void 0:e.data));return[3,4];case 4:return[2]}}))}))};t.prototype.componentDidRender=function(){var t=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-view-header");if(t&&i){console.log("[VIEW] Moving header");i.remove();t.append(i)}};t.prototype.disconnectedCallback=function(){this.unlistenToEnvelope()};t.prototype.listenToEnvelope=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();Store.subscribe("envelopes",this.envelopeId,(function(){return getEnvelope(t.endpoint,t.envelopeId)}),true,(function(i){t.envelope=i;t.loading=false}));return[2]}))}))};t.prototype.unlistenToEnvelope=function(){if(this.envelopeListenerId){Store.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}};t.prototype.handlePageRendered=function(t){};t.prototype.handleOptionSelected=function(t){return __awaiter(this,void 0,void 0,(function(){var i,e,n,s,r,u,r;var a=this;return __generator(this,(function(o){switch(o.label){case 0:n=t.detail.id;switch(n){case"cancel":return[3,1];case"print":return[3,2];case"download-attachments":return[3,3];case"download-certificate":return[3,6];case"download-all":return[3,9]}return[3,10];case 1:if(confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")){this.canceling=true;cancelEnvelope(this.endpoint,this.envelopeId).then((function(t){a.canceling=false;console.log("[VIEW] Envelope canceled",t);return getEnvelope(a.endpoint,a.envelopeId)})).then((function(t){console.log("[VIEW] Loaded new envelope details",t);a.envelope=t})).catch((function(t){var i,e,n;a.canceling=false;console.log("[VIEW] Error canceling envelope",t);(i=a.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(e=t.response)===null||e===void 0?void 0:e.status,(n=t.response)===null||n===void 0?void 0:n.data))}));this.showCancelDone=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"})}return[3,10];case 2:window.print();(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,10];case 3:s=this.envelope.documents.find((function(t){return t.type==="attachment"}));if(!s)return[3,5];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,s.id)];case 4:r=o.sent();window.open(r,"_blank");o.label=5;case 5:return[3,10];case 6:u=this.envelope.documents.find((function(t){return t.type==="certificate"}));if(!u)return[3,8];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,u.id)];case 7:r=o.sent();window.open(r,"_blank");o.label=8;case 8:return[3,10];case 9:saveEnvelopesAsZip(this.endpoint,[this.envelope]).then((function(){var t;(t=a.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:a.endpoint,envelope:a.envelope,event:"downloaded"})})).catch((function(t){console.log("Error downloading Zip",t)}));return[3,10];case 10:return[2]}}))}))};t.prototype.render=function(){var t=this;var i;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to View Envelope",message:"Sorry, that envelope is not valid.",buttonLabel:"OK",onNext:function(){t.showLoadError=false}}))}if(!this.envelope){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"}))}var e=[{id:"print",label:"Print"}];if(userCanCancelEnvelope(this.endpoint.profile,this.envelope)){e.push({id:"cancel",label:"Cancel"})}var n=this.envelope.documents.length>0;var s=this.envelope.documents.filter((function(t){return t.type==="attachment"})).length;var r=this.envelope.documents.find((function(t){return t.type==="certificate"}))!==undefined;if(n||r){e.push({label:""});if(n){e.push({id:"download-attachments",label:s>1?"Download Documents":"Download Document"})}if(r){e.push({id:"download-certificate",label:"Download Certificate"})}if(n&&r){e.push({id:"download-all",label:"Download All Files"})}}return h(Host,null,h("div",{id:"verdocs-view-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:e,onOptionSelected:function(i){return t.handleOptionSelected(i)}}))),h("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(((i=this.envelope)===null||i===void 0?void 0:i.documents)||[]).filter((function(t){return t.type!=="certificate"})).map((function(i){var e=integerSequence(1,i.pages);return h(Fragment,null,e.map((function(e){var n;var s=((n=i.page_sizes)===null||n===void 0?void 0:n[e])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:t.envelopeId,documentId:i.id,endpoint:t.endpoint,type:"filled",virtualWidth:s.width,virtualHeight:s.height,pageNumber:e,onPageRendered:function(i){return t.handlePageRendered(i)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showCancelDone&&h("verdocs-ok-dialog",{heading:"Cancelled",message:"This envelope has been cancelled successfully.",onNext:function(){t.showCancelDone=false}}),this.canceling&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))};Object.defineProperty(t.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();VerdocsView.style=verdocsViewCss;export{VerdocsKbaDialog as verdocs_kba_dialog,VerdocsOtpDialog as verdocs_otp_dialog,VerdocsView as verdocs_view};
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(i,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)if(Object.prototype.hasOwnProperty.call(i,e))t[e]=i[e]};return t(i,e)};return function(i,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(i,e);function n(){this.constructor=i}i.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++){i=arguments[e];for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s))t[s]=i[s]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,i,e,n){function s(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{o(n.next(t))}catch(t){r(t)}}function a(t){try{o(n["throw"](t))}catch(t){r(t)}}function o(t){t.done?e(t.value):s(t.value).then(u,a)}o((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(t){return function(i){return o([t,i])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(e=0)),e)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;s=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){e.label=a[1];break}if(a[0]===6&&e.label<r[1]){e.label=r[1];r=a;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(a);break}if(r[2])e.ops.pop();e.trys.pop();continue}a=i.call(t,e)}catch(t){a=[6,t];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __rest=this&&this.__rest||function(t,i){var e={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i.indexOf(n)<0)e[n]=t[n];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++){if(i.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s]))e[n[s]]=t[n[s]]}return e};var __spreadArray=this&&this.__spreadArray||function(t,i,e){if(e||arguments.length===2)for(var n=0,s=i.length,r;n<s;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return t.concat(r||Array.prototype.slice.call(i))};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-CF7i8guW.js";import{verifySigner,VerdocsEndpoint,getEnvelope,getDocumentDownloadLink,cancelEnvelope,userCanCancelEnvelope,integerSequence}from"@verdocs/js-sdk";import{D as DefaultEndpoint}from"./Environment-C_Xku1v2.js";import{V as VerdocsToast}from"./Toast-CyvDgtoV.js";import{s as saveEnvelopesAsZip}from"./utils-DmfOx9Ey.js";import{S as SDKError}from"./errors-C1sRVZWv.js";import{S as Store}from"./Datastore-C_IIZj49.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-Dl7Xw8F0.js";function isString(t){return typeof t==="string"||t instanceof String}function isObject(t){var i;return typeof t==="object"&&t!=null&&(t==null||(i=t.constructor)==null?void 0:i.name)==="Object"}function pick(t,i){if(Array.isArray(i))return pick(t,(function(t,e){return i.includes(e)}));return Object.entries(t).reduce((function(t,e){var n=e[0],s=e[1];if(i(s,n))t[n]=s;return t}),{})}var DIRECTION={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function forceDirection(t){switch(t){case DIRECTION.LEFT:return DIRECTION.FORCE_LEFT;case DIRECTION.RIGHT:return DIRECTION.FORCE_RIGHT;default:return t}}function escapeRegExp(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function objectIncludes(t,i){if(i===t)return true;var e=Array.isArray(i),n=Array.isArray(t);var s;if(e&&n){if(i.length!=t.length)return false;for(s=0;s<i.length;s++)if(!objectIncludes(i[s],t[s]))return false;return true}if(e!=n)return false;if(i&&t&&typeof i==="object"&&typeof t==="object"){var r=i instanceof Date,u=t instanceof Date;if(r&&u)return i.getTime()==t.getTime();if(r!=u)return false;var a=i instanceof RegExp,o=t instanceof RegExp;if(a&&o)return i.toString()==t.toString();if(a!=o)return false;var h=Object.keys(i);for(s=0;s<h.length;s++)if(!Object.prototype.hasOwnProperty.call(t,h[s]))return false;for(s=0;s<h.length;s++)if(!objectIncludes(t[h[s]],i[h[s]]))return false;return true}else if(i&&t&&typeof i==="function"&&typeof t==="function"){return i.toString()===t.toString()}return false}var ActionDetails=function(){function t(t){Object.assign(this,t);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)){if(this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end)++this.oldSelection.end;else++this.cursorPos}}}Object.defineProperty(t.prototype,"startChangePos",{get:function(){return Math.min(this.cursorPos,this.oldSelection.start)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"insertedCount",{get:function(){return this.cursorPos-this.startChangePos},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"inserted",{get:function(){return this.value.substr(this.startChangePos,this.insertedCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"removedCount",{get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"removed",{get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"head",{get:function(){return this.value.substring(0,this.startChangePos)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tail",{get:function(){return this.value.substring(this.startChangePos+this.insertedCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"removeDirection",{get:function(){if(!this.removedCount||this.insertedCount)return DIRECTION.NONE;return(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?DIRECTION.RIGHT:DIRECTION.LEFT},enumerable:false,configurable:true});return t}();function IMask(t,i){return new IMask.InputMask(t,i)}function maskedClass(t){if(t==null)throw new Error("mask property should be defined");if(t instanceof RegExp)return IMask.MaskedRegExp;if(isString(t))return IMask.MaskedPattern;if(t===Date)return IMask.MaskedDate;if(t===Number)return IMask.MaskedNumber;if(Array.isArray(t)||t===Array)return IMask.MaskedDynamic;if(IMask.Masked&&t.prototype instanceof IMask.Masked)return t;if(IMask.Masked&&t instanceof IMask.Masked)return t.constructor;if(t instanceof Function)return IMask.MaskedFunction;console.warn("Mask not found for mask",t);return IMask.Masked}function normalizeOpts(t){if(!t)throw new Error("Options in not defined");if(IMask.Masked){if(t.prototype instanceof IMask.Masked)return{mask:t};var i=t instanceof IMask.Masked?{mask:t}:isObject(t)&&t.mask instanceof IMask.Masked?t:{},e=i.mask,n=e===void 0?undefined:e,s=__rest(i,["mask"]);if(n){var r=n.mask;return __assign(__assign(__assign({},pick(n,(function(t,i){return!i.startsWith("_")}))),{mask:n.constructor,_mask:r}),s)}}if(!isObject(t))return{mask:t};return __assign({},t)}function createMask(t){if(IMask.Masked&&t instanceof IMask.Masked)return t;var i=normalizeOpts(t);var e=maskedClass(i.mask);if(!e)throw new Error("Masked class is not found for provided mask "+i.mask+", appropriate module needs to be imported manually before creating mask.");if(i.mask===e)delete i.mask;if(i._mask){i.mask=i._mask;delete i._mask}return new e(i)}IMask.createMask=createMask;var MaskElement=function(){function t(){}Object.defineProperty(t.prototype,"selectionStart",{get:function(){var t;try{t=this._unsafeSelectionStart}catch(t){}return t!=null?t:this.value.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectionEnd",{get:function(){var t;try{t=this._unsafeSelectionEnd}catch(t){}return t!=null?t:this.value.length},enumerable:false,configurable:true});t.prototype.select=function(t,i){if(t==null||i==null||t===this.selectionStart&&i===this.selectionEnd)return;try{this._unsafeSelect(t,i)}catch(t){}};Object.defineProperty(t.prototype,"isActive",{get:function(){return false},enumerable:false,configurable:true});return t}();IMask.MaskElement=MaskElement;var KEY_Z=90;var KEY_Y=89;var HTMLMaskElement=function(t){__extends(i,t);function i(i){var e=t.call(this)||this;e.input=i;e._onKeydown=e._onKeydown.bind(e);e._onInput=e._onInput.bind(e);e._onBeforeinput=e._onBeforeinput.bind(e);e._onCompositionEnd=e._onCompositionEnd.bind(e);return e}Object.defineProperty(i.prototype,"rootElement",{get:function(){var t,i,e;return(t=(i=(e=this.input).getRootNode)==null?void 0:i.call(e))!=null?t:document},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isActive",{get:function(){return this.input===this.rootElement.activeElement},enumerable:false,configurable:true});i.prototype.bindEvents=function(t){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",t.drop);this.input.addEventListener("click",t.click);this.input.addEventListener("focus",t.focus);this.input.addEventListener("blur",t.commit);this._handlers=t};i.prototype._onKeydown=function(t){if(this._handlers.redo&&(t.keyCode===KEY_Z&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===KEY_Y&&t.ctrlKey)){t.preventDefault();return this._handlers.redo(t)}if(this._handlers.undo&&t.keyCode===KEY_Z&&(t.metaKey||t.ctrlKey)){t.preventDefault();return this._handlers.undo(t)}if(!t.isComposing)this._handlers.selectionChange(t)};i.prototype._onBeforeinput=function(t){if(t.inputType==="historyUndo"&&this._handlers.undo){t.preventDefault();return this._handlers.undo(t)}if(t.inputType==="historyRedo"&&this._handlers.redo){t.preventDefault();return this._handlers.redo(t)}};i.prototype._onCompositionEnd=function(t){this._handlers.input(t)};i.prototype._onInput=function(t){if(!t.isComposing)this._handlers.input(t)};i.prototype.unbindEvents=function(){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={}};return i}(MaskElement);IMask.HTMLMaskElement=HTMLMaskElement;var HTMLInputMaskElement=function(t){__extends(i,t);function i(i){var e=t.call(this,i)||this;e.input=i;return e}Object.defineProperty(i.prototype,"_unsafeSelectionStart",{get:function(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"_unsafeSelectionEnd",{get:function(){return this.input.selectionEnd},enumerable:false,configurable:true});i.prototype._unsafeSelect=function(t,i){this.input.setSelectionRange(t,i)};Object.defineProperty(i.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:false,configurable:true});return i}(HTMLMaskElement);IMask.HTMLMaskElement=HTMLMaskElement;var HTMLContenteditableMaskElement=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(i.prototype,"_unsafeSelectionStart",{get:function(){var t=this.rootElement;var i=t.getSelection&&t.getSelection();var e=i&&i.anchorOffset;var n=i&&i.focusOffset;if(n==null||e==null||e<n){return e}return n},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"_unsafeSelectionEnd",{get:function(){var t=this.rootElement;var i=t.getSelection&&t.getSelection();var e=i&&i.anchorOffset;var n=i&&i.focusOffset;if(n==null||e==null||e>n){return e}return n},enumerable:false,configurable:true});i.prototype._unsafeSelect=function(t,i){if(!this.rootElement.createRange)return;var e=this.rootElement.createRange();e.setStart(this.input.firstChild||this.input,t);e.setEnd(this.input.lastChild||this.input,i);var n=this.rootElement;var s=n.getSelection&&n.getSelection();if(s){s.removeAllRanges();s.addRange(e)}};Object.defineProperty(i.prototype,"value",{get:function(){return this.input.textContent||""},set:function(t){this.input.textContent=t},enumerable:false,configurable:true});return i}(HTMLMaskElement);IMask.HTMLContenteditableMaskElement=HTMLContenteditableMaskElement;var InputHistory=function(){function t(){this.states=[];this.currentIndex=0}Object.defineProperty(t.prototype,"currentState",{get:function(){return this.states[this.currentIndex]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.states.length===0},enumerable:false,configurable:true});t.prototype.push=function(i){if(this.currentIndex<this.states.length-1)this.states.length=this.currentIndex+1;this.states.push(i);if(this.states.length>t.MAX_LENGTH)this.states.shift();this.currentIndex=this.states.length-1};t.prototype.go=function(t){this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1);return this.currentState};t.prototype.undo=function(){return this.go(-1)};t.prototype.redo=function(){return this.go(1)};t.prototype.clear=function(){this.states.length=0;this.currentIndex=0};return t}();InputHistory.MAX_LENGTH=100;var InputMask=function(){function t(t,i){this.el=t instanceof MaskElement?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new HTMLContenteditableMaskElement(t):new HTMLInputMaskElement(t);this.masked=createMask(i);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()}t.prototype.maskEquals=function(t){var i;return t==null||((i=this.masked)==null?void 0:i.maskEquals(t))};Object.defineProperty(t.prototype,"mask",{get:function(){return this.masked.mask},set:function(t){if(this.maskEquals(t))return;if(!(t instanceof IMask.Masked)&&this.masked.constructor===maskedClass(t)){this.masked.updateOptions({mask:t});return}var i=t instanceof IMask.Masked?t:createMask({mask:t});i.unmaskedValue=this.masked.unmaskedValue;this.masked=i},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){if(this.value===t)return;this.masked.value=t;this.updateControl("auto")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this._unmaskedValue},set:function(t){if(this.unmaskedValue===t)return;this.masked.unmaskedValue=t;this.updateControl("auto")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this._rawInputValue},set:function(t){if(this.rawInputValue===t)return;this.masked.rawInputValue=t;this.updateControl();this.alignCursor()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"typedValue",{get:function(){return this.masked.typedValue},set:function(t){if(this.masked.typedValueEquals(t))return;this.masked.typedValue=t;this.updateControl("auto")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.masked.displayValue},enumerable:false,configurable:true});t.prototype._bindEvents=function(){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})};t.prototype._unbindEvents=function(){if(this.el)this.el.unbindEvents()};t.prototype._fireEvent=function(t,i){var e=this._listeners[t];if(!e)return;e.forEach((function(t){return t(i)}))};Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"cursorPos",{get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){if(!this.el||!this.el.isActive)return;this.el.select(t,t);this._saveSelection()},enumerable:false,configurable:true});t.prototype._saveSelection=function(){if(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}};t.prototype.updateValue=function(){this.masked.value=this.el.value;this._value=this.masked.value;this._unmaskedValue=this.masked.unmaskedValue;this._rawInputValue=this.masked.rawInputValue};t.prototype.updateControl=function(t){var i=this.masked.unmaskedValue;var e=this.masked.value;var n=this.masked.rawInputValue;var s=this.displayValue;var r=this.unmaskedValue!==i||this.value!==e||this._rawInputValue!==n;this._unmaskedValue=i;this._value=e;this._rawInputValue=n;if(this.el.value!==s)this.el.value=s;if(t==="auto")this.alignCursor();else if(t!=null)this.cursorPos=t;if(r)this._fireChangeEvents();if(!this._historyChanging&&(r||this.history.isEmpty))this.history.push({unmaskedValue:i,selection:{start:this.selectionStart,end:this.cursorPos}})};t.prototype.updateOptions=function(t){var i=t.mask,e=__rest(t,["mask"]);var n=!this.maskEquals(i);var s=this.masked.optionsIsChanged(e);if(n)this.mask=i;if(s)this.masked.updateOptions(e);if(n||s)this.updateControl()};t.prototype.updateCursor=function(t){if(t==null)return;this.cursorPos=t;this._delayUpdateCursor(t)};t.prototype._delayUpdateCursor=function(t){var i=this;this._abortUpdateCursor();this._changingCursorPos=t;this._cursorChanging=setTimeout((function(){if(!i.el)return;i.cursorPos=i._changingCursorPos;i._abortUpdateCursor()}),10)};t.prototype._fireChangeEvents=function(){this._fireEvent("accept",this._inputEvent);if(this.masked.isComplete)this._fireEvent("complete",this._inputEvent)};t.prototype._abortUpdateCursor=function(){if(this._cursorChanging){clearTimeout(this._cursorChanging);delete this._cursorChanging}};t.prototype.alignCursor=function(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,DIRECTION.LEFT))};t.prototype.alignCursorFriendly=function(){if(this.selectionStart!==this.cursorPos)return;this.alignCursor()};t.prototype.on=function(t,i){if(!this._listeners[t])this._listeners[t]=[];this._listeners[t].push(i);return this};t.prototype.off=function(t,i){if(!this._listeners[t])return this;if(!i){delete this._listeners[t];return this}var e=this._listeners[t].indexOf(i);if(e>=0)this._listeners[t].splice(e,1);return this};t.prototype._onInput=function(t){this._inputEvent=t;this._abortUpdateCursor();var i=new ActionDetails({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection});var e=this.masked.rawInputValue;var n=this.masked.splice(i.startChangePos,i.removed.length,i.inserted,i.removeDirection,{input:true,raw:true}).offset;var s=e===this.masked.rawInputValue?i.removeDirection:DIRECTION.NONE;var r=this.masked.nearestInputPos(i.startChangePos+n,s);if(s!==DIRECTION.NONE)r=this.masked.nearestInputPos(r,DIRECTION.NONE);this.updateControl(r);delete this._inputEvent};t.prototype._onChange=function(){if(this.displayValue!==this.el.value)this.updateValue();this.masked.doCommit();this.updateControl();this._saveSelection()};t.prototype._onDrop=function(t){t.preventDefault();t.stopPropagation()};t.prototype._onFocus=function(t){this.alignCursorFriendly()};t.prototype._onClick=function(t){this.alignCursorFriendly()};t.prototype._onUndo=function(){this._applyHistoryState(this.history.undo())};t.prototype._onRedo=function(){this._applyHistoryState(this.history.redo())};t.prototype._applyHistoryState=function(t){if(!t)return;this._historyChanging=true;this.unmaskedValue=t.unmaskedValue;this.el.select(t.selection.start,t.selection.end);this._saveSelection();this._historyChanging=false};t.prototype.destroy=function(){this._unbindEvents();this._listeners.length=0;delete this.el};return t}();IMask.InputMask=InputMask;var ChangeDetails=function(){function t(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:false},t)}t.normalize=function(i){return Array.isArray(i)?i:[i,new t]};t.prototype.aggregate=function(t){this.inserted+=t.inserted;this.rawInserted+=t.rawInserted;this.tailShift+=t.tailShift;this.skip=this.skip||t.skip;return this};Object.defineProperty(t.prototype,"offset",{get:function(){return this.tailShift+this.inserted.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"consumed",{get:function(){return Boolean(this.rawInserted)||this.skip},enumerable:false,configurable:true});t.prototype.equals=function(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip};return t}();IMask.ChangeDetails=ChangeDetails;var ContinuousTailDetails=function(){function t(t,i,e){if(t===void 0){t=""}if(i===void 0){i=0}this.value=t;this.from=i;this.stop=e}t.prototype.toString=function(){return this.value};t.prototype.extend=function(t){this.value+=String(t)};t.prototype.appendTo=function(t){return t.append(this.toString(),{tail:true}).aggregate(t._appendPlaceholder())};Object.defineProperty(t.prototype,"state",{get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Object.assign(this,t)},enumerable:false,configurable:true});t.prototype.unshift=function(t){if(!this.value.length||t!=null&&this.from>=t)return"";var i=this.value[0];this.value=this.value.slice(1);return i};t.prototype.shift=function(){if(!this.value.length)return"";var t=this.value[this.value.length-1];this.value=this.value.slice(0,-1);return t};return t}();var Masked=function(){function t(i){this._value="";this._update(__assign(__assign({},t.DEFAULTS),i));this._initialized=true}t.prototype.updateOptions=function(t){if(!this.optionsIsChanged(t))return;this.withValueRefresh(this._update.bind(this,t))};t.prototype._update=function(t){Object.assign(this,t)};Object.defineProperty(t.prototype,"state",{get:function(){return{_value:this.value,_rawInputValue:this.rawInputValue}},set:function(t){this._value=t._value},enumerable:false,configurable:true});t.prototype.reset=function(){this._value=""};Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this.resolve(t,{input:true})},enumerable:false,configurable:true});t.prototype.resolve=function(t,i){if(i===void 0){i={input:true}}this.reset();this.append(t,i,"");this.doCommit()};Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this.value},set:function(t){this.resolve(t,{})},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"typedValue",{get:function(){return this.parse?this.parse(this.value,this):this.unmaskedValue},set:function(t){if(this.format){this.value=this.format(t,this)}else{this.unmaskedValue=String(t)}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this.extractInput(0,this.displayValue.length,{raw:true})},set:function(t){this.resolve(t,{raw:true})},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isComplete",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFilled",{get:function(){return this.isComplete},enumerable:false,configurable:true});t.prototype.nearestInputPos=function(t,i){return t};t.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return Math.min(this.displayValue.length,i-t)};t.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return this.displayValue.slice(t,i)};t.prototype.extractTail=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return new ContinuousTailDetails(this.extractInput(t,i),t)};t.prototype.appendTail=function(t){if(isString(t))t=new ContinuousTailDetails(String(t));return t.appendTo(this)};t.prototype._appendCharRaw=function(t,i){if(!t)return new ChangeDetails;this._value+=t;return new ChangeDetails({inserted:t,rawInserted:t})};t.prototype._appendChar=function(t,i,e){var n;if(i===void 0){i={}}var s=this.state;var r;n=this.doPrepareChar(t,i),t=n[0],r=n[1];if(t){r=r.aggregate(this._appendCharRaw(t,i));if(!r.rawInserted&&this.autofix==="pad"){var u=this.state;this.state=s;var a=this.pad(i);var o=this._appendCharRaw(t,i);a=a.aggregate(o);if(o.rawInserted||a.equals(r)){r=a}else{this.state=u}}}if(r.inserted){var h=void 0;var l=this.doValidate(i)!==false;if(l&&e!=null){var f=this.state;if(this.overwrite===true){h=e.state;for(var c=0;c<r.rawInserted.length;++c){e.unshift(this.displayValue.length-r.tailShift)}}var d=this.appendTail(e);l=d.rawInserted.length===e.toString().length;if(!(l&&d.inserted)&&this.overwrite==="shift"){this.state=f;h=e.state;for(var c=0;c<r.rawInserted.length;++c){e.shift()}d=this.appendTail(e);l=d.rawInserted.length===e.toString().length}if(l&&d.inserted)this.state=f}if(!l){r=new ChangeDetails;this.state=s;if(e&&h)e.state=h}}return r};t.prototype._appendPlaceholder=function(){return new ChangeDetails};t.prototype._appendEager=function(){return new ChangeDetails};t.prototype.append=function(t,i,e){var n;if(!isString(t))throw new Error("value should be string");var s=isString(e)?new ContinuousTailDetails(String(e)):e;if(i!=null&&i.tail)i._beforeTailState=this.state;var r;n=this.doPrepare(t,i),t=n[0],r=n[1];for(var u=0;u<t.length;++u){var a=this._appendChar(t[u],i,s);if(!a.rawInserted&&!this.doSkipInvalid(t[u],i,s))break;r.aggregate(a)}if((this.eager===true||this.eager==="append")&&i!=null&&i.input&&t){r.aggregate(this._appendEager())}if(s!=null){r.tailShift+=this.appendTail(s).tailShift}return r};t.prototype.remove=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}this._value=this.displayValue.slice(0,t)+this.displayValue.slice(i);return new ChangeDetails};t.prototype.withValueRefresh=function(t){if(this._refreshing||!this._initialized)return t();this._refreshing=true;var i=this.rawInputValue;var e=this.value;var n=t();this.rawInputValue=i;if(this.value&&this.value!==e&&e.indexOf(this.value)===0){this.append(e.slice(this.displayValue.length),{},"");this.doCommit()}delete this._refreshing;return n};t.prototype.runIsolated=function(t){if(this._isolated||!this._initialized)return t(this);this._isolated=true;var i=this.state;var e=t(this);this.state=i;delete this._isolated;return e};t.prototype.doSkipInvalid=function(t,i,e){return Boolean(this.skipInvalid)};t.prototype.doPrepare=function(t,i){if(i===void 0){i={}}return ChangeDetails.normalize(this.prepare?this.prepare(t,this,i):t)};t.prototype.doPrepareChar=function(t,i){if(i===void 0){i={}}return ChangeDetails.normalize(this.prepareChar?this.prepareChar(t,this,i):t)};t.prototype.doValidate=function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))};t.prototype.doCommit=function(){if(this.commit)this.commit(this.value,this)};t.prototype.splice=function(t,i,e,n,s){if(e===void 0){e=""}if(n===void 0){n=DIRECTION.NONE}if(s===void 0){s={input:true}}var r=t+i;var u=this.extractTail(r);var a=this.eager===true||this.eager==="remove";var o;if(a){n=forceDirection(n);o=this.extractInput(0,r,{raw:true})}var h=t;var l=new ChangeDetails;if(n!==DIRECTION.NONE){h=this.nearestInputPos(t,i>1&&t!==0&&!a?DIRECTION.NONE:n);l.tailShift=h-t}l.aggregate(this.remove(h));if(a&&n!==DIRECTION.NONE&&o===this.rawInputValue){if(n===DIRECTION.FORCE_LEFT){var f=void 0;while(o===this.rawInputValue&&(f=this.displayValue.length)){l.aggregate(new ChangeDetails({tailShift:-1})).aggregate(this.remove(f-1))}}else if(n===DIRECTION.FORCE_RIGHT){u.unshift()}}return l.aggregate(this.append(e,s,u))};t.prototype.maskEquals=function(t){return this.mask===t};t.prototype.optionsIsChanged=function(t){return!objectIncludes(this,t)};t.prototype.typedValueEquals=function(i){var e=this.typedValue;return i===e||t.EMPTY_VALUES.includes(i)&&t.EMPTY_VALUES.includes(e)||(this.format?this.format(i,this)===this.format(this.typedValue,this):false)};t.prototype.pad=function(t){return new ChangeDetails};return t}();Masked.DEFAULTS={skipInvalid:true};Masked.EMPTY_VALUES=[undefined,null,""];IMask.Masked=Masked;var ChunksTailDetails=function(){function t(t,i){if(t===void 0){t=[]}if(i===void 0){i=0}this.chunks=t;this.from=i}t.prototype.toString=function(){return this.chunks.map(String).join("")};t.prototype.extend=function(i){if(!String(i))return;i=isString(i)?new ContinuousTailDetails(String(i)):i;var e=this.chunks[this.chunks.length-1];var n=e&&(e.stop===i.stop||i.stop==null)&&i.from===e.from+e.toString().length;if(i instanceof ContinuousTailDetails){if(n){e.extend(i.toString())}else{this.chunks.push(i)}}else if(i instanceof t){if(i.stop==null){var s=void 0;while(i.chunks.length&&i.chunks[0].stop==null){s=i.chunks.shift();s.from+=i.from;this.extend(s)}}if(i.toString()){i.stop=i.blockIndex;this.chunks.push(i)}}};t.prototype.appendTo=function(i){if(!(i instanceof IMask.MaskedPattern)){var e=new ContinuousTailDetails(this.toString());return e.appendTo(i)}var n=new ChangeDetails;for(var s=0;s<this.chunks.length;++s){var r=this.chunks[s];var u=i._mapPosToBlock(i.displayValue.length);var a=r.stop;var o=void 0;if(a!=null&&(!u||u.index<=a)){if(r instanceof t||i._stops.indexOf(a)>=0){n.aggregate(i._appendPlaceholder(a))}o=r instanceof t&&i._blocks[a]}if(o){var h=o.appendTail(r);n.aggregate(h);var l=r.toString().slice(h.rawInserted.length);if(l)n.aggregate(i.append(l,{tail:true}))}else{n.aggregate(i.append(r.toString(),{tail:true}))}}return n};Object.defineProperty(t.prototype,"state",{get:function(){return{chunks:this.chunks.map((function(t){return t.state})),from:this.from,stop:this.stop,blockIndex:this.blockIndex}},set:function(i){var e=i.chunks,n=__rest(i,["chunks"]);Object.assign(this,n);this.chunks=e.map((function(i){var e="chunks"in i?new t:new ContinuousTailDetails;e.state=i;return e}))},enumerable:false,configurable:true});t.prototype.unshift=function(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";var i=t!=null?t-this.from:t;var e=0;while(e<this.chunks.length){var n=this.chunks[e];var s=n.unshift(i);if(n.toString()){if(!s)break;++e}else{this.chunks.splice(e,1)}if(s)return s}return""};t.prototype.shift=function(){if(!this.chunks.length)return"";var t=this.chunks.length-1;while(0<=t){var i=this.chunks[t];var e=i.shift();if(i.toString()){if(!e)break;--t}else{this.chunks.splice(t,1)}if(e)return e}return""};return t}();var PatternCursor=function(){function t(t,i){this.masked=t;this._log=[];var e=t._mapPosToBlock(i)||(i<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0}),n=e.offset,s=e.index;this.offset=n;this.index=s;this.ok=false}Object.defineProperty(t.prototype,"block",{get:function(){return this.masked._blocks[this.index]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"pos",{get:function(){return this.masked._blockStartPos(this.index)+this.offset},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"state",{get:function(){return{index:this.index,offset:this.offset,ok:this.ok}},set:function(t){Object.assign(this,t)},enumerable:false,configurable:true});t.prototype.pushState=function(){this._log.push(this.state)};t.prototype.popState=function(){var t=this._log.pop();if(t)this.state=t;return t};t.prototype.bindBlock=function(){if(this.block)return;if(this.index<0){this.index=0;this.offset=0}if(this.index>=this.masked._blocks.length){this.index=this.masked._blocks.length-1;this.offset=this.block.displayValue.length}};t.prototype._pushLeft=function(t){this.pushState();for(this.bindBlock();0<=this.index;--this.index,this.offset=((i=this.block)==null?void 0:i.displayValue.length)||0){var i;if(t())return this.ok=true}return this.ok=false};t.prototype._pushRight=function(t){this.pushState();for(this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0){if(t())return this.ok=true}return this.ok=false};t.prototype.pushLeftBeforeFilled=function(){var t=this;return this._pushLeft((function(){if(t.block.isFixed||!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.FORCE_LEFT);if(t.offset!==0)return true}))};t.prototype.pushLeftBeforeInput=function(){var t=this;return this._pushLeft((function(){if(t.block.isFixed)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.LEFT);return true}))};t.prototype.pushLeftBeforeRequired=function(){var t=this;return this._pushLeft((function(){if(t.block.isFixed||t.block.isOptional&&!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.LEFT);return true}))};t.prototype.pushRightBeforeFilled=function(){var t=this;return this._pushRight((function(){if(t.block.isFixed||!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.FORCE_RIGHT);if(t.offset!==t.block.value.length)return true}))};t.prototype.pushRightBeforeInput=function(){var t=this;return this._pushRight((function(){if(t.block.isFixed)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.NONE);return true}))};t.prototype.pushRightBeforeRequired=function(){var t=this;return this._pushRight((function(){if(t.block.isFixed||t.block.isOptional&&!t.block.value)return;t.offset=t.block.nearestInputPos(t.offset,DIRECTION.NONE);return true}))};return t}();var PatternFixedDefinition=function(){function t(t){Object.assign(this,t);this._value="";this.isFixed=true}Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this.isUnmasking?this.value:""},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this._isRawInput?this.value:""},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.value},enumerable:false,configurable:true});t.prototype.reset=function(){this._isRawInput=false;this._value=""};t.prototype.remove=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}this._value=this._value.slice(0,t)+this._value.slice(i);if(!this._value)this._isRawInput=false;return new ChangeDetails};t.prototype.nearestInputPos=function(t,i){if(i===void 0){i=DIRECTION.NONE}var e=0;var n=this._value.length;switch(i){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return e;case DIRECTION.NONE:case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:default:return n}};t.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}return this._isRawInput?i-t:0};t.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this._value.length}if(e===void 0){e={}}return e.raw&&this._isRawInput&&this._value.slice(t,i)||""};Object.defineProperty(t.prototype,"isComplete",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFilled",{get:function(){return Boolean(this._value)},enumerable:false,configurable:true});t.prototype._appendChar=function(t,i){if(i===void 0){i={}}if(this.isFilled)return new ChangeDetails;var e=this.eager===true||this.eager==="append";var n=this.char===t;var s=n&&(this.isUnmasking||i.input||i.raw)&&(!i.raw||!e)&&!i.tail;var r=new ChangeDetails({inserted:this.char,rawInserted:s?this.char:""});this._value=this.char;this._isRawInput=s&&(i.raw||i.input);return r};t.prototype._appendEager=function(){return this._appendChar(this.char,{tail:true})};t.prototype._appendPlaceholder=function(){var t=new ChangeDetails;if(this.isFilled)return t;this._value=t.inserted=this.char;return t};t.prototype.extractTail=function(){return new ContinuousTailDetails("")};t.prototype.appendTail=function(t){if(isString(t))t=new ContinuousTailDetails(String(t));return t.appendTo(this)};t.prototype.append=function(t,i,e){var n=this._appendChar(t[0],i);if(e!=null){n.tailShift+=this.appendTail(e).tailShift}return n};t.prototype.doCommit=function(){};Object.defineProperty(t.prototype,"state",{get:function(){return{_value:this._value,_rawInputValue:this.rawInputValue}},set:function(t){this._value=t._value;this._isRawInput=Boolean(t._rawInputValue)},enumerable:false,configurable:true});t.prototype.pad=function(t){return this._appendPlaceholder()};return t}();var PatternInputDefinition=function(){function t(t){var i=t.parent,e=t.isOptional,n=t.placeholderChar,s=t.displayChar,r=t.lazy,u=t.eager,a=__rest(t,["parent","isOptional","placeholderChar","displayChar","lazy","eager"]);this.masked=createMask(a);Object.assign(this,{parent:i,isOptional:e,placeholderChar:n,displayChar:s,lazy:r,eager:u})}t.prototype.reset=function(){this.isFilled=false;this.masked.reset()};t.prototype.remove=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}if(t===0&&i>=1){this.isFilled=false;return this.masked.remove(t,i)}return new ChangeDetails};Object.defineProperty(t.prototype,"value",{get:function(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"unmaskedValue",{get:function(){return this.masked.unmaskedValue},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"rawInputValue",{get:function(){return this.masked.rawInputValue},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.masked.value&&this.displayChar||this.value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isComplete",{get:function(){return Boolean(this.masked.value)||this.isOptional},enumerable:false,configurable:true});t.prototype._appendChar=function(t,i){if(i===void 0){i={}}if(this.isFilled)return new ChangeDetails;var e=this.masked.state;var n=this.masked._appendChar(t,this.currentMaskFlags(i));if(n.inserted&&this.doValidate(i)===false){n=new ChangeDetails;this.masked.state=e}if(!n.inserted&&!this.isOptional&&!this.lazy&&!i.input){n.inserted=this.placeholderChar}n.skip=!n.inserted&&!this.isOptional;this.isFilled=Boolean(n.inserted);return n};t.prototype.append=function(t,i,e){return this.masked.append(t,this.currentMaskFlags(i),e)};t.prototype._appendPlaceholder=function(){if(this.isFilled||this.isOptional)return new ChangeDetails;this.isFilled=true;return new ChangeDetails({inserted:this.placeholderChar})};t.prototype._appendEager=function(){return new ChangeDetails};t.prototype.extractTail=function(t,i){return this.masked.extractTail(t,i)};t.prototype.appendTail=function(t){return this.masked.appendTail(t)};t.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.masked.extractInput(t,i,e)};t.prototype.nearestInputPos=function(t,i){if(i===void 0){i=DIRECTION.NONE}var e=0;var n=this.value.length;var s=Math.min(Math.max(t,e),n);switch(i){case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:return this.isComplete?s:e;case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:return this.isComplete?s:n;case DIRECTION.NONE:default:return s}};t.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.value.slice(t,i).length};t.prototype.doValidate=function(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))};t.prototype.doCommit=function(){this.masked.doCommit()};Object.defineProperty(t.prototype,"state",{get:function(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}},set:function(t){this.masked.state=t.masked;this.isFilled=t.isFilled},enumerable:false,configurable:true});t.prototype.currentMaskFlags=function(t){var i;return __assign(__assign({},t),{_beforeTailState:(t==null||(i=t._beforeTailState)==null?void 0:i.masked)||(t==null?void 0:t._beforeTailState)})};t.prototype.pad=function(t){return new ChangeDetails};return t}();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]/,"*":/./};var MaskedRegExp=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=i.mask;if(e)i.validate=function(t){return t.search(e)>=0};t.prototype._update.call(this,i)};return i}(Masked);IMask.MaskedRegExp=MaskedRegExp;var MaskedPattern=function(t){__extends(i,t);function i(e){return t.call(this,__assign(__assign(__assign({},i.DEFAULTS),e),{definitions:Object.assign({},PatternInputDefinition.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)}))||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){i.definitions=Object.assign({},this.definitions,i.definitions);t.prototype._update.call(this,i);this._rebuildMask()};i.prototype._rebuildMask=function(){var t=this.definitions;this._blocks=[];this.exposeBlock=undefined;this._stops=[];this._maskedBlocks={};var e=this.mask;if(!e||!t)return;var n=false;var s=false;var r=function(r){if(u.blocks){var o=e.slice(r);var h=Object.keys(u.blocks).filter((function(t){return o.indexOf(t)===0}));h.sort((function(t,i){return i.length-t.length}));var l=h[0];if(l){var f=normalizeOpts(u.blocks[l]),c=f.expose,d=f.repeat,v=__rest(f,["expose","repeat"]);var b=__assign(__assign({lazy:u.lazy,eager:u.eager,placeholderChar:u.placeholderChar,displayChar:u.displayChar,overwrite:u.overwrite,autofix:u.autofix},v),{repeat:d,parent:u});var g=d!=null?new IMask.RepeatBlock(b):createMask(b);if(g){u._blocks.push(g);if(c)u.exposeBlock=g;if(!u._maskedBlocks[l])u._maskedBlocks[l]=[];u._maskedBlocks[l].push(u._blocks.length-1)}r+=l.length-1;return a=r,"continue"}}var p=e[r];var m=p in t;if(p===i.STOP_CHAR){u._stops.push(u._blocks.length);return a=r,"continue"}if(p==="{"||p==="}"){n=!n;return a=r,"continue"}if(p==="["||p==="]"){s=!s;return a=r,"continue"}if(p===i.ESCAPE_CHAR){++r;p=e[r];if(!p)return a=r,"break";m=false}var x=m?new PatternInputDefinition(__assign(__assign({isOptional:s,lazy:u.lazy,eager:u.eager,placeholderChar:u.placeholderChar,displayChar:u.displayChar},normalizeOpts(t[p])),{parent:u})):new PatternFixedDefinition({char:p,eager:u.eager,isUnmasking:n});u._blocks.push(x);a=r};var u=this,a;for(var o=0;o<e.length;++o){var h=r(o);o=a;if(h==="break")break}};Object.defineProperty(i.prototype,"state",{get:function(){return __assign(__assign({},t.prototype.state),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(i){if(!i){this.reset();return}var e=i._blocks,n=__rest(i,["_blocks"]);this._blocks.forEach((function(t,i){return t.state=e[i]}));t.prototype.state=n},enumerable:false,configurable:true});i.prototype.reset=function(){t.prototype.reset.call(this);this._blocks.forEach((function(t){return t.reset()}))};Object.defineProperty(i.prototype,"isComplete",{get:function(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((function(t){return t.isComplete}))},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isFilled",{get:function(){return this._blocks.every((function(t){return t.isFilled}))},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isFixed",{get:function(){return this._blocks.every((function(t){return t.isFixed}))},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isOptional",{get:function(){return this._blocks.every((function(t){return t.isOptional}))},enumerable:false,configurable:true});i.prototype.doCommit=function(){this._blocks.forEach((function(t){return t.doCommit()}));t.prototype.doCommit.call(this)};Object.defineProperty(i.prototype,"unmaskedValue",{get:function(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((function(t,i){return t+=i.unmaskedValue}),"")},set:function(i){if(this.exposeBlock){var e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=i;this.appendTail(e);this.doCommit()}else t.prototype.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"value",{get:function(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((function(t,i){return t+=i.value}),"")},set:function(i){if(this.exposeBlock){var e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=i;this.appendTail(e);this.doCommit()}else t.prototype.value=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.exposeBlock?this.exposeBlock.typedValue:t.prototype.typedValue},set:function(i){if(this.exposeBlock){var e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=i;this.appendTail(e);this.doCommit()}else t.prototype.typedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"displayValue",{get:function(){return this._blocks.reduce((function(t,i){return t+=i.displayValue}),"")},enumerable:false,configurable:true});i.prototype.appendTail=function(i){return t.prototype.appendTail.call(this,i).aggregate(this._appendPlaceholder())};i.prototype._appendEager=function(){var t;var i=new ChangeDetails;var e=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(e==null)return i;if(this._blocks[e].isFilled)++e;for(var n=e;n<this._blocks.length;++n){var s=this._blocks[n]._appendEager();if(!s.inserted)break;i.aggregate(s)}return i};i.prototype._appendCharRaw=function(t,i){if(i===void 0){i={}}var e=this._mapPosToBlock(this.displayValue.length);var n=new ChangeDetails;if(!e)return n;for(var s=e.index,r=void 0;r=this._blocks[s];++s){var u;var a=r._appendChar(t,__assign(__assign({},i),{_beforeTailState:(u=i._beforeTailState)==null||(u=u._blocks)==null?void 0:u[s]}));n.aggregate(a);if(a.consumed)break}return n};i.prototype.extractTail=function(t,i){var e=this;if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}var n=new ChunksTailDetails;if(t===i)return n;this._forEachBlocksInRange(t,i,(function(t,i,s,r){var u=t.extractTail(s,r);u.stop=e._findStopBefore(i);u.from=e._blockStartPos(i);if(u instanceof ChunksTailDetails)u.blockIndex=i;n.extend(u)}));return n};i.prototype.extractInput=function(t,i,e){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}if(e===void 0){e={}}if(t===i)return"";var n="";this._forEachBlocksInRange(t,i,(function(t,i,s,r){n+=t.extractInput(s,r,e)}));return n};i.prototype._findStopBefore=function(t){var i;for(var e=0;e<this._stops.length;++e){var n=this._stops[e];if(n<=t)i=n;else break}return i};i.prototype._appendPlaceholder=function(t){var i=new ChangeDetails;if(this.lazy&&t==null)return i;var e=this._mapPosToBlock(this.displayValue.length);if(!e)return i;var n=e.index;var s=t!=null?t:this._blocks.length;this._blocks.slice(n,s).forEach((function(e){if(!e.lazy||t!=null){var n;i.aggregate(e._appendPlaceholder((n=e._blocks)==null?void 0:n.length))}}));return i};i.prototype._mapPosToBlock=function(t){var i="";for(var e=0;e<this._blocks.length;++e){var n=this._blocks[e];var s=i.length;i+=n.displayValue;if(t<=i.length){return{index:e,offset:t-s}}}};i.prototype._blockStartPos=function(t){return this._blocks.slice(0,t).reduce((function(t,i){return t+=i.displayValue.length}),0)};i.prototype._forEachBlocksInRange=function(t,i,e){if(i===void 0){i=this.displayValue.length}var n=this._mapPosToBlock(t);if(n){var s=this._mapPosToBlock(i);var r=s&&n.index===s.index;var u=n.offset;var a=s&&r?s.offset:this._blocks[n.index].displayValue.length;e(this._blocks[n.index],n.index,u,a);if(s&&!r){for(var o=n.index+1;o<s.index;++o){e(this._blocks[o],o,0,this._blocks[o].displayValue.length)}e(this._blocks[s.index],s.index,0,s.offset)}}};i.prototype.remove=function(i,e){if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}var n=t.prototype.remove.call(this,i,e);this._forEachBlocksInRange(i,e,(function(t,i,e,s){n.aggregate(t.remove(e,s))}));return n};i.prototype.nearestInputPos=function(t,i){if(i===void 0){i=DIRECTION.NONE}if(!this._blocks.length)return 0;var e=new PatternCursor(this,t);if(i===DIRECTION.NONE){if(e.pushRightBeforeInput())return e.pos;e.popState();if(e.pushLeftBeforeInput())return e.pos;return this.displayValue.length}if(i===DIRECTION.LEFT||i===DIRECTION.FORCE_LEFT){if(i===DIRECTION.LEFT){e.pushRightBeforeFilled();if(e.ok&&e.pos===t)return t;e.popState()}e.pushLeftBeforeInput();e.pushLeftBeforeRequired();e.pushLeftBeforeFilled();if(i===DIRECTION.LEFT){e.pushRightBeforeInput();e.pushRightBeforeRequired();if(e.ok&&e.pos<=t)return e.pos;e.popState();if(e.ok&&e.pos<=t)return e.pos;e.popState()}if(e.ok)return e.pos;if(i===DIRECTION.FORCE_LEFT)return 0;e.popState();if(e.ok)return e.pos;e.popState();if(e.ok)return e.pos;return 0}if(i===DIRECTION.RIGHT||i===DIRECTION.FORCE_RIGHT){e.pushRightBeforeInput();e.pushRightBeforeRequired();if(e.pushRightBeforeFilled())return e.pos;if(i===DIRECTION.FORCE_RIGHT)return this.displayValue.length;e.popState();if(e.ok)return e.pos;e.popState();if(e.ok)return e.pos;return this.nearestInputPos(t,DIRECTION.LEFT)}return t};i.prototype.totalInputPositions=function(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}var e=0;this._forEachBlocksInRange(t,i,(function(t,i,n,s){e+=t.totalInputPositions(n,s)}));return e};i.prototype.maskedBlock=function(t){return this.maskedBlocks(t)[0]};i.prototype.maskedBlocks=function(t){var i=this;var e=this._maskedBlocks[t];if(!e)return[];return e.map((function(t){return i._blocks[t]}))};i.prototype.pad=function(t){var i=new ChangeDetails;this._forEachBlocksInRange(0,this.displayValue.length,(function(e){return i.aggregate(e.pad(t))}));return i};return i}(Masked);MaskedPattern.DEFAULTS=__assign(__assign({},Masked.DEFAULTS),{lazy:true,placeholderChar:"_"});MaskedPattern.STOP_CHAR="`";MaskedPattern.ESCAPE_CHAR="\\";MaskedPattern.InputDefinition=PatternInputDefinition;MaskedPattern.FixedDefinition=PatternFixedDefinition;IMask.MaskedPattern=MaskedPattern;var MaskedRange=function(t){__extends(i,t);function i(i){return t.call(this,i)||this}Object.defineProperty(i.prototype,"_matchFrom",{get:function(){return this.maxLength-String(this.from).length},enumerable:false,configurable:true});i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=i.to,n=e===void 0?this.to||0:e,s=i.from,r=s===void 0?this.from||0:s,u=i.maxLength,a=u===void 0?this.maxLength||0:u,o=i.autofix,h=o===void 0?this.autofix:o,l=__rest(i,["to","from","maxLength","autofix"]);this.to=n;this.from=r;this.maxLength=Math.max(String(n).length,a);this.autofix=h;var f=String(this.from).padStart(this.maxLength,"0");var c=String(this.to).padStart(this.maxLength,"0");var d=0;while(d<c.length&&c[d]===f[d])++d;l.mask=c.slice(0,d).replace(/0/g,"\\0")+"0".repeat(this.maxLength-d);t.prototype._update.call(this,l)};Object.defineProperty(i.prototype,"isComplete",{get:function(){return t.prototype.isComplete&&Boolean(this.value)},enumerable:false,configurable:true});i.prototype.boundaries=function(t){var i="";var e="";var n=t.match(/^(\D*)(\d*)(\D*)/)||[],s=n[1],r=n[2];if(r){i="0".repeat(s.length)+r;e="9".repeat(s.length)+r}i=i.padEnd(this.maxLength,"0");e=e.padEnd(this.maxLength,"9");return[i,e]};i.prototype.doPrepareChar=function(i,e){var n;if(e===void 0){e={}}var s;n=t.prototype.doPrepareChar.call(this,i.replace(/\D/g,""),e),i=n[0],s=n[1];if(!i)s.skip=!this.isComplete;return[i,s]};i.prototype._appendCharRaw=function(i,e){if(e===void 0){e={}}if(!this.autofix||this.value.length+1>this.maxLength)return t.prototype._appendCharRaw.call(this,i,e);var n=String(this.from).padStart(this.maxLength,"0");var s=String(this.to).padStart(this.maxLength,"0");var r=this.boundaries(this.value+i),u=r[0],a=r[1];if(Number(a)<this.from)return t.prototype._appendCharRaw.call(this,n[this.value.length],e);if(Number(u)>this.to){if(!e.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength){return t.prototype._appendCharRaw.call(this,n[this.value.length],e).aggregate(this._appendCharRaw(i,e))}return t.prototype._appendCharRaw.call(this,s[this.value.length],e)}return t.prototype._appendCharRaw.call(this,i,e)};i.prototype.doValidate=function(i){var e=this.value;var n=e.search(/[^0]/);if(n===-1&&e.length<=this._matchFrom)return true;var s=this.boundaries(e),r=s[0],u=s[1];return this.from<=Number(u)&&Number(r)<=this.to&&t.prototype.doValidate.call(this,i)};i.prototype.pad=function(i){var e=this;var n=new ChangeDetails;if(this.value.length===this.maxLength)return n;var s=this.value;var r=this.maxLength-this.value.length;if(r){this.reset();for(var u=0;u<r;++u){n.aggregate(t.prototype._appendCharRaw.call(this,"0",i))}s.split("").forEach((function(t){return e._appendCharRaw(t)}))}return n};return i}(MaskedPattern);IMask.MaskedRange=MaskedRange;var DefaultPattern="d{.}`m{.}`Y";var MaskedDate=function(t){__extends(i,t);function i(e){return t.call(this,i.extractPatternOptions(__assign(__assign({},i.DEFAULTS),e)))||this}i.extractPatternOptions=function(t){var i=t.mask,e=t.pattern,n=__rest(t,["mask","pattern"]);return __assign(__assign({},n),{mask:isString(i)?i:e})};i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(e){var n=__assign(__assign({},i.DEFAULTS),e),s=n.mask,r=n.pattern,u=n.blocks,a=__rest(n,["mask","pattern","blocks"]);var o=Object.assign({},i.GET_DEFAULT_BLOCKS());if(e.min)o.Y.from=e.min.getFullYear();if(e.max)o.Y.to=e.max.getFullYear();if(e.min&&e.max&&o.Y.from===o.Y.to){o.m.from=e.min.getMonth()+1;o.m.to=e.max.getMonth()+1;if(o.m.from===o.m.to){o.d.from=e.min.getDate();o.d.to=e.max.getDate()}}Object.assign(o,this.blocks,u);t.prototype._update.call(this,__assign(__assign({},a),{mask:isString(s)?s:r,blocks:o}))};i.prototype.doValidate=function(i){var e=this.date;return t.prototype.doValidate.call(this,i)&&(!this.isComplete||this.isDateExist(this.value)&&e!=null&&(this.min==null||this.min<=e)&&(this.max==null||e<=this.max))};i.prototype.isDateExist=function(t){return this.format(this.parse(t,this),this).indexOf(t)>=0};Object.defineProperty(i.prototype,"date",{get:function(){return this.typedValue},set:function(t){this.typedValue=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.isComplete?t.prototype.typedValue:null},set:function(i){t.prototype.typedValue=i},enumerable:false,configurable:true});i.prototype.maskEquals=function(i){return i===Date||t.prototype.maskEquals.call(this,i)};i.prototype.optionsIsChanged=function(e){return t.prototype.optionsIsChanged.call(this,i.extractPatternOptions(e))};return i}(MaskedPattern);MaskedDate.GET_DEFAULT_BLOCKS=function(){return{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=__assign(__assign({},MaskedPattern.DEFAULTS),{mask:Date,pattern:DefaultPattern,format:function(t,i){if(!t)return"";var e=String(t.getDate()).padStart(2,"0");var n=String(t.getMonth()+1).padStart(2,"0");var s=t.getFullYear();return[e,n,s].join(".")},parse:function(t,i){var e=t.split(".").map(Number),n=e[0],s=e[1],r=e[2];return new Date(r,s-1,n)}});IMask.MaskedDate=MaskedDate;var MaskedDynamic=function(t){__extends(i,t);function i(e){var n=t.call(this,__assign(__assign({},i.DEFAULTS),e))||this;n.currentMask=undefined;return n}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=this;t.prototype._update.call(this,i);if("mask"in i){this.exposeMask=undefined;this.compiledMasks=Array.isArray(i.mask)?i.mask.map((function(t){var i=normalizeOpts(t),n=i.expose,s=__rest(i,["expose"]);var r=createMask(__assign({overwrite:e._overwrite,eager:e._eager,skipInvalid:e._skipInvalid},s));if(n)e.exposeMask=r;return r})):[]}};i.prototype._appendCharRaw=function(t,i){if(i===void 0){i={}}var e=this._applyDispatch(t,i);if(this.currentMask){e.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(i)))}return e};i.prototype._applyDispatch=function(t,i,e){if(t===void 0){t=""}if(i===void 0){i={}}if(e===void 0){e=""}var n=i.tail&&i._beforeTailState!=null?i._beforeTailState._value:this.value;var s=this.rawInputValue;var r=i.tail&&i._beforeTailState!=null?i._beforeTailState._rawInputValue:s;var u=s.slice(r.length);var a=this.currentMask;var o=new ChangeDetails;var h=a==null?void 0:a.state;this.currentMask=this.doDispatch(t,__assign({},i),e);if(this.currentMask){if(this.currentMask!==a){this.currentMask.reset();if(r){this.currentMask.append(r,{raw:true});o.tailShift=this.currentMask.value.length-n.length}if(u){o.tailShift+=this.currentMask.append(u,{raw:true,tail:true}).tailShift}}else if(h){this.currentMask.state=h}}return o};i.prototype._appendPlaceholder=function(){var t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendPlaceholder())}return t};i.prototype._appendEager=function(){var t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendEager())}return t};i.prototype.appendTail=function(i){var e=new ChangeDetails;if(i)e.aggregate(this._applyDispatch("",{},i));return e.aggregate(this.currentMask?this.currentMask.appendTail(i):t.prototype.appendTail.call(this,i))};i.prototype.currentMaskFlags=function(t){var i,e;return __assign(__assign({},t),{_beforeTailState:((i=t._beforeTailState)==null?void 0:i.currentMaskRef)===this.currentMask&&((e=t._beforeTailState)==null?void 0:e.currentMask)||t._beforeTailState})};i.prototype.doDispatch=function(t,i,e){if(i===void 0){i={}}if(e===void 0){e=""}return this.dispatch(t,this,i,e)};i.prototype.doValidate=function(i){return t.prototype.doValidate.call(this,i)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(i)))};i.prototype.doPrepare=function(i,e){var n;if(e===void 0){e={}}var s=t.prototype.doPrepare.call(this,i,e),r=s[0],u=s[1];if(this.currentMask){var a=void 0;n=t.prototype.doPrepare.call(this,r,this.currentMaskFlags(e)),r=n[0],a=n[1];u=u.aggregate(a)}return[r,u]};i.prototype.doPrepareChar=function(i,e){var n;if(e===void 0){e={}}var s=t.prototype.doPrepareChar.call(this,i,e),r=s[0],u=s[1];if(this.currentMask){var a=void 0;n=t.prototype.doPrepareChar.call(this,r,this.currentMaskFlags(e)),r=n[0],a=n[1];u=u.aggregate(a)}return[r,u]};i.prototype.reset=function(){var t;(t=this.currentMask)==null||t.reset();this.compiledMasks.forEach((function(t){return t.reset()}))};Object.defineProperty(i.prototype,"value",{get:function(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""},set:function(i){if(this.exposeMask){this.exposeMask.value=i;this.currentMask=this.exposeMask;this._applyDispatch()}else t.prototype.value=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"unmaskedValue",{get:function(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""},set:function(i){if(this.exposeMask){this.exposeMask.unmaskedValue=i;this.currentMask=this.exposeMask;this._applyDispatch()}else t.prototype.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""},set:function(t){if(this.exposeMask){this.exposeMask.typedValue=t;this.currentMask=this.exposeMask;this._applyDispatch();return}var i=String(t);if(this.currentMask){this.currentMask.typedValue=t;i=this.currentMask.unmaskedValue}this.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"displayValue",{get:function(){return this.currentMask?this.currentMask.displayValue:""},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isComplete",{get:function(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isComplete)},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"isFilled",{get:function(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isFilled)},enumerable:false,configurable:true});i.prototype.remove=function(t,i){var e=new ChangeDetails;if(this.currentMask){e.aggregate(this.currentMask.remove(t,i)).aggregate(this._applyDispatch())}return e};Object.defineProperty(i.prototype,"state",{get:function(){var i;return __assign(__assign({},t.prototype.state),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((function(t){return t.state})),currentMaskRef:this.currentMask,currentMask:(i=this.currentMask)==null?void 0:i.state})},set:function(i){var e=i.compiledMasks,n=i.currentMaskRef,s=i.currentMask,r=__rest(i,["compiledMasks","currentMaskRef","currentMask"]);if(e)this.compiledMasks.forEach((function(t,i){return t.state=e[i]}));if(n!=null){this.currentMask=n;this.currentMask.state=s}t.prototype.state=r},enumerable:false,configurable:true});i.prototype.extractInput=function(t,i,e){return this.currentMask?this.currentMask.extractInput(t,i,e):""};i.prototype.extractTail=function(i,e){return this.currentMask?this.currentMask.extractTail(i,e):t.prototype.extractTail.call(this,i,e)};i.prototype.doCommit=function(){if(this.currentMask)this.currentMask.doCommit();t.prototype.doCommit.call(this)};i.prototype.nearestInputPos=function(i,e){return this.currentMask?this.currentMask.nearestInputPos(i,e):t.prototype.nearestInputPos.call(this,i,e)};Object.defineProperty(i.prototype,"overwrite",{get:function(){return this.currentMask?this.currentMask.overwrite:this._overwrite},set:function(t){this._overwrite=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"eager",{get:function(){return this.currentMask?this.currentMask.eager:this._eager},set:function(t){this._eager=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"skipInvalid",{get:function(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid},set:function(t){this._skipInvalid=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"autofix",{get:function(){return this.currentMask?this.currentMask.autofix:this._autofix},set:function(t){this._autofix=t},enumerable:false,configurable:true});i.prototype.maskEquals=function(i){return Array.isArray(i)?this.compiledMasks.every((function(t,e){if(!i[e])return;var n=i[e],s=n.mask,r=__rest(n,["mask"]);return objectIncludes(t,r)&&t.maskEquals(s)})):t.prototype.maskEquals.call(this,i)};i.prototype.typedValueEquals=function(t){var i;return Boolean((i=this.currentMask)==null?void 0:i.typedValueEquals(t))};return i}(Masked);MaskedDynamic.DEFAULTS=__assign(__assign({},Masked.DEFAULTS),{dispatch:function(t,i,e,n){if(!i.compiledMasks.length)return;var s=i.rawInputValue;var r=i.compiledMasks.map((function(r,u){var a=i.currentMask===r;var o=a?r.displayValue.length:r.nearestInputPos(r.displayValue.length,DIRECTION.FORCE_LEFT);if(r.rawInputValue!==s){r.reset();r.append(s,{raw:true})}else if(!a){r.remove(o)}r.append(t,i.currentMaskFlags(e));r.appendTail(n);return{index:u,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(o,r.nearestInputPos(r.displayValue.length,DIRECTION.FORCE_LEFT)))}}));r.sort((function(t,i){return i.weight-t.weight||i.totalInputPositions-t.totalInputPositions}));return i.compiledMasks[r[0].index]}});IMask.MaskedDynamic=MaskedDynamic;var MaskedEnum=function(t){__extends(i,t);function i(e){return t.call(this,__assign(__assign({},i.DEFAULTS),e))||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e=i.enum,n=__rest(i,["enum"]);if(e){var s=e.map((function(t){return t.length}));var r=Math.min.apply(Math,s);var u=Math.max.apply(Math,s)-r;n.mask="*".repeat(r);if(u)n.mask+="["+"*".repeat(u)+"]";this.enum=e}t.prototype._update.call(this,n)};i.prototype._appendCharRaw=function(i,e){var n=this;if(e===void 0){e={}}var s=Math.min(this.nearestInputPos(0,DIRECTION.FORCE_RIGHT),this.value.length);var r=this.enum.filter((function(t){return n.matchValue(t,n.unmaskedValue+i,s)}));if(r.length){if(r.length===1){this._forEachBlocksInRange(0,this.value.length,(function(t,i){var s=r[0][i];if(i>=n.value.length||s===t.value)return;t.reset();t._appendChar(s,e)}))}var u=t.prototype._appendCharRaw.call(this,r[0][this.value.length],e);if(r.length===1){r[0].slice(this.unmaskedValue.length).split("").forEach((function(i){return u.aggregate(t.prototype._appendCharRaw.call(n,i))}))}return u}return new ChangeDetails({skip:!this.isComplete})};i.prototype.extractTail=function(t,i){if(t===void 0){t=0}return new ContinuousTailDetails("",t)};i.prototype.remove=function(i,e){var n=this;if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}if(i===e)return new ChangeDetails;var s=Math.min(t.prototype.nearestInputPos.call(this,0,DIRECTION.FORCE_RIGHT),this.value.length);var r;for(r=i;r>=0;--r){var u=this.enum.filter((function(t){return n.matchValue(t,n.value.slice(s,r),s)}));if(u.length>1)break}var a=t.prototype.remove.call(this,r,e);a.tailShift+=r-i;return a};Object.defineProperty(i.prototype,"isComplete",{get:function(){return this.enum.indexOf(this.value)>=0},enumerable:false,configurable:true});return i}(MaskedPattern);MaskedEnum.DEFAULTS=__assign(__assign({},MaskedPattern.DEFAULTS),{matchValue:function(t,i,e){return t.indexOf(i,e)===e}});IMask.MaskedEnum=MaskedEnum;var MaskedFunction=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){t.prototype._update.call(this,__assign(__assign({},i),{validate:i.mask}))};return i}(Masked);IMask.MaskedFunction=MaskedFunction;var _MaskedNumber;var MaskedNumber=function(t){__extends(i,t);function i(e){return t.call(this,__assign(__assign({},i.DEFAULTS),e))||this}i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){t.prototype._update.call(this,i);this._updateRegExps()};i.prototype._updateRegExps=function(){var t="^"+(this.allowNegative?"[+|\\-]?":"");var i="\\d*";var e=(this.scale?"("+escapeRegExp(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+i+e);this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(escapeRegExp).join("")+"]","g");this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(this.thousandsSeparator),"g")};i.prototype._removeThousandsSeparators=function(t){return t.replace(this._thousandsSeparatorRegExp,"")};i.prototype._insertThousandsSeparators=function(t){var i=t.split(this.radix);i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator);return i.join(this.radix)};i.prototype.doPrepareChar=function(i,e){if(e===void 0){e={}}var n=t.prototype.doPrepareChar.call(this,this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?i.replace(this._mapToRadixRegExp,this.radix):i),e),s=n[0],r=n[1];if(i&&!s)r.skip=true;if(s&&!this.allowPositive&&!this.value&&s!=="-")r.aggregate(this._appendChar("-"));return[s,r]};i.prototype._separatorsCount=function(t,i){if(i===void 0){i=false}var e=0;for(var n=0;n<t;++n){if(this._value.indexOf(this.thousandsSeparator,n)===n){++e;if(i)t+=this.thousandsSeparator.length}}return e};i.prototype._separatorsCountFromSlice=function(t){if(t===void 0){t=this._value}return this._separatorsCount(this._removeThousandsSeparators(t).length,true)};i.prototype.extractInput=function(i,e,n){var s;if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}s=this._adjustRangeWithSeparators(i,e),i=s[0],e=s[1];return this._removeThousandsSeparators(t.prototype.extractInput.call(this,i,e,n))};i.prototype._appendCharRaw=function(t,e){if(e===void 0){e={}}var n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value;var s=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var r=this._value;this._value+=t;var u=this.number;var a=!isNaN(u);var o=false;if(a){var h=void 0;if(this.min!=null&&this.min<0&&this.number<this.min)h=this.min;if(this.max!=null&&this.max>0&&this.number>this.max)h=this.max;if(h!=null){if(this.autofix){this._value=this.format(h,this).replace(i.UNMASKED_RADIX,this.radix);o||(o=r===this._value&&!e.tail)}else{a=false}}a&&(a=Boolean(this._value.match(this._numberRegExp)))}var l;if(!a){this._value=r;l=new ChangeDetails}else{l=new ChangeDetails({inserted:this._value.slice(r.length),rawInserted:o?"":t,skip:o})}this._value=this._insertThousandsSeparators(this._value);var f=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value;var c=this._separatorsCountFromSlice(f);l.tailShift+=(c-s)*this.thousandsSeparator.length;return l};i.prototype._findSeparatorAround=function(t){if(this.thousandsSeparator){var i=t-this.thousandsSeparator.length+1;var e=this.value.indexOf(this.thousandsSeparator,i);if(e<=t)return e}return-1};i.prototype._adjustRangeWithSeparators=function(t,i){var e=this._findSeparatorAround(t);if(e>=0)t=e;var n=this._findSeparatorAround(i);if(n>=0)i=n+this.thousandsSeparator.length;return[t,i]};i.prototype.remove=function(t,i){var e;if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}e=this._adjustRangeWithSeparators(t,i),t=e[0],i=e[1];var n=this.value.slice(0,t);var s=this.value.slice(i);var r=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+s));var u=this._separatorsCountFromSlice(n);return new ChangeDetails({tailShift:(u-r)*this.thousandsSeparator.length})};i.prototype.nearestInputPos=function(t,i){if(!this.thousandsSeparator)return t;switch(i){case DIRECTION.NONE:case DIRECTION.LEFT:case DIRECTION.FORCE_LEFT:{var e=this._findSeparatorAround(t-1);if(e>=0){var n=e+this.thousandsSeparator.length;if(t<n||this.value.length<=n||i===DIRECTION.FORCE_LEFT){return e}}break}case DIRECTION.RIGHT:case DIRECTION.FORCE_RIGHT:{var s=this._findSeparatorAround(t);if(s>=0){return s+this.thousandsSeparator.length}}}return t};i.prototype.doCommit=function(){if(this.value){var i=this.number;var e=i;if(this.min!=null)e=Math.max(e,this.min);if(this.max!=null)e=Math.min(e,this.max);if(e!==i)this.unmaskedValue=this.format(e,this);var n=this.value;if(this.normalizeZeros)n=this._normalizeZeros(n);if(this.padFractionalZeros&&this.scale>0)n=this._padFractionalZeros(n);this._value=n}t.prototype.doCommit.call(this)};i.prototype._normalizeZeros=function(t){var i=this._removeThousandsSeparators(t).split(this.radix);i[0]=i[0].replace(/^(\D*)(0*)(\d*)/,(function(t,i,e,n){return i+n}));if(t.length&&!/\d$/.test(i[0]))i[0]=i[0]+"0";if(i.length>1){i[1]=i[1].replace(/0*$/,"");if(!i[1].length)i.length=1}return this._insertThousandsSeparators(i.join(this.radix))};i.prototype._padFractionalZeros=function(t){if(!t)return t;var i=t.split(this.radix);if(i.length<2)i.push("");i[1]=i[1].padEnd(this.scale,"0");return i.join(this.radix)};i.prototype.doSkipInvalid=function(e,n,s){if(n===void 0){n={}}var r=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===i.UNMASKED_RADIX||this.mapToRadix.includes(e));return t.prototype.doSkipInvalid.call(this,e,n,s)&&!r};Object.defineProperty(i.prototype,"unmaskedValue",{get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,i.UNMASKED_RADIX)},set:function(i){t.prototype.unmaskedValue=i},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"typedValue",{get:function(){return this.parse(this.unmaskedValue,this)},set:function(t){this.rawInputValue=this.format(t,this).replace(i.UNMASKED_RADIX,this.radix)},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"number",{get:function(){return this.typedValue},set:function(t){this.typedValue=t},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"allowNegative",{get:function(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"allowPositive",{get:function(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0},enumerable:false,configurable:true});i.prototype.typedValueEquals=function(e){return(t.prototype.typedValueEquals.call(this,e)||i.EMPTY_VALUES.includes(e)&&i.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")};return i}(Masked);_MaskedNumber=MaskedNumber;MaskedNumber.UNMASKED_RADIX=".";MaskedNumber.EMPTY_VALUES=__spreadArray(__spreadArray([],Masked.EMPTY_VALUES,true),[0],false);MaskedNumber.DEFAULTS=__assign(__assign({},Masked.DEFAULTS),{mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[_MaskedNumber.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:true,padFractionalZeros:false,parse:Number,format:function(t){return t.toLocaleString("en-US",{useGrouping:false,maximumFractionDigits:20})}});IMask.MaskedNumber=MaskedNumber;var PIPE_TYPE={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function createPipe(t,i,e){if(i===void 0){i=PIPE_TYPE.MASKED}if(e===void 0){e=PIPE_TYPE.MASKED}var n=createMask(t);return function(t){return n.runIsolated((function(n){n[i]=t;return n[e]}))}}function pipe(t,i,e,n){return createPipe(i,e,n)(t)}IMask.PIPE_TYPE=PIPE_TYPE;IMask.createPipe=createPipe;IMask.pipe=pipe;var RepeatBlock=function(t){__extends(i,t);function i(i){return t.call(this,i)||this}Object.defineProperty(i.prototype,"repeatFrom",{get:function(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===Infinity?0:this.repeat)!=null?t:0},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"repeatTo",{get:function(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:Infinity},enumerable:false,configurable:true});i.prototype.updateOptions=function(i){t.prototype.updateOptions.call(this,i)};i.prototype._update=function(i){var e,n,s;var r=normalizeOpts(i),u=r.repeat,a=__rest(r,["repeat"]);this._blockOpts=Object.assign({},this._blockOpts,a);var o=createMask(this._blockOpts);this.repeat=(e=(n=u!=null?u:o.repeat)!=null?n:this.repeat)!=null?e:Infinity;t.prototype._update.call(this,{mask:"m".repeat(Math.max(this.repeatTo===Infinity&&((s=this._blocks)==null?void 0:s.length)||0,this.repeatFrom)),blocks:{m:o},eager:o.eager,overwrite:o.overwrite,skipInvalid:o.skipInvalid,lazy:o.lazy,placeholderChar:o.placeholderChar,displayChar:o.displayChar})};i.prototype._allocateBlock=function(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===Infinity||this._blocks.length<this.repeatTo){this._blocks.push(createMask(this._blockOpts));this.mask+="m";return this._blocks[this._blocks.length-1]}};i.prototype._appendCharRaw=function(t,i){if(i===void 0){i={}}var e=new ChangeDetails;for(var n=(u=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?u:Math.max(this._blocks.length-1,0),s=void 0,r=void 0;s=(o=this._blocks[n])!=null?o:r=!r&&this._allocateBlock(n);++n){var u,a,o,h;var l=s._appendChar(t,__assign(__assign({},i),{_beforeTailState:(h=i._beforeTailState)==null||(h=h._blocks)==null?void 0:h[n]}));if(l.skip&&r){this._blocks.pop();this.mask=this.mask.slice(1);break}e.aggregate(l);if(l.consumed)break}return e};i.prototype._trimEmptyTail=function(t,i){var e,n;if(t===void 0){t=0}var s=Math.max(((e=this._mapPosToBlock(t))==null?void 0:e.index)||0,this.repeatFrom,0);var r;if(i!=null)r=(n=this._mapPosToBlock(i))==null?void 0:n.index;if(r==null)r=this._blocks.length-1;var u=0;for(var a=r;s<=a;--a,++u){if(this._blocks[a].unmaskedValue)break}if(u){this._blocks.splice(r-u+1,u);this.mask=this.mask.slice(u)}};i.prototype.reset=function(){t.prototype.reset.call(this);this._trimEmptyTail()};i.prototype.remove=function(i,e){if(i===void 0){i=0}if(e===void 0){e=this.displayValue.length}var n=t.prototype.remove.call(this,i,e);this._trimEmptyTail(i,e);return n};i.prototype.totalInputPositions=function(i,e){if(i===void 0){i=0}if(e==null&&this.repeatTo===Infinity)return Infinity;return t.prototype.totalInputPositions.call(this,i,e)};Object.defineProperty(i.prototype,"state",{get:function(){return t.prototype.state},set:function(i){this._blocks.length=i._blocks.length;this.mask=this.mask.slice(0,this._blocks.length);t.prototype.state=i},enumerable:false,configurable:true});return i}(MaskedPattern);IMask.RepeatBlock=RepeatBlock;try{globalThis.IMask=IMask}catch(t){}var verdocsKbaDialogCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-kba-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-kba-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:10px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-kba-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-kba-dialog .step{margin-left:6px;color:#666}verdocs-kba-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-kba-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-kba-dialog .help-icon{width:40px;height:40px}verdocs-kba-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-kba-dialog .help-text{font-weight:400}verdocs-kba-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-kba-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-kba-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-kba-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-kba-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-kba-dialog .field label{margin-top:4px;-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-kba-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-kba-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-kba-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-kba-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;font-size:14px;padding:0 5px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-kba-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-kba-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-kba-dialog .buttons verdocs-button{margin-left:16px}';var States={AL:"Alabama",AK:"Alaska",AS:"American Samoa",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FM:"Federated States Of Micronesia",FL:"Florida",GA:"Georgia",GU:"Guam",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MH:"Marshall Islands",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",MP:"Northern Mariana Islands",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PW:"Palau",PA:"Pennsylvania",PR:"Puerto Rico",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VI:"Virgin Islands",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"};var STATE_OPTIONS=Object.entries(States).map((function(t){var i=t[0],e=t[1];return{value:i,label:e}}));var QuestionIcon$1='<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>';var VerdocsKbaDialog=function(){function t(t){registerInstance(this,t);this.exit=createEvent(this,"exit");this.pinEntered=createEvent(this,"pinEntered");this.next=createEvent(this,"next");this.step=1;this.steps=3;this.helptitle="Previous Addresses";this.helptext="Please select the address below that you have most recently lived at.";this.mode="choice";this.label="PIN";this.placeholder="Enter your PIN...";this.recipient=null;this.choices=["553 Arbor Dr","18 Lacey Ln","23A Ball Ct","2375 Cavallo Blvd","23-1 RR-7","151 Boulder Rd"];this.agreed=false;this.response="";this.updatedRecipient=null;this.dobContainerId="verdocs-date-input-".concat(Math.random().toString(36).substring(2,11))}t.prototype.componentWillLoad=function(){this.updatedRecipient=__assign({},this.recipient||{})};t.prototype.componentDidRender=function(){IMask(document.getElementById(this.dobContainerId),{mask:Date,min:new Date(1920,0,1),max:new Date(2007,12,31),lazy:false,pattern:"m/d/Y",format:function(t){var i=t.getDate();var e=t.getMonth()+1;var n=t.getFullYear();if(i<10)i="0"+i;if(e<10)e="0"+e;return[e,i,n].join("/")},parse:function(t){var i=t.split("/");return new Date(i[2],i[0]-1,i[1])}})};t.prototype.handleCancel=function(){this.exit.emit()};t.prototype.handleDismiss=function(t){if(t.target.class==="background-overlay"){t.preventDefault();this.handleCancel()}};t.prototype.handleDone=function(){this.next.emit(this.response);this.response=""};t.prototype.handleConfirmID=function(){console.log("Confirm ID",this.updatedRecipient);this.next.emit(this.updatedRecipient)};t.prototype.render=function(){var t=this;var i,e,n,s,r,u,a,o,l,f,c,d,v,b;if(this.mode==="choice"){return h(Host,null,h("div",{class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Confirm Your Identity",this.steps>1?h("span",{class:"step"},"(",this.step,"/",this.steps,")"):h(Fragment,null)),!!this.helptitle&&h("div",{class:"help-box"},h("div",{class:"help-icon",innerHTML:QuestionIcon$1}),h("div",{class:"help-details"},h("div",{class:"help-title"},this.helptitle),h("div",{class:"help-text"},this.helptext))),h("div",{class:"choices"},this.choices.map((function(i){return h("div",{class:"choice ".concat(i===t.response?"selected":""),onClick:function(){console.log("Selected",i);t.response=i}},i)}))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return t.handleCancel()}}),h("verdocs-button",{label:this.step<this.steps?"Next":"Submit",onClick:function(){return t.handleDone()},disabled:!this.response})))))}if(this.mode==="identity"){return h(Host,null,h("div",{class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Confirm Your Identity"),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-first"},"Your Name:",h("span",{class:"required"},"*")),h("input",{required:true,type:"text",id:"verdocs-kba-first",name:"verdocs-kba-first",placeholder:"First name...",value:(i=this.updatedRecipient)===null||i===void 0?void 0:i.first_name,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{first_name:i.target.value})}}),h("input",{type:"text",id:"verdocs-kba-last",name:"verdocs-kba-last",placeholder:"Last name...",required:true,value:(e=this.updatedRecipient)===null||e===void 0?void 0:e.last_name,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{last_name:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-address"},"Address:",h("span",{class:"required"},"*")),h("input",{type:"text",id:"verdocs-kba-address",name:"verdocs-kba-address",placeholder:"Address...",value:(n=this.updatedRecipient)===null||n===void 0?void 0:n.address,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{address:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-city"},"City:"),h("input",{type:"text",id:"verdocs-kba-city",name:"verdocs-kba-city",placeholder:"City...",value:(s=this.updatedRecipient)===null||s===void 0?void 0:s.city,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{city:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-state"},"State:"),h("verdocs-select-input",{options:STATE_OPTIONS,value:(r=this.updatedRecipient)===null||r===void 0?void 0:r.state,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{state:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-zip"},"Zip Code:",h("span",{class:"required"},"*")),h("input",{type:"text",id:"verdocs-kba-zip",name:"verdocs-kba-zip",placeholder:"Zip Code...",required:true,value:(u=this.updatedRecipient)===null||u===void 0?void 0:u.zip,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{zip:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:"verdocs-kba-ssn"},"SSN Last 4:",h("span",{class:"required"},"*")),h("input",{type:"text",id:"verdocs-kba-ssn",name:"verdocs-kba-ssn",placeholder:"Last 4 digits of your Social Security Number...",required:true,value:(a=this.updatedRecipient)===null||a===void 0?void 0:a.ssn_last_4,onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{ssn_last_4:i.target.value})}})),h("div",{class:"field"},h("label",{htmlFor:this.dobContainerId},"Date of Birth:",h("span",{class:"required"},"*")),h("input",{type:"text",value:((o=this.updatedRecipient)===null||o===void 0?void 0:o.dob)||"",id:this.dobContainerId,placeholder:"DOB...",onInput:function(i){return t.updatedRecipient=__assign(__assign({},t.updatedRecipient),{dob:i.target.value})}})),h("div",{class:"field"},h("label",null),h("verdocs-checkbox",{id:"verdocs-kba-agree",name:"verdocs-kba-agree",checked:this.agreed,onInput:function(i){return t.agreed=i.target.checked}}),h("span",null,"I agree to provide my personal information in order to validate my identity.")),h("div",{class:"buttons"},h("verdocs-button",{label:"Submit",onClick:function(){return t.handleConfirmID()},disabled:!this.agreed||!((l=this.updatedRecipient)===null||l===void 0?void 0:l.first_name)||!((f=this.updatedRecipient)===null||f===void 0?void 0:f.last_name)||!((c=this.updatedRecipient)===null||c===void 0?void 0:c.address)||!((d=this.updatedRecipient)===null||d===void 0?void 0:d.zip)||!((v=this.updatedRecipient)===null||v===void 0?void 0:v.ssn_last_4)||!((b=this.updatedRecipient)===null||b===void 0?void 0:b.dob)})))))}return h(Host,null,h("div",{class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{class:"dialog"},h("div",{class:"heading"},"Please Confirm Your Identity",this.steps>1?h("span",{class:"step"},"(",this.step,"/",this.steps,")"):h(Fragment,null)),!!this.helptitle&&h("div",{class:"help-box"},h("div",{class:"help-icon",innerHTML:QuestionIcon$1}),h("div",{class:"help-details"},h("div",{class:"help-title"},this.helptitle),h("div",{class:"help-text"},this.helptext))),h("div",{class:"input"},h("label",{htmlFor:"verdocs-kba-input"},this.label),h("input",{type:"text",id:"verdocs-kba-input",name:"verdocs-kba-input",placeholder:this.placeholder,value:this.response,onInput:function(i){return t.response=i.target.value}})),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return t.handleCancel()}}),h("verdocs-button",{label:"Submit",onClick:function(){return t.handleDone()},disabled:!this.response})))))};return t}();VerdocsKbaDialog.style=verdocsKbaDialogCss;var verdocsOtpDialogCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-otp-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-otp-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:10px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-otp-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-otp-dialog .step{margin-left:6px;color:#666}verdocs-otp-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-otp-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-otp-dialog .help-icon{width:40px;height:40px}verdocs-otp-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-otp-dialog .help-text{font-weight:400}verdocs-otp-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-otp-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-otp-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-otp-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-otp-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-otp-dialog .field label{-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-otp-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-otp-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-otp-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-otp-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;font-size:14px;padding:0 5px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-otp-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-otp-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-otp-dialog .buttons verdocs-button{margin-left:16px}';var QuestionIcon='<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>';var VerdocsOtpDialog=function(){function t(t){registerInstance(this,t);this.exit=createEvent(this,"exit");this.next=createEvent(this,"next");this.resendTimeout=null;this.endpoint=DefaultEndpoint;this.method="email";this.recipient=null;this.resendDisabled=true;this.response=""}t.prototype.componentDidLoad=function(){var t=this;this.startResendTimeout();setTimeout((function(){verifySigner(t.endpoint,{auth_method:t.method,code:"",resend:true}).then((function(i){console.log("Resend result",i);t.response=""})).catch((function(t){return console.log("Error resending code",t)}))}),1e3)};t.prototype.disconnectedCallback=function(){if(this.resendTimeout){clearTimeout(this.resendTimeout);this.resendTimeout=null}};t.prototype.handleCancel=function(){this.exit.emit()};t.prototype.handleDismiss=function(t){if(t.target.class==="background-overlay"){t.preventDefault();this.handleCancel()}};t.prototype.startResendTimeout=function(){var t=this;this.resendDisabled=true;if(this.resendTimeout){clearTimeout(this.resendTimeout)}this.resendTimeout=setTimeout((function(){t.resendDisabled=false}),3e4)};t.prototype.handleResend=function(){var t=this;this.startResendTimeout();verifySigner(this.endpoint,{auth_method:this.method,code:"",resend:true}).then((function(i){console.log("Resend result",i);t.response="";VerdocsToast("A new code has been sent.")})).catch((function(t){return console.log("Error resending code",t)}))};t.prototype.handleSubmit=function(){var t=this;this.startResendTimeout();verifySigner(this.endpoint,{auth_method:this.method,code:this.response}).then((function(i){console.log("Verification completed",i);t.next.emit({response:i});VerdocsToast("Thank you. Your verification was successful.")})).catch((function(t){VerdocsToast("Invalid verification code. Please try again.");console.log("Invalid code",t)}));this.response=""};t.prototype.render=function(){var t=this;return h(Host,{key:"e9936d57ff961236f26620800e7f315a715b50a0"},h("div",{key:"1db7981fcf3fde1a8999fbe7bf122cc0169011bc",class:"background-overlay",onClick:function(i){return t.handleDismiss(i)}},h("div",{key:"8ef5993c5bcf1ac08abbcdda589530413c58bbdc",class:"dialog"},h("div",{key:"360f24b0eb2eb4a34d08080f36a1ee5a2aaa4774",class:"heading"},"Verification Required"),h("div",{key:"6d34ca6bf6ad50c39bb813c64b3acb7a4ee81c02",class:"help-box"},h("div",{key:"7b3afd68c4a705bc83f889ed3709ff51dd40758c",class:"help-icon",innerHTML:QuestionIcon}),h("div",{key:"34a04301351ce588ebf2f4cca678152e1486941a",class:"help-details"},h("div",{key:"bc9c4bc2ca0b6db46485c2f22b329cf25ffb97af",class:"help-title"},"Please verify your email address"),h("div",{key:"a45508806c35bb2d7d44d5a83e289dadb6584c84",class:"help-text"},"Check your email for a one-time code, and enter it below."))),h("div",{key:"8ca152850009203189a9a73c18f320989c97c741",class:"input"},h("label",{key:"4f6f6dcfd0502c69bab6c2fb7f319bcbf84645b6",htmlFor:"verdocs-otp-input"},"Code:"),h("input",{key:"6b859b0e73afe9963d6934d5b7efa921daf1c547",type:"text",id:"verdocs-otp-input",name:"verdocs-otp-input",placeholder:"Enter your one-time code...",value:this.response,onInput:function(i){return t.response=i.target.value}})),h("div",{key:"0d7f1f45563bd2a1f891efa639addf2eb62d5591",class:"buttons"},h("verdocs-button",{key:"55f8bb22817142e371420e0a5c15f133779fd6c9",label:"Cancel",variant:"outline",onClick:function(){return t.handleCancel()}}),h("verdocs-button",{key:"8ebbcc0fcd384a2600f92aeb8c832d46804185a4",label:"Resend",onClick:function(){return t.handleResend()},disabled:this.resendDisabled}),h("verdocs-button",{key:"af1bf5d46d21011fd13c0ad2c4af693c11ad2fe0",label:"Submit",onClick:function(){return t.handleSubmit()},disabled:!this.response})))))};return t}();VerdocsOtpDialog.style=verdocsOtpDialogCss;var verdocsViewCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;min-height:600px;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .document{-ms-flex:1;flex:1;width:100%;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;max-width:1200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view .document .inner{width:100%;max-width:1028px}verdocs-view .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}#verdocs-view-header{width:100%;color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 20px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}@media all and (max-width: 500px){#verdocs-view-header{padding:0 10px}}#verdocs-view-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media all and (max-width: 500px){#verdocs-view-header .inner{padding:0 10px}}#verdocs-view-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-view-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';var VerdocsView=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError");this.envelopeUpdated=createEvent(this,"envelopeUpdated");this.another=createEvent(this,"another");this.view=createEvent(this,"view");this.next=createEvent(this,"next");this.envelopeListenerId=null;this.endpoint=null;this.envelopeId="";this.headerTargetId=null;this.canceling=false;this.showCancelDone=false;this.showLoadError=false;this.loading=true;this.envelope=null}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n,s;return __generator(this,(function(r){switch(r.label){case 0:if(!this.endpoint){this.endpoint=VerdocsEndpoint.getDefault();this.endpoint.loadSession()}if(!this.envelopeId){console.error("[VIEW] Missing required envelopeId");return[2]}this.listenToEnvelope();if(!!this.envelope)return[3,4];r.label=1;case 1:r.trys.push([1,3,,4]);console.log("[VIEW] Loading envelope...");n=this;return[4,getEnvelope(this.endpoint,this.envelopeId)];case 2:n.envelope=r.sent();console.log("[VIEW] Loaded envelope",this.envelope);return[3,4];case 3:s=r.sent();this.showLoadError=true;(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(e=s.response)===null||e===void 0?void 0:e.data));return[3,4];case 4:return[2]}}))}))};t.prototype.componentDidRender=function(){var t=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-view-header");if(t&&i){console.log("[VIEW] Moving header");i.remove();t.append(i)}};t.prototype.disconnectedCallback=function(){this.unlistenToEnvelope()};t.prototype.listenToEnvelope=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();Store.subscribe("envelopes",this.envelopeId,(function(){return getEnvelope(t.endpoint,t.envelopeId)}),true,(function(i){t.envelope=i;t.loading=false}));return[2]}))}))};t.prototype.unlistenToEnvelope=function(){if(this.envelopeListenerId){Store.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}};t.prototype.handlePageRendered=function(t){};t.prototype.handleOptionSelected=function(t){return __awaiter(this,void 0,void 0,(function(){var i,e,n,s,r,u,r;var a=this;return __generator(this,(function(o){switch(o.label){case 0:n=t.detail.id;switch(n){case"cancel":return[3,1];case"print":return[3,2];case"download-attachments":return[3,3];case"download-certificate":return[3,6];case"download-all":return[3,9]}return[3,10];case 1:if(confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")){this.canceling=true;cancelEnvelope(this.endpoint,this.envelopeId).then((function(t){a.canceling=false;console.log("[VIEW] Envelope canceled",t);return getEnvelope(a.endpoint,a.envelopeId)})).then((function(t){console.log("[VIEW] Loaded new envelope details",t);a.envelope=t})).catch((function(t){var i,e,n;a.canceling=false;console.log("[VIEW] Error canceling envelope",t);(i=a.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(e=t.response)===null||e===void 0?void 0:e.status,(n=t.response)===null||n===void 0?void 0:n.data))}));this.showCancelDone=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"})}return[3,10];case 2:window.print();(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,10];case 3:s=this.envelope.documents.find((function(t){return t.type==="attachment"}));if(!s)return[3,5];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,s.id)];case 4:r=o.sent();window.open(r,"_blank");o.label=5;case 5:return[3,10];case 6:u=this.envelope.documents.find((function(t){return t.type==="certificate"}));if(!u)return[3,8];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,u.id)];case 7:r=o.sent();window.open(r,"_blank");o.label=8;case 8:return[3,10];case 9:saveEnvelopesAsZip(this.endpoint,[this.envelope]).then((function(){var t;(t=a.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:a.endpoint,envelope:a.envelope,event:"downloaded"})})).catch((function(t){console.log("Error downloading Zip",t)}));return[3,10];case 10:return[2]}}))}))};t.prototype.render=function(){var t=this;var i;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to View Envelope",message:"Sorry, that envelope is not valid.",buttonLabel:"OK",onNext:function(){t.showLoadError=false}}))}if(!this.envelope){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"}))}var e=[{id:"print",label:"Print"}];if(userCanCancelEnvelope(this.endpoint.profile,this.envelope)){e.push({id:"cancel",label:"Cancel"})}var n=this.envelope.documents.length>0;var s=this.envelope.documents.filter((function(t){return t.type==="attachment"})).length;var r=this.envelope.documents.find((function(t){return t.type==="certificate"}))!==undefined;if(n||r){e.push({label:""});if(n){e.push({id:"download-attachments",label:s>1?"Download Documents":"Download Document"})}if(r){e.push({id:"download-certificate",label:"Download Certificate"})}if(n&&r){e.push({id:"download-all",label:"Download All Files"})}}return h(Host,null,h("div",{id:"verdocs-view-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:e,onOptionSelected:function(i){return t.handleOptionSelected(i)}}))),h("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(((i=this.envelope)===null||i===void 0?void 0:i.documents)||[]).filter((function(t){return t.type!=="certificate"})).map((function(i){var e=integerSequence(1,i.pages);return h(Fragment,null,e.map((function(e){var n;var s=((n=i.page_sizes)===null||n===void 0?void 0:n[e])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:t.envelopeId,documentId:i.id,endpoint:t.endpoint,type:"filled",virtualWidth:s.width,virtualHeight:s.height,pageNumber:e,onPageRendered:function(i){return t.handlePageRendered(i)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showCancelDone&&h("verdocs-ok-dialog",{heading:"Cancelled",message:"This envelope has been cancelled successfully.",onNext:function(){t.showCancelDone=false}}),this.canceling&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))};Object.defineProperty(t.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();VerdocsView.style=verdocsViewCss;export{VerdocsKbaDialog as verdocs_kba_dialog,VerdocsOtpDialog as verdocs_otp_dialog,VerdocsView as verdocs_view};
|
2
2
|
//# sourceMappingURL=verdocs-kba-dialog_3.entry.js.map
|