@verdocs/web-sdk 5.0.46 → 5.0.48
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/Environment-241c5659.js +13 -0
- package/dist/cjs/Environment-241c5659.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +8 -10
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +3688 -3
- package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-radio-button.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/controls/verdocs-radio-button/verdocs-radio-button.css +2 -2
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.js +91 -3
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +5 -4
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +4 -3
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +6 -8
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.css +2 -2
- package/dist/collection/utils/Environment.js +6 -0
- package/dist/collection/utils/Environment.js.map +1 -0
- package/dist/collection/utils/Unleash.js +1 -1
- package/dist/collection/utils/Unleash.js.map +1 -1
- package/dist/components/{p-ccbd93c3.js → p-01c8196b.js} +8 -10
- package/dist/components/p-01c8196b.js.map +1 -0
- package/dist/components/p-0aad02d5.js +10 -0
- package/dist/components/p-0aad02d5.js.map +1 -0
- package/dist/components/{p-81e52989.js → p-162ae711.js} +2 -2
- package/dist/components/{p-81e52989.js.map → p-162ae711.js.map} +1 -1
- package/dist/components/{p-a808fcb1.js → p-4fb8b22d.js} +6 -5
- package/dist/components/p-4fb8b22d.js.map +1 -0
- package/dist/components/{p-0a14020a.js → p-956fb355.js} +3 -3
- package/dist/components/{p-0a14020a.js.map → p-956fb355.js.map} +1 -1
- package/dist/components/{p-b9ec1278.js → p-968df95c.js} +3 -3
- package/dist/components/{p-b9ec1278.js.map → p-968df95c.js.map} +1 -1
- package/dist/components/p-c5fc58ab.js +3835 -0
- package/dist/components/p-c5fc58ab.js.map +1 -0
- package/dist/components/{p-bfa07825.js → p-c83a272f.js} +2 -2
- package/dist/components/{p-bfa07825.js.map → p-c83a272f.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-field-radio.js +1 -1
- package/dist/components/verdocs-kba-dialog.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-radio-button.js +1 -1
- package/dist/components/verdocs-radio-button.js.map +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +24 -17
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/esm/Environment-3a31549a.js +10 -0
- package/dist/esm/Environment-3a31549a.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-contact-picker_2.entry.js +7 -9
- package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm/verdocs-kba-dialog_2.entry.js +3688 -3
- package/dist/esm/verdocs-kba-dialog_2.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +3 -2
- package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm/verdocs-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-radio-button.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +2 -1
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Environment-3a31549a.js +2 -0
- package/dist/esm-es5/Environment-3a31549a.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +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_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-kba-dialog_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +2 -2
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-radio-button.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.d.ts +2 -2
- package/dist/types/utils/Environment.d.ts +5 -0
- package/dist/verdocs-web-sdk/p-05a1dce1.system.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-05a1dce1.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-0aad02d5.js +2 -0
- package/dist/verdocs-web-sdk/p-0aad02d5.js.map +1 -0
- package/dist/verdocs-web-sdk/p-0c1898f6.system.js +1 -1
- package/dist/verdocs-web-sdk/p-245bdf6f.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-46263e7a.system.entry.js.map → p-245bdf6f.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-9a19e851.entry.js → p-35384b77.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9a19e851.entry.js.map → p-35384b77.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-3fc80e05.entry.js → p-4c5b836b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-3fc80e05.entry.js.map → p-4c5b836b.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-9ccbbb22.system.entry.js → p-4f16d741.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9ccbbb22.system.entry.js.map → p-4f16d741.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-f6bf7e6a.system.entry.js → p-5239a35e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f6bf7e6a.system.entry.js.map → p-5239a35e.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-6074b40b.system.js +2 -0
- package/dist/verdocs-web-sdk/p-6074b40b.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-8ed58724.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-8ed58724.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b17b12c5.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b17b12c5.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b198c703.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b198c703.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d33c2b26.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-d33c2b26.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-dad790a1.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-dad790a1.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-dcf0049c.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-d47c58de.entry.js.map → p-dcf0049c.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +6 -5
- package/dist/components/p-a808fcb1.js.map +0 -1
- package/dist/components/p-b4eee1ed.js +0 -144
- package/dist/components/p-b4eee1ed.js.map +0 -1
- package/dist/components/p-ccbd93c3.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1f8bd27c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1f8bd27c.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-41c60a2e.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-41c60a2e.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-66ca774d.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-66ca774d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7a2fbc8a.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-7a2fbc8a.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-89c69404.system.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-89c69404.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d47c58de.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e8268ed9.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-e8268ed9.entry.js.map +0 -1
@@ -0,0 +1,2 @@
|
|
1
|
+
System.register(["@verdocs/js-sdk"],(function(t){"use strict";var s;return{setters:[function(t){s=t.VerdocsEndpoint}],execute:function(){var o=t("B",["https://beta.verdocs.com","https://stage.verdocs.com","http://localhost:6006","http://localhost:5173"]);var c=o.includes(window.location.origin);var e=c?"https://stage-api.verdocs.com":"https://api.verdocs.com";var r=t("D",s.getDefault().setBaseURL(e))}}}));
|
2
|
+
//# sourceMappingURL=p-6074b40b.system.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["BETA_ORIGINS","exports","IS_BETA","includes","window","location","origin","API_URL","DefaultEndpoint","VerdocsEndpoint","getDefault","setBaseURL"],"sources":["src/utils/Environment.ts"],"sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\n\nexport const BETA_ORIGINS = ['https://beta.verdocs.com', 'https://stage.verdocs.com', 'http://localhost:6006', 'http://localhost:5173'];\n\nexport const IS_BETA = BETA_ORIGINS.includes(window.location.origin);\n\nexport const API_URL = IS_BETA ? 'https://stage-api.verdocs.com' : 'https://api.verdocs.com';\n\nexport const DefaultEndpoint = VerdocsEndpoint.getDefault().setBaseURL(API_URL);\n"],"mappings":"6IAEaA,EAAYC,EAAA,IAAG,CAAC,2BAA4B,4BAA6B,wBAAyB,0BAExG,IAAMC,EAAUF,EAAaG,SAASC,OAAOC,SAASC,QAEtD,IAAMC,EAAUL,EAAU,gCAAkC,0B,IAEtDM,EAAeP,EAAA,IAAGQ,EAAgBC,aAAaC,WAAWJ,G","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,c as i,h as t,H as s,F as o}from"./p-ddadabfb.js";import{VerdocsEndpoint as n,startSigningSession as a,envelopeRecipientAgree as l,envelopeRecipientDecline as r,updateEnvelopeField as d,createSignature as c,updateEnvelopeFieldSignature as h,createInitials as p,updateEnvelopeFieldInitials as u,isValidPhone as g,isValidEmail as v,sortFields as f,envelopeRecipientSubmit as m,getEnvelope as x,uploadEnvelopeFieldAttachment as b,deleteEnvelopeFieldAttachment as y,formatFullName as w,fullNameToInitials as k,authenticateSigner as S,integerSequence as N}from"@verdocs/js-sdk";import{a as I,u as G,r as z,g as F}from"./p-0c45b79c.js";import{D as P}from"./p-0aad02d5.js";import{V as D}from"./p-04c07b7b.js";import{S as T}from"./p-fd97809c.js";import{S as E}from"./p-33300e3a.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const j='@-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-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-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-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;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-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .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-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:50%;width:50%;font-size:16px;background:white;border-radius:5px;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;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)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';const R=j;const A=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const L=[{id:"print",label:"Print"},{id:"download",label:"Download"}];const U=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.endpoint=P;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.authStep=null;this.authDetails=null;this.authMethodStates={};this.kbaQuestions=[];this.showSpinner=false;this.kbaChoices=[];this.loading=true;this.envelope=null}componentWillLoad(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new n({sessionType:"signing"})}}async componentDidLoad(){var e,i,t,s,o,n,l;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new T("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new T("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{envelope:e,recipient:i,auth_step:t,auth_details:o}=await a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);console.log(`[SIGN] Loaded signing session`,e,i);this.recipient=i;this.envelope=e;this.authStep=t;this.authDetails=o;this.agreed=i.agreed;this.submitted=i.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;E.updateEnvelope(this.envelopeId,e);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=i.auth_method_states||{};if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(i.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope})}catch(e){console.log("[SIGN] Error with signing session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new T(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(l=e.response)===null||l===void 0?void 0:l.data));this.showLoadError=true}}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}}handleClickAgree(){this.submitting=true;l(this.endpoint,this.envelopeId,this.roleId,true).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Update failure",e);this.submitting=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,o,n;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":D("This feature will be available in an upcoming release.");(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=true;const e=await r(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Decline result",e);(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified."}break;case"print":window.print();(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>e.type==="attachment"));if(e){I(this.endpoint,this.envelope,e.id).catch((e=>{console.log("[SIGN] Error downloading PDF",e)}));(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}break}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e,i);this.getRecipientFields().forEach((t=>{if(t.name===e){t.value=i.value;t.settings=i.settings;G(t);this.checkRecipientFields()}}))}saveFieldChange(e,i){console.log("[SIGN] saveFieldChange",e,i);d(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new T(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"radio":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"dropdown":console.log("Saving dropdown",e.name,i.detail);return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":if(!i.detail){return}this.showSpinner=true;const o=await(await fetch(i.detail)).blob();return p(this.endpoint,"initial",o).then((async i=>{const t=await u(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);this.showSpinner=false}));case"signature":if(!i.detail){return}this.showSpinner=true;const n=await(await fetch(i.detail)).blob();return c(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await h(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);this.showSpinner=false}));case"date":const{formattedDate:a}=i.detail;if(a){return this.saveFieldChange(e.name,{prepared:false,value:a})}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e);break}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return v(i);case"phone":return g(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>e.value==="true"))}return e.value==="true";default:return false}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));f(e);return e}async handleNext(){var e;if(this.nextSubmits){try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const i=await m(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");x(this.endpoint,this.envelopeId).then((e=>{this.envelope=e;this.submitting=false})).catch((e=>{console.log("[SIGN] Error reloading envelope",e);this.submitting=false}))}catch(e){console.log("[SIGN] Error submitting",e)}return}const i=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldFilled(e)));f(i);const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let o=i[s];let n=0;if(n<i.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){n++;s++;if(s>=i.length){s=0}o=i[s]}if(n>=i.length){o=null}if(o){const e=F(o);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth"});i===null||i===void 0?void 0:i.focusField();this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",e.map((e=>e.name)));this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t){if(t.getAttribute("attached")==="1"){return}t.setAttribute("attached","1");t.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));t.addEventListener("attached",(async t=>{console.log("[SIGN] onAttached",t.detail,t.target.value);this.showSpinner=true;try{const s=await b(this.endpoint,this.envelopeId,i.name,t.detail);this.updateRecipientFieldValue(i.name,s);this.checkRecipientFields();const o=z("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,o);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);D("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("deleted",(async t=>{console.log("[SIGN] onDeleted",t.detail,t.target.value);this.showSpinner=true;try{const t=await y(this.endpoint,this.envelopeId,i.name);console.log("[SIGN] Deleted attachment",t);this.updateRecipientFieldValue(i.name,t);this.checkRecipientFields();const s=z("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,s);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);D("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("focusout",(e=>{if(i.type!=="dropdown"&&i.type!=="attachment"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}}));t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);const s=w(this.recipient);t.setAttribute("initials",k(s));t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail;const t=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,t);t.forEach(((e,t)=>{if(e.page!==i.pageNumber){return}const s=z("envelope",e,i,{disabled:false,editable:false,draggable:false,done:this.isDone},t);if(!s){return}if(Array.isArray(s)){s.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=z("envelope",e,i,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!t){return}if(Array.isArray(t)){t.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,t)}}))}));this.checkRecipientFields()}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);S(this.endpoint,e).then((e=>{console.log("[SIGN] Authentication successful",e);this.authStep=e.auth_step;this.authDetails=e.auth_details})).catch((e=>{var i,t,s,o,n;console.log("[SIGN] Error submitting authentication step",e);if((s=(t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||s===void 0?void 0:s.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{D(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}render(){console.log("[SIGN] Rendering",{authStep:this.authStep});if(this.showLoadError){return t(s,null,t("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`,buttonLabel:"OK",onNext:()=>{window.location.reload()}}))}if(!this.envelope){return t(s,null,t("verdocs-loader",null))}if(this.fatalErrorMessage){return t(s,{class:{agreed:this.agreed}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},this.fatalErrorHeader),t("p",null,this.fatalErrorMessage))))}if(this.isDone){return t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:e=>{e.preventDefault();e.stopPropagation();this.showDone=false;this.isDone=true}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)))}if(!this.agreed){return t(s,{class:"agreed"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:()=>this.handleClickAgree()}),t("ul",null,t("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",t("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),t("li",null,"Agree to Verdocs'"," ",t("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",t("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))}if(this.authStep==="passcode"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,placeholder:"Enter your passcode...",helptitle:"Document is protected by a Passcode",helptext:"Please enter your Passcode to proceed. If you do not have one, please contact the sender.",label:"Passcode",onNext:e=>this.handleAuthenticateSigner({auth_method:"passcode",code:e.detail})}))))}if(this.authStep==="kba"&&!this.authMethodStates.kba){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const i=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:i.first_name,last_name:i.last_name,address:i.address,city:i.city,state:i.state,zip:i.zip,dob:i.dob})}}))))}return t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?A:L,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=N(1,e.pages);return t(o,null,i.map((i=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=false}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=false;this.isDone=true}}),this.submitting||this.showSpinner&&t("verdocs-portal",null,t("div",{class:"spinner-overlay"},t("verdocs-spinner",null))))}};U.style=R;export{U as verdocs_sign};
|
2
|
+
//# sourceMappingURL=p-8ed58724.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["verdocsSignCss","VerdocsSignStyle0","inProgressMenuOptions","id","label","doneMenuOptions","VerdocsSign","constructor","hostRef","this","endpoint","DefaultEndpoint","envelopeId","roleId","inviteCode","headerTargetId","recipient","hasSignature","nextButtonLabel","nextSubmits","fatalErrorHeader","fatalErrorMessage","focusedField","submitting","submitted","isDone","showDone","showLoadError","finishLater","showFinishLater","agreed","documentsSingularPlural","authStep","authDetails","authMethodStates","kbaQuestions","showSpinner","kbaChoices","loading","envelope","componentWillLoad","console","log","VerdocsEndpoint","sessionType","componentDidLoad","_a","sdkError","emit","SDKError","_b","_c","auth_step","auth_details","startSigningSession","status","Store","updateEnvelope","documents","length","auth_method_states","Object","values","includes","checkRecipientFields","_d","envelopeLoaded","e","_e","message","_f","response","_g","data","componentDidRender","headerTarget","document","getElementById","headerEl","remove","append","handleClickAgree","envelopeRecipientAgree","then","envelopeUpdated","event","catch","handleOptionSelected","detail","VerdocsToast","declineResult","envelopeRecipientDecline","window","print","firstDoc","find","doc","type","saveAttachment","updateRecipientFieldValue","fieldName","updateResult","getRecipientFields","forEach","oldField","name","value","settings","updateDocumentFieldValue","saveFieldChange","fields","updateEnvelopeField","error","handleFieldChange","field","checked","target","prepared","String","initialsBlob","fetch","blob","createInitials","async","newInitials","updateEnvelopeFieldInitials","signatureBlob","createSignature","newSignature","updateEnvelopeFieldSignature","warn","formattedDate","ts","getAttribute","isFieldFilled","validator","isValidEmail","isValidPhone","trim","group","filter","f","some","isFieldValid","required","getSortedFillableFields","recipientFields","sortFields","handleNext","result","envelopeRecipientSubmit","getEnvelope","emptyFields","focusedIndex","findIndex","nextFocusedIndex","nextRequiredField","skips","getFieldId","el","scrollIntoView","behavior","focusField","role_name","invalidFields","map","attachFieldAttributes","pageInfo","setAttribute","addEventListener","finally","uploadEnvelopeFieldAttachment","newEl","renderDocumentField","disabled","editable","draggable","done","style","deleteEnvelopeFieldAttachment","template_id","pageNumber","xScale","yScale","fullName","formatFullName","fullNameToInitials","handlePageRendered","tabIndex","page","Array","isArray","recipients","r","handleAuthenticateSigner","params","authenticateSigner","render","h","Host","heading","buttonLabel","onNext","location","reload","class","onSdkError","preventDefault","stopPropagation","src","alt","paddingTop","width","height","boxShadow","marginTop","onInput","href","mode","step","steps","placeholder","helptitle","helptext","auth_method","code","kba","recipDetails","first_name","last_name","address","city","state","zip","dob","flex","size","onClick","marginLeft","options","onOptionSelected","envelopeDocument","pageNumbers","integerSequence","pages","Fragment","pageSize","page_sizes","documentId","virtualWidth","virtualHeight","onPageRendered","layers"],"sources":["src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n //.intro {\n // width: 100%;\n // display: flex;\n // flex: 0 0 60px;\n // color: #111111;\n // font-size: 18px;\n // font-weight: 500;\n // line-height: 28px;\n // flex-direction: row;\n // background: #ffffff;\n //\n // .inner {\n // width: 100%;\n // display: flex;\n // margin: 0 auto;\n // padding: 0 20px;\n // max-width: 1200px;\n // flex-direction: row;\n // align-items: center;\n // }\n //}\n\n > .document {\n flex: 1;\n width: 100%;\n height: 100%;\n align-self: center;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n max-width: 1200px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n //justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 5000;\n position: absolute;\n padding-top: 100px;\n align-items: center;\n flex-direction: column;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .agree {\n flex: 0;\n width: 600px;\n display: flex;\n max-width: 90%;\n padding: 30px 15px;\n flex-direction: column;\n background-color: #ffffff;\n\n .header {\n flex: 0 0 56px;\n }\n\n li {\n margin: 0.5em 0;\n }\n }\n\n verdocs-ok-dialog .background-overlay {\n align-items: flex-start;\n padding-top: 100px;\n }\n\n .loading-indicator {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 10000;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.7);\n }\n\n .fatal-error {\n position: absolute;\n z-index: 100;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #4a4a4a;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .placeholder {\n position: absolute;\n opacity: 0.1;\n z-index: -1;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n margin-top: 15px;\n }\n\n .message {\n max-width: 50%;\n width: 50%;\n font-size: 16px;\n background: white;\n border-radius: 5px;\n box-shadow: 3px 3px 9px -1px #0000003f;\n }\n\n .header {\n color: white;\n font-size: 18px;\n font-weight: 500;\n padding: 5px 10px;\n margin: 0 0 10px 0;\n background: $verdocs-purple-shade;\n }\n\n p {\n margin: 1rem;\n font-size: 14px;\n font-weight: 400;\n padding: 0 10px;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n\n#verdocs-sign-header {\n color: #fff;\n width: 100%;\n display: flex;\n z-index: 1000;\n flex: 0 0 46px;\n font-size: 12px;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow:\n 0 4px 4px 0 rgb(0 0 0 / 24%),\n 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n display: flex;\n margin: 0 auto;\n padding: 0 12px;\n max-width: 1200px;\n align-items: center;\n flex-direction: row;\n }\n\n .logo {\n width: 80px;\n display: none;\n margin: -6px 0 0 0;\n }\n\n .title {\n font-size: 18px;\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n padding: 0 10px 0 0;\n text-overflow: ellipsis;\n }\n}\n\n.spinner-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n background: #0000007f;\n justify-content: center;\n}\n","import {updateEnvelopeField, sortFields} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {getEnvelope, integerSequence, isValidEmail, isValidPhone, updateEnvelopeFieldInitials} from '@verdocs/js-sdk';\nimport {fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment, formatFullName} from '@verdocs/js-sdk';\nimport {authenticateSigner, IEnvelope, IEnvelopeField, IRecipient, TAuthenticateRecipientRequest} from '@verdocs/js-sdk';\nimport {updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint, TRecipientAuthMethod} from '@verdocs/js-sdk';\nimport {createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit} from '@verdocs/js-sdk';\nimport {getFieldId, renderDocumentField, saveAttachment, updateDocumentFieldValue} from '../../../utils/utils';\nimport {DefaultEndpoint} from '../../../utils/Environment';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst inProgressMenuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing'},\n {id: 'download', label: 'Download'},\n];\n\nconst doneMenuOptions = [\n {id: 'print', label: 'Print'},\n {id: 'download', label: 'Download'},\n];\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop({mutable: true}) endpoint: VerdocsEndpoint = DefaultEndpoint;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop({reflect: true}) envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop({reflect: true}) roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop({reflect: true}) inviteCode: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the header will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects (e.g. \"fixed\").\n *\n * The movement of the header to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the header's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() headerTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n // @State() roleNames: string[] = [];\n // @State() sortedRecipients: IRecipient[] = [];\n @State() recipient: IRecipient | null = null;\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() fatalErrorHeader = '';\n @State() fatalErrorMessage = '';\n @State() focusedField = '';\n @State() submitting = false;\n @State() submitted = false;\n @State() isDone = false;\n @State() showDone = false;\n @State() showLoadError = false;\n @State() finishLater = false;\n @State() showFinishLater = false;\n @State() agreed = false;\n @State() documentsSingularPlural = 'document';\n @State() authStep: string | null = null;\n @State() authDetails: any = null;\n @State() authMethodStates: Partial<Record<TRecipientAuthMethod, string>> = {};\n @State() kbaQuestions: any[] = [];\n @State() showSpinner = false;\n @State() kbaChoices = [];\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n // recipientIndex: number = -1;\n\n componentWillLoad() {\n if (!this.endpoint) {\n console.log('[SIGN] Creating signing endpoint');\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n\n // NOTE: We don't listen to the store here because we are often an independent\n // session and might have a different \"view\" of the envelope.\n const {envelope, recipient, auth_step, auth_details} = await startSigningSession(this.endpoint, this.envelopeId, this.roleId, this.inviteCode);\n console.log(`[SIGN] Loaded signing session`, envelope, recipient);\n this.recipient = recipient;\n this.envelope = envelope;\n this.authStep = auth_step;\n this.authDetails = auth_details;\n this.agreed = recipient.agreed;\n this.submitted = recipient.status === 'submitted';\n this.isDone = this.submitted;\n this.showDone = this.submitted;\n\n Store.updateEnvelope(this.envelopeId, envelope);\n\n if (this.envelope.documents.length > 0) {\n this.documentsSingularPlural = 'document(s)';\n }\n\n this.authMethodStates = recipient.auth_method_states || ({} as Record<TRecipientAuthMethod, string>);\n if (Object.values(this.authMethodStates).includes('failed')) {\n this.fatalErrorHeader = 'Recipient Verification Failed';\n this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';\n this.isDone = true;\n }\n\n // TODO: Envelope \"complete\" | \"declined\" | \"canceled\"\n // TODO: Recipient \"canceled\"\n\n if (this.envelope.status === 'canceled') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'This envelope has been canceled. The sender has been notified.';\n } else if (recipient.status === 'declined') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'You have declined to sign this envelope. The sender has been notified.';\n } else if (this.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n this.checkRecipientFields();\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: this.envelope});\n } catch (e) {\n console.log('[SIGN] Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n this.showLoadError = true;\n }\n }\n\n componentDidRender() {\n const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;\n const headerEl = document.getElementById('verdocs-sign-header');\n if (headerTarget && headerEl) {\n console.log('[SIGN] Moving header');\n headerEl.remove();\n headerTarget.append(headerEl);\n }\n }\n\n handleClickAgree() {\n this.submitting = true;\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(() => {\n this.nextButtonLabel = 'Next';\n this.recipient.agreed = true;\n this.submitting = false;\n this.agreed = true; // The server returns a recipient object but it's not \"deep\" so we track this locally\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('[SIGN] Update failure', e);\n this.submitting = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e: any) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'later'});\n break;\n\n case 'claim':\n VerdocsToast('This feature will be available in an upcoming release.');\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'claimed'});\n break;\n\n case 'decline':\n {\n this.submitting = true;\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Decline result', declineResult);\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'declined'});\n this.submitting = false;\n this.fatalErrorHeader = 'Declined';\n this.fatalErrorMessage = 'You have declined to sign this envelope. The sender has been notified.';\n }\n break;\n\n case 'print':\n window.print();\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'printed'});\n break;\n\n case 'download':\n {\n const firstDoc = this.envelope.documents.find(doc => doc.type === 'attachment');\n if (firstDoc) {\n saveAttachment(this.endpoint, this.envelope, firstDoc.id).catch(e => {\n console.log('[SIGN] Error downloading PDF', e);\n });\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n }\n }\n break;\n }\n }\n\n updateRecipientFieldValue(fieldName: string, updateResult: any) {\n console.log('[SIGN] updateRecipientFieldValue', fieldName, updateResult);\n this.getRecipientFields().forEach(oldField => {\n if (oldField.name === fieldName) {\n oldField.value = updateResult.value;\n // TODO: Keeping this while attachments still rely on it\n oldField.settings = updateResult.settings;\n updateDocumentFieldValue(oldField);\n this.checkRecipientFields();\n }\n });\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n console.log('[SIGN] saveFieldChange', fieldName, fields);\n updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .then(updateResult => this.updateRecipientFieldValue(fieldName, updateResult))\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n console.log('[SIGN] Signing session expired');\n this.fatalErrorHeader = 'Signing Session Expired';\n this.fatalErrorMessage = 'Please reload your browser to continue.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IEnvelopeField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type as any) {\n // TODO: Remove legacy type when no longer needed\n case 'textarea':\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'radio': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'dropdown':\n // TODO: Set prepared to false server-side.\n console.log('Saving dropdown', field.name, e.detail);\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(async newInitials => {\n const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.log('Error updating initials', e);\n this.showSpinner = false;\n });\n\n case 'signature':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(async newSignature => {\n console.log('Signature update result', newSignature);\n const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.warn('[SIGN] Error updating signature', e);\n this.showSpinner = false;\n });\n\n case 'date':\n const {formattedDate} = e.detail;\n if (formattedDate) {\n return this.saveFieldChange(field.name, {prepared: false, value: formattedDate});\n }\n break;\n\n case 'timestamp':\n console.log('[SIGN] Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('[SIGN] Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldFilled(field: IEnvelopeField) {\n const {value = ''} = field;\n switch (field.type as any) {\n case 'textarea':\n case 'textbox':\n switch (field.validator || '') {\n case 'email':\n return isValidEmail(value);\n case 'phone':\n return isValidPhone(value);\n default:\n return (value || '').trim() !== '';\n }\n\n case 'signature':\n return value === 'signed';\n\n case 'initial':\n return value === 'initialed';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'date':\n return !!value;\n\n case 'attachment':\n return value === 'attached';\n\n case 'dropdown':\n return value !== '';\n\n case 'checkbox':\n return value === 'true';\n\n case 'radio':\n if (!!field.group) {\n return this.getRecipientFields()\n .filter(f => f.group === field.group)\n .some(field => field.value === 'true');\n }\n\n return field.value === 'true';\n\n default:\n return false;\n }\n }\n\n isFieldValid(field: IEnvelopeField) {\n return !field.required || this.isFieldFilled(field);\n }\n\n getSortedFillableFields() {\n const recipientFields = this.getRecipientFields().filter(field => field.type !== 'timestamp');\n sortFields(recipientFields);\n return recipientFields;\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n // Patches the date picker to be forcibly removed if still showing during submission\n document.getElementById('air-datepicker-global-container')?.remove();\n\n this.submitting = true;\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.recipient.status = 'submitted';\n this.showDone = true;\n console.log('[SIGN] Reloading envelope');\n getEnvelope(this.endpoint, this.envelopeId)\n .then(envelope => {\n this.envelope = envelope;\n // The show-done dialog does this\n // this.isDone = true;\n this.submitting = false;\n })\n .catch(e => {\n // this.isDone = true;\n console.log('[SIGN] Error reloading envelope', e);\n this.submitting = false;\n });\n } catch (e) {\n console.log('[SIGN] Error submitting', e);\n }\n\n return;\n }\n\n // Find and focus the next incomplete field (that is fillable)\n const emptyFields = this.getSortedFillableFields().filter(field => field.required && !this.isFieldFilled(field));\n sortFields(emptyFields);\n\n const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = emptyFields[nextFocusedIndex];\n // console.log('Next field', nextRequiredField, emptyFields);\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ['initialed', 'signed'].includes(nextRequiredField.value)) {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = emptyFields[nextFocusedIndex];\n }\n\n if (skips >= emptyFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.scrollIntoView({behavior: 'smooth'});\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n getRecipientFields() {\n return this.envelope.fields.filter(field => field.role_name === this.recipient.role_name);\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.getRecipientFields().filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n if (!this.nextSubmits) {\n this.nextSubmits = true;\n }\n } else {\n console.log(\n '[SIGN] Invalid fields remaining',\n invalidFields.map(field => field.name),\n );\n this.nextButtonLabel = 'Next';\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, el) {\n // We can get called multiple times as rendering completes and it's hard to avoid that\n // because it's a ton of work for the callers to know it's been done already. But we\n // don't want to attach multiple event listeners or we get dupe event handling, like\n // calling the server twice on every field update. Since JS has no removeAllEventListeners()\n // option, using removeEventListener() isn't reliable the way Stencil binds local function\n // contexts, and cloneNode messes up the rest of the rendering, we just track it with a flag.\n if (el.getAttribute('attached') === '1') {\n return;\n }\n el.setAttribute('attached', '1');\n\n el.addEventListener('input', (e: any) => {\n // console.log('[SIGN] onfieldInput', e.detail, e.target.value);\n // These field types don't emit fieldChange. Should we standardize on that? We don't tap \"input\" for fields like\n // text boxes because we'd be updating the field on every keystroke. We do those on blur which fires fieldChange.\n if (e.target.type === 'radio' || e.target.type === 'checkbox') {\n // if (e.target.type === 'radio' || e.target.name.includes('date') || e.target.name.includes('checkbox')) {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n } else {\n this.checkRecipientFields();\n }\n });\n el.addEventListener('attached', async (e: any) => {\n console.log('[SIGN] onAttached', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await uploadEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name, e.detail);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('deleted', async (e: any) => {\n console.log('[SIGN] onDeleted', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await deleteEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name);\n console.log('[SIGN] Deleted attachment', updateResult);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('focusout', e => {\n // These field types trigger focusout as they're used, even without a value change\n if (field.type !== 'dropdown' && field.type !== 'attachment') {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n }\n });\n el.addEventListener('fieldChange', e => {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n });\n\n el.setAttribute('templateid', this.envelope.template_id);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('page', pageInfo.pageNumber);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n\n const fullName = formatFullName(this.recipient);\n el.setAttribute('initials', fullNameToInitials(fullName));\n el.setAttribute('name', fullName);\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n\n // NOTE: We don't filter on pageNumber here because we need the position in the\n // entire list to set the tabIndex.\n const recipientFields = this.getSortedFillableFields();\n console.log('[SIGN] Rendering fields for page', pageInfo.pageNumber, recipientFields);\n\n // First render the fields for the signer\n recipientFields.forEach((field, tabIndex) => {\n if (field.page !== pageInfo.pageNumber) {\n return;\n }\n\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone}, tabIndex);\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n\n // Now render the fields for other signers who have yet to act\n this.envelope.recipients\n .filter(r => r.role_name !== this.recipient.role_name && (r.status === 'invited' || r.status === 'opened' || r.status === 'pending'))\n .forEach(() => {\n this.getRecipientFields()\n .filter(field => field.page === pageInfo.pageNumber)\n .forEach(field => {\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n });\n\n this.checkRecipientFields();\n }\n\n handleAuthenticateSigner(params: TAuthenticateRecipientRequest) {\n console.log('[SIGN] Submitting authentication step', params);\n authenticateSigner(this.endpoint, params)\n .then(r => {\n console.log('[SIGN] Authentication successful', r);\n this.authStep = r.auth_step;\n this.authDetails = r.auth_details;\n })\n .catch(e => {\n console.log('[SIGN] Error submitting authentication step', e);\n if (e.response?.data?.error?.includes('failed')) {\n this.fatalErrorHeader = 'Recipient Verification Failed';\n this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';\n this.isDone = true;\n } else {\n VerdocsToast(e.response?.data?.error || 'Unable to verify your identity. Please try again.', {style: 'error'});\n }\n });\n }\n\n render() {\n console.log('[SIGN] Rendering', {authStep: this.authStep});\n if (this.showLoadError) {\n return (\n <Host>\n <verdocs-ok-dialog\n heading=\"Unable to Start Signing\"\n message={`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`}\n buttonLabel=\"OK\"\n onNext={() => {\n window.location.reload();\n }}\n />\n </Host>\n );\n }\n\n if (!this.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (this.fatalErrorMessage) {\n return (\n <Host class={{agreed: this.agreed}}>\n <div class=\"fatal-error\">\n <div class=\"message\">\n <div class=\"header\">{this.fatalErrorHeader}</div>\n <p>{this.fatalErrorMessage}</p>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.isDone) {\n return (\n <Host class={{agreed: this.agreed}}>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={(e: any) => {\n e.preventDefault();\n e.stopPropagation();\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting && (\n <div class=\"loading-indicator\">\n <verdocs-loader />\n </div>\n )}\n </Host>\n );\n }\n\n if (!this.agreed) {\n return (\n <Host class=\"agreed\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"By checking this box, you:\" onInput={() => this.handleClickAgree()} />\n <ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the{' '}\n <a href=\"https://verdocs.com/en/electronic-record-signature-disclosure/\" target=\"_blank\">\n Electronic Record and Signatures Disclosure\n </a>\n .\n </li>\n <li>\n Agree to Verdocs'{' '}\n <a href=\"https://verdocs.com/en/eula\" target=\"_blank\">\n End User License Agreement\n </a>{' '}\n and confirm you have read Verdocs'{' '}\n <a href=\"https://verdocs.com/en/privacy-policy/\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </li>\n </ul>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.authStep === 'passcode') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"text\"\n step={1}\n steps={1}\n placeholder=\"Enter your passcode...\"\n helptitle=\"Document is protected by a Passcode\"\n helptext=\"Please enter your Passcode to proceed. If you do not have one, please contact the sender.\"\n label=\"Passcode\"\n onNext={e => this.handleAuthenticateSigner({auth_method: 'passcode', code: e.detail as string})}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.authStep === 'kba' && !this.authMethodStates.kba) {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"identity\"\n helptitle=\"Document requires identity verification\"\n helptext=\"Please complete your contact details to proceed.\"\n recipient={this.recipient}\n onNext={async e => {\n const recipDetails = e.detail as IRecipient;\n this.handleAuthenticateSigner({\n auth_method: 'kba',\n first_name: recipDetails.first_name,\n last_name: recipDetails.last_name,\n address: recipDetails.address,\n city: recipDetails.city,\n state: recipDetails.state,\n zip: recipDetails.zip,\n dob: recipDetails.dob,\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n // if (this.kbaStep === 'challenge') {\n // const questionNumber = this.kbaChoices.length;\n // const kbaQuestion = this.kbaQuestions[questionNumber];\n // return (\n // <Host class=\"kba\">\n // <div id=\"verdocs-sign-header\">\n // <div class=\"inner\">\n // <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n // <div class=\"title\">{this.envelope.name}</div>\n // </div>\n // </div>\n //\n // <div class=\"document\" style={{paddingTop: '15px'}}>\n // <img\n // src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n // style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n // alt=\"Placeholder page\"\n // />\n // </div>\n //\n // <div class=\"cover\">\n // <div class=\"kba\">\n // {this.kbaChoices.length >= this.kbaQuestions.length ? (\n // <verdocs-spinner />\n // ) : (\n // <verdocs-kba-dialog\n // mode=\"choice\"\n // helptitle=\"Your identity requires additional verification\"\n // helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}\n // choices={kbaQuestion?.answer || ['Skip Question']}\n // step={questionNumber + 1}\n // steps={this.kbaQuestions.length}\n // onNext={async (e: any) => {\n // const answer = e.detail as string;\n // this.kbaChoices = [...this.kbaChoices, answer];\n // if (this.kbaChoices.length >= this.kbaQuestions.length) {\n // const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));\n // console.log('Submitting KBA responses', this.kbaChoices, responses);\n // try {\n // const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);\n // console.log('KBA challenge response', response);\n // this.kbaStep = response.kba_step;\n // if (this.kbaStep === 'failed') {\n // this.fatalErrorHeader = 'Identity Verification Failed';\n // this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';\n // this.isDone = true;\n // } else {\n // this.kbaQuestions = (response as any).questions?.question || [];\n // this.kbaChoices = [];\n // }\n // } catch (e) {\n // console.log('Error submitting KBA challenge', e);\n // this.kbaStep = '';\n // this.fatalErrorHeader = 'Unable to Verify Identity';\n // this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';\n // this.isDone = true;\n // }\n // }\n // }}\n // />\n // )}\n // </div>\n // </div>\n // </Host>\n // );\n // }\n\n return (\n <Host>\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n <div style={{flex: '1'}} />\n\n {!this.finishLater && <verdocs-button size=\"xsmall\" label={this.nextButtonLabel} disabled={!this.agreed} onClick={() => this.handleNext()} />}\n\n <div style={{marginLeft: '10px'}} />\n <verdocs-dropdown options={!this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n {(this.envelope.documents || []).map(envelopeDocument => {\n const pageNumbers = integerSequence(1, envelopeDocument.pages);\n\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = envelopeDocument.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n // In signing mode we show the original template page with all the recipient fields so we can show source formatting and\n // where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or\n // future signers still need to act. Once we're \"done\" we flip to showing the envelope's documents which have the final\n // field vales (so far) stamped into them.\n // TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure\n // we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.\n // console.log('tp', templatePage, page);\n return (\n <verdocs-envelope-document-page\n envelopeId={this.envelopeId}\n documentId={envelopeDocument.id}\n endpoint={this.endpoint}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n pageNumber={pageNumber}\n onPageRendered={e => this.handlePageRendered(e)}\n type=\"filled\"\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message={`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`}\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={() => {\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting ||\n (this.showSpinner && (\n <verdocs-portal>\n <div class=\"spinner-overlay\">\n <verdocs-spinner />\n </div>\n </verdocs-portal>\n ))}\n </Host>\n );\n }\n}\n"],"mappings":"41BAAA,MAAMA,EAAiB,sgIACvB,MAAAC,EAAeD,ECaf,MAAME,EAAwB,CAC5B,CAACC,GAAI,QAASC,MAAO,gBAErB,CAACD,GAAI,UAAWC,MAAO,mBACvB,CAACD,GAAI,QAASC,MAAO,yBACrB,CAACD,GAAI,WAAYC,MAAO,aAG1B,MAAMC,EAAkB,CACtB,CAACF,GAAI,QAASC,MAAO,SACrB,CAACD,GAAI,WAAYC,MAAO,a,MAyBbE,EAAW,MALxB,WAAAC,CAAAC,G,6IASyBC,KAAAC,SAA4BC,EAK5BF,KAAAG,WAA4B,KAK5BH,KAAAI,OAAwB,KAKxBJ,KAAAK,WAA4B,KAW3CL,KAAAM,eAAgC,KAoB/BN,KAAAO,UAA+B,KAC/BP,KAAAQ,aAAe,MACfR,KAAAS,gBAAkB,QAClBT,KAAAU,YAAc,MACdV,KAAAW,iBAAmB,GACnBX,KAAAY,kBAAoB,GACpBZ,KAAAa,aAAe,GACfb,KAAAc,WAAa,MACbd,KAAAe,UAAY,MACZf,KAAAgB,OAAS,MACThB,KAAAiB,SAAW,MACXjB,KAAAkB,cAAgB,MAChBlB,KAAAmB,YAAc,MACdnB,KAAAoB,gBAAkB,MAClBpB,KAAAqB,OAAS,MACTrB,KAAAs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AAa,IAAI2G,KAAI4E,IACnC,MAAMC,EAAcC,EAAgB,EAAGF,EAAiBG,OAExD,OACE9C,EAAC+C,EAAQ,KACNH,EAAY7E,KAAIgB,I,MACf,MAAMiE,IAAWxM,EAAAmM,EAAiBM,cAAU,MAAAzM,SAAA,SAAAA,EAAGuI,KAAe,CAAC+B,MAAO,IAAKC,OAAQ,KASnF,OACEf,EAAA,kCACE1L,WAAYH,KAAKG,WACjB4O,WAAYP,EAAiB9O,GAC7BO,SAAUD,KAAKC,SACf+O,aAAcH,EAASlC,MACvBsC,cAAeJ,EAASjC,OACxBhC,WAAYA,EACZsE,eAAgBxL,GAAK1D,KAAKkL,mBAAmBxH,GAC7C8B,KAAK,SACL2J,OAAQ,CACN,CAACnJ,KAAM,OAAQR,KAAM,UACrB,CAACQ,KAAM,WAAYR,KAAM,SAE3B,IAGG,KAKhBxF,KAAKoB,iBACJyK,EAAA,qBACEE,QAAQ,8CACRnI,QAAS,mBAAmB5D,KAAKsB,2HACjC2K,OAAQ,IAAOjM,KAAKoB,gBAAkB,QAIzCpB,KAAKiB,UACJ4K,EAAA,qBACEE,QAAQ,eACRnI,QAAS,sBAAsB5D,KAAKsB,sOACpC2K,OAAQ,KACNjM,KAAKiB,SAAW,MAChBjB,KAAKgB,OAAS,IAAI,IAKvBhB,KAAKc,YACHd,KAAK2B,aACJkK,EAAA,sBACEA,EAAA,OAAKO,MAAM,mBACTP,EAAA,0B","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,c as i,h as s,F as e,H as r,g as n}from"./p-ddadabfb.js";import{VerdocsEndpoint as u,getEnvelope as h,getDocumentDownloadLink as o,cancelEnvelope as a,userCanCancelEnvelope as l,integerSequence as d}from"@verdocs/js-sdk";import{s as c}from"./p-0c45b79c.js";import{S as f}from"./p-fd97809c.js";import{S as p}from"./p-33300e3a.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";function v(t){return typeof t==="string"||t instanceof String}function g(t){var i;return typeof t==="object"&&t!=null&&(t==null||(i=t.constructor)==null?void 0:i.name)==="Object"}function m(t,i){if(Array.isArray(i))return m(t,((t,s)=>i.includes(s)));return Object.entries(t).reduce(((t,s)=>{let[e,r]=s;if(i(r,e))t[e]=r;return t}),{})}const b={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function x(t){switch(t){case b.LEFT:return b.FORCE_LEFT;case b.RIGHT:return b.FORCE_RIGHT;default:return t}}function A(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function w(t,i){if(i===t)return true;const s=Array.isArray(i),e=Array.isArray(t);let r;if(s&&e){if(i.length!=t.length)return false;for(r=0;r<i.length;r++)if(!w(i[r],t[r]))return false;return true}if(s!=e)return false;if(i&&t&&typeof i==="object"&&typeof t==="object"){const s=i instanceof Date,e=t instanceof Date;if(s&&e)return i.getTime()==t.getTime();if(s!=e)return false;const n=i instanceof RegExp,u=t instanceof RegExp;if(n&&u)return i.toString()==t.toString();if(n!=u)return false;const h=Object.keys(i);for(r=0;r<h.length;r++)if(!Object.prototype.hasOwnProperty.call(t,h[r]))return false;for(r=0;r<h.length;r++)if(!w(t[h[r]],i[h[r]]))return false;return true}else if(i&&t&&typeof i==="function"&&typeof t==="function"){return i.toString()===t.toString()}return false}class C{constructor(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}}}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){if(!this.removedCount||this.insertedCount)return b.NONE;return(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?b.RIGHT:b.LEFT}}function F(t,i){return new F.InputMask(t,i)}function k(t){if(t==null)throw new Error("mask property should be defined");if(t instanceof RegExp)return F.MaskedRegExp;if(v(t))return F.MaskedPattern;if(t===Date)return F.MaskedDate;if(t===Number)return F.MaskedNumber;if(Array.isArray(t)||t===Array)return F.MaskedDynamic;if(F.Masked&&t.prototype instanceof F.Masked)return t;if(F.Masked&&t instanceof F.Masked)return t.constructor;if(t instanceof Function)return F.MaskedFunction;console.warn("Mask not found for mask",t);return F.Masked}function D(t){if(!t)throw new Error("Options in not defined");if(F.Masked){if(t.prototype instanceof F.Masked)return{mask:t};const{mask:i=undefined,...s}=t instanceof F.Masked?{mask:t}:g(t)&&t.mask instanceof F.Masked?t:{};if(i){const t=i.mask;return{...m(i,((t,i)=>!i.startsWith("_"))),mask:i.constructor,_mask:t,...s}}}if(!g(t))return{mask:t};return{...t}}function B(t){if(F.Masked&&t instanceof F.Masked)return t;const i=D(t);const s=k(i.mask);if(!s)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===s)delete i.mask;if(i._mask){i.mask=i._mask;delete i._mask}return new s(i)}F.createMask=B;class E{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t!=null?t:this.value.length}select(t,i){if(t==null||i==null||t===this.selectionStart&&i===this.selectionEnd)return;try{this._unsafeSelect(t,i)}catch{}}get isActive(){return false}}F.MaskElement=E;const y=90;const I=89;class _ extends E{constructor(t){super();this.input=t;this._onKeydown=this._onKeydown.bind(this);this._onInput=this._onInput.bind(this);this._onBeforeinput=this._onBeforeinput.bind(this);this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,i,s;return(t=(i=(s=this.input).getRootNode)==null?void 0:i.call(s))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(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}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===y&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===I&&t.ctrlKey)){t.preventDefault();return this._handlers.redo(t)}if(this._handlers.undo&&t.keyCode===y&&(t.metaKey||t.ctrlKey)){t.preventDefault();return this._handlers.undo(t)}if(!t.isComposing)this._handlers.selectionChange(t)}_onBeforeinput(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)}}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){if(!t.isComposing)this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown);this.input.removeEventListener("input",this._onInput);this.input.removeEventListener("beforeinput",this._onBeforeinput);this.input.removeEventListener("compositionend",this._onCompositionEnd);this.input.removeEventListener("drop",this._handlers.drop);this.input.removeEventListener("click",this._handlers.click);this.input.removeEventListener("focus",this._handlers.focus);this.input.removeEventListener("blur",this._handlers.commit);this._handlers={}}}F.HTMLMaskElement=_;class S extends _{constructor(t){super(t);this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,i){this.input.setSelectionRange(t,i)}get value(){return this.input.value}set value(t){this.input.value=t}}F.HTMLMaskElement=_;class V extends _{get _unsafeSelectionStart(){const t=this.rootElement;const i=t.getSelection&&t.getSelection();const s=i&&i.anchorOffset;const e=i&&i.focusOffset;if(e==null||s==null||s<e){return s}return e}get _unsafeSelectionEnd(){const t=this.rootElement;const i=t.getSelection&&t.getSelection();const s=i&&i.anchorOffset;const e=i&&i.focusOffset;if(e==null||s==null||s>e){return s}return e}_unsafeSelect(t,i){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,t);s.setEnd(this.input.lastChild||this.input,i);const e=this.rootElement;const r=e.getSelection&&e.getSelection();if(r){r.removeAllRanges();r.addRange(s)}}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}F.HTMLContenteditableMaskElement=V;class M{constructor(){this.states=[];this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){if(this.currentIndex<this.states.length-1)this.states.length=this.currentIndex+1;this.states.push(t);if(this.states.length>M.MAX_LENGTH)this.states.shift();this.currentIndex=this.states.length-1}go(t){this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1);return this.currentState}undo(){return this.go(-1)}redo(){return this.go(+1)}clear(){this.states.length=0;this.currentIndex=0}}M.MAX_LENGTH=100;class O{constructor(t,i){this.el=t instanceof E?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new V(t):new S(t);this.masked=B(i);this._listeners={};this._value="";this._unmaskedValue="";this._rawInputValue="";this.history=new M;this._saveSelection=this._saveSelection.bind(this);this._onInput=this._onInput.bind(this);this._onChange=this._onChange.bind(this);this._onDrop=this._onDrop.bind(this);this._onFocus=this._onFocus.bind(this);this._onClick=this._onClick.bind(this);this._onUndo=this._onUndo.bind(this);this._onRedo=this._onRedo.bind(this);this.alignCursor=this.alignCursor.bind(this);this.alignCursorFriendly=this.alignCursorFriendly.bind(this);this._bindEvents();this.updateValue();this._onChange()}maskEquals(t){var i;return t==null||((i=this.masked)==null?void 0:i.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof F.Masked)&&this.masked.constructor===k(t)){this.masked.updateOptions({mask:t});return}const i=t instanceof F.Masked?t:B({mask:t});i.unmaskedValue=this.masked.unmaskedValue;this.masked=i}get value(){return this._value}set value(t){if(this.value===t)return;this.masked.value=t;this.updateControl("auto")}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){if(this.unmaskedValue===t)return;this.masked.unmaskedValue=t;this.updateControl("auto")}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){if(this.rawInputValue===t)return;this.masked.rawInputValue=t;this.updateControl();this.alignCursor()}get typedValue(){return this.masked.typedValue}set typedValue(t){if(this.masked.typedValueEquals(t))return;this.masked.typedValue=t;this.updateControl("auto")}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){if(this.el)this.el.unbindEvents()}_fireEvent(t,i){const s=this._listeners[t];if(!s)return;s.forEach((t=>t(i)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){if(!this.el||!this.el.isActive)return;this.el.select(t,t);this._saveSelection()}_saveSelection(){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}}updateValue(){this.masked.value=this.el.value;this._value=this.masked.value;this._unmaskedValue=this.masked.unmaskedValue;this._rawInputValue=this.masked.rawInputValue}updateControl(t){const i=this.masked.unmaskedValue;const s=this.masked.value;const e=this.masked.rawInputValue;const r=this.displayValue;const n=this.unmaskedValue!==i||this.value!==s||this._rawInputValue!==e;this._unmaskedValue=i;this._value=s;this._rawInputValue=e;if(this.el.value!==r)this.el.value=r;if(t==="auto")this.alignCursor();else if(t!=null)this.cursorPos=t;if(n)this._fireChangeEvents();if(!this._historyChanging&&(n||this.history.isEmpty))this.history.push({unmaskedValue:i,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:i,...s}=t;const e=!this.maskEquals(i);const r=this.masked.optionsIsChanged(s);if(e)this.mask=i;if(r)this.masked.updateOptions(s);if(e||r)this.updateControl()}updateCursor(t){if(t==null)return;this.cursorPos=t;this._delayUpdateCursor(t)}_delayUpdateCursor(t){this._abortUpdateCursor();this._changingCursorPos=t;this._cursorChanging=setTimeout((()=>{if(!this.el)return;this.cursorPos=this._changingCursorPos;this._abortUpdateCursor()}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent);if(this.masked.isComplete)this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){if(this._cursorChanging){clearTimeout(this._cursorChanging);delete this._cursorChanging}}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,b.LEFT))}alignCursorFriendly(){if(this.selectionStart!==this.cursorPos)return;this.alignCursor()}on(t,i){if(!this._listeners[t])this._listeners[t]=[];this._listeners[t].push(i);return this}off(t,i){if(!this._listeners[t])return this;if(!i){delete this._listeners[t];return this}const s=this._listeners[t].indexOf(i);if(s>=0)this._listeners[t].splice(s,1);return this}_onInput(t){this._inputEvent=t;this._abortUpdateCursor();const i=new C({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection});const s=this.masked.rawInputValue;const e=this.masked.splice(i.startChangePos,i.removed.length,i.inserted,i.removeDirection,{input:true,raw:true}).offset;const r=s===this.masked.rawInputValue?i.removeDirection:b.NONE;let n=this.masked.nearestInputPos(i.startChangePos+e,r);if(r!==b.NONE)n=this.masked.nearestInputPos(n,b.NONE);this.updateControl(n);delete this._inputEvent}_onChange(){if(this.displayValue!==this.el.value)this.updateValue();this.masked.doCommit();this.updateControl();this._saveSelection()}_onDrop(t){t.preventDefault();t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(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}destroy(){this._unbindEvents();this._listeners.length=0;delete this.el}}F.InputMask=O;class T{static normalize(t){return Array.isArray(t)?t:[t,new T]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:false},t)}aggregate(t){this.inserted+=t.inserted;this.rawInserted+=t.rawInserted;this.tailShift+=t.tailShift;this.skip=this.skip||t.skip;return this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}F.ChangeDetails=T;class R{constructor(t,i,s){if(t===void 0){t=""}if(i===void 0){i=0}this.value=t;this.from=i;this.stop=s}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:true}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const i=this.value[0];this.value=this.value.slice(1);return i}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];this.value=this.value.slice(0,-1);return t}}class P{constructor(t){this._value="";this._update({...P.DEFAULTS,...t});this._initialized=true}updateOptions(t){if(!this.optionsIsChanged(t))return;this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:true})}resolve(t,i){if(i===void 0){i={input:true}}this.reset();this.append(t,i,"");this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){if(this.format){this.value=this.format(t,this)}else{this.unmaskedValue=String(t)}}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:true})}set rawInputValue(t){this.resolve(t,{raw:true})}get displayValue(){return this.value}get isComplete(){return true}get isFilled(){return this.isComplete}nearestInputPos(t,i){return t}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return Math.min(this.displayValue.length,i-t)}extractInput(t,i,s){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return this.displayValue.slice(t,i)}extractTail(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}return new R(this.extractInput(t,i),t)}appendTail(t){if(v(t))t=new R(String(t));return t.appendTo(this)}_appendCharRaw(t,i){if(!t)return new T;this._value+=t;return new T({inserted:t,rawInserted:t})}_appendChar(t,i,s){if(i===void 0){i={}}const e=this.state;let r;[t,r]=this.doPrepareChar(t,i);if(t){r=r.aggregate(this._appendCharRaw(t,i));if(!r.rawInserted&&this.autofix==="pad"){const s=this.state;this.state=e;let n=this.pad(i);const u=this._appendCharRaw(t,i);n=n.aggregate(u);if(u.rawInserted||n.equals(r)){r=n}else{this.state=s}}}if(r.inserted){let t;let n=this.doValidate(i)!==false;if(n&&s!=null){const i=this.state;if(this.overwrite===true){t=s.state;for(let t=0;t<r.rawInserted.length;++t){s.unshift(this.displayValue.length-r.tailShift)}}let e=this.appendTail(s);n=e.rawInserted.length===s.toString().length;if(!(n&&e.inserted)&&this.overwrite==="shift"){this.state=i;t=s.state;for(let t=0;t<r.rawInserted.length;++t){s.shift()}e=this.appendTail(s);n=e.rawInserted.length===s.toString().length}if(n&&e.inserted)this.state=i}if(!n){r=new T;this.state=e;if(s&&t)s.state=t}}return r}_appendPlaceholder(){return new T}_appendEager(){return new T}append(t,i,s){if(!v(t))throw new Error("value should be string");const e=v(s)?new R(String(s)):s;if(i!=null&&i.tail)i._beforeTailState=this.state;let r;[t,r]=this.doPrepare(t,i);for(let s=0;s<t.length;++s){const n=this._appendChar(t[s],i,e);if(!n.rawInserted&&!this.doSkipInvalid(t[s],i,e))break;r.aggregate(n)}if((this.eager===true||this.eager==="append")&&i!=null&&i.input&&t){r.aggregate(this._appendEager())}if(e!=null){r.tailShift+=this.appendTail(e).tailShift}return r}remove(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 T}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=true;const i=this.rawInputValue;const s=this.value;const e=t();this.rawInputValue=i;if(this.value&&this.value!==s&&s.indexOf(this.value)===0){this.append(s.slice(this.displayValue.length),{},"");this.doCommit()}delete this._refreshing;return e}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=true;const i=this.state;const s=t(this);this.state=i;delete this._isolated;return s}doSkipInvalid(t,i,s){return Boolean(this.skipInvalid)}doPrepare(t,i){if(i===void 0){i={}}return T.normalize(this.prepare?this.prepare(t,this,i):t)}doPrepareChar(t,i){if(i===void 0){i={}}return T.normalize(this.prepareChar?this.prepareChar(t,this,i):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){if(this.commit)this.commit(this.value,this)}splice(t,i,s,e,r){if(s===void 0){s=""}if(e===void 0){e=b.NONE}if(r===void 0){r={input:true}}const n=t+i;const u=this.extractTail(n);const h=this.eager===true||this.eager==="remove";let o;if(h){e=x(e);o=this.extractInput(0,n,{raw:true})}let a=t;const l=new T;if(e!==b.NONE){a=this.nearestInputPos(t,i>1&&t!==0&&!h?b.NONE:e);l.tailShift=a-t}l.aggregate(this.remove(a));if(h&&e!==b.NONE&&o===this.rawInputValue){if(e===b.FORCE_LEFT){let t;while(o===this.rawInputValue&&(t=this.displayValue.length)){l.aggregate(new T({tailShift:-1})).aggregate(this.remove(t-1))}}else if(e===b.FORCE_RIGHT){u.unshift()}}return l.aggregate(this.append(s,r,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!w(this,t)}typedValueEquals(t){const i=this.typedValue;return t===i||P.EMPTY_VALUES.includes(t)&&P.EMPTY_VALUES.includes(i)||(this.format?this.format(t,this)===this.format(this.typedValue,this):false)}pad(t){return new T}}P.DEFAULTS={skipInvalid:true};P.EMPTY_VALUES=[undefined,null,""];F.Masked=P;class N{constructor(t,i){if(t===void 0){t=[]}if(i===void 0){i=0}this.chunks=t;this.from=i}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=v(t)?new R(String(t)):t;const i=this.chunks[this.chunks.length-1];const s=i&&(i.stop===t.stop||t.stop==null)&&t.from===i.from+i.toString().length;if(t instanceof R){if(s){i.extend(t.toString())}else{this.chunks.push(t)}}else if(t instanceof N){if(t.stop==null){let i;while(t.chunks.length&&t.chunks[0].stop==null){i=t.chunks.shift();i.from+=t.from;this.extend(i)}}if(t.toString()){t.stop=t.blockIndex;this.chunks.push(t)}}}appendTo(t){if(!(t instanceof F.MaskedPattern)){const i=new R(this.toString());return i.appendTo(t)}const i=new T;for(let s=0;s<this.chunks.length;++s){const e=this.chunks[s];const r=t._mapPosToBlock(t.displayValue.length);const n=e.stop;let u;if(n!=null&&(!r||r.index<=n)){if(e instanceof N||t._stops.indexOf(n)>=0){i.aggregate(t._appendPlaceholder(n))}u=e instanceof N&&t._blocks[n]}if(u){const s=u.appendTail(e);i.aggregate(s);const r=e.toString().slice(s.rawInserted.length);if(r)i.aggregate(t.append(r,{tail:true}))}else{i.aggregate(t.append(e.toString(),{tail:true}))}}return i}get state(){return{chunks:this.chunks.map((t=>t.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:i,...s}=t;Object.assign(this,s);this.chunks=i.map((t=>{const i="chunks"in t?new N:new R;i.state=t;return i}))}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const i=t!=null?t-this.from:t;let s=0;while(s<this.chunks.length){const t=this.chunks[s];const e=t.unshift(i);if(t.toString()){if(!e)break;++s}else{this.chunks.splice(s,1)}if(e)return e}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;while(0<=t){const i=this.chunks[t];const s=i.shift();if(i.toString()){if(!s)break;--t}else{this.chunks.splice(t,1)}if(s)return s}return""}}class z{constructor(t,i){this.masked=t;this._log=[];const{offset:s,index:e}=t._mapPosToBlock(i)||(i<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s;this.index=e;this.ok=false}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();if(t)this.state=t;return t}bindBlock(){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}}_pushLeft(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}_pushRight(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}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(this.block.isFixed||!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,b.FORCE_LEFT);if(this.offset!==0)return true}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(this.block.isFixed)return;this.offset=this.block.nearestInputPos(this.offset,b.LEFT);return true}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(this.block.isFixed||this.block.isOptional&&!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,b.LEFT);return true}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(this.block.isFixed||!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,b.FORCE_RIGHT);if(this.offset!==this.block.value.length)return true}))}pushRightBeforeInput(){return this._pushRight((()=>{if(this.block.isFixed)return;this.offset=this.block.nearestInputPos(this.offset,b.NONE);return true}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(this.block.isFixed||this.block.isOptional&&!this.block.value)return;this.offset=this.block.nearestInputPos(this.offset,b.NONE);return true}))}}class j{constructor(t){Object.assign(this,t);this._value="";this.isFixed=true}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=false;this._value=""}remove(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 T}nearestInputPos(t,i){if(i===void 0){i=b.NONE}const s=0;const e=this._value.length;switch(i){case b.LEFT:case b.FORCE_LEFT:return s;case b.NONE:case b.RIGHT:case b.FORCE_RIGHT:default:return e}}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this._value.length}return this._isRawInput?i-t:0}extractInput(t,i,s){if(t===void 0){t=0}if(i===void 0){i=this._value.length}if(s===void 0){s={}}return s.raw&&this._isRawInput&&this._value.slice(t,i)||""}get isComplete(){return true}get isFilled(){return Boolean(this._value)}_appendChar(t,i){if(i===void 0){i={}}if(this.isFilled)return new T;const s=this.eager===true||this.eager==="append";const e=this.char===t;const r=e&&(this.isUnmasking||i.input||i.raw)&&(!i.raw||!s)&&!i.tail;const n=new T({inserted:this.char,rawInserted:r?this.char:""});this._value=this.char;this._isRawInput=r&&(i.raw||i.input);return n}_appendEager(){return this._appendChar(this.char,{tail:true})}_appendPlaceholder(){const t=new T;if(this.isFilled)return t;this._value=t.inserted=this.char;return t}extractTail(){return new R("")}appendTail(t){if(v(t))t=new R(String(t));return t.appendTo(this)}append(t,i,s){const e=this._appendChar(t[0],i);if(s!=null){e.tailShift+=this.appendTail(s).tailShift}return e}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value;this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class L{constructor(t){const{parent:i,isOptional:s,placeholderChar:e,displayChar:r,lazy:n,eager:u,...h}=t;this.masked=B(h);Object.assign(this,{parent:i,isOptional:s,placeholderChar:e,displayChar:r,lazy:n,eager:u})}reset(){this.isFilled=false;this.masked.reset()}remove(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 T}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,i){if(i===void 0){i={}}if(this.isFilled)return new T;const s=this.masked.state;let e=this.masked._appendChar(t,this.currentMaskFlags(i));if(e.inserted&&this.doValidate(i)===false){e=new T;this.masked.state=s}if(!e.inserted&&!this.isOptional&&!this.lazy&&!i.input){e.inserted=this.placeholderChar}e.skip=!e.inserted&&!this.isOptional;this.isFilled=Boolean(e.inserted);return e}append(t,i,s){return this.masked.append(t,this.currentMaskFlags(i),s)}_appendPlaceholder(){if(this.isFilled||this.isOptional)return new T;this.isFilled=true;return new T({inserted:this.placeholderChar})}_appendEager(){return new T}extractTail(t,i){return this.masked.extractTail(t,i)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,i,s){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.masked.extractInput(t,i,s)}nearestInputPos(t,i){if(i===void 0){i=b.NONE}const s=0;const e=this.value.length;const r=Math.min(Math.max(t,s),e);switch(i){case b.LEFT:case b.FORCE_LEFT:return this.isComplete?r:s;case b.RIGHT:case b.FORCE_RIGHT:return this.isComplete?r:e;case b.NONE:default:return r}}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this.value.length}return this.value.slice(t,i).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked;this.isFilled=t.isFilled}currentMaskFlags(t){var i;return{...t,_beforeTailState:(t==null||(i=t._beforeTailState)==null?void 0:i.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new T}}L.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class q extends P{updateOptions(t){super.updateOptions(t)}_update(t){const i=t.mask;if(i)t.validate=t=>t.search(i)>=0;super._update(t)}}F.MaskedRegExp=q;class W extends P{constructor(t){super({...W.DEFAULTS,...t,definitions:Object.assign({},L.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions);super._update(t);this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[];this.exposeBlock=undefined;this._stops=[];this._maskedBlocks={};const i=this.mask;if(!i||!t)return;let s=false;let e=false;for(let r=0;r<i.length;++r){if(this.blocks){const t=i.slice(r);const s=Object.keys(this.blocks).filter((i=>t.indexOf(i)===0));s.sort(((t,i)=>i.length-t.length));const e=s[0];if(e){const{expose:t,repeat:i,...s}=D(this.blocks[e]);const n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...s,repeat:i,parent:this};const u=i!=null?new F.RepeatBlock(n):B(n);if(u){this._blocks.push(u);if(t)this.exposeBlock=u;if(!this._maskedBlocks[e])this._maskedBlocks[e]=[];this._maskedBlocks[e].push(this._blocks.length-1)}r+=e.length-1;continue}}let n=i[r];let u=n in t;if(n===W.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(n==="{"||n==="}"){s=!s;continue}if(n==="["||n==="]"){e=!e;continue}if(n===W.ESCAPE_CHAR){++r;n=i[r];if(!n)break;u=false}const h=u?new L({isOptional:e,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...D(t[n]),parent:this}):new j({char:n,eager:this.eager,isUnmasking:s});this._blocks.push(h)}}get state(){return{...super.state,_blocks:this._blocks.map((t=>t.state))}}set state(t){if(!t){this.reset();return}const{_blocks:i,...s}=t;this._blocks.forEach(((t,s)=>t.state=i[s]));super.state=s}reset(){super.reset();this._blocks.forEach((t=>t.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((t=>t.isComplete))}get isFilled(){return this._blocks.every((t=>t.isFilled))}get isFixed(){return this._blocks.every((t=>t.isFixed))}get isOptional(){return this._blocks.every((t=>t.isOptional))}doCommit(){this._blocks.forEach((t=>t.doCommit()));super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((t,i)=>t+=i.unmaskedValue),"")}set unmaskedValue(t){if(this.exposeBlock){const i=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t;this.appendTail(i);this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((t,i)=>t+=i.value),"")}set value(t){if(this.exposeBlock){const i=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t;this.appendTail(i);this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const i=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t;this.appendTail(i);this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce(((t,i)=>t+=i.displayValue),"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const i=new T;let s=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(s==null)return i;if(this._blocks[s].isFilled)++s;for(let t=s;t<this._blocks.length;++t){const s=this._blocks[t]._appendEager();if(!s.inserted)break;i.aggregate(s)}return i}_appendCharRaw(t,i){if(i===void 0){i={}}const s=this._mapPosToBlock(this.displayValue.length);const e=new T;if(!s)return e;for(let n=s.index,u;u=this._blocks[n];++n){var r;const s=u._appendChar(t,{...i,_beforeTailState:(r=i._beforeTailState)==null||(r=r._blocks)==null?void 0:r[n]});e.aggregate(s);if(s.consumed)break}return e}extractTail(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}const s=new N;if(t===i)return s;this._forEachBlocksInRange(t,i,((t,i,e,r)=>{const n=t.extractTail(e,r);n.stop=this._findStopBefore(i);n.from=this._blockStartPos(i);if(n instanceof N)n.blockIndex=i;s.extend(n)}));return s}extractInput(t,i,s){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}if(s===void 0){s={}}if(t===i)return"";let e="";this._forEachBlocksInRange(t,i,((t,i,r,n)=>{e+=t.extractInput(r,n,s)}));return e}_findStopBefore(t){let i;for(let s=0;s<this._stops.length;++s){const e=this._stops[s];if(e<=t)i=e;else break}return i}_appendPlaceholder(t){const i=new T;if(this.lazy&&t==null)return i;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return i;const e=s.index;const r=t!=null?t:this._blocks.length;this._blocks.slice(e,r).forEach((s=>{if(!s.lazy||t!=null){var e;i.aggregate(s._appendPlaceholder((e=s._blocks)==null?void 0:e.length))}}));return i}_mapPosToBlock(t){let i="";for(let s=0;s<this._blocks.length;++s){const e=this._blocks[s];const r=i.length;i+=e.displayValue;if(t<=i.length){return{index:s,offset:t-r}}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce(((t,i)=>t+=i.displayValue.length),0)}_forEachBlocksInRange(t,i,s){if(i===void 0){i=this.displayValue.length}const e=this._mapPosToBlock(t);if(e){const t=this._mapPosToBlock(i);const r=t&&e.index===t.index;const n=e.offset;const u=t&&r?t.offset:this._blocks[e.index].displayValue.length;s(this._blocks[e.index],e.index,n,u);if(t&&!r){for(let i=e.index+1;i<t.index;++i){s(this._blocks[i],i,0,this._blocks[i].displayValue.length)}s(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}const s=super.remove(t,i);this._forEachBlocksInRange(t,i,((t,i,e,r)=>{s.aggregate(t.remove(e,r))}));return s}nearestInputPos(t,i){if(i===void 0){i=b.NONE}if(!this._blocks.length)return 0;const s=new z(this,t);if(i===b.NONE){if(s.pushRightBeforeInput())return s.pos;s.popState();if(s.pushLeftBeforeInput())return s.pos;return this.displayValue.length}if(i===b.LEFT||i===b.FORCE_LEFT){if(i===b.LEFT){s.pushRightBeforeFilled();if(s.ok&&s.pos===t)return t;s.popState()}s.pushLeftBeforeInput();s.pushLeftBeforeRequired();s.pushLeftBeforeFilled();if(i===b.LEFT){s.pushRightBeforeInput();s.pushRightBeforeRequired();if(s.ok&&s.pos<=t)return s.pos;s.popState();if(s.ok&&s.pos<=t)return s.pos;s.popState()}if(s.ok)return s.pos;if(i===b.FORCE_LEFT)return 0;s.popState();if(s.ok)return s.pos;s.popState();if(s.ok)return s.pos;return 0}if(i===b.RIGHT||i===b.FORCE_RIGHT){s.pushRightBeforeInput();s.pushRightBeforeRequired();if(s.pushRightBeforeFilled())return s.pos;if(i===b.FORCE_RIGHT)return this.displayValue.length;s.popState();if(s.ok)return s.pos;s.popState();if(s.ok)return s.pos;return this.nearestInputPos(t,b.LEFT)}return t}totalInputPositions(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}let s=0;this._forEachBlocksInRange(t,i,((t,i,e,r)=>{s+=t.totalInputPositions(e,r)}));return s}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const i=this._maskedBlocks[t];if(!i)return[];return i.map((t=>this._blocks[t]))}pad(t){const i=new T;this._forEachBlocksInRange(0,this.displayValue.length,(s=>i.aggregate(s.pad(t))));return i}}W.DEFAULTS={...P.DEFAULTS,lazy:true,placeholderChar:"_"};W.STOP_CHAR="`";W.ESCAPE_CHAR="\\";W.InputDefinition=L;W.FixedDefinition=j;F.MaskedPattern=W;class H extends W{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:i=this.to||0,from:s=this.from||0,maxLength:e=this.maxLength||0,autofix:r=this.autofix,...n}=t;this.to=i;this.from=s;this.maxLength=Math.max(String(i).length,e);this.autofix=r;const u=String(this.from).padStart(this.maxLength,"0");const h=String(this.to).padStart(this.maxLength,"0");let o=0;while(o<h.length&&h[o]===u[o])++o;n.mask=h.slice(0,o).replace(/0/g,"\\0")+"0".repeat(this.maxLength-o);super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let i="";let s="";const[,e,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];if(r){i="0".repeat(e.length)+r;s="9".repeat(e.length)+r}i=i.padEnd(this.maxLength,"0");s=s.padEnd(this.maxLength,"9");return[i,s]}doPrepareChar(t,i){if(i===void 0){i={}}let s;[t,s]=super.doPrepareChar(t.replace(/\D/g,""),i);if(!t)s.skip=!this.isComplete;return[t,s]}_appendCharRaw(t,i){if(i===void 0){i={}}if(!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,i);const s=String(this.from).padStart(this.maxLength,"0");const e=String(this.to).padStart(this.maxLength,"0");const[r,n]=this.boundaries(this.value+t);if(Number(n)<this.from)return super._appendCharRaw(s[this.value.length],i);if(Number(r)>this.to){if(!i.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength){return super._appendCharRaw(s[this.value.length],i).aggregate(this._appendCharRaw(t,i))}return super._appendCharRaw(e[this.value.length],i)}return super._appendCharRaw(t,i)}doValidate(t){const i=this.value;const s=i.search(/[^0]/);if(s===-1&&i.length<=this._matchFrom)return true;const[e,r]=this.boundaries(i);return this.from<=Number(r)&&Number(e)<=this.to&&super.doValidate(t)}pad(t){const i=new T;if(this.value.length===this.maxLength)return i;const s=this.value;const e=this.maxLength-this.value.length;if(e){this.reset();for(let s=0;s<e;++s){i.aggregate(super._appendCharRaw("0",t))}s.split("").forEach((t=>this._appendCharRaw(t)))}return i}}F.MaskedRange=H;const U="d{.}`m{.}`Y";class Y extends W{static extractPatternOptions(t){const{mask:i,pattern:s,...e}=t;return{...e,mask:v(i)?i:s}}constructor(t){super(Y.extractPatternOptions({...Y.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:i,pattern:s,blocks:e,...r}={...Y.DEFAULTS,...t};const n=Object.assign({},Y.GET_DEFAULT_BLOCKS());if(t.min)n.Y.from=t.min.getFullYear();if(t.max)n.Y.to=t.max.getFullYear();if(t.min&&t.max&&n.Y.from===n.Y.to){n.m.from=t.min.getMonth()+1;n.m.to=t.max.getMonth()+1;if(n.m.from===n.m.to){n.d.from=t.min.getDate();n.d.to=t.max.getDate()}}Object.assign(n,this.blocks,e);super._update({...r,mask:v(i)?i:s,blocks:n})}doValidate(t){const i=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&i!=null&&(this.min==null||this.min<=i)&&(this.max==null||i<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(Y.extractPatternOptions(t))}}Y.GET_DEFAULT_BLOCKS=()=>({d:{mask:H,from:1,to:31,maxLength:2},m:{mask:H,from:1,to:12,maxLength:2},Y:{mask:H,from:1900,to:9999}});Y.DEFAULTS={...W.DEFAULTS,mask:Date,pattern:U,format:(t,i)=>{if(!t)return"";const s=String(t.getDate()).padStart(2,"0");const e=String(t.getMonth()+1).padStart(2,"0");const r=t.getFullYear();return[s,e,r].join(".")},parse:(t,i)=>{const[s,e,r]=t.split(".").map(Number);return new Date(r,e-1,s)}};F.MaskedDate=Y;class Z extends P{constructor(t){super({...Z.DEFAULTS,...t});this.currentMask=undefined}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t);if("mask"in t){this.exposeMask=undefined;this.compiledMasks=Array.isArray(t.mask)?t.mask.map((t=>{const{expose:i,...s}=D(t);const e=B({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});if(i)this.exposeMask=e;return e})):[]}}_appendCharRaw(t,i){if(i===void 0){i={}}const s=this._applyDispatch(t,i);if(this.currentMask){s.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(i)))}return s}_applyDispatch(t,i,s){if(t===void 0){t=""}if(i===void 0){i={}}if(s===void 0){s=""}const e=i.tail&&i._beforeTailState!=null?i._beforeTailState._value:this.value;const r=this.rawInputValue;const n=i.tail&&i._beforeTailState!=null?i._beforeTailState._rawInputValue:r;const u=r.slice(n.length);const h=this.currentMask;const o=new T;const a=h==null?void 0:h.state;this.currentMask=this.doDispatch(t,{...i},s);if(this.currentMask){if(this.currentMask!==h){this.currentMask.reset();if(n){this.currentMask.append(n,{raw:true});o.tailShift=this.currentMask.value.length-e.length}if(u){o.tailShift+=this.currentMask.append(u,{raw:true,tail:true}).tailShift}}else if(a){this.currentMask.state=a}}return o}_appendPlaceholder(){const t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendPlaceholder())}return t}_appendEager(){const t=this._applyDispatch();if(this.currentMask){t.aggregate(this.currentMask._appendEager())}return t}appendTail(t){const i=new T;if(t)i.aggregate(this._applyDispatch("",{},t));return i.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var i,s;return{...t,_beforeTailState:((i=t._beforeTailState)==null?void 0:i.currentMaskRef)===this.currentMask&&((s=t._beforeTailState)==null?void 0:s.currentMask)||t._beforeTailState}}doDispatch(t,i,s){if(i===void 0){i={}}if(s===void 0){s=""}return this.dispatch(t,this,i,s)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,i){if(i===void 0){i={}}let[s,e]=super.doPrepare(t,i);if(this.currentMask){let t;[s,t]=super.doPrepare(s,this.currentMaskFlags(i));e=e.aggregate(t)}return[s,e]}doPrepareChar(t,i){if(i===void 0){i={}}let[s,e]=super.doPrepareChar(t,i);if(this.currentMask){let t;[s,t]=super.doPrepareChar(s,this.currentMaskFlags(i));e=e.aggregate(t)}return[s,e]}reset(){var t;(t=this.currentMask)==null||t.reset();this.compiledMasks.forEach((t=>t.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){if(this.exposeMask){this.exposeMask.value=t;this.currentMask=this.exposeMask;this._applyDispatch()}else super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){if(this.exposeMask){this.exposeMask.unmaskedValue=t;this.currentMask=this.exposeMask;this._applyDispatch()}else super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t;this.currentMask=this.exposeMask;this._applyDispatch();return}let i=String(t);if(this.currentMask){this.currentMask.typedValue=t;i=this.currentMask.unmaskedValue}this.unmaskedValue=i}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isComplete)}get isFilled(){var t;return Boolean((t=this.currentMask)==null?void 0:t.isFilled)}remove(t,i){const s=new T;if(this.currentMask){s.aggregate(this.currentMask.remove(t,i)).aggregate(this._applyDispatch())}return s}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((t=>t.state)),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:i,currentMaskRef:s,currentMask:e,...r}=t;if(i)this.compiledMasks.forEach(((t,s)=>t.state=i[s]));if(s!=null){this.currentMask=s;this.currentMask.state=e}super.state=r}extractInput(t,i,s){return this.currentMask?this.currentMask.extractInput(t,i,s):""}extractTail(t,i){return this.currentMask?this.currentMask.extractTail(t,i):super.extractTail(t,i)}doCommit(){if(this.currentMask)this.currentMask.doCommit();super.doCommit()}nearestInputPos(t,i){return this.currentMask?this.currentMask.nearestInputPos(t,i):super.nearestInputPos(t,i)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every(((i,s)=>{if(!t[s])return;const{mask:e,...r}=t[s];return w(i,r)&&i.maskEquals(e)})):super.maskEquals(t)}typedValueEquals(t){var i;return Boolean((i=this.currentMask)==null?void 0:i.typedValueEquals(t))}}Z.DEFAULTS={...P.DEFAULTS,dispatch:(t,i,s,e)=>{if(!i.compiledMasks.length)return;const r=i.rawInputValue;const n=i.compiledMasks.map(((n,u)=>{const h=i.currentMask===n;const o=h?n.displayValue.length:n.nearestInputPos(n.displayValue.length,b.FORCE_LEFT);if(n.rawInputValue!==r){n.reset();n.append(r,{raw:true})}else if(!h){n.remove(o)}n.append(t,i.currentMaskFlags(s));n.appendTail(e);return{index:u,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(o,n.nearestInputPos(n.displayValue.length,b.FORCE_LEFT)))}}));n.sort(((t,i)=>i.weight-t.weight||i.totalInputPositions-t.totalInputPositions));return i.compiledMasks[n[0].index]}};F.MaskedDynamic=Z;class K extends W{constructor(t){super({...K.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:i,...s}=t;if(i){const t=i.map((t=>t.length));const e=Math.min(...t);const r=Math.max(...t)-e;s.mask="*".repeat(e);if(r)s.mask+="["+"*".repeat(r)+"]";this.enum=i}super._update(s)}_appendCharRaw(t,i){if(i===void 0){i={}}const s=Math.min(this.nearestInputPos(0,b.FORCE_RIGHT),this.value.length);const e=this.enum.filter((i=>this.matchValue(i,this.unmaskedValue+t,s)));if(e.length){if(e.length===1){this._forEachBlocksInRange(0,this.value.length,((t,s)=>{const r=e[0][s];if(s>=this.value.length||r===t.value)return;t.reset();t._appendChar(r,i)}))}const t=super._appendCharRaw(e[0][this.value.length],i);if(e.length===1){e[0].slice(this.unmaskedValue.length).split("").forEach((i=>t.aggregate(super._appendCharRaw(i))))}return t}return new T({skip:!this.isComplete})}extractTail(t,i){if(t===void 0){t=0}return new R("",t)}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}if(t===i)return new T;const s=Math.min(super.nearestInputPos(0,b.FORCE_RIGHT),this.value.length);let e;for(e=t;e>=0;--e){const t=this.enum.filter((t=>this.matchValue(t,this.value.slice(s,e),s)));if(t.length>1)break}const r=super.remove(e,i);r.tailShift+=e-t;return r}get isComplete(){return this.enum.indexOf(this.value)>=0}}K.DEFAULTS={...W.DEFAULTS,matchValue:(t,i,s)=>t.indexOf(i,s)===s};F.MaskedEnum=K;class G extends P{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}F.MaskedFunction=G;var $;class J extends P{constructor(t){super({...J.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t);this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":"");const i="\\d*";const s=(this.scale?"("+A(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+i+s);this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(A).join("")+"]","g");this._thousandsSeparatorRegExp=new RegExp(A(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const i=t.split(this.radix);i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator);return i.join(this.radix)}doPrepareChar(t,i){if(i===void 0){i={}}const[s,e]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(i.input&&i.raw||!i.input&&!i.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),i);if(t&&!s)e.skip=true;if(s&&!this.allowPositive&&!this.value&&s!=="-")e.aggregate(this._appendChar("-"));return[s,e]}_separatorsCount(t,i){if(i===void 0){i=false}let s=0;for(let e=0;e<t;++e){if(this._value.indexOf(this.thousandsSeparator,e)===e){++s;if(i)t+=this.thousandsSeparator.length}}return s}_separatorsCountFromSlice(t){if(t===void 0){t=this._value}return this._separatorsCount(this._removeThousandsSeparators(t).length,true)}extractInput(t,i,s){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}[t,i]=this._adjustRangeWithSeparators(t,i);return this._removeThousandsSeparators(super.extractInput(t,i,s))}_appendCharRaw(t,i){if(i===void 0){i={}}const s=i.tail&&i._beforeTailState?i._beforeTailState._value:this._value;const e=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const r=this._value;this._value+=t;const n=this.number;let u=!isNaN(n);let h=false;if(u){let t;if(this.min!=null&&this.min<0&&this.number<this.min)t=this.min;if(this.max!=null&&this.max>0&&this.number>this.max)t=this.max;if(t!=null){if(this.autofix){this._value=this.format(t,this).replace(J.UNMASKED_RADIX,this.radix);h||(h=r===this._value&&!i.tail)}else{u=false}}u&&(u=Boolean(this._value.match(this._numberRegExp)))}let o;if(!u){this._value=r;o=new T}else{o=new T({inserted:this._value.slice(r.length),rawInserted:h?"":t,skip:h})}this._value=this._insertThousandsSeparators(this._value);const a=i.tail&&i._beforeTailState?i._beforeTailState._value:this._value;const l=this._separatorsCountFromSlice(a);o.tailShift+=(l-e)*this.thousandsSeparator.length;return o}_findSeparatorAround(t){if(this.thousandsSeparator){const i=t-this.thousandsSeparator.length+1;const s=this.value.indexOf(this.thousandsSeparator,i);if(s<=t)return s}return-1}_adjustRangeWithSeparators(t,i){const s=this._findSeparatorAround(t);if(s>=0)t=s;const e=this._findSeparatorAround(i);if(e>=0)i=e+this.thousandsSeparator.length;return[t,i]}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}[t,i]=this._adjustRangeWithSeparators(t,i);const s=this.value.slice(0,t);const e=this.value.slice(i);const r=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+e));const n=this._separatorsCountFromSlice(s);return new T({tailShift:(n-r)*this.thousandsSeparator.length})}nearestInputPos(t,i){if(!this.thousandsSeparator)return t;switch(i){case b.NONE:case b.LEFT:case b.FORCE_LEFT:{const s=this._findSeparatorAround(t-1);if(s>=0){const e=s+this.thousandsSeparator.length;if(t<e||this.value.length<=e||i===b.FORCE_LEFT){return s}}break}case b.RIGHT:case b.FORCE_RIGHT:{const i=this._findSeparatorAround(t);if(i>=0){return i+this.thousandsSeparator.length}}}return t}doCommit(){if(this.value){const t=this.number;let i=t;if(this.min!=null)i=Math.max(i,this.min);if(this.max!=null)i=Math.min(i,this.max);if(i!==t)this.unmaskedValue=this.format(i,this);let s=this.value;if(this.normalizeZeros)s=this._normalizeZeros(s);if(this.padFractionalZeros&&this.scale>0)s=this._padFractionalZeros(s);this._value=s}super.doCommit()}_normalizeZeros(t){const i=this._removeThousandsSeparators(t).split(this.radix);i[0]=i[0].replace(/^(\D*)(0*)(\d*)/,((t,i,s,e)=>i+e));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))}_padFractionalZeros(t){if(!t)return t;const i=t.split(this.radix);if(i.length<2)i.push("");i[1]=i[1].padEnd(this.scale,"0");return i.join(this.radix)}doSkipInvalid(t,i,s){if(i===void 0){i={}}const e=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===J.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,i,s)&&!e}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,J.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(J.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||J.EMPTY_VALUES.includes(t)&&J.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}$=J;J.UNMASKED_RADIX=".";J.EMPTY_VALUES=[...P.EMPTY_VALUES,0];J.DEFAULTS={...P.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[$.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:true,padFractionalZeros:false,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:false,maximumFractionDigits:20})};F.MaskedNumber=J;const X={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Q(t,i,s){if(i===void 0){i=X.MASKED}if(s===void 0){s=X.MASKED}const e=B(t);return t=>e.runIsolated((e=>{e[i]=t;return e[s]}))}function tt(t,i,s,e){return Q(i,s,e)(t)}F.PIPE_TYPE=X;F.createPipe=Q;F.pipe=tt;class it extends W{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===Infinity?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:Infinity}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var i,s,e;const{repeat:r,...n}=D(t);this._blockOpts=Object.assign({},this._blockOpts,n);const u=B(this._blockOpts);this.repeat=(i=(s=r!=null?r:u.repeat)!=null?s:this.repeat)!=null?i:Infinity;super._update({mask:"m".repeat(Math.max(this.repeatTo===Infinity&&((e=this._blocks)==null?void 0:e.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===Infinity||this._blocks.length<this.repeatTo){this._blocks.push(B(this._blockOpts));this.mask+="m";return this._blocks[this._blocks.length-1]}}_appendCharRaw(t,i){if(i===void 0){i={}}const s=new T;for(let h=(e=(r=this._mapPosToBlock(this.displayValue.length))==null?void 0:r.index)!=null?e:Math.max(this._blocks.length-1,0),o,a;o=(n=this._blocks[h])!=null?n:a=!a&&this._allocateBlock(h);++h){var e,r,n,u;const l=o._appendChar(t,{...i,_beforeTailState:(u=i._beforeTailState)==null||(u=u._blocks)==null?void 0:u[h]});if(l.skip&&a){this._blocks.pop();this.mask=this.mask.slice(1);break}s.aggregate(l);if(l.consumed)break}return s}_trimEmptyTail(t,i){var s,e;if(t===void 0){t=0}const r=Math.max(((s=this._mapPosToBlock(t))==null?void 0:s.index)||0,this.repeatFrom,0);let n;if(i!=null)n=(e=this._mapPosToBlock(i))==null?void 0:e.index;if(n==null)n=this._blocks.length-1;let u=0;for(let t=n;r<=t;--t,++u){if(this._blocks[t].unmaskedValue)break}if(u){this._blocks.splice(n-u+1,u);this.mask=this.mask.slice(u)}}reset(){super.reset();this._trimEmptyTail()}remove(t,i){if(t===void 0){t=0}if(i===void 0){i=this.displayValue.length}const s=super.remove(t,i);this._trimEmptyTail(t,i);return s}totalInputPositions(t,i){if(t===void 0){t=0}if(i==null&&this.repeatTo===Infinity)return Infinity;return super.totalInputPositions(t,i)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length;this.mask=this.mask.slice(0,this._blocks.length);super.state=t}}F.RepeatBlock=it;try{globalThis.IMask=F}catch{}const st='@-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:center;align-items:center;-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{-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}';const et=st;const rt={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"};const nt=Object.entries(rt).map((([t,i])=>({value:t,label:i})));const ut=`<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>`;const ht=class{constructor(s){t(this,s);this.exit=i(this,"exit",7);this.pinEntered=i(this,"pinEntered",7);this.next=i(this,"next",7);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.response="";this.updatedRecipient=null;this.dobContainerId=`verdocs-date-input-${Math.random().toString(36).substring(2,11)}`}componentWillLoad(){this.updatedRecipient={...this.recipient||{}}}componentDidRender(){F(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 s=t.getMonth()+1;var e=t.getFullYear();if(i<10)i="0"+i;if(s<10)s="0"+s;return[s,i,e].join("/")},parse:function(t){var i=t.split("/");return new Date(i[2],i[0]-1,i[1])}})}handleCancel(){this.exit.emit()}handleDismiss(t){if(t.target.class==="background-overlay"){t.preventDefault();this.handleCancel()}}handleDone(){this.next.emit(this.response);this.response=""}handleConfirmID(){console.log("Confirm ID",this.updatedRecipient);this.next.emit(this.updatedRecipient)}render(){var t,i,n,u,h,o,a,l,d,c,f,p;if(this.mode==="choice"){return s(r,null,s("div",{class:"background-overlay",onClick:t=>this.handleDismiss(t)},s("div",{class:"dialog"},s("div",{class:"heading"},"Confirm Your Identity",this.steps>1?s("span",{class:"step"},"(",this.step,"/",this.steps,")"):s(e,null)),!!this.helptitle&&s("div",{class:"help-box"},s("div",{class:"help-icon",innerHTML:ut}),s("div",{class:"help-details"},s("div",{class:"help-title"},this.helptitle),s("div",{class:"help-text"},this.helptext))),s("div",{class:"choices"},this.choices.map((t=>s("div",{class:`choice ${t===this.response?"selected":""}`,onClick:()=>{console.log("Selected",t);this.response=t}},t)))),s("div",{class:"buttons"},s("verdocs-button",{label:"Cancel",variant:"outline",onClick:()=>this.handleCancel()}),s("verdocs-button",{label:this.step<this.steps?"Next":"Submit",onClick:()=>this.handleDone(),disabled:!this.response})))))}if(this.mode==="identity"){return s(r,null,s("div",{class:"background-overlay",onClick:t=>this.handleDismiss(t)},s("div",{class:"dialog"},s("div",{class:"heading"},"Confirm Your Identity"),!!this.helptitle&&s("div",{class:"help-box"},s("div",{class:"help-icon",innerHTML:ut}),s("div",{class:"help-details"},s("div",{class:"help-title"},"Identity verification is required"),s("div",{class:"help-text"},"NOTE: Only four fields are required, but providing more details will allow us to complete the verification process more quickly."))),s("div",{class:"field"},s("label",{htmlFor:"verdocs-kba-first"},"Your Name:",s("span",{class:"required"},"*")),s("input",{required:true,type:"text",id:"verdocs-kba-first",name:"verdocs-kba-first",placeholder:"First name...",value:(t=this.updatedRecipient)===null||t===void 0?void 0:t.first_name,onInput:t=>this.updatedRecipient={...this.updatedRecipient,first_name:t.target.value}}),s("input",{type:"text",id:"verdocs-kba-last",name:"verdocs-kba-last",placeholder:"Last name...",required:true,value:(i=this.updatedRecipient)===null||i===void 0?void 0:i.last_name,onInput:t=>this.updatedRecipient={...this.updatedRecipient,last_name:t.target.value}})),s("div",{class:"field"},s("label",{htmlFor:"verdocs-kba-address"},"Address:",s("span",{class:"required"},"*")),s("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:t=>this.updatedRecipient={...this.updatedRecipient,address:t.target.value}})),s("div",{class:"field"},s("label",{htmlFor:"verdocs-kba-city"},"City:"),s("input",{type:"text",id:"verdocs-kba-city",name:"verdocs-kba-city",placeholder:"City...",value:(u=this.updatedRecipient)===null||u===void 0?void 0:u.city,onInput:t=>this.updatedRecipient={...this.updatedRecipient,city:t.target.value}})),s("div",{class:"field"},s("label",{htmlFor:"verdocs-kba-state"},"State:"),s("verdocs-select-input",{options:nt,value:(h=this.updatedRecipient)===null||h===void 0?void 0:h.state,onInput:t=>this.updatedRecipient={...this.updatedRecipient,state:t.target.value}})),s("div",{class:"field"},s("label",{htmlFor:"verdocs-kba-zip"},"Zip Code:",s("span",{class:"required"},"*")),s("input",{type:"text",id:"verdocs-kba-zip",name:"verdocs-kba-zip",placeholder:"Zip Code...",required:true,value:(o=this.updatedRecipient)===null||o===void 0?void 0:o.zip,onInput:t=>this.updatedRecipient={...this.updatedRecipient,zip:t.target.value}})),s("div",{class:"field"},s("label",{htmlFor:this.dobContainerId},"Date of Birth:",s("span",{class:"required"},"*")),s("input",{type:"text",value:((a=this.updatedRecipient)===null||a===void 0?void 0:a.dob)||"",id:this.dobContainerId,placeholder:"DOB...",onInput:t=>this.updatedRecipient={...this.updatedRecipient,dob:t.target.value}})),s("div",{class:"buttons"},s("verdocs-button",{label:"Submit",onClick:()=>this.handleConfirmID(),disabled:!((l=this.updatedRecipient)===null||l===void 0?void 0:l.first_name)||!((d=this.updatedRecipient)===null||d===void 0?void 0:d.last_name)||!((c=this.updatedRecipient)===null||c===void 0?void 0:c.address)||!((f=this.updatedRecipient)===null||f===void 0?void 0:f.zip)||!((p=this.updatedRecipient)===null||p===void 0?void 0:p.dob)})))))}return s(r,null,s("div",{class:"background-overlay",onClick:t=>this.handleDismiss(t)},s("div",{class:"dialog"},s("div",{class:"heading"},"Please Confirm Your Identity",this.steps>1?s("span",{class:"step"},"(",this.step,"/",this.steps,")"):s(e,null)),!!this.helptitle&&s("div",{class:"help-box"},s("div",{class:"help-icon",innerHTML:ut}),s("div",{class:"help-details"},s("div",{class:"help-title"},this.helptitle),s("div",{class:"help-text"},this.helptext))),s("div",{class:"input"},s("label",{htmlFor:"verdocs-kba-input"},this.label),s("input",{type:"text",id:"verdocs-kba-input",name:"verdocs-kba-input",placeholder:this.placeholder,value:this.response,onInput:t=>this.response=t.target.value})),s("div",{class:"buttons"},s("verdocs-button",{label:"Cancel",variant:"outline",onClick:()=>this.handleCancel()}),s("verdocs-button",{label:"Submit",onClick:()=>this.handleDone(),disabled:!this.response})))))}};ht.style=et;const ot='@-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}';const at=ot;const lt=class{constructor(s){t(this,s);this.sdkError=i(this,"sdkError",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.another=i(this,"another",7);this.view=i(this,"view",7);this.next=i(this,"next",7);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}async componentWillLoad(){var t,i,s;if(!this.endpoint){this.endpoint=u.getDefault();this.endpoint.loadSession()}if(!this.envelopeId){console.error(`[VIEW] Missing required envelopeId`);return}this.listenToEnvelope();if(!this.envelope){try{console.log("[VIEW] Loading envelope...");this.envelope=await h(this.endpoint,this.envelopeId);console.log("[VIEW] Loaded envelope",this.envelope)}catch(e){this.showLoadError=true;(t=this.sdkError)===null||t===void 0?void 0:t.emit(new f(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(s=e.response)===null||s===void 0?void 0:s.data))}}}componentDidRender(){const t=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-view-header");if(t&&i){console.log("[VIEW] Moving header");i.remove();t.append(i)}}disconnectedCallback(){this.unlistenToEnvelope()}async listenToEnvelope(){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();p.subscribe("envelopes",this.envelopeId,(()=>h(this.endpoint,this.envelopeId)),true,(t=>{this.envelope=t;this.loading=false}))}unlistenToEnvelope(){if(this.envelopeListenerId){p.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}}handlePageRendered(t){}async handleOptionSelected(t){var i,s;switch(t.detail.id){case"cancel":if(confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")){this.canceling=true;a(this.endpoint,this.envelopeId).then((t=>{this.canceling=false;console.log("[VIEW] Envelope canceled",t);return h(this.endpoint,this.envelopeId)})).then((t=>{console.log("[VIEW] Loaded new envelope details",t);this.envelope=t})).catch((t=>{var i,s,e;this.canceling=false;console.log("[VIEW] Error canceling envelope",t);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new f(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(e=t.response)===null||e===void 0?void 0:e.data))}));this.showCancelDone=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"})}break;case"print":window.print();(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download-attachments":{const t=this.envelope.documents.find((t=>t.type==="attachment"));if(t){const i=await o(this.endpoint,this.envelopeId,t.id);window.open(i,"_blank")}}break;case"download-certificate":{const t=this.envelope.documents.find((t=>t.type==="certificate"));if(t){const i=await o(this.endpoint,this.envelopeId,t.id);window.open(i,"_blank")}}break;case"download-all":c(this.endpoint,[this.envelope]).then((()=>{var t;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})})).catch((t=>{console.log("Error downloading Zip",t)}));break}}render(){var t;if(this.loading){return s(r,null,s("verdocs-loader",null))}if(this.showLoadError){return s(r,null,s("verdocs-ok-dialog",{heading:"Unable to View Envelope",message:`Sorry, that envelope is not valid.`,buttonLabel:"OK",onNext:()=>{this.showLoadError=false}}))}if(!this.envelope){return s(r,null,s("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"}))}const i=[{id:"print",label:"Print"}];if(l(this.endpoint.profile,this.envelope)){i.push({id:"cancel",label:"Cancel"})}const n=this.envelope.documents.length>0;const u=this.envelope.documents.filter((t=>t.type==="attachment")).length;const h=this.envelope.documents.find((t=>t.type==="certificate"))!==undefined;if(n||h){i.push({label:""});if(n){i.push({id:"download-attachments",label:u>1?"Download Documents":"Download Document"})}if(h){i.push({id:"download-certificate",label:"Download Certificate"})}if(n&&h){i.push({id:"download-all",label:"Download All Files"})}}return s(r,null,s("div",{id:"verdocs-view-header"},s("div",{class:"inner"},s("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),s("div",{class:"title"},this.envelope.name),s("div",{style:{flex:"1"}}),s("div",{style:{marginLeft:"10px"}}),s("verdocs-dropdown",{options:i,onOptionSelected:t=>this.handleOptionSelected(t)}))),s("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(((t=this.envelope)===null||t===void 0?void 0:t.documents)||[]).filter((t=>t.type!=="certificate")).map((t=>{const i=d(1,t.pages);return s(e,null,i.map((i=>{var e;const r=((e=t.page_sizes)===null||e===void 0?void 0:e[i])||{width:612,height:792};return s("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:t.id,endpoint:this.endpoint,type:"filled",virtualWidth:r.width,virtualHeight:r.height,pageNumber:i,onPageRendered:t=>this.handlePageRendered(t),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showCancelDone&&s("verdocs-ok-dialog",{heading:"Cancelled",message:`This envelope has been cancelled successfully.`,onNext:()=>{this.showCancelDone=false}}),this.canceling&&s("div",{class:"loading-indicator"},s("verdocs-loader",null)))}get component(){return n(this)}};lt.style=at;export{ht as verdocs_kba_dialog,lt as verdocs_view};
|
2
|
+
//# sourceMappingURL=p-b17b12c5.entry.js.map
|