@verdocs/web-sdk 6.10.6 → 6.12.1
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-C3P2cz0J.js +14 -0
- package/dist/cjs/Environment-C3P2cz0J.js.map +1 -0
- package/dist/cjs/{Icons-TVvtZ5iL.js → Icons-Zdy_DFce.js} +16 -2
- package/dist/cjs/{Icons-TVvtZ5iL.js.map → Icons-Zdy_DFce.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-auth.cjs.entry.js +271 -15
- package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +12 -14
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +2 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +45 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +302 -19
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +12 -14
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/utils/Environment.js +4 -7
- package/dist/collection/utils/Environment.js.map +1 -1
- package/dist/collection/utils/Icons.js +12 -0
- package/dist/collection/utils/Icons.js.map +1 -1
- package/dist/components/{p-DCZz2B7h.js → p-6RWROB9R.js} +2 -2
- package/dist/components/p-6RWROB9R.js.map +1 -0
- package/dist/components/{p-i3o08M2d.js → p-B1UVXqFA.js} +2 -2
- package/dist/components/{p-bPe0_Dsn.js → p-B8R4luxA.js} +2 -2
- package/dist/components/{p-D-TexkaT.js → p-BXaR1BSS.js} +2 -2
- package/dist/components/{p-DL4-aTsZ.js → p-BYLm9aol.js} +2 -2
- package/dist/components/{p-DiYuPnJJ.js → p-Bp88Loqg.js} +2 -2
- package/dist/components/{p-C43B3SP_.js → p-C7JN32A9.js} +2 -2
- package/dist/components/{p-BDv5kBUR.js → p-C7k2AOsW.js} +2 -2
- package/dist/components/p-C7k2AOsW.js.map +1 -0
- package/dist/components/{p-DKKsPZnz.js → p-CCr_gliS.js} +2 -2
- package/dist/components/{p-BELGzhZw.js → p-CFau7OiC.js} +2 -2
- package/dist/components/{p-zTcSNwsp.js → p-Ck4pdoyc.js} +2 -2
- package/dist/components/{p-DZa0rMk2.js → p-CsF979IT.js} +2 -2
- package/dist/components/{p-CYvB5bYX.js → p-CtNpZzq1.js} +2 -2
- package/dist/components/{p-B6aUlIQe.js → p-CzKj8wD_.js} +2 -2
- package/dist/components/{p-DiwfOWXt.js → p-DJMr11ue.js} +2 -2
- package/dist/components/{p-CZwyK_uo.js → p-DLo5dMNn.js} +2 -2
- package/dist/components/{p-D1cSgqut.js → p-D_FNSGtS.js} +2 -2
- package/dist/components/p-DavVixMP.js +2 -0
- package/dist/components/p-DavVixMP.js.map +1 -0
- package/dist/components/{p-K_PKw6bs.js → p-DmxiVavg.js} +2 -2
- package/dist/components/{p-D7oMWhqM.js → p-DrNmI7Wz.js} +2 -2
- package/dist/components/{p-DfIxVX8-.js → p-DubfX0n1.js} +2 -2
- package/dist/components/{p-Dy2CRiH8.js → p-b2u0_wDk.js} +1 -1
- package/dist/components/p-b2u0_wDk.js.map +1 -0
- package/dist/components/{p-CAGp0qKc.js → p-hxWwaOcD.js} +2 -2
- package/dist/components/{p-BQUZjuoP.js → p-vcHtLpWY.js} +2 -2
- package/dist/components/verdocs-adopt-signature-dialog.js +1 -1
- package/dist/components/verdocs-auth.js +1 -1
- package/dist/components/verdocs-auth.js.map +1 -1
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-delegate-dialog.js +1 -1
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -1
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-payment.js +1 -1
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-field-textarea.js +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-file-chooser.js +1 -1
- package/dist/components/verdocs-otp-dialog.js +1 -1
- package/dist/components/verdocs-passcode-dialog.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-template-attachments.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-toolbar-icon.js +1 -1
- package/dist/custom-elements.json +2508 -0
- package/dist/esm/Environment-b2u0_wDk.js +12 -0
- package/dist/esm/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm/{Icons-BU5rnXp2.js → Icons-DobS6Y7w.js} +15 -3
- package/dist/esm/{Icons-BU5rnXp2.js.map → Icons-DobS6Y7w.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +2 -2
- package/dist/esm/verdocs-auth.entry.js +273 -17
- package/dist/esm/verdocs-auth.entry.js.map +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +12 -14
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +2 -2
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{Environment-Dy2CRiH8.js → Environment-b2u0_wDk.js} +1 -1
- package/dist/esm-es5/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm-es5/{Icons-BU5rnXp2.js → Icons-DobS6Y7w.js} +2 -2
- package/dist/esm-es5/{Icons-BU5rnXp2.js.map → Icons-DobS6Y7w.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +31 -3
- package/dist/types/components.d.ts +18 -7
- package/dist/types/utils/Icons.d.ts +2 -0
- package/dist/verdocs-web-sdk/{p-869024e0.system.entry.js → p-09f5670e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-0fb8e6e0.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-0fb8e6e0.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-e87a29a3.system.entry.js → p-298d799f.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-734c8a8b.entry.js → p-2a6a3bc6.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-46e52384.system.entry.js → p-39c54b65.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-62464041.system.entry.js → p-439d36b0.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d95705c6.entry.js → p-4930b31d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-255e1915.entry.js → p-4e0788f9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-4e0788f9.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js → p-4ea0632f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js.map → p-4ea0632f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-c86111fd.system.entry.js → p-5404f6bf.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-10d47bbd.entry.js → p-5cad2422.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4aee15e6.entry.js → p-932e8b9b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6e8ce989.system.entry.js → p-99f7a0fa.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-GqS1qR-V.system.js → p-BHF3ByWV.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-GqS1qR-V.system.js.map → p-BHF3ByWV.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-C96xjMgt.system.js → p-COHG5J4h.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-COHG5J4h.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-BU5rnXp2.js → p-DobS6Y7w.js} +2 -2
- package/dist/verdocs-web-sdk/{p-BU5rnXp2.js.map → p-DobS6Y7w.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-Dy2CRiH8.js → p-b2u0_wDk.js} +1 -1
- package/dist/verdocs-web-sdk/p-b2u0_wDk.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js → p-ba0d4ff5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js.map → p-ba0d4ff5.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c3e9634c.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-c3e9634c.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7e1f895c.entry.js → p-dd59aa9a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c3527f3e.system.entry.js → p-f7b14409.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1df29abb.entry.js → p-fe404347.entry.js} +2 -2
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +4 -4
- package/dist/cjs/Environment-CUCX3aWX.js +0 -17
- package/dist/cjs/Environment-CUCX3aWX.js.map +0 -1
- package/dist/components/p-BDv5kBUR.js.map +0 -1
- package/dist/components/p-CYqVJ_kJ.js +0 -2
- package/dist/components/p-CYqVJ_kJ.js.map +0 -1
- package/dist/components/p-DCZz2B7h.js.map +0 -1
- package/dist/components/p-Dy2CRiH8.js.map +0 -1
- package/dist/esm/Environment-Dy2CRiH8.js +0 -15
- package/dist/esm/Environment-Dy2CRiH8.js.map +0 -1
- package/dist/esm-es5/Environment-Dy2CRiH8.js.map +0 -1
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-255e1915.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-46e52384.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-C96xjMgt.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Dy2CRiH8.js.map +0 -1
- /package/dist/components/{p-i3o08M2d.js.map → p-B1UVXqFA.js.map} +0 -0
- /package/dist/components/{p-bPe0_Dsn.js.map → p-B8R4luxA.js.map} +0 -0
- /package/dist/components/{p-D-TexkaT.js.map → p-BXaR1BSS.js.map} +0 -0
- /package/dist/components/{p-DL4-aTsZ.js.map → p-BYLm9aol.js.map} +0 -0
- /package/dist/components/{p-DiYuPnJJ.js.map → p-Bp88Loqg.js.map} +0 -0
- /package/dist/components/{p-C43B3SP_.js.map → p-C7JN32A9.js.map} +0 -0
- /package/dist/components/{p-DKKsPZnz.js.map → p-CCr_gliS.js.map} +0 -0
- /package/dist/components/{p-BELGzhZw.js.map → p-CFau7OiC.js.map} +0 -0
- /package/dist/components/{p-zTcSNwsp.js.map → p-Ck4pdoyc.js.map} +0 -0
- /package/dist/components/{p-DZa0rMk2.js.map → p-CsF979IT.js.map} +0 -0
- /package/dist/components/{p-CYvB5bYX.js.map → p-CtNpZzq1.js.map} +0 -0
- /package/dist/components/{p-B6aUlIQe.js.map → p-CzKj8wD_.js.map} +0 -0
- /package/dist/components/{p-DiwfOWXt.js.map → p-DJMr11ue.js.map} +0 -0
- /package/dist/components/{p-CZwyK_uo.js.map → p-DLo5dMNn.js.map} +0 -0
- /package/dist/components/{p-D1cSgqut.js.map → p-D_FNSGtS.js.map} +0 -0
- /package/dist/components/{p-K_PKw6bs.js.map → p-DmxiVavg.js.map} +0 -0
- /package/dist/components/{p-D7oMWhqM.js.map → p-DrNmI7Wz.js.map} +0 -0
- /package/dist/components/{p-DfIxVX8-.js.map → p-DubfX0n1.js.map} +0 -0
- /package/dist/components/{p-CAGp0qKc.js.map → p-hxWwaOcD.js.map} +0 -0
- /package/dist/components/{p-BQUZjuoP.js.map → p-vcHtLpWY.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-869024e0.system.entry.js.map → p-09f5670e.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e87a29a3.system.entry.js.map → p-298d799f.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-734c8a8b.entry.js.map → p-2a6a3bc6.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-62464041.system.entry.js.map → p-439d36b0.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d95705c6.entry.js.map → p-4930b31d.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c86111fd.system.entry.js.map → p-5404f6bf.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-10d47bbd.entry.js.map → p-5cad2422.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4aee15e6.entry.js.map → p-932e8b9b.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-6e8ce989.system.entry.js.map → p-99f7a0fa.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7e1f895c.entry.js.map → p-dd59aa9a.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c3527f3e.system.entry.js.map → p-f7b14409.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-1df29abb.entry.js.map → p-fe404347.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s,F as o,g as n}from"./p-CjTHbolG.js";import{VerdocsEndpoint as l,DEFAULT_DISCLOSURES as a,startSigningSession as r,getEnvelope as d,envelopeRecipientAgree as c,updateEnvelopeField as h,createSignature as p,createInitials as u,sortFields as g,envelopeRecipientSubmit as v,isFieldValid as f,isFieldFilled as m,uploadEnvelopeFieldAttachment as x,deleteEnvelopeFieldAttachment as b,formatFullName as w,fullNameToInitials as y,verifySigner as k,getEnvelopesZip as C,getEnvelopeDocumentDownloadLink as S,getCombinedEnvelopeDocumentDownloadLink as N,delegateRecipient as I,envelopeRecipientDecline as z,integerSequence as G,askQuestion as L}from"@verdocs/js-sdk";import{u as H,g as T,r as D,a as E,d as F}from"./p-CGsVCy75.js";import{D as V}from"./p-CIxfEdV7.js";import{D as q,C as M}from"./p-BU5rnXp2.js";import{V as P}from"./p-D97GxsI-.js";import{S as A}from"./p-C1sRVZWv.js";import{S as R}from"./p-C7hFgM52.js";import"./p-BglCURB-.js";const j=()=>`verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;min-height:700px;position:relative;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f5f5f5;font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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;padding-right:140px;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>.document .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-sign>.document .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-sign>.document .document-separator:first-child{margin-top:0}verdocs-sign .signed-document-container{width:64%;margin-left:260px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}verdocs-sign .signed-document-container.zoom-normal{width:64%;margin-left:260px}verdocs-sign .signed-document-container.zoom-zoom1{width:80%;margin-left:200px}verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:150px}verdocs-sign .signed-document-container.zoom-zoom2 .verdocs-flag-instance{opacity:0;pointer-events:none}@media (max-width: 768px){verdocs-sign verdocs-sign-footer{padding:0 10px}verdocs-sign verdocs-sign-footer .buttons{gap:8px}verdocs-sign verdocs-sign-footer .buttons button{font-size:10px}verdocs-sign .signed-document-container{width:100%;margin-left:0}verdocs-sign .signed-document-container.zoom-normal,verdocs-sign .signed-document-container.zoom-zoom1,verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:0}verdocs-sign>.document{padding-right:15px}verdocs-sign .verdocs-flag-instance{display:none !important}verdocs-sign .controls-toolbar .center-controls{display:none}verdocs-sign .controls-toolbar .right-controls .mobile-next-button{display:block;margin-right:10px}verdocs-sign .controls-toolbar .right-controls .minus,verdocs-sign .controls-toolbar .right-controls .plus{display:none}}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 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:360px;width:50%;font-size:16px;background:white;-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,.controls-toolbar,.verdocs-flag-instance,verdocs-signing-progress{display:none !important}verdocs-sign{min-height:auto;background-color:white}verdocs-sign>.document{overflow:visible;height:auto;display:block;padding:0;margin:0}verdocs-sign>.document .document-separator{display:none}verdocs-sign .signed-document-container{width:100%;margin:0}}#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;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}#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}@media (max-width: 670px){#verdocs-sign-header .title{font-size:14px}}#verdocs-sign-header .remaining-count{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:8px;color:#ffffff;font-size:13px;font-weight:400;white-space:nowrap}#verdocs-sign-header .remaining-count .check-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}#verdocs-sign-header .remaining-count .check-icon svg{width:16px;height:16px;fill:#55bc81}#verdocs-sign-header .remaining-count .separator{opacity:0.5;margin:0 2px}#verdocs-sign-header .remaining-count .review-optional{cursor:pointer;text-decoration:underline}#verdocs-sign-header .remaining-count .review-optional:hover{color:#54d68c}@media (max-width: 670px){#verdocs-sign-header .remaining-count .review-optional{display:none}}@media (max-width: 670px){#verdocs-sign-header .remaining-count{font-size:12px}}#verdocs-sign-header .icon-button{width:20px;height:32px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}#verdocs-sign-header .icon-button svg path{fill:#ffffff}#verdocs-sign-header .icon-button:hover{background-color:rgba(255, 255, 255, 0.1)}#verdocs-sign-header .icon-button.disabled{opacity:0.35;pointer-events:none}#verdocs-sign-header .icon-button+.icon-button{margin-left:-6px}@media (max-width: 670px){#verdocs-sign-header .icon-button.magnify{display:none}}.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}.controls-toolbar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:54px;padding:0 12px 0 24px;background-color:#ffffff;border-bottom:1px solid #e0e0e0;-webkit-box-shadow:none;box-shadow:none;font-family:"Inter", sans-serif;color:#424242;z-index:1000}.controls-toolbar .left-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .left-controls .title{font-weight:500;font-size:16px;color:#242424;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.controls-toolbar .center-controls{-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:10px;font-size:14px;display:none}.controls-toolbar .center-controls .label{color:#000000;font-weight:300}.controls-toolbar .center-controls .select-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .center-controls .select-wrapper verdocs-select-input{margin:0}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-label{display:none}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element{background:transparent;border:1px solid #e0e0e0;height:32px;padding:2px 8px;min-width:60px;text-align:center;font-family:inherit;color:#424242}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element:focus{border-color:var(--verdocs-primary-color, #55bc81)}.controls-toolbar .center-controls .count{color:#000000;font-weight:300}.controls-toolbar .right-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.controls-toolbar .right-controls .mobile-next-button{display:none}.controls-toolbar .right-controls .icon-button{width:32px;height:32px;display:-ms-flexbox;display:flex;color:#424242;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}.controls-toolbar .right-controls .icon-button:hover{background-color:#f5f5f5}.controls-toolbar .right-controls .icon-button.disabled{opacity:0.3;pointer-events:none}.controls-toolbar .right-controls .icon-button svg{display:block;width:20px;height:20px}`;const O=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11ZM14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z" fill="#424242" /></svg>`;const U=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5ZM8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z" fill="#424242" /></svg>`;const $=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 16.9988C15.7761 16.9988 16 17.2226 16 17.4988C16 17.7442 15.8231 17.9484 15.5899 17.9907L15.5 17.9988H4.5C4.22386 17.9988 4 17.7749 4 17.4988C4 17.2533 4.17688 17.0492 4.41012 17.0068L4.5 16.9988H15.5ZM10.0001 2.00098C10.2456 2.00098 10.4497 2.17798 10.492 2.41124L10.5 2.50112L10.496 14.295L14.1414 10.6466C14.3148 10.4729 14.5842 10.4534 14.7792 10.5882L14.8485 10.646C15.0222 10.8194 15.0418 11.0888 14.907 11.2838L14.8492 11.3531L10.3574 15.8531C10.285 15.9257 10.1957 15.9714 10.1021 15.9901L9.99608 15.9999C9.83511 15.9999 9.69192 15.9237 9.60051 15.8056L5.14386 11.3537C4.94846 11.1586 4.94823 10.842 5.14336 10.6466C5.3168 10.4729 5.58621 10.4534 5.78117 10.5883L5.85046 10.6461L9.496 14.287L9.5 2.50083C9.50008 2.22469 9.724 2.00098 10.0001 2.00098Z" fill="#424242"/></svg>`;const Z=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5C5 3.67157 5.67157 3 6.5 3H13.5C14.3284 3 15 3.67157 15 4.5V5H15.5C16.8807 5 18 6.11929 18 7.5V12.5C18 13.3284 17.3284 14 16.5 14H15V15.5C15 16.3284 14.3284 17 13.5 17H6.5C5.67157 17 5 16.3284 5 15.5V14H3.5C2.67157 14 2 13.3284 2 12.5V7.5C2 6.11929 3.11929 5 4.5 5H5V4.5ZM6 5H14V4.5C14 4.22386 13.7761 4 13.5 4H6.5C6.22386 4 6 4.22386 6 4.5V5ZM5 13V11.5C5 10.6716 5.67157 10 6.5 10H13.5C14.3284 10 15 10.6716 15 11.5V13H16.5C16.7761 13 17 12.7761 17 12.5V7.5C17 6.67157 16.3284 6 15.5 6H4.5C3.67157 6 3 6.67157 3 7.5V12.5C3 12.7761 3.22386 13 3.5 13H5ZM6.5 11C6.22386 11 6 11.2239 6 11.5V15.5C6 15.7761 6.22386 16 6.5 16H13.5C13.7761 16 14 15.7761 14 15.5V11.5C14 11.2239 13.7761 11 13.5 11H6.5Z" fill="#424242"/></svg>`;const Y=class{constructor(i){e(this,i);this.sdkError=t(this,"sdkError");this.envelopeLoaded=t(this,"envelopeLoaded");this.envelopeUpdated=t(this,"envelopeUpdated");this.endpoint=new l({sessionType:"signing"});this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.toolbarStyle="menu";this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=a;this.fieldUpdateCounter=0;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.adoptingSignature=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.signatureId=null;this.initialId=null;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.pageNumber=1;this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.showDownloadDialog=false;this.loading=true;this.envelope=null;this.zoomLevel="normal";this.signingProgressMode="start";this.polling=true;this.renderedPages={};this.pollingInterval=null;this.handleDoneDialogDismiss=async()=>{this.showDone=false;if(!this.isDone){this.prepareForViewTransition();await new Promise((e=>requestAnimationFrame((()=>e()))));this.isDone=true}}}async componentDidLoad(){var e,t,i,s,o,n;this.updateZoomFromWindow();window.addEventListener("resize",(()=>this.updateZoomFromWindow()));if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new A("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new A("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new A("[SIGN] Missing required inviteCode",500,""));return}try{await this.initSigningSession()}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new A(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}async initSigningSession(){console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await r(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}async retrySigningSession(){var e,t,i;this.showLoadError=false;this.loading=true;try{await this.initSigningSession()}catch(s){console.log("[SIGN] Error with signing session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new A(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));this.showLoadError=true;this.loading=false}}prepareForViewTransition(){var e,t;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();this.observer=null;(t=document.getElementById("air-datepicker-global-container"))===null||t===void 0?void 0:t.remove()}async handleSubmitSuccess(){var e,t;this.submitting=false;this.submitted=true;this.nextSubmits=false;this.signingProgressMode="completed";try{const i=await d(this.endpoint,this.envelopeId);this.envelope=i;R.updateEnvelope(this.envelopeId,i);const s=(e=i.recipients)===null||e===void 0?void 0:e.find((e=>{var t;return e.role_name===((t=this.recipient)===null||t===void 0?void 0:t.role_name)}));if(s){this.recipient=s}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:i,event:"submitted"})}catch(e){console.warn("[SIGN] Error refreshing envelope after submit",e)}this.showDone=true}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}this.setupIntersectionObserver()}disconnectedCallback(){var e,t,i;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();window.removeEventListener("resize",(()=>this.updateZoomFromWindow()));(t=document.getElementById(this.getOrgStyleOverridesId()))===null||t===void 0?void 0:t.remove();(i=document.getElementById(this.getBrandStyleOverridesId()))===null||i===void 0?void 0:i.remove()}updateZoomFromWindow(){const e=window.innerWidth;if(e<768){if(this.zoomLevel!=="zoom2")this.zoomLevel="zoom2"}else if(e<1024){if(this.zoomLevel!=="zoom1")this.zoomLevel="zoom1"}else{if(this.zoomLevel!=="normal")this.zoomLevel="normal"}}setupIntersectionObserver(){const e=this.el.querySelectorAll("verdocs-envelope-document-page");if(e.length===0)return;if(this.observer){this.observer.disconnect()}const t=this.el.querySelector(".signed-document-container");const i={root:t,rootMargin:"-40% 0px -40% 0px",threshold:0};this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;const i=parseInt(t.replace("page-",""),10);if(!isNaN(i)&&this.pageNumber!==i){this.pageNumber=i}}}))}),i);e.forEach((e=>this.observer.observe(e)))}getOrgStyleOverridesId(){return`verdocs-org-style-overrides-${this.envelopeId}`}getBrandStyleOverridesId(){return`verdocs-brand-style-overrides-${this.envelopeId}`}applyOrgStyleOverrides(){var e,t;const i=this.getOrgStyleOverridesId();const s=document.getElementById(i);const o=(t=(e=this.envelope)===null||e===void 0?void 0:e.organization)===null||t===void 0?void 0:t.style_overrides;if(typeof o==="string"){const e=s||document.createElement("style");e.id=i;e.textContent=o;if(!s){document.head.appendChild(e)}}else if(s){s.remove()}}applyBrandStyleOverrides(e){const t=this.getBrandStyleOverridesId();const i=document.getElementById(t);const s=e===null||e===void 0?void 0:e.style_overrides;if(typeof s==="string"&&s.length>0){const e=i||document.createElement("style");e.id=t;e.textContent=s;if(!i){document.head.appendChild(e)}}else if(i){i.remove()}}processAuthResponse(e){var t,i,s,o;const{envelope:n,recipient:l,brand:r}=e;(t=n.documents)===null||t===void 0?void 0:t.sort(((e,t)=>e.order!==t.order?e.order-t.order:e.created_at.localeCompare(t.created_at)));const{auth_step:d}=l;this.recipient=l;this.envelope=n;this.disclosures=((s=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||s===void 0?void 0:s.disclaimer)||a;this.applyOrgStyleOverrides();this.applyBrandStyleOverrides(r);this.authStep=d;this.delegated=!!l.delegated_to;this.agreed=l.agreed;this.signatureId=null;this.initialId=null;this.submitted=l.status==="submitted";this.loading=false;this.isDone=this.submitted;this.showDone=this.submitted;R.updateEnvelope(this.envelopeId,n);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=l.auth_method_states||{};this.kbaQuestions=l.kba_questions;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(l.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(o=this.envelopeLoaded)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);const e=Intl.DateTimeFormat().resolvedOptions();c(this.endpoint,this.envelopeId,this.roleId,this.disclosures,{locale:e.locale,timezone:e.timeZone}).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 t,i,s;console.log("[SIGN] Unable to accept disclosures",e);P("Unable to accept disclosures, please try again later",{style:"error"});(t=this.sdkError)===null||t===void 0?void 0:t.emit(new A(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(s=e.response)===null||s===void 0?void 0:s.data));this.submitting=false}))}handlePageSelect(e){const t=parseInt(e.target.value);if(!isNaN(t)){this.pageNumber=t;const e=this.el.querySelector(".signed-document-container");const i=this.el.querySelector(`#page-${t}`);if(e&&i){const t=i.offsetTop-20;e.scrollTo({top:t,behavior:"smooth"})}}}async handleOptionSelected(e){var t,i;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":this.showDownloadDialog=true;this.startPolling();break}}startPolling(){this.stopPolling();const e=()=>{var e,t,i,s,o,n;const l=((e=this.envelope)===null||e===void 0?void 0:e.status)==="complete"||!!((t=this.envelope)===null||t===void 0?void 0:t.signed);const a=(s=(i=this.envelope)===null||i===void 0?void 0:i.documents)===null||s===void 0?void 0:s.some((e=>e.type==="certificate"));const r=(n=(o=this.envelope)===null||o===void 0?void 0:o.recipients)===null||n===void 0?void 0:n.every((e=>e.status==="submitted"));if(l&&a)return false;if(!r)return false;return true};if(!e()){return}this.polling=true;this.pollingInterval=setInterval((async()=>{try{const t=await d(this.endpoint,this.envelopeId);this.envelope=t;R.updateEnvelope(this.envelopeId,t);this.checkRecipientFields();if(!e()){this.stopPolling()}}catch(e){console.error("[SIGN] Polling error",e);this.stopPolling()}}),5e3)}stopPolling(){if(this.pollingInterval){clearInterval(this.pollingInterval);this.pollingInterval=null}this.polling=false}handleZoomIn(){if(this.zoomLevel==="normal"){this.zoomLevel="zoom1"}else if(this.zoomLevel==="zoom1"){this.zoomLevel="zoom2"}}handleZoomOut(){if(this.zoomLevel==="zoom1"){this.zoomLevel="normal"}else if(this.zoomLevel==="zoom2"){this.zoomLevel="zoom1"}}updateRecipientFieldValue(e,t){console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((i=>{if(i.name===e){i.value=t.value;i.settings=t.settings;H(i);this.fieldUpdateCounter++;this.markEnvelopeStarted();this.checkRecipientFields()}}))}getStartedKey(){var e;return`${this.envelopeId}:${((e=this.recipient)===null||e===void 0?void 0:e.role_name)||""}`}markEnvelopeStarted(){const e=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const t=this.getStartedKey();if(!e.includes(t)){e.push(t);while(e.length>10){e.shift()}localStorage.setItem("startedEnvelopes",JSON.stringify(e))}}saveFieldChange(e,t,i){const s=this.getRecipientFields().find((t=>t.name===e));if(s===null||s===void 0?void 0:s.readonly){return}console.log("[SIGN] saveFieldChange",e,{value:t,prepared:i});h(this.endpoint,this.envelopeId,this.roleId,e,t,i).then((t=>this.updateRecipientFieldValue(e,t))).catch((e=>{var t,i,s,o,n,l;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(i=e.response)===null||i===void 0?void 0:i.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);P("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new A(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(l=e.response)===null||l===void 0?void 0:l.data))}))}async handleFieldChange(e,t){if(!t.target){return}const{value:i,checked:s}=t.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,i,false);case"checkbox":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"radio":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"dropdown":console.log("Saving dropdown",e.name,t.detail);return this.saveFieldChange(e.name,t.detail,false);case"initial":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing initial");const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.initialId){console.log("[SIGN] Reusing initial",this.initialId);const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,this.initialId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing initial",t.detail);const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.initialId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const o=await(await fetch(t.detail)).blob();return u(this.endpoint,"initial",o).then((async t=>{const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.initialId=t.id;this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);P("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing signature");const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.signatureId){console.log("[SIGN] Reusing signature",this.signatureId);const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,this.signatureId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing signature",t.detail);const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.signatureId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const n=await(await fetch(t.detail)).blob();console.log("[SIGN] Creating new signature");return p(this.endpoint,"signature",n).then((async t=>{console.log("Signature update result",t);const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.signatureId=t.id;this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);P("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:l}=t.detail;if(l){return this.saveFieldChange(e.name,l,false)}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:i,checked:s},e);break}}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"&&!e.readonly));g(e);return e}getSortedDisplayableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));g(e);return e}async handleNext(){var e;if(this.nextSubmits){if(this.submitted){return}try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const t=Intl.DateTimeFormat().resolvedOptions();const i=await v(this.endpoint,this.envelopeId,this.roleId,{locale:t.locale,timezone:t.timeZone});console.log("[SIGN] Submitted successfully",i);await this.handleSubmitSuccess()}catch(e){console.log("[SIGN] Error submitting",e);this.submitting=false;P("Unable to submit document, please try again.",{style:"error"})}return}const t=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));const i=this.getNextFieldFromList(t);if(i){const e=T(i);const t=document.getElementById(e);t===null||t===void 0?void 0:t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});t===null||t===void 0?void 0:t.focusField();this.focusedField=i.name}}handleNextOptional(){const e=this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e)));const t=this.getNextFieldFromList(e);if(t){const e=T(t);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});i===null||i===void 0?void 0:i.focusField();this.focusedField=t.name}}getRecipientFields(){var e;return((e=this.envelope)===null||e===void 0?void 0:e.fields.filter((e=>e.role_name===this.recipient.role_name)))||[]}getRequiredTotalCount(){return this.getSortedFillableFields().filter((e=>e.required)).length}getRequiredFilledCount(){return this.getSortedFillableFields().filter((e=>e.required&&this.isFieldActuallyFilled(e))).length}getOptionalUnfilledCount(){return this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e))).length}checkRecipientFields(){if(this.submitted||this.isDone){return}const e=this.getRecipientFields().filter((e=>!f(e,this.getRecipientFields())));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}this.updateAllFlags();const t=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const i=t.includes(this.getStartedKey());if(this.nextSubmits){this.signingProgressMode="completed"}else if(i){this.signingProgressMode="signing"}else{this.signingProgressMode="start"}}isFieldActuallyFilled(e){if(e.type==="radio"&&e.group){const t=this.getRecipientFields().some((t=>t.group===e.group&&t.value==="true"));if(t){return true}}return m(e,this.getRecipientFields())&&(e.type!=="dropdown"||!!e.value)&&(e.type!=="radio"||e.value==="true")&&(e.type!=="checkbox"||e.value==="true")}getNextRequiredField(){const e=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldActuallyFilled(e)));g(e);if(e.length===0){const e=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));g(e);if(e.length>0){return this.getNextFieldFromList(e)}return null}return this.getNextFieldFromList(e)}getNextFieldFromList(e){const t=e.findIndex((e=>e.name===this.focusedField));let i=t+1;if(i>=e.length){i=0}return e[i]}handlePrev(){var e;const t=this.getSortedFillableFields();const i=t.findIndex((e=>e.name===this.focusedField));if(i>0){const s=t[i-1];const o=T(s);const n=document.getElementById(o);n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth",block:"center"});(e=n===null||n===void 0?void 0:n.focusField)===null||e===void 0?void 0:e.call(n);this.focusedField=s.name}}updateAllFlags(){Object.values(this.renderedPages).forEach((e=>{this.updateFlagsForPage(e)}))}updateFlagsForPage(e){if(!e)return;const t=document.getElementById(e.containerId+"-controls");if(!t)return;const i=t.querySelectorAll(".verdocs-flag-instance");i.forEach((e=>e.remove()));let s=this.getNextRequiredField();const o=this.getRecipientFields().find((e=>e.name===this.focusedField));if(o&&!m(o,this.getRecipientFields())){s=o}if(s&&s.page===e.pageNumber&&s.document_id===e.documentId){const t="fill";let i="FILL";let o=false;switch(s.type){case"signature":i="SIGN";break;case"initial":i="INITIAL";break;case"checkbox":i="CHECK";break;case"radio":i="SELECT";break;case"date":case"dropdown":i="SELECT";break;case"attachment":i="ATTACH";break;case"payment":i="PAY";break}if(!s.required){o=true}D(e,s.y,s.height||F(s.type),{variant:t,label:i,showSkip:o,onSkip:()=>{this.handleNext()},onClick:()=>{var e;const t=T(s);const i=document.getElementById(t);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center"});(e=i===null||i===void 0?void 0:i.focusField)===null||e===void 0?void 0:e.call(i)}})}}attachFieldAttributes(e,t,i){if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));i.addEventListener("attached",(async i=>{console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;try{const s=await x(this.endpoint,this.envelopeId,this.roleId,t.name,i.detail);this.updateRecipientFieldValue(t.name,s);this.checkRecipientFields();const o=E("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,o);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("deleted",(async i=>{console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;try{const i=await b(this.endpoint,this.envelopeId,this.roleId,t.name);console.log("[SIGN] Deleted attachment",i);this.updateRecipientFieldValue(t.name,i);this.checkRecipientFields();const s=E("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("focusout",(e=>{if(t.type!=="dropdown"&&t.type!=="attachment"&&t.type!=="signature"&&t.type!=="initial"&&t.type!=="checkbox"&&t.type!=="radio"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}}));i.addEventListener("fieldChange",(e=>{this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}));i.addEventListener("adopt",(()=>{this.focusedField=t.name;this.adoptingSignature=true}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);const s=w(this.recipient);i.setAttribute("initials",y(s));i.setAttribute("name",s);if(this.signatureId){i.setAttribute("signatureid",this.signatureId)}if(this.initialId){i.setAttribute("initialid",this.initialId)}}handlePageRendered(e){const t=e.detail;this.renderedPages[`${t.documentId}:${t.pageNumber}`]=t;const i=this.getSortedDisplayableFields();i.filter((e=>e&&e.document_id===t.documentId&&e.page===t.pageNumber)).forEach(((e,i)=>{const s=E("envelope",e,t,{disabled:false,editable:false,draggable:false,done:this.isDone},i);if(!s){return}if(Array.isArray(s)){s.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,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.document_id===t.documentId&&e.page===t.pageNumber)).forEach((e=>{const i=E("envelope",e,t,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!i){return}if(Array.isArray(i)){i.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,e,i)}}))}));this.checkRecipientFields();this.updateFlagsForPage(t)}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);k(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var t,i,s,o,n,l;console.log("[SIGN] Error submitting authentication step",e);console.log((t=e.response)===null||t===void 0?void 0:t.data);if((o=(s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error)===null||o===void 0?void 0:o.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{P(((l=(n=e.response)===null||n===void 0?void 0:n.data)===null||l===void 0?void 0:l.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}async handleOnDownload(e){var t,i;const{action:s,documentId:o}=e.detail;console.log("[SIGN] Download action selected:",s,o);try{switch(s){case V.certificate:const e=this.envelope.documents.find((e=>e.type==="certificate"));if(e){const t=await S(this.endpoint,e.id);window.open(t,"_blank")}else{P("Certificate not yet available.",{style:"info"})}break;case V.combined:const s=o||((t=this.envelope.documents.find((e=>e.type==="certificate")))===null||t===void 0?void 0:t.id);const n=await N(this.endpoint,s);window.open(n,"_blank");break;case V.document:const l=o||((i=this.envelope.documents.find((e=>e.type==="attachment")))===null||i===void 0?void 0:i.id);if(l){const e=await S(this.endpoint,l);window.open(e,"_blank")}break;case V.zip:const a=await C(this.endpoint,[this.envelopeId]);const r=window.URL.createObjectURL(a.data);const d=document.createElement("a");d.href=r;d.download=`${this.envelope.name}.zip`;document.body.appendChild(d);d.click();d.remove();window.URL.revokeObjectURL(r);break}}catch(e){console.error("Download error",e);P("Unable to complete download request.",{style:"error"})}}render(){var e;if(this.showLoadError){return i(s,null,i("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:()=>{this.retrySigningSession()}}))}if(!this.envelope){return i(s,null,i("verdocs-loader",null))}if(this.fatalErrorMessage){return i(s,{class:{agreed:this.agreed}},i("div",{class:"fatal-error"},i("div",{class:"message"},i("div",{class:"header"},this.fatalErrorHeader),i("p",null,this.fatalErrorMessage))))}if(this.delegated){return i(s,{class:{agreed:false}},i("div",{class:"fatal-error"},i("div",{class:"message"},i("div",{class:"header"},"Delegated Signing Request"),i("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return i(s,{class:{agreed:this.agreed}},i("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var t;return(t=this.sdkError)===null||t===void 0?void 0:t.emit(e.detail)}}),this.showDone&&i("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.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.submitting&&i("div",{class:"loading-indicator"},i("verdocs-loader",null)))}if(this.delegating){return i(s,{class:"agreed"},i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{I(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{P("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);P("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return i(s,{class:"agreed"},i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{z(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);this.declining=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);P("Unable to decline, please try again later",{style:"error"})}))}}))}if(!this.agreed){return i(s,{class:"agreed"},i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return i("verdocs-passcode-dialog",{endpoint:this.endpoint,onNext:e=>this.processAuthResponse(e.detail.response)})}if(this.authStep==="sms"){return i("verdocs-otp-dialog",{endpoint:this.endpoint,method:"sms",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="email"){return i("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return i(s,{class:"kba"},i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},this.envelope.name))),i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("div",{class:"cover"},i("div",{class:"kba"},i("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 t=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:t.first_name,last_name:t.last_name,address:t.address,city:t.city,state:t.state,zip:t.zip,dob:t.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const t=this.kbaQuestions[e];return i(s,{class:"kba"},i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},this.envelope.name))),i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("div",{class:"cover"},i("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?i("verdocs-spinner",null):i("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(t===null||t===void 0?void 0:t.prompt)||"Please select one of the options below.",choices:(t===null||t===void 0?void 0:t.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const t=e.detail;this.kbaChoices=[...this.kbaChoices,t];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,t)=>({type:e.type,answer:this.kbaChoices[t]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const t=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const n=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){t.unshift({id:"delegate",label:"Delegate"})}const l=this.getRecipientFields().filter((e=>!f(e,this.getRecipientFields())));l.length>0?console.log("[SIGN] Invalid fields remaining",l.map((e=>e.name))):console.log("[SIGN] All field valid");const a=this.envelope.documents.reduce(((e,t)=>e+t.pages),0);const r=G(1,a).map((e=>({label:e.toString(),value:e.toString()})));let d=0;return i(s,null,this.toolbarStyle==="menu"&&i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},i("div",{class:"title"},this.envelope.name),i("div",{style:{flex:"1"}}),!this.finishLater&&!this.submitted&&(()=>{const e=this.getRequiredTotalCount()-this.getRequiredFilledCount();const t=this.getOptionalUnfilledCount();if(e>0){return i("span",{class:"remaining-count"},e," required field",e===1?"":"s"," left")}return i("span",{class:"remaining-count"},i("span",{class:"check-icon",innerHTML:M}),"All required fields complete",t>0&&i("div",{class:"review-optional"},i("span",{class:"separator"},"| "),i("span",{onClick:()=>this.handleNextOptional()},"Review ",t," optional")))})(),!this.finishLater&&!this.submitted&&i("verdocs-button",{size:"xsmall",label:this.nextButtonLabel==="Next"?"Next Required":this.nextButtonLabel,disabled:!this.agreed||this.submitting||this.submitted,onClick:()=>this.handleNext()}),i("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal",magnify:true},innerHTML:O,onClick:()=>this.handleZoomOut()}),i("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2",magnify:true},innerHTML:U,onClick:()=>this.handleZoomIn()}),i("verdocs-dropdown",{options:!this.isDone&&!this.finishLater&&!this.submitted?t:n,onOptionSelected:e=>this.handleOptionSelected(e)}))),this.toolbarStyle==="controls"&&i("div",{class:"controls-toolbar"},i("div",{class:"left-controls"},i("div",{class:"title"},this.envelope.name)),i("div",{class:"center-controls"},i("span",{class:"label"},"Page"),i("div",{class:"select-wrapper"},i("verdocs-select-input",{options:r,value:this.pageNumber.toString(),onInput:e=>this.handlePageSelect(e)})),i("span",{class:"count"},"of ",a)),i("div",{class:"right-controls"},!this.submitted&&i("verdocs-button",{class:"mobile-next-button",label:this.nextButtonLabel,size:"xsmall",disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),i("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal"},innerHTML:O,onClick:()=>this.handleZoomOut()}),i("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2"},innerHTML:U,onClick:()=>this.handleZoomIn()}),i("div",{class:"icon-button download",innerHTML:$,onClick:()=>this.handleOptionSelected({detail:{id:"download"}})}),i("div",{class:"icon-button print",innerHTML:Z,onClick:()=>this.handleOptionSelected({detail:{id:"print"}})}))),i("div",{class:`document signed-document-container zoom-${this.zoomLevel}`},(this.envelope.documents||[]).map((e=>{const t=G(1,e.pages);return i(o,null,this.envelope.documents.length>1&&i("div",{class:"document-separator"},i("div",{innerHTML:q}),i("span",null,e.name)),t.map((t=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[t])||{width:612,height:792};d++;return i("verdocs-envelope-document-page",{id:`page-${d}`,envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:t,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("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.isDone=true;this.showFinishLater=false}}),this.showDone&&i("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.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.adoptingSignature&&i("verdocs-adopt-signature-dialog",{name:w(this.recipient),nameLocked:!!((e=this.recipient)===null||e===void 0?void 0:e.name_locked),onNext:async e=>{console.log("[SIGN] Adopting signature/initials block",e.detail);this.showSpinner=true;const t=await(await fetch(e.detail.signature)).blob();const i=await(await fetch(e.detail.initials)).blob();const s=await p(this.endpoint,"signature",t);console.log("[SIGN] Created signature",s);this.signatureId=s.id;const o=await u(this.endpoint,"initial",i);console.log("[SIGN] Created initials",o);this.initialId=o.id;this.showSpinner=false;this.adoptingSignature=false;this.markEnvelopeStarted();if(this.focusedField){const e=this.getRecipientFields().find((e=>e.name===this.focusedField));if(e){const t=e.type==="signature"?this.signatureId:e.type==="initial"?this.initialId:null;if(t){const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t,false);this.updateRecipientFieldValue(e.name,i)}}this.focusedField=""}const n=this.el.querySelectorAll("verdocs-field-signature");n.forEach((e=>e.setAttribute("signatureid",this.signatureId)));const l=this.el.querySelectorAll("verdocs-field-initial");l.forEach((e=>e.setAttribute("initialid",this.initialId)));this.checkRecipientFields()},onExit:()=>this.adoptingSignature=false}),(this.submitting||this.showSpinner)&&i("verdocs-portal",null,i("div",{class:"spinner-overlay"},i("verdocs-spinner",null))),this.showDownloadDialog&&i("verdocs-download-dialog",{signed:this.envelope.signed,polling:this.polling,documents:this.envelope.documents,onExit:()=>{this.showDownloadDialog=false;this.stopPolling()},onDownload:e=>this.handleOnDownload(e)}),!this.loading&&!this.isDone&&!this.submitted&&i("verdocs-sign-footer",{endpoint:this.endpoint,envelopeId:this.envelopeId,isDone:this.isDone,onAskQuestion:e=>{L(this.endpoint,this.envelopeId,this.roleId,{question:e.detail.question}).then((()=>P("Your question has been sent.",{style:"success"}))).catch((e=>{console.log("Error asking question",e);P("Unable to send question, please try again later.",{style:"error"})}))},onDecline:()=>this.declining=true,onFinishLater:()=>this.showFinishLater=true}))}get el(){return n(this)}};Y.style=j();export{Y as verdocs_sign};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as i,H as s,F as o,g as n}from"./p-CjTHbolG.js";import{VerdocsEndpoint as l,DEFAULT_DISCLOSURES as a,startSigningSession as r,getEnvelope as d,envelopeRecipientAgree as c,updateEnvelopeField as h,createSignature as p,createInitials as u,sortFields as g,envelopeRecipientSubmit as v,isFieldValid as f,isFieldFilled as m,uploadEnvelopeFieldAttachment as x,deleteEnvelopeFieldAttachment as b,formatFullName as w,fullNameToInitials as y,verifySigner as k,getEnvelopesZip as C,getEnvelopeDocumentDownloadLink as S,getCombinedEnvelopeDocumentDownloadLink as N,delegateRecipient as I,envelopeRecipientDecline as z,integerSequence as G,askQuestion as L}from"@verdocs/js-sdk";import{u as H,g as T,r as D,a as E,d as F}from"./p-CGsVCy75.js";import{D as V}from"./p-CIxfEdV7.js";import{D as q,C as M}from"./p-DobS6Y7w.js";import{V as P}from"./p-D97GxsI-.js";import{S as A}from"./p-C1sRVZWv.js";import{S as R}from"./p-C7hFgM52.js";import"./p-BglCURB-.js";const j=()=>`verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;min-height:700px;position:relative;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f5f5f5;font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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;padding-right:140px;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>.document .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-sign>.document .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-sign>.document .document-separator:first-child{margin-top:0}verdocs-sign .signed-document-container{width:64%;margin-left:260px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}verdocs-sign .signed-document-container.zoom-normal{width:64%;margin-left:260px}verdocs-sign .signed-document-container.zoom-zoom1{width:80%;margin-left:200px}verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:150px}verdocs-sign .signed-document-container.zoom-zoom2 .verdocs-flag-instance{opacity:0;pointer-events:none}@media (max-width: 768px){verdocs-sign verdocs-sign-footer{padding:0 10px}verdocs-sign verdocs-sign-footer .buttons{gap:8px}verdocs-sign verdocs-sign-footer .buttons button{font-size:10px}verdocs-sign .signed-document-container{width:100%;margin-left:0}verdocs-sign .signed-document-container.zoom-normal,verdocs-sign .signed-document-container.zoom-zoom1,verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:0}verdocs-sign>.document{padding-right:15px}verdocs-sign .verdocs-flag-instance{display:none !important}verdocs-sign .controls-toolbar .center-controls{display:none}verdocs-sign .controls-toolbar .right-controls .mobile-next-button{display:block;margin-right:10px}verdocs-sign .controls-toolbar .right-controls .minus,verdocs-sign .controls-toolbar .right-controls .plus{display:none}}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 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:360px;width:50%;font-size:16px;background:white;-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,.controls-toolbar,.verdocs-flag-instance,verdocs-signing-progress{display:none !important}verdocs-sign{min-height:auto;background-color:white}verdocs-sign>.document{overflow:visible;height:auto;display:block;padding:0;margin:0}verdocs-sign>.document .document-separator{display:none}verdocs-sign .signed-document-container{width:100%;margin:0}}#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;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}#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}@media (max-width: 670px){#verdocs-sign-header .title{font-size:14px}}#verdocs-sign-header .remaining-count{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:8px;color:#ffffff;font-size:13px;font-weight:400;white-space:nowrap}#verdocs-sign-header .remaining-count .check-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}#verdocs-sign-header .remaining-count .check-icon svg{width:16px;height:16px;fill:#55bc81}#verdocs-sign-header .remaining-count .separator{opacity:0.5;margin:0 2px}#verdocs-sign-header .remaining-count .review-optional{cursor:pointer;text-decoration:underline}#verdocs-sign-header .remaining-count .review-optional:hover{color:#54d68c}@media (max-width: 670px){#verdocs-sign-header .remaining-count .review-optional{display:none}}@media (max-width: 670px){#verdocs-sign-header .remaining-count{font-size:12px}}#verdocs-sign-header .icon-button{width:20px;height:32px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}#verdocs-sign-header .icon-button svg path{fill:#ffffff}#verdocs-sign-header .icon-button:hover{background-color:rgba(255, 255, 255, 0.1)}#verdocs-sign-header .icon-button.disabled{opacity:0.35;pointer-events:none}#verdocs-sign-header .icon-button+.icon-button{margin-left:-6px}@media (max-width: 670px){#verdocs-sign-header .icon-button.magnify{display:none}}.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}.controls-toolbar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:54px;padding:0 12px 0 24px;background-color:#ffffff;border-bottom:1px solid #e0e0e0;-webkit-box-shadow:none;box-shadow:none;font-family:"Inter", sans-serif;color:#424242;z-index:1000}.controls-toolbar .left-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .left-controls .title{font-weight:500;font-size:16px;color:#242424;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.controls-toolbar .center-controls{-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:10px;font-size:14px;display:none}.controls-toolbar .center-controls .label{color:#000000;font-weight:300}.controls-toolbar .center-controls .select-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .center-controls .select-wrapper verdocs-select-input{margin:0}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-label{display:none}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element{background:transparent;border:1px solid #e0e0e0;height:32px;padding:2px 8px;min-width:60px;text-align:center;font-family:inherit;color:#424242}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element:focus{border-color:var(--verdocs-primary-color, #55bc81)}.controls-toolbar .center-controls .count{color:#000000;font-weight:300}.controls-toolbar .right-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.controls-toolbar .right-controls .mobile-next-button{display:none}.controls-toolbar .right-controls .icon-button{width:32px;height:32px;display:-ms-flexbox;display:flex;color:#424242;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}.controls-toolbar .right-controls .icon-button:hover{background-color:#f5f5f5}.controls-toolbar .right-controls .icon-button.disabled{opacity:0.3;pointer-events:none}.controls-toolbar .right-controls .icon-button svg{display:block;width:20px;height:20px}`;const O=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11ZM14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z" fill="#424242" /></svg>`;const U=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5ZM8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z" fill="#424242" /></svg>`;const $=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 16.9988C15.7761 16.9988 16 17.2226 16 17.4988C16 17.7442 15.8231 17.9484 15.5899 17.9907L15.5 17.9988H4.5C4.22386 17.9988 4 17.7749 4 17.4988C4 17.2533 4.17688 17.0492 4.41012 17.0068L4.5 16.9988H15.5ZM10.0001 2.00098C10.2456 2.00098 10.4497 2.17798 10.492 2.41124L10.5 2.50112L10.496 14.295L14.1414 10.6466C14.3148 10.4729 14.5842 10.4534 14.7792 10.5882L14.8485 10.646C15.0222 10.8194 15.0418 11.0888 14.907 11.2838L14.8492 11.3531L10.3574 15.8531C10.285 15.9257 10.1957 15.9714 10.1021 15.9901L9.99608 15.9999C9.83511 15.9999 9.69192 15.9237 9.60051 15.8056L5.14386 11.3537C4.94846 11.1586 4.94823 10.842 5.14336 10.6466C5.3168 10.4729 5.58621 10.4534 5.78117 10.5883L5.85046 10.6461L9.496 14.287L9.5 2.50083C9.50008 2.22469 9.724 2.00098 10.0001 2.00098Z" fill="#424242"/></svg>`;const Z=`<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5C5 3.67157 5.67157 3 6.5 3H13.5C14.3284 3 15 3.67157 15 4.5V5H15.5C16.8807 5 18 6.11929 18 7.5V12.5C18 13.3284 17.3284 14 16.5 14H15V15.5C15 16.3284 14.3284 17 13.5 17H6.5C5.67157 17 5 16.3284 5 15.5V14H3.5C2.67157 14 2 13.3284 2 12.5V7.5C2 6.11929 3.11929 5 4.5 5H5V4.5ZM6 5H14V4.5C14 4.22386 13.7761 4 13.5 4H6.5C6.22386 4 6 4.22386 6 4.5V5ZM5 13V11.5C5 10.6716 5.67157 10 6.5 10H13.5C14.3284 10 15 10.6716 15 11.5V13H16.5C16.7761 13 17 12.7761 17 12.5V7.5C17 6.67157 16.3284 6 15.5 6H4.5C3.67157 6 3 6.67157 3 7.5V12.5C3 12.7761 3.22386 13 3.5 13H5ZM6.5 11C6.22386 11 6 11.2239 6 11.5V15.5C6 15.7761 6.22386 16 6.5 16H13.5C13.7761 16 14 15.7761 14 15.5V11.5C14 11.2239 13.7761 11 13.5 11H6.5Z" fill="#424242"/></svg>`;const Y=class{constructor(i){e(this,i);this.sdkError=t(this,"sdkError");this.envelopeLoaded=t(this,"envelopeLoaded");this.envelopeUpdated=t(this,"envelopeUpdated");this.endpoint=new l({sessionType:"signing"});this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.toolbarStyle="menu";this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=a;this.fieldUpdateCounter=0;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.adoptingSignature=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.signatureId=null;this.initialId=null;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.pageNumber=1;this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.showDownloadDialog=false;this.loading=true;this.envelope=null;this.zoomLevel="normal";this.signingProgressMode="start";this.polling=true;this.renderedPages={};this.pollingInterval=null;this.handleDoneDialogDismiss=async()=>{this.showDone=false;if(!this.isDone){this.prepareForViewTransition();await new Promise((e=>requestAnimationFrame((()=>e()))));this.isDone=true}}}async componentDidLoad(){var e,t,i,s,o,n;this.updateZoomFromWindow();window.addEventListener("resize",(()=>this.updateZoomFromWindow()));if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new A("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new A("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new A("[SIGN] Missing required inviteCode",500,""));return}try{await this.initSigningSession()}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new A(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}async initSigningSession(){console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await r(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}async retrySigningSession(){var e,t,i;this.showLoadError=false;this.loading=true;try{await this.initSigningSession()}catch(s){console.log("[SIGN] Error with signing session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new A(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));this.showLoadError=true;this.loading=false}}prepareForViewTransition(){var e,t;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();this.observer=null;(t=document.getElementById("air-datepicker-global-container"))===null||t===void 0?void 0:t.remove()}async handleSubmitSuccess(){var e,t;this.submitting=false;this.submitted=true;this.nextSubmits=false;this.signingProgressMode="completed";try{const i=await d(this.endpoint,this.envelopeId);this.envelope=i;R.updateEnvelope(this.envelopeId,i);const s=(e=i.recipients)===null||e===void 0?void 0:e.find((e=>{var t;return e.role_name===((t=this.recipient)===null||t===void 0?void 0:t.role_name)}));if(s){this.recipient=s}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:i,event:"submitted"})}catch(e){console.warn("[SIGN] Error refreshing envelope after submit",e)}this.showDone=true}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}this.setupIntersectionObserver()}disconnectedCallback(){var e,t,i;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();window.removeEventListener("resize",(()=>this.updateZoomFromWindow()));(t=document.getElementById(this.getOrgStyleOverridesId()))===null||t===void 0?void 0:t.remove();(i=document.getElementById(this.getBrandStyleOverridesId()))===null||i===void 0?void 0:i.remove()}updateZoomFromWindow(){const e=window.innerWidth;if(e<768){if(this.zoomLevel!=="zoom2")this.zoomLevel="zoom2"}else if(e<1024){if(this.zoomLevel!=="zoom1")this.zoomLevel="zoom1"}else{if(this.zoomLevel!=="normal")this.zoomLevel="normal"}}setupIntersectionObserver(){const e=this.el.querySelectorAll("verdocs-envelope-document-page");if(e.length===0)return;if(this.observer){this.observer.disconnect()}const t=this.el.querySelector(".signed-document-container");const i={root:t,rootMargin:"-40% 0px -40% 0px",threshold:0};this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;const i=parseInt(t.replace("page-",""),10);if(!isNaN(i)&&this.pageNumber!==i){this.pageNumber=i}}}))}),i);e.forEach((e=>this.observer.observe(e)))}getOrgStyleOverridesId(){return`verdocs-org-style-overrides-${this.envelopeId}`}getBrandStyleOverridesId(){return`verdocs-brand-style-overrides-${this.envelopeId}`}applyOrgStyleOverrides(){var e,t;const i=this.getOrgStyleOverridesId();const s=document.getElementById(i);const o=(t=(e=this.envelope)===null||e===void 0?void 0:e.organization)===null||t===void 0?void 0:t.style_overrides;if(typeof o==="string"){const e=s||document.createElement("style");e.id=i;e.textContent=o;if(!s){document.head.appendChild(e)}}else if(s){s.remove()}}applyBrandStyleOverrides(e){const t=this.getBrandStyleOverridesId();const i=document.getElementById(t);const s=e===null||e===void 0?void 0:e.style_overrides;if(typeof s==="string"&&s.length>0){const e=i||document.createElement("style");e.id=t;e.textContent=s;if(!i){document.head.appendChild(e)}}else if(i){i.remove()}}processAuthResponse(e){var t,i,s,o;const{envelope:n,recipient:l,brand:r}=e;(t=n.documents)===null||t===void 0?void 0:t.sort(((e,t)=>e.order!==t.order?e.order-t.order:e.created_at.localeCompare(t.created_at)));const{auth_step:d}=l;this.recipient=l;this.envelope=n;this.disclosures=((s=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||s===void 0?void 0:s.disclaimer)||a;this.applyOrgStyleOverrides();this.applyBrandStyleOverrides(r);this.authStep=d;this.delegated=!!l.delegated_to;this.agreed=l.agreed;this.signatureId=null;this.initialId=null;this.submitted=l.status==="submitted";this.loading=false;this.isDone=this.submitted;this.showDone=this.submitted;R.updateEnvelope(this.envelopeId,n);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=l.auth_method_states||{};this.kbaQuestions=l.kba_questions;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(l.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(o=this.envelopeLoaded)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);const e=Intl.DateTimeFormat().resolvedOptions();c(this.endpoint,this.envelopeId,this.roleId,this.disclosures,{locale:e.locale,timezone:e.timeZone}).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 t,i,s;console.log("[SIGN] Unable to accept disclosures",e);P("Unable to accept disclosures, please try again later",{style:"error"});(t=this.sdkError)===null||t===void 0?void 0:t.emit(new A(e.message,(i=e.response)===null||i===void 0?void 0:i.status,(s=e.response)===null||s===void 0?void 0:s.data));this.submitting=false}))}handlePageSelect(e){const t=parseInt(e.target.value);if(!isNaN(t)){this.pageNumber=t;const e=this.el.querySelector(".signed-document-container");const i=this.el.querySelector(`#page-${t}`);if(e&&i){const t=i.offsetTop-20;e.scrollTo({top:t,behavior:"smooth"})}}}async handleOptionSelected(e){var t,i;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":this.showDownloadDialog=true;this.startPolling();break}}startPolling(){this.stopPolling();const e=()=>{var e,t,i,s,o,n;const l=((e=this.envelope)===null||e===void 0?void 0:e.status)==="complete"||!!((t=this.envelope)===null||t===void 0?void 0:t.signed);const a=(s=(i=this.envelope)===null||i===void 0?void 0:i.documents)===null||s===void 0?void 0:s.some((e=>e.type==="certificate"));const r=(n=(o=this.envelope)===null||o===void 0?void 0:o.recipients)===null||n===void 0?void 0:n.every((e=>e.status==="submitted"));if(l&&a)return false;if(!r)return false;return true};if(!e()){return}this.polling=true;this.pollingInterval=setInterval((async()=>{try{const t=await d(this.endpoint,this.envelopeId);this.envelope=t;R.updateEnvelope(this.envelopeId,t);this.checkRecipientFields();if(!e()){this.stopPolling()}}catch(e){console.error("[SIGN] Polling error",e);this.stopPolling()}}),5e3)}stopPolling(){if(this.pollingInterval){clearInterval(this.pollingInterval);this.pollingInterval=null}this.polling=false}handleZoomIn(){if(this.zoomLevel==="normal"){this.zoomLevel="zoom1"}else if(this.zoomLevel==="zoom1"){this.zoomLevel="zoom2"}}handleZoomOut(){if(this.zoomLevel==="zoom1"){this.zoomLevel="normal"}else if(this.zoomLevel==="zoom2"){this.zoomLevel="zoom1"}}updateRecipientFieldValue(e,t){console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((i=>{if(i.name===e){i.value=t.value;i.settings=t.settings;H(i);this.fieldUpdateCounter++;this.markEnvelopeStarted();this.checkRecipientFields()}}))}getStartedKey(){var e;return`${this.envelopeId}:${((e=this.recipient)===null||e===void 0?void 0:e.role_name)||""}`}markEnvelopeStarted(){const e=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const t=this.getStartedKey();if(!e.includes(t)){e.push(t);while(e.length>10){e.shift()}localStorage.setItem("startedEnvelopes",JSON.stringify(e))}}saveFieldChange(e,t,i){const s=this.getRecipientFields().find((t=>t.name===e));if(s===null||s===void 0?void 0:s.readonly){return}console.log("[SIGN] saveFieldChange",e,{value:t,prepared:i});h(this.endpoint,this.envelopeId,this.roleId,e,t,i).then((t=>this.updateRecipientFieldValue(e,t))).catch((e=>{var t,i,s,o,n,l;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(i=e.response)===null||i===void 0?void 0:i.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);P("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new A(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(l=e.response)===null||l===void 0?void 0:l.data))}))}async handleFieldChange(e,t){if(!t.target){return}const{value:i,checked:s}=t.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,i,false);case"checkbox":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"radio":{return this.saveFieldChange(e.name,String(t.target.checked),false)}case"dropdown":console.log("Saving dropdown",e.name,t.detail);return this.saveFieldChange(e.name,t.detail,false);case"initial":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing initial");const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.initialId){console.log("[SIGN] Reusing initial",this.initialId);const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,this.initialId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing initial",t.detail);const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.initialId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const o=await(await fetch(t.detail)).blob();return u(this.endpoint,"initial",o).then((async t=>{const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.initialId=t.id;this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);P("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(t.detail===undefined){return}if(t.detail===null){console.log("[SIGN] Clearing signature");const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false);return this.updateRecipientFieldValue(e.name,t)}if(this.signatureId){console.log("[SIGN] Reusing signature",this.signatureId);const t=await h(this.endpoint,this.envelopeId,this.roleId,e.name,this.signatureId,false);return this.updateRecipientFieldValue(e.name,t)}if(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)){console.log("[SIGN] Reusing signature",t.detail);const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false);this.signatureId=t.detail;return this.updateRecipientFieldValue(e.name,i)}this.showSpinner=true;const n=await(await fetch(t.detail)).blob();console.log("[SIGN] Creating new signature");return p(this.endpoint,"signature",n).then((async t=>{console.log("Signature update result",t);const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false);this.updateRecipientFieldValue(e.name,i);this.signatureId=t.id;this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);P("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:l}=t.detail;if(l){return this.saveFieldChange(e.name,l,false)}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:i,checked:s},e);break}}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"&&!e.readonly));g(e);return e}getSortedDisplayableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));g(e);return e}async handleNext(){var e;if(this.nextSubmits){if(this.submitted){return}try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const t=Intl.DateTimeFormat().resolvedOptions();const i=await v(this.endpoint,this.envelopeId,this.roleId,{locale:t.locale,timezone:t.timeZone});console.log("[SIGN] Submitted successfully",i);await this.handleSubmitSuccess()}catch(e){console.log("[SIGN] Error submitting",e);this.submitting=false;P("Unable to submit document, please try again.",{style:"error"})}return}const t=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));const i=this.getNextFieldFromList(t);if(i){const e=T(i);const t=document.getElementById(e);t===null||t===void 0?void 0:t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});t===null||t===void 0?void 0:t.focusField();this.focusedField=i.name}}handleNextOptional(){const e=this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e)));const t=this.getNextFieldFromList(e);if(t){const e=T(t);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});i===null||i===void 0?void 0:i.focusField();this.focusedField=t.name}}getRecipientFields(){var e;return((e=this.envelope)===null||e===void 0?void 0:e.fields.filter((e=>e.role_name===this.recipient.role_name)))||[]}getRequiredTotalCount(){return this.getSortedFillableFields().filter((e=>e.required)).length}getRequiredFilledCount(){return this.getSortedFillableFields().filter((e=>e.required&&this.isFieldActuallyFilled(e))).length}getOptionalUnfilledCount(){return this.getSortedFillableFields().filter((e=>!e.required&&!this.isFieldActuallyFilled(e))).length}checkRecipientFields(){if(this.submitted||this.isDone){return}const e=this.getRecipientFields().filter((e=>!f(e,this.getRecipientFields())));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}this.updateAllFlags();const t=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");const i=t.includes(this.getStartedKey());if(this.nextSubmits){this.signingProgressMode="completed"}else if(i){this.signingProgressMode="signing"}else{this.signingProgressMode="start"}}isFieldActuallyFilled(e){if(e.type==="radio"&&e.group){const t=this.getRecipientFields().some((t=>t.group===e.group&&t.value==="true"));if(t){return true}}return m(e,this.getRecipientFields())&&(e.type!=="dropdown"||!!e.value)&&(e.type!=="radio"||e.value==="true")&&(e.type!=="checkbox"||e.value==="true")}getNextRequiredField(){const e=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldActuallyFilled(e)));g(e);if(e.length===0){const e=this.getSortedFillableFields().filter((e=>!this.isFieldActuallyFilled(e)));g(e);if(e.length>0){return this.getNextFieldFromList(e)}return null}return this.getNextFieldFromList(e)}getNextFieldFromList(e){const t=e.findIndex((e=>e.name===this.focusedField));let i=t+1;if(i>=e.length){i=0}return e[i]}handlePrev(){var e;const t=this.getSortedFillableFields();const i=t.findIndex((e=>e.name===this.focusedField));if(i>0){const s=t[i-1];const o=T(s);const n=document.getElementById(o);n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth",block:"center"});(e=n===null||n===void 0?void 0:n.focusField)===null||e===void 0?void 0:e.call(n);this.focusedField=s.name}}updateAllFlags(){Object.values(this.renderedPages).forEach((e=>{this.updateFlagsForPage(e)}))}updateFlagsForPage(e){if(!e)return;const t=document.getElementById(e.containerId+"-controls");if(!t)return;const i=t.querySelectorAll(".verdocs-flag-instance");i.forEach((e=>e.remove()));let s=this.getNextRequiredField();const o=this.getRecipientFields().find((e=>e.name===this.focusedField));if(o&&!m(o,this.getRecipientFields())){s=o}if(s&&s.page===e.pageNumber&&s.document_id===e.documentId){const t="fill";let i="FILL";let o=false;switch(s.type){case"signature":i="SIGN";break;case"initial":i="INITIAL";break;case"checkbox":i="CHECK";break;case"radio":i="SELECT";break;case"date":case"dropdown":i="SELECT";break;case"attachment":i="ATTACH";break;case"payment":i="PAY";break}if(!s.required){o=true}D(e,s.y,s.height||F(s.type),{variant:t,label:i,showSkip:o,onSkip:()=>{this.handleNext()},onClick:()=>{var e;const t=T(s);const i=document.getElementById(t);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center"});(e=i===null||i===void 0?void 0:i.focusField)===null||e===void 0?void 0:e.call(i)}})}}attachFieldAttributes(e,t,i){if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));i.addEventListener("attached",(async i=>{console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;try{const s=await x(this.endpoint,this.envelopeId,this.roleId,t.name,i.detail);this.updateRecipientFieldValue(t.name,s);this.checkRecipientFields();const o=E("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,o);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("deleted",(async i=>{console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;try{const i=await b(this.endpoint,this.envelopeId,this.roleId,t.name);console.log("[SIGN] Deleted attachment",i);this.updateRecipientFieldValue(t.name,i);this.checkRecipientFields();const s=E("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false}catch(i){console.log("Error uploading attachment",i);P("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));i.addEventListener("focusout",(e=>{if(t.type!=="dropdown"&&t.type!=="attachment"&&t.type!=="signature"&&t.type!=="initial"&&t.type!=="checkbox"&&t.type!=="radio"){this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}}));i.addEventListener("fieldChange",(e=>{this.handleFieldChange(t,e).finally((()=>this.checkRecipientFields()))}));i.addEventListener("adopt",(()=>{this.focusedField=t.name;this.adoptingSignature=true}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);const s=w(this.recipient);i.setAttribute("initials",y(s));i.setAttribute("name",s);if(this.signatureId){i.setAttribute("signatureid",this.signatureId)}if(this.initialId){i.setAttribute("initialid",this.initialId)}}handlePageRendered(e){const t=e.detail;this.renderedPages[`${t.documentId}:${t.pageNumber}`]=t;const i=this.getSortedDisplayableFields();i.filter((e=>e&&e.document_id===t.documentId&&e.page===t.pageNumber)).forEach(((e,i)=>{const s=E("envelope",e,t,{disabled:false,editable:false,draggable:false,done:this.isDone},i);if(!s){return}if(Array.isArray(s)){s.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,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.document_id===t.documentId&&e.page===t.pageNumber)).forEach((e=>{const i=E("envelope",e,t,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!i){return}if(Array.isArray(i)){i.map((i=>this.attachFieldAttributes(t,e,i)))}else{this.attachFieldAttributes(t,e,i)}}))}));this.checkRecipientFields();this.updateFlagsForPage(t)}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);k(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var t,i,s,o,n,l;console.log("[SIGN] Error submitting authentication step",e);console.log((t=e.response)===null||t===void 0?void 0:t.data);if((o=(s=(i=e.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error)===null||o===void 0?void 0:o.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{P(((l=(n=e.response)===null||n===void 0?void 0:n.data)===null||l===void 0?void 0:l.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}async handleOnDownload(e){var t,i;const{action:s,documentId:o}=e.detail;console.log("[SIGN] Download action selected:",s,o);try{switch(s){case V.certificate:const e=this.envelope.documents.find((e=>e.type==="certificate"));if(e){const t=await S(this.endpoint,e.id);window.open(t,"_blank")}else{P("Certificate not yet available.",{style:"info"})}break;case V.combined:const s=o||((t=this.envelope.documents.find((e=>e.type==="certificate")))===null||t===void 0?void 0:t.id);const n=await N(this.endpoint,s);window.open(n,"_blank");break;case V.document:const l=o||((i=this.envelope.documents.find((e=>e.type==="attachment")))===null||i===void 0?void 0:i.id);if(l){const e=await S(this.endpoint,l);window.open(e,"_blank")}break;case V.zip:const a=await C(this.endpoint,[this.envelopeId]);const r=window.URL.createObjectURL(a.data);const d=document.createElement("a");d.href=r;d.download=`${this.envelope.name}.zip`;document.body.appendChild(d);d.click();d.remove();window.URL.revokeObjectURL(r);break}}catch(e){console.error("Download error",e);P("Unable to complete download request.",{style:"error"})}}render(){var e;if(this.showLoadError){return i(s,null,i("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:()=>{this.retrySigningSession()}}))}if(!this.envelope){return i(s,null,i("verdocs-loader",null))}if(this.fatalErrorMessage){return i(s,{class:{agreed:this.agreed}},i("div",{class:"fatal-error"},i("div",{class:"message"},i("div",{class:"header"},this.fatalErrorHeader),i("p",null,this.fatalErrorMessage))))}if(this.delegated){return i(s,{class:{agreed:false}},i("div",{class:"fatal-error"},i("div",{class:"message"},i("div",{class:"header"},"Delegated Signing Request"),i("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return i(s,{class:{agreed:this.agreed}},i("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var t;return(t=this.sdkError)===null||t===void 0?void 0:t.emit(e.detail)}}),this.showDone&&i("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.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.submitting&&i("div",{class:"loading-indicator"},i("verdocs-loader",null)))}if(this.delegating){return i(s,{class:"agreed"},i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{I(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{P("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);P("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return i(s,{class:"agreed"},i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{z(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);this.declining=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);P("Unable to decline, please try again later",{style:"error"})}))}}))}if(!this.agreed){return i(s,{class:"agreed"},i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return i("verdocs-passcode-dialog",{endpoint:this.endpoint,onNext:e=>this.processAuthResponse(e.detail.response)})}if(this.authStep==="sms"){return i("verdocs-otp-dialog",{endpoint:this.endpoint,method:"sms",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="email"){return i("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return i(s,{class:"kba"},i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},this.envelope.name))),i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("div",{class:"cover"},i("div",{class:"kba"},i("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 t=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:t.first_name,last_name:t.last_name,address:t.address,city:t.city,state:t.state,zip:t.zip,dob:t.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const t=this.kbaQuestions[e];return i(s,{class:"kba"},i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},this.envelope.name))),i("div",{class:"document",style:{paddingTop:"15px"}},i("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"})),i("div",{class:"cover"},i("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?i("verdocs-spinner",null):i("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(t===null||t===void 0?void 0:t.prompt)||"Please select one of the options below.",choices:(t===null||t===void 0?void 0:t.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const t=e.detail;this.kbaChoices=[...this.kbaChoices,t];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,t)=>({type:e.type,answer:this.kbaChoices[t]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const t=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const n=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){t.unshift({id:"delegate",label:"Delegate"})}const l=this.getRecipientFields().filter((e=>!f(e,this.getRecipientFields())));l.length>0?console.log("[SIGN] Invalid fields remaining",l.map((e=>e.name))):console.log("[SIGN] All field valid");const a=this.envelope.documents.reduce(((e,t)=>e+t.pages),0);const r=G(1,a).map((e=>({label:e.toString(),value:e.toString()})));let d=0;return i(s,null,this.toolbarStyle==="menu"&&i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},i("div",{class:"title"},this.envelope.name),i("div",{style:{flex:"1"}}),!this.finishLater&&!this.submitted&&(()=>{const e=this.getRequiredTotalCount()-this.getRequiredFilledCount();const t=this.getOptionalUnfilledCount();if(e>0){return i("span",{class:"remaining-count"},e," required field",e===1?"":"s"," left")}return i("span",{class:"remaining-count"},i("span",{class:"check-icon",innerHTML:M}),"All required fields complete",t>0&&i("div",{class:"review-optional"},i("span",{class:"separator"},"| "),i("span",{onClick:()=>this.handleNextOptional()},"Review ",t," optional")))})(),!this.finishLater&&!this.submitted&&i("verdocs-button",{size:"xsmall",label:this.nextButtonLabel==="Next"?"Next Required":this.nextButtonLabel,disabled:!this.agreed||this.submitting||this.submitted,onClick:()=>this.handleNext()}),i("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal",magnify:true},innerHTML:O,onClick:()=>this.handleZoomOut()}),i("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2",magnify:true},innerHTML:U,onClick:()=>this.handleZoomIn()}),i("verdocs-dropdown",{options:!this.isDone&&!this.finishLater&&!this.submitted?t:n,onOptionSelected:e=>this.handleOptionSelected(e)}))),this.toolbarStyle==="controls"&&i("div",{class:"controls-toolbar"},i("div",{class:"left-controls"},i("div",{class:"title"},this.envelope.name)),i("div",{class:"center-controls"},i("span",{class:"label"},"Page"),i("div",{class:"select-wrapper"},i("verdocs-select-input",{options:r,value:this.pageNumber.toString(),onInput:e=>this.handlePageSelect(e)})),i("span",{class:"count"},"of ",a)),i("div",{class:"right-controls"},!this.submitted&&i("verdocs-button",{class:"mobile-next-button",label:this.nextButtonLabel,size:"xsmall",disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),i("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal"},innerHTML:O,onClick:()=>this.handleZoomOut()}),i("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2"},innerHTML:U,onClick:()=>this.handleZoomIn()}),i("div",{class:"icon-button download",innerHTML:$,onClick:()=>this.handleOptionSelected({detail:{id:"download"}})}),i("div",{class:"icon-button print",innerHTML:Z,onClick:()=>this.handleOptionSelected({detail:{id:"print"}})}))),i("div",{class:`document signed-document-container zoom-${this.zoomLevel}`},(this.envelope.documents||[]).map((e=>{const t=G(1,e.pages);return i(o,null,this.envelope.documents.length>1&&i("div",{class:"document-separator"},i("div",{innerHTML:q}),i("span",null,e.name)),t.map((t=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[t])||{width:612,height:792};d++;return i("verdocs-envelope-document-page",{id:`page-${d}`,envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:t,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("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.isDone=true;this.showFinishLater=false}}),this.showDone&&i("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.handleDoneDialogDismiss()},onExit:()=>this.handleDoneDialogDismiss()}),this.adoptingSignature&&i("verdocs-adopt-signature-dialog",{name:w(this.recipient),nameLocked:!!((e=this.recipient)===null||e===void 0?void 0:e.name_locked),onNext:async e=>{console.log("[SIGN] Adopting signature/initials block",e.detail);this.showSpinner=true;const t=await(await fetch(e.detail.signature)).blob();const i=await(await fetch(e.detail.initials)).blob();const s=await p(this.endpoint,"signature",t);console.log("[SIGN] Created signature",s);this.signatureId=s.id;const o=await u(this.endpoint,"initial",i);console.log("[SIGN] Created initials",o);this.initialId=o.id;this.showSpinner=false;this.adoptingSignature=false;this.markEnvelopeStarted();if(this.focusedField){const e=this.getRecipientFields().find((e=>e.name===this.focusedField));if(e){const t=e.type==="signature"?this.signatureId:e.type==="initial"?this.initialId:null;if(t){const i=await h(this.endpoint,this.envelopeId,this.roleId,e.name,t,false);this.updateRecipientFieldValue(e.name,i)}}this.focusedField=""}const n=this.el.querySelectorAll("verdocs-field-signature");n.forEach((e=>e.setAttribute("signatureid",this.signatureId)));const l=this.el.querySelectorAll("verdocs-field-initial");l.forEach((e=>e.setAttribute("initialid",this.initialId)));this.checkRecipientFields()},onExit:()=>this.adoptingSignature=false}),(this.submitting||this.showSpinner)&&i("verdocs-portal",null,i("div",{class:"spinner-overlay"},i("verdocs-spinner",null))),this.showDownloadDialog&&i("verdocs-download-dialog",{signed:this.envelope.signed,polling:this.polling,documents:this.envelope.documents,onExit:()=>{this.showDownloadDialog=false;this.stopPolling()},onDownload:e=>this.handleOnDownload(e)}),!this.loading&&!this.isDone&&!this.submitted&&i("verdocs-sign-footer",{endpoint:this.endpoint,envelopeId:this.envelopeId,isDone:this.isDone,onAskQuestion:e=>{L(this.endpoint,this.envelopeId,this.roleId,{question:e.detail.question}).then((()=>P("Your question has been sent.",{style:"success"}))).catch((e=>{console.log("Error asking question",e);P("Unable to send question, please try again later.",{style:"error"})}))},onDecline:()=>this.declining=true,onFinishLater:()=>this.showFinishLater=true}))}get el(){return n(this)}};Y.style=j();export{Y as verdocs_sign};
|
|
2
|
+
//# sourceMappingURL=p-2a6a3bc6.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,c){function a(e){try{r(o.next(e))}catch(e){c(e)}}function n(e){try{r(o["throw"](e))}catch(e){c(e)}}function r(e){e.done?i(e.value):s(e.value).then(a,n)}r((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,s,c,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=n(0),a["throw"]=n(1),a["return"]=n(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,n[0]&&(i=0)),i)try{if(o=1,s&&(c=n[0]&2?s["return"]:n[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,n[1])).done)return c;if(s=0,c)n=[n[0]&2,c.value];switch(n[0]){case 0:case 1:c=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;s=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(c=i.trys,c=c.length>0&&c[c.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!c||n[1]>c[0]&&n[1]<c[3])){i.label=n[1];break}if(n[0]===6&&i.label<c[1]){i.label=c[1];c=n;break}if(c&&i.label<c[2]){i.label=c[2];i.ops.push(n);break}if(c[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(e){n=[6,e];s=0}finally{o=c=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,s=t.length,c;o<s;o++){if(c||!(o in t)){if(!c)c=Array.prototype.slice.call(t,0,o);c[o]=t[o]}}return e.concat(c||Array.prototype.slice.call(t))};System.register(["./p-De3fNE_u.system.js","@verdocs/js-sdk","./p-nfw6V5pF.system.js","./p-C7pDryJb.system.js","./p-CwIkMPyJ.system.js"],(function(e){"use strict";var t,i,o,s,c,a,n,r,d;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.F},function(e){c=e.VerdocsEndpoint;a=e.formatFullName;n=e.getActiveEntitlements;r=e.isValidEmail},function(e){d=e.c},null,null],execute:function(){var l=function(){return'verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{gap:12px;width:300px;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .row .option{gap:4px;display:-ms-flexbox;display:flex;padding:5px 8px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;text-wrap:nowrap}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:88px}verdocs-contact-picker form .pin-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .pin-code>input{-ms-flex:0 0 197px;flex:0 0 197px;font-size:14px}verdocs-contact-picker form .address{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .address>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form .zip-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .zip-code>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 80px;flex:0 0 80px;font-size:13px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message textarea{width:100%;padding:5px 7px;border-radius:4px;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-contact-picker form input{-ms-flex:1;flex:1;padding:6px;font-size:14px;border-radius:3px;border:1px solid rgba(112, 122, 229, 0.3725490196)}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}#verdocs-contact-picker-suggestions .dropdown{max-height:225px;overflow-y:scroll;background:#ffffff;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}#verdocs-contact-picker-suggestions .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-contact-picker-suggestions .dropdown .suggestion svg{width:32px;height:32px}#verdocs-contact-picker-suggestions .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}#verdocs-contact-picker-suggestions .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#verdocs-contact-picker-suggestions .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}#verdocs-contact-picker-suggestions .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}#verdocs-contact-picker-suggestions .dropdown .suggestion:hover{background:#eee;cursor:pointer}'};var f='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>';var p=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=i(this,"searchContacts");this.exit=i(this,"exit");this.next=i(this,"next");this.endpoint=c.getDefault();this.templateRole=null;this.contactSuggestions=[];this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.name_locked=false;this.auth_methods=[];this.passcode="";this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11));this.activeEntitlements={};this.authMethodsLoading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s;return __generator(this,(function(c){switch(c.label){case 0:this.endpoint.loadSession();if(this.templateRole){e=a(this.templateRole);t=e.split(" ");i=this.templateRole.first_name||t.shift()||"";o=this.templateRole.last_name||t.join(" ")||"";this.first_name=i;this.last_name=o;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.name_locked=this.delegator?false:this.templateRole.name_locked||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.auth_methods=this.templateRole.auth_methods||[];this.passcode=this.templateRole.passcode||""}s=this;return[4,n(this.endpoint).catch((function(e){console.warn("[CONTACT PICKER] Unable to load entitlements, continuing with base auth methods only",e);return{}}))];case 1:s.activeEntitlements=c.sent();this.authMethodsLoading=false;console.log("[CONTACT PICKER] Loaded entitlements",this.activeEntitlements);return[2]}}))}))};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator,name_locked:this.name_locked,auth_methods:this.auth_methods,passcode:this.passcode,address:this.address,zip:this.zip})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;var t=this.first_name&&this.last_name&&r(this.email);var i=!this.auth_methods.length||this.auth_methods.includes("passcode")&&!!this.passcode||this.auth_methods.includes("kba")&&!!this.first_name&&!!this.last_name||this.auth_methods.includes("email")&&!!this.email||this.auth_methods.includes("sms")&&!!this.phone;var c=t&&i;var n=!!this.activeEntitlements.sms_auth;var l=[];l.push({label:"Passcode",value:"passcode"});l.push({label:"Email",value:"email"});if(n){l.push({label:"SMS (One-Time Code)",value:"sms"})}if(!!this.activeEntitlements.kba_auth){l.push({label:"Knowledge-Based (KBA)",value:"kba"})}if(!!this.activeEntitlements.id_auth){l.push({label:"ID Check",value:"id"})}return o("form",{key:"70e2a9e4eb9e9da4bd9f491648d81fd30f9a34a6",onSubmit:function(e){return e.preventDefault()},autocomplete:"off"},o("div",{key:"9134b3e8bcd2c59f8773ad3db7bdd04d52d9cbf7",class:"row"},o("label",{key:"455c784b89b96afddb46dcde9bd760e3b36c890d",htmlFor:this.firstNameFieldId},"Name:"),o("div",{key:"802e5786743df37c017f6aab4061b01db4207988",class:"names-row"},o("input",{key:"5ee405fd8487c8f2539ede7ccf26e76bb96c3932",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.first_name,placeholder:"First...",onFocus:function(){setTimeout((function(){var t;e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0}),100)},onInput:function(t){return e.handleFirstNameChange(t)}}),o("input",{key:"2de6301b850c7d0986b0418bbb737b0f9e04849f",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.last_name,placeholder:"Last...",onFocus:function(){setTimeout((function(){var t;e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0}),100)},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&o("verdocs-portal",{key:"39c6ccb8a231fe9e01fbd99aebc3e7625dfeef17",anchor:this.firstNameFieldId,onClickAway:function(){e.showSuggestions=false;document.querySelectorAll(".verdocs-portal-wrapper").forEach((function(e){return e.remove()}))},id:"verdocs-contact-picker-suggestions"},o("div",{key:"bbabbff5428faeb5cef999f422d441d3e66fdf62",class:"dropdown"},this.contactSuggestions.filter((function(t){var i;return!e.first_name||((i=t.first_name)===null||i===void 0?void 0:i.toLowerCase().includes(e.first_name.toLowerCase()))})).map((function(t){var i;return o("div",{key:(i=t.id)!==null&&i!==void 0?i:t.email,class:"suggestion",onClick:function(i){return e.handleSelectSuggestion(i,t)}},t.picture?o("img",{alt:"Avatar",class:"avatar",src:t.picture}):o("div",{class:"avatar",innerHTML:f}),o("div",{class:"details"},o("div",{class:"name"},a(t)),t.email&&o("div",{class:"destination"},t.email),t.phone&&o("div",{class:"destination"},t.phone)))}))))),o("div",{key:"31c843f59d029535c1006c682f76d8b18f885dc3",class:"row"},o("label",{key:"540a430d827ec0b44fc2d56d4f2cb5938d663236",htmlFor:this.emailFieldId},"Email:"),o("input",{key:"055b0ecaee8f361a4f222cbaeedcdcfbf536a5cb",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.email,placeholder:"Invite/verify via email...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.email=t.target.value}})),n&&o("div",{key:"b9c6dd3118c6eba736add88b35e68ff79715e44d",class:"row"},o("label",{key:"ff687e318625a8cde98b208bf72b111d48659acc",htmlFor:this.phoneFieldId},"Phone:"),o("input",{key:"3c6f09760be62cedde15b43a1d34bbd8c2960600",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.phone,placeholder:"Invite/verify via SMS...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){e.phone=d(t.target.value)}})),o(s,{key:"2b652dbfb48a4b0360c2b6e536158492ef06125b"},l.length>0&&o("div",{key:"589c42562ec9e834680969803d747f6e94d00ec2",class:"row pin-code"},o("label",{key:"189c3562f5e0ed7599a816d0300b5fe3c96741cb"},"Verification Methods:"),this.authMethodsLoading?o("verdocs-spinner",{size:10,mode:"dark",style:{margin:"auto"}}):o("div",null,l.map((function(t,i){return o("div",{class:"option"},o("verdocs-checkbox",{size:"small",id:"verdocs-multi-select-opt-".concat(i),value:t.value,checked:e.auth_methods.includes(t.value),onInput:function(i){if(i.target.checked){e.auth_methods=__spreadArray(__spreadArray([],e.auth_methods,true),[t.value],false)}else{e.auth_methods=e.auth_methods.filter((function(e){return e!==t.value}))}}}),o("label",{htmlFor:"verdocs-multi-select-option-".concat(i)},t.label))})))),this.auth_methods.includes("passcode")&&o("div",{key:"6e12581d825a0c8089e20015d1d96fb6a182cdb5",class:"row pin-code"},o("label",{key:"e728bc75adcf8f8a322628c1a38f612d3dd2d2dc",htmlFor:this.phoneFieldId},"Passcode:"),o("input",{key:"59afa58c6563d4fa9a1cb7e65409370fb685d1db",id:"verdocs-passcode",name:"verdocs-passcode",type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.passcode,placeholder:"4-8 digits recommended...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.passcode=t.target.value}}))),o("div",{key:"eca3f9921286dba2e5d3ba02f0b886e3d179a23f",class:"row pin-code"},o("label",{key:"04e26414864324205e2ee71173aac15b46350b7e",style:{marginTop:"6px"}},"Options:"),o("div",{key:"f8df70196098a3462df02933d7d7c51cac5c856b"},o("div",{key:"09f4d4f88a355d19ae560203020c9639fe88280e",class:"option"},o("verdocs-checkbox",{key:"e71d71be949fc96c1c074dcbb58ff121c4c3fd05",size:"small",id:"verdocs-delegator",checked:this.delegator,disabled:this.name_locked,onInput:function(t){e.delegator=t.target.checked;if(e.delegator)e.name_locked=false}}),o("label",{key:"b83381a0c733b2fc19502ee1fb64462c77eb20f2",htmlFor:"verdocs-delegator"},"May delegate signing")),o("div",{key:"d3f59732383cded91c3c9d0431001ce27b1998b8",class:"option"},o("verdocs-checkbox",{key:"9c0acbf0601728bf4498e2fe3c89232ee4e9448c",size:"small",id:"verdocs-name-locked",checked:this.name_locked,disabled:this.delegator,onInput:function(t){e.name_locked=t.target.checked;if(e.name_locked)e.delegator=false}}),o("label",{key:"df906c6274917b04c471aa00eedf8fad9b9c15a1",htmlFor:"verdocs-name-locked"},"Name locked")))),o("div",{key:"74e5e6004872803e50c315540c6dc66957d6b9b0",class:"row message"},o("label",{key:"36557fd5a7ccd14cd5fae192bf3bfaaf9f39c136",htmlFor:"verdocs-contact-picker-message"},"Message:"),o("textarea",{key:"c362c8a6b1953330f128bfc5083749060d17727c",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message","data-lpignore":"true",autocomplete:"blocked",placeholder:"Optional message to include in invitation...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.message=t.target.value}},this.message)),o("div",{key:"8864df6dba12af9cc9e476398368f3482ab4982f",class:"buttons"},o("div",{key:"f09409d3f75a7f04dcb4a93189d098dbc68177c4",class:"flex-fill"}),o("verdocs-button",{key:"17a564f49e64ec50a3ef201e0aa5b662ab0f0522",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{key:"c731fb4642166fc0b682894cb71f4e41fe7b48e7",label:"OK",size:"small",disabled:!c,onClick:!c?function(){}:function(t){return e.handleSubmit(t)}})))};return e}());p.style=l()}}}));
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function a(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function c(e){try{r(o.next(e))}catch(e){s(e)}}function n(e){try{r(o["throw"](e))}catch(e){s(e)}}function r(e){e.done?i(e.value):a(e.value).then(c,n)}r((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,a,s,c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=n(0),c["throw"]=n(1),c["return"]=n(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");while(c&&(c=0,n[0]&&(i=0)),i)try{if(o=1,a&&(s=n[0]&2?a["return"]:n[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,n[1])).done)return s;if(a=0,s)n=[n[0]&2,s.value];switch(n[0]){case 0:case 1:s=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;a=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!s||n[1]>s[0]&&n[1]<s[3])){i.label=n[1];break}if(n[0]===6&&i.label<s[1]){i.label=s[1];s=n;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(n);break}if(s[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(e){n=[6,e];a=0}finally{o=s=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,a=t.length,s;o<a;o++){if(s||!(o in t)){if(!s)s=Array.prototype.slice.call(t,0,o);s[o]=t[o]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-De3fNE_u.system.js","@verdocs/js-sdk","./p-nfw6V5pF.system.js","./p-C7pDryJb.system.js","./p-CwIkMPyJ.system.js"],(function(e){"use strict";var t,i,o,a,s,c,n,r,d;return{setters:[function(e){t=e.r;i=e.c;o=e.h;a=e.F},function(e){s=e.VerdocsEndpoint;c=e.formatFullName;n=e.getActiveEntitlements;r=e.isValidEmail},function(e){d=e.c},null,null],execute:function(){var l=function(){return'verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{gap:12px;width:300px;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .row .option{gap:4px;display:-ms-flexbox;display:flex;padding:5px 8px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;text-wrap:nowrap}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:88px}verdocs-contact-picker form .pin-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .pin-code>input{-ms-flex:0 0 197px;flex:0 0 197px;font-size:14px}verdocs-contact-picker form .address{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .address>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form .zip-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .zip-code>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 80px;flex:0 0 80px;font-size:13px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message textarea{width:100%;padding:5px 7px;border-radius:4px;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-contact-picker form input{-ms-flex:1;flex:1;padding:6px;font-size:14px;border-radius:3px;border:1px solid rgba(112, 122, 229, 0.3725490196)}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}#verdocs-contact-picker-suggestions .dropdown{max-height:225px;overflow-y:scroll;background:#ffffff;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}#verdocs-contact-picker-suggestions .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-contact-picker-suggestions .dropdown .suggestion svg{width:32px;height:32px}#verdocs-contact-picker-suggestions .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}#verdocs-contact-picker-suggestions .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#verdocs-contact-picker-suggestions .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}#verdocs-contact-picker-suggestions .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}#verdocs-contact-picker-suggestions .dropdown .suggestion:hover{background:#eee;cursor:pointer}'};var f='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>';var p=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=i(this,"searchContacts");this.exit=i(this,"exit");this.next=i(this,"next");this.endpoint=s.getDefault();this.templateRole=null;this.contactSuggestions=[];this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.name_locked=false;this.auth_methods=[];this.passcode="";this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11));this.activeEntitlements={};this.authMethodsLoading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:this.endpoint.loadSession();if(this.templateRole){e=c(this.templateRole);t=e.split(" ");i=this.templateRole.first_name||t.shift()||"";o=this.templateRole.last_name||t.join(" ")||"";this.first_name=i;this.last_name=o;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.name_locked=this.delegator?false:this.templateRole.name_locked||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.auth_methods=this.templateRole.auth_methods||[];this.passcode=this.templateRole.passcode||""}a=this;return[4,n(this.endpoint).catch((function(e){console.warn("[CONTACT PICKER] Unable to load entitlements, continuing with base auth methods only",e);return{}}))];case 1:a.activeEntitlements=s.sent();this.authMethodsLoading=false;console.log("[CONTACT PICKER] Loaded entitlements",this.activeEntitlements);return[2]}}))}))};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator,name_locked:this.name_locked,auth_methods:this.auth_methods,passcode:this.passcode,address:this.address,zip:this.zip})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;var t=this.first_name&&this.last_name&&r(this.email);var i=!this.auth_methods.length||this.auth_methods.includes("passcode")&&!!this.passcode||this.auth_methods.includes("kba")&&!!this.first_name&&!!this.last_name||this.auth_methods.includes("email")&&!!this.email||this.auth_methods.includes("sms")&&!!this.phone;var s=t&&i;var n=!!this.activeEntitlements.sms_auth;var l=[];l.push({label:"Passcode",value:"passcode"});l.push({label:"Email",value:"email"});if(n){l.push({label:"SMS (One-Time Code)",value:"sms"})}if(!!this.activeEntitlements.kba_auth){l.push({label:"Knowledge-Based (KBA)",value:"kba"})}if(!!this.activeEntitlements.id_auth){l.push({label:"ID Check",value:"id"})}return o("form",{key:"6709871235915b9c57af981cb4ab8560c040c29f",onSubmit:function(e){return e.preventDefault()},autocomplete:"off"},o("div",{key:"b4792f8bf7a38bd1eca0a684da63e06607b29d4a",class:"row"},o("label",{key:"75f1386774dcf2dba1ae074e2ef86b9d04525763",htmlFor:this.firstNameFieldId},"Name:"),o("div",{key:"36916fdd64584ef209620a6311c4db381e55ea82",class:"names-row"},o("input",{key:"8ab3867864dad6e2726a09666e8c3334f6bbc713",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.first_name,placeholder:"First...",onFocus:function(){setTimeout((function(){var t;e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0}),100)},onInput:function(t){return e.handleFirstNameChange(t)}}),o("input",{key:"000acb6f26cfa8a78105b211df519ef3851dc474",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.last_name,placeholder:"Last...",onFocus:function(){setTimeout((function(){var t;e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0}),100)},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&o("verdocs-portal",{key:"4e9c8ee57f464fcf09578430e1fe09981e87bafc",anchor:this.firstNameFieldId,onClickAway:function(){e.showSuggestions=false;document.querySelectorAll(".verdocs-portal-wrapper").forEach((function(e){return e.remove()}))},id:"verdocs-contact-picker-suggestions"},o("div",{key:"5cbf60f0f1186f318f686ef6bdc8d791072e4d41",class:"dropdown"},this.contactSuggestions.filter((function(t){var i;return!e.first_name||((i=t.first_name)===null||i===void 0?void 0:i.toLowerCase().includes(e.first_name.toLowerCase()))})).map((function(t){var i;return o("div",{key:(i=t.id)!==null&&i!==void 0?i:t.email,class:"suggestion",onClick:function(i){return e.handleSelectSuggestion(i,t)}},t.picture?o("img",{alt:"Avatar",class:"avatar",src:t.picture}):o("div",{class:"avatar",innerHTML:f}),o("div",{class:"details"},o("div",{class:"name"},c(t)),t.email&&o("div",{class:"destination"},t.email),t.phone&&o("div",{class:"destination"},t.phone)))}))))),o("div",{key:"3d6aaa5e5bd3f0bc5681c4b788f222b6dfb45584",class:"row"},o("label",{key:"67e9b6d47602d8c455a46e47b94bf008d2ac3a4e",htmlFor:this.emailFieldId},"Email:"),o("input",{key:"b65569322f9a9864fe82ac3371ffcf4e769b69f1",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.email,placeholder:"Invite/verify via email...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.email=t.target.value}})),n&&o("div",{key:"defed17223c457db6eea0aff5c13598a70882157",class:"row"},o("label",{key:"7a06bd13e92cd70c51f23228bbe4ed5be59919bb",htmlFor:this.phoneFieldId},"Phone:"),o("input",{key:"770012fd3d838449afa88309f7b003c600e10a1c",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.phone,placeholder:"Invite/verify via SMS...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){e.phone=d(t.target.value)}})),o(a,{key:"e0071e7e2fb5521685c8863dab279f31089bf20e"},l.length>0&&o("div",{key:"7f769fdb13d206c769b813eef2c68e810bc635f3",class:"row pin-code"},o("label",{key:"4ebf33f0821f3b1f2a63ac918d3d2923b8f38e38"},"Verification Methods:"),this.authMethodsLoading?o("verdocs-spinner",{size:10,mode:"dark",style:{margin:"auto"}}):o("div",null,l.map((function(t,i){return o("div",{class:"option"},o("verdocs-checkbox",{size:"small",id:"verdocs-multi-select-opt-".concat(i),value:t.value,checked:e.auth_methods.includes(t.value),onInput:function(i){if(i.target.checked){e.auth_methods=__spreadArray(__spreadArray([],e.auth_methods,true),[t.value],false)}else{e.auth_methods=e.auth_methods.filter((function(e){return e!==t.value}))}}}),o("label",{htmlFor:"verdocs-multi-select-option-".concat(i)},t.label))})))),this.auth_methods.includes("passcode")&&o("div",{key:"79feab0e29cbfbbb825f285a995d21576732bb8a",class:"row pin-code"},o("label",{key:"7fd8dd8c3f254e9d6eba0e657f3a02f0fd47b05e",htmlFor:this.phoneFieldId},"Passcode:"),o("input",{key:"a9d0055ca2669776bc465ed4d7a1ce414bb628a4",id:"verdocs-passcode",name:"verdocs-passcode",type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.passcode,placeholder:"4-8 digits recommended...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.passcode=t.target.value}}))),o("div",{key:"71101e3ae9adab93ffde79f43431ab91657df8cd",class:"row pin-code"},o("label",{key:"312a0dafe35171d1ebc61e62f868e2fdcd8a8e8d",style:{marginTop:"6px"}},"Options:"),o("div",{key:"38341490838ffe88ee03800e886d46b163f1d21a"},o("div",{key:"68fbb6b02029ba082da5db49687989e2d0228235",class:"option"},o("verdocs-checkbox",{key:"57c933a6ebc171d8a0c86452ff26504270175463",size:"small",id:"verdocs-delegator",checked:this.delegator,disabled:this.name_locked,onInput:function(t){e.delegator=t.target.checked;if(e.delegator)e.name_locked=false}}),o("label",{key:"8d4bbaef0ca5cea8100777fa37d520f1bd5a1d1e",htmlFor:"verdocs-delegator"},"May delegate signing")),o("div",{key:"d1278133af51917475ae1778c28da315072ca4a6",class:"option"},o("verdocs-checkbox",{key:"32f6401902c5f850f52c58fb06def2d16fc65e99",size:"small",id:"verdocs-name-locked",checked:this.name_locked,disabled:this.delegator,onInput:function(t){e.name_locked=t.target.checked;if(e.name_locked)e.delegator=false}}),o("label",{key:"82d3cb3a2c48c66e8dd4bf917e35ed85327d994d",htmlFor:"verdocs-name-locked"},"Name locked")))),o("div",{key:"01f4e93445daee8493eb67f41640865753db54bb",class:"row message"},o("label",{key:"499b65b9368abe5f355ece31825fdd6b92905b55",htmlFor:"verdocs-contact-picker-message"},"Message:"),o("textarea",{key:"817c16d982edb9af18f8ebee829ed77068d431b5",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message","data-lpignore":"true",autocomplete:"blocked",placeholder:"Optional message to include in invitation...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.message=t.target.value}},this.message)),o("div",{key:"044a45c3a9ba57334c6e10f12e0b1f19ce5c3403",class:"buttons"},o("div",{key:"6aa3536c73eef3852f7d483deee3773413167f5d",class:"flex-fill"}),o("verdocs-button",{key:"7dc65ba7bcb927c9822cc19d00b3a74278db8688",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{key:"7f3434aa2547d87ad2a54610374bec0511aa7940",label:"OK",size:"small",disabled:!s,onClick:!s?function(){}:function(t){return e.handleSubmit(t)}})))};return e}());p.style=l()}}}));
|
|
2
|
+
//# sourceMappingURL=p-39c54b65.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["verdocsContactPickerCss","addrBookIcon","VerdocsContactPicker","exports","class_1","hostRef","this","endpoint","VerdocsEndpoint","getDefault","templateRole","contactSuggestions","showSuggestions","showMessage","delegator","name_locked","auth_methods","passcode","firstNameFieldId","concat","Math","random","toString","substring","lastNameFieldId","emailFieldId","phoneFieldId","activeEntitlements","authMethodsLoading","prototype","componentWillLoad","loadSession","fullName","formatFullName","nameComponents","split","firstName","first_name","shift","lastName","last_name","join","email","phone","message","_b","getActiveEntitlements","catch","e","console","warn","_c","sent","log","handleFirstNameChange","target","value","_a","searchContacts","emit","query","handleLastNameChange","handleCancel","stopPropagation","exit","handleSubmit","next","address","zip","handleSelectSuggestion","suggestion","render","_this","hasBasics","isValidEmail","hasAuthRequirements","length","includes","canSubmit","hasSMSAuth","sms_auth","verificationOptions","push","label","kba_auth","id_auth","h","key","onSubmit","preventDefault","autocomplete","class","htmlFor","id","name","type","placeholder","onFocus","setTimeout","onInput","anchor","onClickAway","document","querySelectorAll","forEach","el","remove","filter","toLowerCase","map","onClick","picture","alt","src","innerHTML","autoComplete","convertToE164","Fragment","size","mode","style","margin","option","i","checked","__spreadArray","selected","marginTop","disabled","variant"],"sources":["src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.scss?tag=verdocs-contact-picker","src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-contact-picker {\n display: block;\n border: 1px solid #ebebeb;\n background-color: $verdocs-grey-4;\n font-family: $verdocs-primary-font;\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);\n\n form {\n gap: 12px;\n width: 300px;\n padding: 12px;\n display: flex;\n flex-direction: column;\n background-color: $verdocs-grey-3;\n\n .row {\n gap: 8px;\n display: flex;\n position: relative;\n flex-direction: row;\n align-items: flex-start;\n\n .option {\n gap: 4px;\n display: flex;\n padding: 5px 8px;\n align-items: center;\n flex-direction: row;\n text-wrap: nowrap;\n }\n }\n\n .names-row {\n gap: 8px;\n display: flex;\n flex-direction: row;\n\n > input {\n font-size: 14px;\n width: 88px;\n }\n }\n\n .pin-code {\n gap: 8px;\n display: flex;\n align-items: flex-start;\n flex-direction: row;\n\n > input {\n flex: 0 0 197px;\n font-size: 14px;\n //margin-left: 88px;\n }\n }\n\n .address {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 1;\n font-size: 14px;\n //margin-left: 88px;\n }\n }\n\n .zip-code {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 1;\n font-size: 14px;\n //margin-left: 88px;\n }\n }\n\n label {\n display: flex;\n flex: 0 0 80px;\n font-size: 13px;\n font-weight: 500;\n color: $verdocs-bg-4;\n }\n\n .row.message textarea {\n width: 100%;\n padding: 5px 7px;\n border-radius: 4px;\n font-family: $verdocs-primary-font;\n }\n\n input {\n flex: 1;\n padding: 6px;\n font-size: 14px;\n border-radius: 3px;\n //background: #00000005;\n border: 1px solid $border-color-extralight;\n\n &:focus {\n outline: none;\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 6px;\n margin-top: 16px;\n flex-direction: row;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n\n // @see https://community.logmein.com/t5/LastPass-Support-Discussions/placeholder-text-overrides-data-lpignore-quot-true-quot/td-p/295135\n // LastPass is ignoring the data-lpignore attribute in some cases\n [data-lastpass-icon-root] {\n display: none !important;\n }\n}\n\n#verdocs-contact-picker-suggestions {\n .dropdown {\n max-height: 225px;\n overflow-y: scroll;\n background: #ffffff;\n font-family: $verdocs-primary-font;\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);\n\n .suggestion {\n display: flex;\n padding: 6px 12px;\n align-items: center;\n flex-direction: row;\n\n svg {\n width: 32px;\n height: 32px;\n }\n\n .avatar {\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n margin-right: 8px;\n border-radius: 100%;\n }\n\n .details {\n display: flex;\n flex-direction: column;\n }\n\n .name {\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 3px;\n color: $verdocs-grey-0;\n }\n\n .destination {\n font-size: 14px;\n margin-bottom: 3px;\n color: $verdocs-grey-1;\n }\n\n &:hover {\n background: #eee;\n cursor: pointer;\n }\n }\n }\n}\n","import {Component, h, Event, EventEmitter, Fragment, Prop, State} from '@stencil/core';\nimport {formatFullName, getActiveEntitlements, IEntitlement, IProfile, IRecipient, isValidEmail, TEntitlement, TRecipientAuthMethod, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {convertToE164} from '../../../utils/utils';\n\nconst addrBookIcon = `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-book-user\"><path d=\"M15 13a3 3 0 1 0-6 0\"/><path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\"/><circle cx=\"12\" cy=\"8\" r=\"2\"/></svg>`;\n\nexport interface IContactSearchEvent {\n query: string;\n}\n\nexport interface IContactSelectEvent {\n first_name: string;\n last_name: string;\n email: string;\n phone: string;\n message: string;\n delegator: boolean;\n name_locked: boolean;\n auth_methods: TRecipientAuthMethod[];\n passcode: string;\n address: string;\n zip: string;\n}\n\nexport type TPickerContact = Partial<IProfile>;\n\n/**\n * Display a contact picker suitable for filling out Recipient objects when sending Envelopes.\n *\n * This picker can also be integrated with a backend to provide contact list / suggestion / address-book style behavior. As the\n * user interacts with the component, the text entered in the name fields is sent back to the parent via the `searchContacts` event.\n * The parent can use that text as a query string to call a backend to obtain appropriate contacts to show. This list may also be\n * hard-coded ahead of time to provide the user with smart suggestions on initial display, such as \"Recently Used\" contacts, or\n * to always display the user's own contact record.\n *\n * ```ts\n * <verdocs-contact-picker\n * templateRole={role}\n * contactSuggestions={[]}\n * onNext={e => console.log('Contact completed', e.detail)}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-contact-picker',\n styleUrl: 'verdocs-contact-picker.scss',\n shadow: false,\n})\nexport class VerdocsContactPicker {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The role that this contact will be assigned to.\n */\n @Prop() templateRole: Partial<IRecipient> | null = null;\n\n /**\n * If set, suggestions will be displayed in a drop-down list to the user. It is recommended that the number\n * of suggestions be limited to the 5 best matching records.\n */\n @Prop() contactSuggestions: TPickerContact[] = [];\n\n /**\n * Event fired when the user enters text in the search field. The calling application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) next: EventEmitter<IContactSelectEvent>;\n\n @State() first_name: string;\n @State() last_name: string;\n @State() email: string;\n @State() phone: string;\n @State() zip: string;\n @State() address: string;\n @State() message: string;\n @State() showSuggestions: boolean = false;\n @State() showMessage: boolean = false;\n @State() delegator: boolean = false;\n @State() name_locked: boolean = false;\n @State() auth_methods: TRecipientAuthMethod[] = [];\n @State() passcode: string = '';\n\n @State() firstNameFieldId = `verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2, 11)}`;\n @State() lastNameFieldId = `verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2, 11)}`;\n @State() emailFieldId = `verdocs-contact-picker-email-${Math.random().toString(36).substring(2, 11)}`;\n @State() phoneFieldId = `verdocs-contact-picker-phone-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() activeEntitlements: Partial<Record<TEntitlement, IEntitlement>> = {};\n @State() authMethodsLoading: boolean = true\n\n async componentWillLoad() {\n this.endpoint.loadSession();\n\n if (this.templateRole) {\n const fullName = formatFullName(this.templateRole);\n const nameComponents = fullName.split(' ');\n const firstName = this.templateRole.first_name || nameComponents.shift() || '';\n const lastName = this.templateRole.last_name || nameComponents.join(' ') || '';\n this.first_name = firstName;\n this.last_name = lastName;\n\n this.email = this.templateRole.email || '';\n this.phone = this.templateRole.phone || '';\n // delegator and name_locked are mutually exclusive; delegator takes precedence if both are somehow set\n this.delegator = this.templateRole.delegator || false;\n this.name_locked = this.delegator ? false : (this.templateRole.name_locked || false);\n this.message = this.templateRole.message || '';\n this.showMessage = this.message !== '';\n this.auth_methods = this.templateRole.auth_methods || [];\n this.passcode = this.templateRole.passcode || '';\n }\n\n // Entitlements only gate optional methods like KBA. We need error handling here in case the getActiveEntitlements\n // call fails or we stay loading forever.\n this.activeEntitlements = await getActiveEntitlements(this.endpoint).catch(e => {\n console.warn('[CONTACT PICKER] Unable to load entitlements, continuing with base auth methods only', e);\n return {} as Partial<Record<TEntitlement, IEntitlement>>;\n });\n\n this.authMethodsLoading = false;\n console.log('[CONTACT PICKER] Loaded entitlements', this.activeEntitlements);\n }\n\n handleFirstNameChange(e: any) {\n this.first_name = e.target.value;\n this.searchContacts?.emit({query: this.first_name});\n }\n\n handleLastNameChange(e: any) {\n this.last_name = e.target.value;\n this.searchContacts?.emit({query: this.last_name});\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.showSuggestions = false;\n this.exit?.emit();\n }\n\n handleSubmit(e: any) {\n e.stopPropagation();\n\n this.showSuggestions = false;\n this.next?.emit({\n first_name: this.first_name,\n last_name: this.last_name,\n email: this.email,\n phone: this.phone,\n message: this.message,\n delegator: this.delegator,\n name_locked: this.name_locked,\n auth_methods: this.auth_methods,\n passcode: this.passcode,\n address: this.address,\n zip: this.zip,\n });\n }\n\n handleSelectSuggestion(e: any, suggestion: TPickerContact) {\n e.stopPropagation();\n\n this.first_name = suggestion.first_name;\n this.last_name = suggestion.last_name;\n this.email = suggestion.email;\n this.phone = suggestion.phone;\n this.showSuggestions = false;\n }\n\n // The reason for the random names/IDs is to disable browser autocomplete. We set the autocomplete tags but many browsers ignore them\n // and show a duplicate autocomplete picker on top of our own.\n render() {\n // const hasBasics = this.first_name && this.last_name && (isValidEmail(this.email) || isValidPhone(this.phone));\n const hasBasics = this.first_name && this.last_name && isValidEmail(this.email);\n const hasAuthRequirements =\n !this.auth_methods.length ||\n (this.auth_methods.includes('passcode') && !!this.passcode) ||\n (this.auth_methods.includes('kba') && !!this.first_name && !!this.last_name) ||\n (this.auth_methods.includes('email') && !!this.email) ||\n (this.auth_methods.includes('sms') && !!this.phone);\n const canSubmit = hasBasics && hasAuthRequirements;\n const hasSMSAuth = !!this.activeEntitlements.sms_auth\n\n const verificationOptions = [];\n\n verificationOptions.push({label: 'Passcode', value: 'passcode'});\n verificationOptions.push({label: 'Email', value: 'email'});\n\n if (hasSMSAuth) {\n verificationOptions.push({label: 'SMS (One-Time Code)', value: 'sms'});\n }\n\n if (!!this.activeEntitlements.kba_auth) {\n verificationOptions.push({label: 'Knowledge-Based (KBA)', value: 'kba'});\n }\n\n if (!!this.activeEntitlements.id_auth) {\n verificationOptions.push({label: 'ID Check', value: 'id'});\n }\n\n return (\n <form\n onSubmit={e => e.preventDefault()}\n // onClick={e => e.stopPropagation()}\n autocomplete=\"off\"\n >\n <div class=\"row\">\n <label htmlFor={this.firstNameFieldId}>Name:</label>\n <div class=\"names-row\">\n <input\n id={this.firstNameFieldId}\n name={this.firstNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n aria-autocomplete=\"none\"\n value={this.first_name}\n placeholder=\"First...\"\n onFocus={() => {\n // Give the blur event a chance to hide it first if going between first/last\n setTimeout(() => {\n this.showSuggestions = this.contactSuggestions?.length > 0;\n }, 100);\n }}\n onInput={e => this.handleFirstNameChange(e)}\n />\n <input\n id={this.lastNameFieldId}\n name={this.lastNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n aria-autocomplete=\"none\"\n value={this.last_name}\n placeholder=\"Last...\"\n onFocus={() => {\n // Give the blur event a chance to hide it first if going between first/last\n setTimeout(() => {\n this.showSuggestions = this.contactSuggestions?.length > 0;\n }, 100);\n }}\n onInput={e => this.handleLastNameChange(e)}\n />\n </div>\n\n {this.showSuggestions && (\n <verdocs-portal\n anchor={this.firstNameFieldId}\n onClickAway={() => {\n this.showSuggestions = false;\n document.querySelectorAll(`.verdocs-portal-wrapper`).forEach(el => el.remove());\n }}\n id=\"verdocs-contact-picker-suggestions\"\n >\n <div class=\"dropdown\">\n {this.contactSuggestions\n .filter(suggestion => !this.first_name || suggestion.first_name?.toLowerCase().includes(this.first_name.toLowerCase()))\n .map(suggestion => (\n <div key={suggestion.id ?? suggestion.email} class=\"suggestion\" onClick={e => this.handleSelectSuggestion(e, suggestion)}>\n {suggestion.picture ? <img alt=\"Avatar\" class=\"avatar\" src={suggestion.picture} /> : <div class=\"avatar\" innerHTML={addrBookIcon} />}\n <div class=\"details\">\n <div class=\"name\">{formatFullName(suggestion)}</div>\n {suggestion.email && <div class=\"destination\">{suggestion.email}</div>}\n {suggestion.phone && <div class=\"destination\">{suggestion.phone}</div>}\n </div>\n </div>\n ))}\n </div>\n </verdocs-portal>\n )}\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.emailFieldId}>Email:</label>\n <input\n id={this.emailFieldId}\n name={this.emailFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n aria-autocomplete=\"none\"\n value={this.email}\n placeholder=\"Invite/verify via email...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.email = e.target.value)}\n />\n </div>\n\n {hasSMSAuth && (\n <div class=\"row\">\n <label htmlFor={this.phoneFieldId}>Phone:</label>\n <input\n id={this.phoneFieldId}\n name={this.phoneFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n aria-autocomplete=\"none\"\n value={this.phone}\n placeholder=\"Invite/verify via SMS...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => {\n this.phone = convertToE164(e.target.value);\n }}\n />\n </div>\n )}\n\n <Fragment>\n {verificationOptions.length > 0 && (\n <div class=\"row pin-code\">\n <label>Verification Methods:</label>\n {this.authMethodsLoading ? (\n <verdocs-spinner size={10} mode=\"dark\" style={{margin: 'auto'}} />\n ) : (\n <div>\n {verificationOptions.map((option, i) => (\n <div class=\"option\">\n <verdocs-checkbox\n size=\"small\"\n id={`verdocs-multi-select-opt-${i}`}\n value={option.value}\n checked={this.auth_methods.includes(option.value)}\n onInput={(e: any) => {\n if (e.target.checked) {\n this.auth_methods = [...this.auth_methods, option.value];\n } else {\n this.auth_methods = this.auth_methods.filter(selected => selected !== option.value);\n }\n }}\n />\n <label htmlFor={`verdocs-multi-select-option-${i}`}>{option.label}</label>\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n\n {this.auth_methods.includes('passcode') && (\n <div class=\"row pin-code\">\n <label htmlFor={this.phoneFieldId}>Passcode:</label>\n <input\n id=\"verdocs-passcode\"\n name=\"verdocs-passcode\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n aria-autocomplete=\"none\"\n value={this.passcode}\n placeholder=\"4-8 digits recommended...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.passcode = e.target.value)}\n />\n </div>\n )}\n </Fragment>\n\n <div class=\"row pin-code\">\n <label style={{marginTop: '6px'}}>Options:</label>\n <div>\n <div class=\"option\">\n <verdocs-checkbox\n size=\"small\"\n id=\"verdocs-delegator\"\n checked={this.delegator}\n disabled={this.name_locked}\n onInput={(e: any) => {\n this.delegator = e.target.checked;\n if (this.delegator) this.name_locked = false;\n }}\n />\n <label htmlFor=\"verdocs-delegator\">May delegate signing</label>\n </div>\n <div class=\"option\">\n <verdocs-checkbox\n size=\"small\"\n id=\"verdocs-name-locked\"\n checked={this.name_locked}\n disabled={this.delegator}\n onInput={(e: any) => {\n this.name_locked = e.target.checked;\n if (this.name_locked) this.delegator = false;\n }}\n />\n <label htmlFor=\"verdocs-name-locked\">Name locked</label>\n </div>\n </div>\n </div>\n\n <div class=\"row message\">\n <label htmlFor=\"verdocs-contact-picker-message\">Message:</label>\n <textarea\n id=\"verdocs-contact-picker-message\"\n name=\"verdocs-contact-picker-message\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n placeholder=\"Optional message to include in invitation...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.message = e.target.value)}\n >\n {this.message}\n </textarea>\n </div>\n\n <div class=\"buttons\">\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" disabled={!canSubmit} onClick={!canSubmit ? () => {} : e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n"],"mappings":"6oEAAA,IAAMA,EAA0B,WAAM,87HCItC,IAAMC,EAAe,oU,IA4CRC,EAAoBC,EAAA,oCALjC,SAAAC,EAAAC,G,yGASUC,KAAAC,SAA4BC,EAAgBC,aAK5CH,KAAAI,aAA2C,KAM3CJ,KAAAK,mBAAuC,GAyBtCL,KAAAM,gBAA2B,MAC3BN,KAAAO,YAAuB,MACvBP,KAAAQ,UAAqB,MACrBR,KAAAS,YAAuB,MACvBT,KAAAU,aAAuC,GACvCV,KAAAW,SAAmB,GAEnBX,KAAAY,iBAAmB,oCAAAC,OAAoCC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/FjB,KAAAkB,gBAAkB,mCAAAL,OAAmCC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC7FjB,KAAAmB,aAAe,gCAAAN,OAAgCC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KACvFjB,KAAAoB,aAAe,gCAAAP,OAAgCC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAEvFjB,KAAAqB,mBAAkE,GAClErB,KAAAsB,mBAA8B,IAqUxC,CAnUOxB,EAAAyB,UAAAC,kBAAN,W,0HACExB,KAAKC,SAASwB,cAEd,GAAIzB,KAAKI,aAAc,CACfsB,EAAWC,EAAe3B,KAAKI,cAC/BwB,EAAiBF,EAASG,MAAM,KAChCC,EAAY9B,KAAKI,aAAa2B,YAAcH,EAAeI,SAAW,GACtEC,EAAWjC,KAAKI,aAAa8B,WAAaN,EAAeO,KAAK,MAAQ,GAC5EnC,KAAK+B,WAAaD,EAClB9B,KAAKkC,UAAYD,EAEjBjC,KAAKoC,MAAQpC,KAAKI,aAAagC,OAAS,GACxCpC,KAAKqC,MAAQrC,KAAKI,aAAaiC,OAAS,GAExCrC,KAAKQ,UAAYR,KAAKI,aAAaI,WAAa,MAChDR,KAAKS,YAAcT,KAAKQ,UAAY,MAASR,KAAKI,aAAaK,aAAe,MAC9ET,KAAKsC,QAAUtC,KAAKI,aAAakC,SAAW,GAC5CtC,KAAKO,YAAcP,KAAKsC,UAAY,GACpCtC,KAAKU,aAAeV,KAAKI,aAAaM,cAAgB,GACtDV,KAAKW,SAAWX,KAAKI,aAAaO,UAAY,E,CAKhD4B,EAAAvC,KAA0B,SAAMwC,EAAsBxC,KAAKC,UAAUwC,OAAM,SAAAC,GACzEC,QAAQC,KAAK,uFAAwFF,GACrG,MAAO,EACT,K,OAHAH,EAAKlB,mBAAqBwB,EAAAC,OAK1B9C,KAAKsB,mBAAqB,MAC1BqB,QAAQI,IAAI,uCAAwC/C,KAAKqB,oB,kBAG3DvB,EAAAyB,UAAAyB,sBAAA,SAAsBN,G,MACpB1C,KAAK+B,WAAaW,EAAEO,OAAOC,OAC3BC,EAAAnD,KAAKoD,kBAAc,MAAAD,SAAA,SAAAA,EAAEE,KAAK,CAACC,MAAOtD,KAAK+B,Y,EAGzCjC,EAAAyB,UAAAgC,qBAAA,SAAqBb,G,MACnB1C,KAAKkC,UAAYQ,EAAEO,OAAOC,OAC1BC,EAAAnD,KAAKoD,kBAAc,MAAAD,SAAA,SAAAA,EAAEE,KAAK,CAACC,MAAOtD,KAAKkC,W,EAGzCpC,EAAAyB,UAAAiC,aAAA,SAAad,G,MACXA,EAAEe,kBACFzD,KAAKM,gBAAkB,OACvB6C,EAAAnD,KAAK0D,QAAI,MAAAP,SAAA,SAAAA,EAAEE,M,EAGbvD,EAAAyB,UAAAoC,aAAA,SAAajB,G,MACXA,EAAEe,kBAEFzD,KAAKM,gBAAkB,OACvB6C,EAAAnD,KAAK4D,QAAI,MAAAT,SAAA,SAAAA,EAAEE,KAAK,CACdtB,WAAY/B,KAAK+B,WACjBG,UAAWlC,KAAKkC,UAChBE,MAAOpC,KAAKoC,MACZC,MAAOrC,KAAKqC,MACZC,QAAStC,KAAKsC,QACd9B,UAAWR,KAAKQ,UAChBC,YAAaT,KAAKS,YAClBC,aAAcV,KAAKU,aACnBC,SAAUX,KAAKW,SACfkD,QAAS7D,KAAK6D,QACdC,IAAK9D,KAAK8D,K,EAIdhE,EAAAyB,UAAAwC,uBAAA,SAAuBrB,EAAQsB,GAC7BtB,EAAEe,kBAEFzD,KAAK+B,WAAaiC,EAAWjC,WAC7B/B,KAAKkC,UAAY8B,EAAW9B,UAC5BlC,KAAKoC,MAAQ4B,EAAW5B,MACxBpC,KAAKqC,MAAQ2B,EAAW3B,MACxBrC,KAAKM,gBAAkB,K,EAKzBR,EAAAyB,UAAA0C,OAAA,eAAAC,EAAAlE,KAEE,IAAMmE,EAAYnE,KAAK+B,YAAc/B,KAAKkC,WAAakC,EAAapE,KAAKoC,OACzE,IAAMiC,GACHrE,KAAKU,aAAa4D,QAClBtE,KAAKU,aAAa6D,SAAS,eAAiBvE,KAAKW,UACjDX,KAAKU,aAAa6D,SAAS,UAAYvE,KAAK+B,cAAgB/B,KAAKkC,WACjElC,KAAKU,aAAa6D,SAAS,YAAcvE,KAAKoC,OAC9CpC,KAAKU,aAAa6D,SAAS,UAAYvE,KAAKqC,MAC/C,IAAMmC,EAAYL,GAAaE,EAC/B,IAAMI,IAAezE,KAAKqB,mBAAmBqD,SAE7C,IAAMC,EAAsB,GAE5BA,EAAoBC,KAAK,CAACC,MAAO,WAAY3B,MAAO,aACpDyB,EAAoBC,KAAK,CAACC,MAAO,QAAS3B,MAAO,UAEjD,GAAIuB,EAAY,CACdE,EAAoBC,KAAK,CAACC,MAAO,sBAAuB3B,MAAO,O,CAGjE,KAAMlD,KAAKqB,mBAAmByD,SAAU,CACtCH,EAAoBC,KAAK,CAACC,MAAO,wBAAyB3B,MAAO,O,CAGnE,KAAMlD,KAAKqB,mBAAmB0D,QAAS,CACrCJ,EAAoBC,KAAK,CAACC,MAAO,WAAY3B,MAAO,M,CAGtD,OACE8B,EAAA,QAAAC,IAAA,2CACEC,SAAU,SAAAxC,GAAK,OAAAA,EAAEyC,gBAAF,EAEfC,aAAa,OAEbJ,EAAA,OAAAC,IAAA,2CAAKI,MAAM,OACTL,EAAA,SAAAC,IAAA,2CAAOK,QAAStF,KAAKY,kBAAgB,SACrCoE,EAAA,OAAAC,IAAA,2CAAKI,MAAM,aACTL,EAAA,SAAAC,IAAA,2CACEM,GAAIvF,KAAKY,iBACT4E,KAAMxF,KAAKY,iBACX6E,KAAK,OAAM,gBACG,OACdL,aAAa,UAAS,oBACJ,OAClBlC,MAAOlD,KAAK+B,WACZ2D,YAAY,WACZC,QAAS,WAEPC,YAAW,W,MACT1B,EAAK5D,kBAAkB6C,EAAAe,EAAK7D,sBAAkB,MAAA8C,SAAA,SAAAA,EAAEmB,QAAS,C,GACxD,IACL,EACAuB,QAAS,SAAAnD,GAAK,OAAAwB,EAAKlB,sBAAsBN,EAA3B,IAEhBsC,EAAA,SAAAC,IAAA,2CACEM,GAAIvF,KAAKkB,gBACTsE,KAAMxF,KAAKkB,gBACXuE,KAAK,OAAM,gBACG,OACdL,aAAa,UAAS,oBACJ,OAClBlC,MAAOlD,KAAKkC,UACZwD,YAAY,UACZC,QAAS,WAEPC,YAAW,W,MACT1B,EAAK5D,kBAAkB6C,EAAAe,EAAK7D,sBAAkB,MAAA8C,SAAA,SAAAA,EAAEmB,QAAS,C,GACxD,IACL,EACAuB,QAAS,SAAAnD,GAAK,OAAAwB,EAAKX,qBAAqBb,EAA1B,KAIjB1C,KAAKM,iBACJ0E,EAAA,kBAAAC,IAAA,2CACEa,OAAQ9F,KAAKY,iBACbmF,YAAa,WACX7B,EAAK5D,gBAAkB,MACvB0F,SAASC,iBAAiB,2BAA2BC,SAAQ,SAAAC,GAAM,OAAAA,EAAGC,QAAH,G,EAErEb,GAAG,sCAEHP,EAAA,OAAAC,IAAA,2CAAKI,MAAM,YACRrF,KAAKK,mBACHgG,QAAO,SAAArC,GAAa,IAAAb,EAAC,OAACe,EAAKnC,cAAcoB,EAAAa,EAAWjC,cAAU,MAAAoB,SAAA,SAAAA,EAAEmD,cAAc/B,SAASL,EAAKnC,WAAWuE,eAAc,IACrHC,KAAI,SAAAvC,G,MAAc,OACjBgB,EAAA,OAAKC,KAAK9B,EAAAa,EAAWuB,MAAE,MAAApC,SAAA,EAAAA,EAAIa,EAAW5B,MAAOiD,MAAM,aAAamB,QAAS,SAAA9D,GAAK,OAAAwB,EAAKH,uBAAuBrB,EAAGsB,EAA/B,GAC3EA,EAAWyC,QAAUzB,EAAA,OAAK0B,IAAI,SAASrB,MAAM,SAASsB,IAAK3C,EAAWyC,UAAczB,EAAA,OAAKK,MAAM,SAASuB,UAAWjH,IACpHqF,EAAA,OAAKK,MAAM,WACTL,EAAA,OAAKK,MAAM,QAAQ1D,EAAeqC,IACjCA,EAAW5B,OAAS4C,EAAA,OAAKK,MAAM,eAAerB,EAAW5B,OACzD4B,EAAW3B,OAAS2C,EAAA,OAAKK,MAAM,eAAerB,EAAW3B,Q,OAS1E2C,EAAA,OAAAC,IAAA,2CAAKI,MAAM,OACTL,EAAA,SAAAC,IAAA,2CAAOK,QAAStF,KAAKmB,cAAY,UACjC6D,EAAA,SAAAC,IAAA,2CACEM,GAAIvF,KAAKmB,aACTqE,KAAMxF,KAAKmB,aACXsE,KAAK,OAAM,gBACG,OACdoB,aAAa,UAAS,oBACJ,OAClB3D,MAAOlD,KAAKoC,MACZsD,YAAY,6BACZC,QAAS,kBAAOzB,EAAK5D,gBAAkB,KAA9B,EACTuF,QAAS,SAACnD,GAAM,OAAMwB,EAAK9B,MAAQM,EAAEO,OAAOC,KAA5B,KAInBuB,GACCO,EAAA,OAAAC,IAAA,2CAAKI,MAAM,OACTL,EAAA,SAAAC,IAAA,2CAAOK,QAAStF,KAAKoB,cAAY,UACjC4D,EAAA,SAAAC,IAAA,2CACEM,GAAIvF,KAAKoB,aACToE,KAAMxF,KAAKoB,aACXqE,KAAK,OAAM,gBACG,OACdoB,aAAa,UAAS,oBACJ,OAClB3D,MAAOlD,KAAKqC,MACZqD,YAAY,2BACZC,QAAS,kBAAOzB,EAAK5D,gBAAkB,KAA9B,EACTuF,QAAS,SAACnD,GACRwB,EAAK7B,MAAQyE,EAAcpE,EAAEO,OAAOC,MACtC,KAKN8B,EAAC+B,EAAQ,CAAA9B,IAAA,4CACNN,EAAoBL,OAAS,GAC5BU,EAAA,OAAAC,IAAA,2CAAKI,MAAM,gBACTL,EAAA,SAAAC,IAAA,qEACCjF,KAAKsB,mBACJ0D,EAAA,mBAAiBgC,KAAM,GAAIC,KAAK,OAAOC,MAAO,CAACC,OAAQ,UAEvDnC,EAAA,WACCL,EAAoB4B,KAAI,SAACa,EAAQC,GAAC,OACjCrC,EAAA,OAAKK,MAAM,UACTL,EAAA,oBACEgC,KAAK,QACLzB,GAAI,4BAAA1E,OAA4BwG,GAChCnE,MAAOkE,EAAOlE,MACdoE,QAASpD,EAAKxD,aAAa6D,SAAS6C,EAAOlE,OAC3C2C,QAAS,SAACnD,GACR,GAAIA,EAAEO,OAAOqE,QAAS,CACpBpD,EAAKxD,aAAY6G,4BAAA,GAAOrD,EAAKxD,aAAY,OAAE0G,EAAOlE,OAAK,M,KAClD,CACLgB,EAAKxD,aAAewD,EAAKxD,aAAa2F,QAAO,SAAAmB,GAAY,OAAAA,IAAaJ,EAAOlE,KAApB,G,KAI/D8B,EAAA,SAAOM,QAAS,+BAAAzE,OAA+BwG,IAAMD,EAAOvC,OAf7B,MAuBxC7E,KAAKU,aAAa6D,SAAS,aAC1BS,EAAA,OAAAC,IAAA,2CAAKI,MAAM,gBACTL,EAAA,SAAAC,IAAA,2CAAOK,QAAStF,KAAKoB,cAAY,aACjC4D,EAAA,SAAAC,IAAA,2CACEM,GAAG,mBACHC,KAAK,mBACLC,KAAK,OAAM,gBACG,OACdL,aAAa,UAAS,oBACJ,OAClBlC,MAAOlD,KAAKW,SACZ+E,YAAY,4BACZC,QAAS,kBAAOzB,EAAK5D,gBAAkB,KAA9B,EACTuF,QAAS,SAACnD,GAAM,OAAMwB,EAAKvD,SAAW+B,EAAEO,OAAOC,KAA/B,MAMxB8B,EAAA,OAAAC,IAAA,2CAAKI,MAAM,gBACTL,EAAA,SAAAC,IAAA,2CAAOiC,MAAO,CAACO,UAAW,QAAM,YAChCzC,EAAA,OAAAC,IAAA,4CACED,EAAA,OAAAC,IAAA,2CAAKI,MAAM,UACTL,EAAA,oBAAAC,IAAA,2CACE+B,KAAK,QACLzB,GAAG,oBACH+B,QAAStH,KAAKQ,UACdkH,SAAU1H,KAAKS,YACfoF,QAAS,SAACnD,GACRwB,EAAK1D,UAAYkC,EAAEO,OAAOqE,QAC1B,GAAIpD,EAAK1D,UAAW0D,EAAKzD,YAAc,KACzC,IAEFuE,EAAA,SAAAC,IAAA,2CAAOK,QAAQ,qBAAmB,yBAEpCN,EAAA,OAAAC,IAAA,2CAAKI,MAAM,UACTL,EAAA,oBAAAC,IAAA,2CACE+B,KAAK,QACLzB,GAAG,sBACH+B,QAAStH,KAAKS,YACdiH,SAAU1H,KAAKQ,UACfqF,QAAS,SAACnD,GACRwB,EAAKzD,YAAciC,EAAEO,OAAOqE,QAC5B,GAAIpD,EAAKzD,YAAayD,EAAK1D,UAAY,K,IAG3CwE,EAAA,SAAAC,IAAA,2CAAOK,QAAQ,uBAAqB,kBAK1CN,EAAA,OAAAC,IAAA,2CAAKI,MAAM,eACTL,EAAA,SAAAC,IAAA,2CAAOK,QAAQ,kCAAgC,YAC/CN,EAAA,YAAAC,IAAA,2CACEM,GAAG,iCACHC,KAAK,iCAAgC,gBACvB,OACdJ,aAAa,UACbM,YAAY,+CACZC,QAAS,kBAAOzB,EAAK5D,gBAAkB,KAA9B,EACTuF,QAAS,SAACnD,GAAM,OAAMwB,EAAK5B,QAAUI,EAAEO,OAAOC,KAA9B,GAEflD,KAAKsC,UAIV0C,EAAA,OAAAC,IAAA,2CAAKI,MAAM,WACTL,EAAA,OAAAC,IAAA,2CAAKI,MAAM,cAEXL,EAAA,kBAAAC,IAAA,2CAAgB0C,QAAQ,UAAU9C,MAAM,SAASmC,KAAK,QAAQR,QAAS,SAAA9D,GAAK,OAAAwB,EAAKV,aAAad,EAAlB,IAC5EsC,EAAA,kBAAAC,IAAA,2CAAgBJ,MAAM,KAAKmC,KAAK,QAAQU,UAAWlD,EAAWgC,SAAUhC,EAAY,WAAK,EAAM,SAAA9B,GAAK,OAAAwB,EAAKP,aAAajB,EAAlB,K,WArX7E,I","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i["throw"](e))}catch(e){o(e)}}function c(e){e.done?n(e.value):r(e.value).then(s,a)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=a(0),s["throw"]=a(1),s["return"]=a(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-De3fNE_u.system.js","./p-CQwimGbQ.system.js","./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i["throw"](e))}catch(e){o(e)}}function c(e){e.done?n(e.value):r(e.value).then(s,a)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=a(0),s["throw"]=a(1),s["return"]=a(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-De3fNE_u.system.js","./p-CQwimGbQ.system.js","./p-BHF3ByWV.system.js","./p-fEbwslLK.system.js","./p-D6-Ny6z1.system.js","@verdocs/js-sdk"],(function(e){"use strict";var t,n,i,r,o,s,a,c,f;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.F;o=e.H;s=e.g},function(e){a=e.i},function(e){c=e.S},function(e){f=e.S},null,null],execute:function(){var l=function(){return'verdocs-field-payment{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-payment .settings-icon svg{fill:#707ae5}verdocs-field-payment .settings-icon:hover{opacity:1}'};var u=e("verdocs_field_payment",function(){function e(e){t(this,e);this.settingsChanged=n(this,"settingsChanged");this.deleted=n(this,"deleted");this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.done=false;this.editable=false;this.moveable=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.focused=false;this.signed=false;this.signatureUrl="";this.roleindex=0}e.prototype.handleBlur=function(){this.focused=false};e.prototype.componentWillLoad=function(){if(this.recipients&&this.recipients.length>0){var e=this.recipients.find((function(e){return e.type==="preparer"}));console.log("Found preparer",e);if(e){this.preparedMessage="Prepared by ".concat(e["full_name"])}}};e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();this.focused=true;return[2]}))}))};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.fieldname));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.fieldname));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.onEditableChanged=function(e,t){if(t&&!e){a(this.el).unset()}};e.prototype.disconnectedCallback=function(){a(this.el).unset()};e.prototype.render=function(){var e;var t=this;var n=this,s=n.source,a=n.sourceid,l=n.fieldname,u=n.editable,d=u===void 0?false:u,h=n.done,p=h===void 0?false:h,v=n.disabled,g=v===void 0?false:v,m=n.focused,b=n.xscale,y=b===void 0?1:b,w=n.yscale,x=w===void 0?1:w;var k=f.getField(s,a,l,this.field),_=k.index,j=k.field;var z="signer-".concat(_%10+1);if(!j){return i(r,null)}if(p){return i(o,{class:{"verdocs-field":true,done:p}},"$✓")}return i(o,{class:(e={"verdocs-field":true,focused:m,disabled:g},e[z]=true,e)},i("button",{class:{hide:this.signed}},"$"),this.signed?i("div",{class:"frame"}):i("div",{style:{display:"none"}}),i("img",{width:"100%",height:"100%",src:this.signatureUrl,alt:"Payment Icon"}),d&&i(r,null,i("div",{id:"verdocs-settings-panel-trigger-".concat(l),style:{transform:"scale(".concat(Math.floor(1/y*1e3)/1e3,", ").concat(Math.floor(1/x*1e3)/1e3,")")},class:"settings-icon",innerHTML:c,onClick:function(e){e.stopPropagation();t.showingProperties=!t.showingProperties}}),this.showingProperties&&i("verdocs-portal",{anchor:"verdocs-settings-panel-trigger-".concat(j.name),onClickAway:function(){return t.showingProperties=false}},i("verdocs-template-field-properties",{templateId:a,fieldName:j.name,onClose:function(){return t.showingProperties=false},onDelete:function(){var e;(e=t.deleted)===null||e===void 0?void 0:e.emit({fieldName:l});return t.hideSettingsPanel()},onSettingsChanged:function(e){var n;(n=t.settingsChanged)===null||n===void 0?void 0:n.emit(e.detail);return t.hideSettingsPanel()},helpText:"Check boxes allow the user to select one or more (non-exclusive) options."}))))};Object.defineProperty(e.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{editable:[{onEditableChanged:0}]}},enumerable:false,configurable:true});return e}());u.style=l()}}}));
|
|
2
|
+
//# sourceMappingURL=p-439d36b0.system.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as t,h as s,F as i,H as n,g as o}from"./p-CjTHbolG.js";import{i as a}from"./p-COaijEV0.js";import{S as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as t,h as s,F as i,H as n,g as o}from"./p-CjTHbolG.js";import{i as a}from"./p-COaijEV0.js";import{S as r}from"./p-DobS6Y7w.js";import{S as l}from"./p-C7hFgM52.js";import"./p-B85MJLTf.js";import"@verdocs/js-sdk";const d=()=>`verdocs-field-payment{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-payment .settings-icon svg{fill:#707ae5}verdocs-field-payment .settings-icon:hover{opacity:1}`;const c=class{constructor(s){e(this,s);this.settingsChanged=t(this,"settingsChanged");this.deleted=t(this,"deleted");this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.done=false;this.editable=false;this.moveable=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.focused=false;this.signed=false;this.signatureUrl="";this.roleindex=0}handleBlur(){this.focused=false}componentWillLoad(){if(this.recipients&&this.recipients.length>0){const e=this.recipients.find((e=>e.type==="preparer"));console.log("Found preparer",e);if(e){this.preparedMessage=`Prepared by ${e["full_name"]}`}}}async focusField(){this.el.focus();this.focused=true}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.showPanel){e.showPanel()}}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.hidePanel){e.hidePanel()}}onEditableChanged(e,t){if(t&&!e){a(this.el).unset()}}disconnectedCallback(){a(this.el).unset()}render(){const{source:e,sourceid:t,fieldname:o,editable:a=false,done:d=false,disabled:c=false,focused:p,xscale:h=1,yscale:f=1}=this;const{index:g,field:m}=l.getField(e,t,o,this.field);const u=`signer-${g%10+1}`;if(!m){return s(i,null)}if(d){return s(n,{class:{"verdocs-field":true,done:d}},"$✓")}return s(n,{class:{"verdocs-field":true,focused:p,disabled:c,[u]:true}},s("button",{class:{hide:this.signed}},"$"),this.signed?s("div",{class:"frame"}):s("div",{style:{display:"none"}}),s("img",{width:"100%",height:"100%",src:this.signatureUrl,alt:"Payment Icon"}),a&&s(i,null,s("div",{id:`verdocs-settings-panel-trigger-${o}`,style:{transform:`scale(${Math.floor(1/h*1e3)/1e3}, ${Math.floor(1/f*1e3)/1e3})`},class:"settings-icon",innerHTML:r,onClick:e=>{e.stopPropagation();this.showingProperties=!this.showingProperties}}),this.showingProperties&&s("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${m.name}`,onClickAway:()=>this.showingProperties=false},s("verdocs-template-field-properties",{templateId:t,fieldName:m.name,onClose:()=>this.showingProperties=false,onDelete:()=>{var e;(e=this.deleted)===null||e===void 0?void 0:e.emit({fieldName:o});return this.hideSettingsPanel()},onSettingsChanged:e=>{var t;(t=this.settingsChanged)===null||t===void 0?void 0:t.emit(e.detail);return this.hideSettingsPanel()},helpText:"Check boxes allow the user to select one or more (non-exclusive) options."}))))}get el(){return o(this)}static get watchers(){return{editable:[{onEditableChanged:0}]}}};c.style=d();export{c as verdocs_field_payment};
|
|
2
|
+
//# sourceMappingURL=p-4930b31d.entry.js.map
|