@verdocs/web-sdk 6.13.0 → 6.13.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.
Files changed (52) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-preview_6.cjs.entry.js +43 -2
  3. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  4. package/dist/cjs/verdocs-sign.cjs.entry.js +39 -7
  5. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/components/embeds/verdocs-send/verdocs-send.css +55 -0
  8. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +45 -1
  9. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  10. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +39 -7
  11. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  12. package/dist/components/p-VqyGWtIp.js +2 -0
  13. package/dist/components/p-VqyGWtIp.js.map +1 -0
  14. package/dist/components/verdocs-build.js +1 -1
  15. package/dist/components/verdocs-send.js +1 -1
  16. package/dist/components/verdocs-sign.js +1 -1
  17. package/dist/components/verdocs-sign.js.map +1 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/verdocs-preview_6.entry.js +44 -3
  20. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  21. package/dist/esm/verdocs-sign.entry.js +39 -7
  22. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  23. package/dist/esm/verdocs-web-sdk.js +1 -1
  24. package/dist/esm-es5/loader.js +1 -1
  25. package/dist/esm-es5/verdocs-preview_6.entry.js +2 -2
  26. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  27. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  28. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  29. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  30. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +14 -1
  31. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  32. package/dist/verdocs-web-sdk/p-575b6f98.system.entry.js +8 -0
  33. package/dist/verdocs-web-sdk/p-575b6f98.system.entry.js.map +1 -0
  34. package/dist/verdocs-web-sdk/p-957e4cb0.entry.js +2 -0
  35. package/dist/verdocs-web-sdk/p-957e4cb0.entry.js.map +1 -0
  36. package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
  37. package/dist/verdocs-web-sdk/p-f3924e9e.entry.js +8 -0
  38. package/dist/verdocs-web-sdk/p-f3924e9e.entry.js.map +1 -0
  39. package/dist/verdocs-web-sdk/p-f41af68e.system.entry.js +2 -0
  40. package/dist/verdocs-web-sdk/p-f41af68e.system.entry.js.map +1 -0
  41. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/components/p-CnUZ9w2T.js +0 -2
  44. package/dist/components/p-CnUZ9w2T.js.map +0 -1
  45. package/dist/verdocs-web-sdk/p-2a6a3bc6.entry.js +0 -2
  46. package/dist/verdocs-web-sdk/p-2a6a3bc6.entry.js.map +0 -1
  47. package/dist/verdocs-web-sdk/p-5404f6bf.system.entry.js +0 -2
  48. package/dist/verdocs-web-sdk/p-5404f6bf.system.entry.js.map +0 -1
  49. package/dist/verdocs-web-sdk/p-788c8d67.system.entry.js +0 -8
  50. package/dist/verdocs-web-sdk/p-788c8d67.system.entry.js.map +0 -1
  51. package/dist/verdocs-web-sdk/p-987d5653.entry.js +0 -8
  52. package/dist/verdocs-web-sdk/p-987d5653.entry.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{p as e,b as a}from"./p-CjTHbolG.js";export{s as setNonce}from"./p-CjTHbolG.js";import{g as i}from"./p-DQuL1Twl.js";var d=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};d().then((async e=>{await i();return a(JSON.parse('[["p-c5039c2d",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-2a6a3bc6",[[0,"verdocs-sign",{"endpoint":[1040],"envelopeId":[513,"envelope-id"],"roleId":[513,"role-id"],"inviteCode":[513,"invite-code"],"headerTargetId":[1,"header-target-id"],"toolbarStyle":[1,"toolbar-style"],"recipient":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"fatalErrorHeader":[32],"fatalErrorMessage":[32],"focusedField":[32],"disclosures":[32],"fieldUpdateCounter":[32],"submitting":[32],"submitted":[32],"isDone":[32],"showDone":[32],"adoptingSignature":[32],"showLoadError":[32],"finishLater":[32],"showFinishLater":[32],"agreed":[32],"signatureId":[32],"initialId":[32],"documentsSingularPlural":[32],"authStep":[32],"authMethodStates":[32],"pageNumber":[32],"kbaQuestions":[32],"showSpinner":[32],"declining":[32],"delegating":[32],"delegated":[32],"kbaChoices":[32],"showDownloadDialog":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"signingProgressMode":[32],"polling":[32]}]]],["p-478de2c9",[[0,"verdocs-envelopes-list",{"endpoint":[16],"view":[1537],"status":[1537],"sort":[1537],"match":[1537],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"selectedEnvelopes":[32],"envelopes":[32]},null,{"view":[{"handleViewUpdated":0}],"status":[{"handleStatusUpdated":0}],"sort":[{"handleSortUpdated":0}],"match":[{"handleMatchUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-2197fb39",[[0,"verdocs-templates-list",{"endpoint":[16],"visibility":[1537],"starred":[1537],"sort":[1537],"name":[1537],"allowedActions":[1040],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"confirmDelete":[32],"templates":[32],"localNameFilter":[32]},null,{"sharing":[{"handleSharingUpdated":0}],"starred":[{"handleStarredUpdated":0}],"sort":[{"handleSortUpdated":0}],"name":[{"handleNameUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-58b84a5a",[[0,"verdocs-envelope-sidebar",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"activeTab":[32],"panelOpen":[32],"showRecipientDialog":[32],"showCancelDialog":[32],"showReinviteDialog":[32],"showUpdateDialog":[32],"remindersEnabled":[32],"updatingReminders":[32],"initialReminder":[32],"followupReminders":[32],"loading":[32],"envelope":[32]}]]],["p-4930b31d",[[0,"verdocs-field-payment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"signed":[4],"roleindex":[2],"showingProperties":[32],"focused":[32],"preparedMessage":[32],"signatureUrl":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}]]],["p-79c46160",[[0,"verdocs-template-settings",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"visibility":[32],"sender":[32],"sendReminders":[32],"initialReminder":[32],"followupReminders":[32],"dirty":[32],"loading":[32],"template":[32]}]]],["p-04baf279",[[0,"verdocs-template-create",{"endpoint":[16],"maxSize":[1026,"max-size"],"file":[32],"creating":[32],"progressLabel":[32],"progressPercent":[32],"errorMessage":[32]}]]],["p-634a7187",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"displayMode":[1025,"display-mode"],"showSocialLogins":[4,"show-social-logins"],"org_name":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"verificationCode":[32],"newPassword":[32],"password":[32],"confirmpass":[32],"submitting":[32],"resendDisabled":[32],"session":[32],"profile":[32],"providers":[32],"mfaToken":[32],"mfaCode":[32],"recoveryCode":[32],"useRecoveryCode":[32],"mfaError":[32]},null,{"showSocialLogins":[{"onShowSocialLoginsChanged":0}]}]]],["p-fea6fe32",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["p-f97233a8",[[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasUploadedImage":[32],"uploadedFileName":[32]}]]],["p-af133520",[[0,"verdocs-date-input",{"value":[1537],"label":[1],"placeholder":[1],"helpText":[1,"help-text"],"disabled":[4],"required":[4],"showingPw":[32],"focused":[32],"containerId":[32],"focusField":[64]}]]],["p-7f76166a",[[0,"verdocs-envelope-recipient-summary",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"canSendAnother":[4,"can-send-another"],"canView":[4,"can-view"],"canDone":[4,"can-done"],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32],"gettingLinks":[32],"links":[32],"loading":[32],"envelope":[32]}]]],["p-cd8ac44e",[[0,"verdocs-multiselect",{"label":[1],"placeholder":[1],"options":[16],"selectedOptions":[16],"showPicker":[32]}]]],["p-8f50f83f",[[0,"verdocs-signing-progress",{"mode":[1],"focusedField":[1,"focused-field"],"fields":[16],"recipientFields":[16]}]]],["p-54ab818c",[[260,"verdocs-button-panel",{"icon":[1],"showPanel":[64],"hidePanel":[64],"toggle":[64]}]]],["p-418f3dd2",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["p-9f3a2cef",[[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["p-3a5d4aa0",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["p-52621662",[[0,"verdocs-table",{"columns":[16],"data":[16]}]]],["p-1fbed8c0",[[260,"verdocs-tabs",{"tabs":[16],"selectedTab":[2,"selected-tab"]}]]],["p-208bbc49",[[0,"verdocs-template-card",{"template":[16]}]]],["p-b5997615",[[0,"verdocs-template-tags",{"tags":[16]}]]],["p-7d3955b7",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["p-cdcef698",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["p-375a7dea",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"containerId":[32]}]]],["p-5455e818",[[0,"verdocs-template-star",{"endpoint":[16],"template":[1040],"updating":[32]}]]],["p-b3f941c2",[[0,"verdocs-envelope-update-recipient",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"originalRecipient":[32],"updatedRecipient":[32]}],[0,"verdocs-envelope-recipient-link",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"recipient":[32]}]]],["p-301f0247",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"showCancel":[4,"show-cancel"],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"zip":[32],"address":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"name_locked":[32],"auth_methods":[32],"passcode":[32],"firstNameFieldId":[32],"lastNameFieldId":[32],"emailFieldId":[32],"phoneFieldId":[32],"activeEntitlements":[32],"authMethodsLoading":[32]},[[4,"click","handleDocumentClick"]]]]],["p-2da68853",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["p-97fadf95",[[0,"verdocs-switch",{"checked":[1028],"theme":[1],"disabled":[4]}]]],["p-84275b8d",[[0,"verdocs-text-input",{"value":[1537],"label":[1],"placeholder":[1],"description":[1],"autocomplete":[1],"helpText":[1,"help-text"],"clearable":[4],"copyable":[4],"type":[1],"disabled":[4],"required":[4],"showingPw":[32]}],[0,"verdocs-help-icon",{"text":[1],"icon":[1],"containerId":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["p-8ec770c3",[[0,"verdocs-template-field-properties",{"endpoint":[16],"templateId":[1,"template-id"],"fieldName":[1025,"field-name"],"helpText":[1,"help-text"],"dirty":[32],"label":[32],"type":[32],"name":[32],"required":[32],"readonly":[32],"roleName":[32],"group":[32],"fieldType":[32],"options":[32],"placeholder":[32],"defaultValue":[32],"showingHelp":[32],"loading":[32],"template":[32]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}],[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"size":[1],"disabled":[4]}],[0,"verdocs-component-error",{"message":[1]}],[0,"verdocs-loader"]]],["p-723d6bde",[[0,"verdocs-template-role-properties",{"endpoint":[16],"templateId":[1,"template-id"],"roleName":[1,"role-name"],"dirty":[32],"saving":[32],"name":[32],"type":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"delegator":[32],"loading":[32],"template":[32]}],[260,"verdocs-menu-panel",{"side":[1],"overlay":[4],"width":[2]},[[4,"click","handleClick"]]]]],["p-46d6279e",[[0,"verdocs-quick-filter",{"options":[16],"label":[1],"value":[1537],"placeholder":[1],"open":[32]}],[0,"verdocs-pagination",{"selectedPage":[1538,"selected-page"],"itemCount":[2,"item-count"],"perPage":[2,"per-page"]}]]],["p-e9158fec",[[0,"verdocs-dropdown",{"options":[16],"containerId":[32],"showPicker":[32]}]]],["p-1a91a922",[[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"placement":[1],"containerId":[32]}],[0,"verdocs-template-document-page",{"endpoint":[16],"editable":[4],"disabled":[4],"done":[4],"templateId":[513,"template-id"],"documentId":[513,"document-id"],"pageNumber":[514,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32],"xScale":[32],"yScale":[32],"loading":[32],"template":[32]}]]],["p-6a3ca6bf",[[0,"verdocs-file-chooser",{"endpoint":[16],"file":[32]}],[0,"verdocs-progress-bar",{"label":[1],"showPercent":[4,"show-percent"],"percent":[2]}]]],["p-92f51592",[[0,"verdocs-spinner",{"size":[2],"mode":[1]}]]],["p-9538ac0e",[[260,"verdocs-dialog",{"persistent":[4]}]]],["p-590900d7",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"buttonLabel":[1,"button-label"],"showCancel":[4,"show-cancel"],"closed":[32]}]]],["p-9bd55619",[[0,"verdocs-flag",{"variant":[1],"label":[1],"showSkip":[4,"show-skip"]}]]],["p-987d5653",[[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1537,"template-id"],"toolbarTargetId":[1,"toolbar-target-id"],"placing":[32],"showMustSelectRole":[32],"selectedRoleName":[32],"loading":[32],"template":[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-roles",{"endpoint":[16],"templateId":[1,"template-id"],"showingRoleDialog":[32],"sender":[32],"dragging":[32],"loading":[32],"template":[32]}],[0,"verdocs-send",{"endpoint":[16],"templateId":[513,"template-id"],"environment":[1],"showCancel":[4,"show-cancel"],"brandKey":[1025,"brand-key"],"containerId":[32],"view":[32],"editingRoleId":[32],"sessionContacts":[32],"sending":[32],"brands":[32],"organization":[32],"expiresInDays":[32],"noContact":[32],"rolesCompleted":[32],"loading":[32],"template":[32],"reset":[64]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-attachments",{"endpoint":[16],"templateId":[1,"template-id"],"uploading":[32],"progressLabel":[32],"progressPercent":[32],"showDeleteError":[32],"confirmDeleteDocument":[32],"loading":[32],"template":[32]}],[0,"verdocs-template-build-tabs",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-2e382167",[[0,"verdocs-sign-footer",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"isDone":[4,"is-done"],"askingQuestion":[32],"declinine":[32],"envelope":[32]}],[0,"verdocs-download-dialog",{"signed":[4],"polling":[4],"documents":[16],"hasCertificate":[4,"has-certificate"]}],[0,"verdocs-envelope-document-page",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"type":[1],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}],[0,"verdocs-question-dialog",{"question":[1025],"closed":[32]}]]],["p-bf38aa98",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"headerTargetId":[1,"header-target-id"],"canceling":[32],"showCancelDone":[32],"showLoadError":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"showDownloadDialog":[32],"polling":[32]}],[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"recipient":[16],"choices":[16],"agreed":[32],"response":[32],"updatedRecipient":[32],"dobContainerId":[32]}],[0,"verdocs-adopt-signature-dialog",{"name":[1],"nameLocked":[4,"name-locked"],"fontLoaded":[32],"enteredName":[32],"enteredInitials":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasDrawnInitials":[32]}],[0,"verdocs-otp-dialog",{"endpoint":[1040],"method":[1],"resendDisabled":[32],"response":[32]}],[0,"verdocs-passcode-dialog",{"endpoint":[1040],"response":[32]}],[0,"verdocs-disclosure-dialog",{"disclosures":[1],"delegator":[4],"accepted":[32]}],[0,"verdocs-delegate-dialog",{"endpoint":[1040],"envelope":[16],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"message":[32]}]]],["p-afd010d6",[[0,"verdocs-organization-card",{"organization":[16],"hovered":[32]},[[1,"mouseover","onMouseOver"],[1,"mouseout","onMouseOut"]]],[260,"verdocs-portal",{"anchor":[1],"voffset":[2]},[[11,"scroll","handleScroll"],[9,"resize","handleResize"],[4,"click","handleClick"]]]]],["p-f6ad24c5",[[0,"verdocs-field-attachment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"dialogOpen":[32],"selectedFile":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-checkbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-date",{"source":[513],"sourceid":[513],"fieldname":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"field":[16],"isPreview":[516,"is-preview"],"containerId":[32],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-dropdown",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-initial",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"disabled":[516],"initials":[513],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"initialid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempInitials":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-radio",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"required":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-signature",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"name":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"signatureid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempSignature":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"],[0,"blur","onBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textarea",{"endpoint":[16],"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"multiline":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-timestamp",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[2],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-upload-dialog",{"maxSize":[1026,"max-size"],"existingFile":[1032,"existing-file"],"draggingOver":[32],"confirmDelete":[32],"selectedFiles":[32],"errorMessage":[32]}]]]]'),e)}));
1
+ import{p as e,b as a}from"./p-CjTHbolG.js";export{s as setNonce}from"./p-CjTHbolG.js";import{g as i}from"./p-DQuL1Twl.js";var d=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};d().then((async e=>{await i();return a(JSON.parse('[["p-c5039c2d",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-957e4cb0",[[0,"verdocs-sign",{"endpoint":[1040],"envelopeId":[513,"envelope-id"],"roleId":[513,"role-id"],"inviteCode":[513,"invite-code"],"headerTargetId":[1,"header-target-id"],"toolbarStyle":[1,"toolbar-style"],"recipient":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"fatalErrorHeader":[32],"fatalErrorMessage":[32],"focusedField":[32],"disclosures":[32],"fieldUpdateCounter":[32],"submitting":[32],"submitted":[32],"isDone":[32],"showDone":[32],"adoptingSignature":[32],"showLoadError":[32],"finishLater":[32],"showFinishLater":[32],"agreed":[32],"signatureId":[32],"initialId":[32],"documentsSingularPlural":[32],"authStep":[32],"authMethodStates":[32],"pageNumber":[32],"kbaQuestions":[32],"showSpinner":[32],"declining":[32],"delegating":[32],"delegated":[32],"kbaChoices":[32],"showDownloadDialog":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"signingProgressMode":[32],"polling":[32]}]]],["p-478de2c9",[[0,"verdocs-envelopes-list",{"endpoint":[16],"view":[1537],"status":[1537],"sort":[1537],"match":[1537],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"selectedEnvelopes":[32],"envelopes":[32]},null,{"view":[{"handleViewUpdated":0}],"status":[{"handleStatusUpdated":0}],"sort":[{"handleSortUpdated":0}],"match":[{"handleMatchUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-2197fb39",[[0,"verdocs-templates-list",{"endpoint":[16],"visibility":[1537],"starred":[1537],"sort":[1537],"name":[1537],"allowedActions":[1040],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"confirmDelete":[32],"templates":[32],"localNameFilter":[32]},null,{"sharing":[{"handleSharingUpdated":0}],"starred":[{"handleStarredUpdated":0}],"sort":[{"handleSortUpdated":0}],"name":[{"handleNameUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-58b84a5a",[[0,"verdocs-envelope-sidebar",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"activeTab":[32],"panelOpen":[32],"showRecipientDialog":[32],"showCancelDialog":[32],"showReinviteDialog":[32],"showUpdateDialog":[32],"remindersEnabled":[32],"updatingReminders":[32],"initialReminder":[32],"followupReminders":[32],"loading":[32],"envelope":[32]}]]],["p-4930b31d",[[0,"verdocs-field-payment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"signed":[4],"roleindex":[2],"showingProperties":[32],"focused":[32],"preparedMessage":[32],"signatureUrl":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}]]],["p-79c46160",[[0,"verdocs-template-settings",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"visibility":[32],"sender":[32],"sendReminders":[32],"initialReminder":[32],"followupReminders":[32],"dirty":[32],"loading":[32],"template":[32]}]]],["p-04baf279",[[0,"verdocs-template-create",{"endpoint":[16],"maxSize":[1026,"max-size"],"file":[32],"creating":[32],"progressLabel":[32],"progressPercent":[32],"errorMessage":[32]}]]],["p-634a7187",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"displayMode":[1025,"display-mode"],"showSocialLogins":[4,"show-social-logins"],"org_name":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"verificationCode":[32],"newPassword":[32],"password":[32],"confirmpass":[32],"submitting":[32],"resendDisabled":[32],"session":[32],"profile":[32],"providers":[32],"mfaToken":[32],"mfaCode":[32],"recoveryCode":[32],"useRecoveryCode":[32],"mfaError":[32]},null,{"showSocialLogins":[{"onShowSocialLoginsChanged":0}]}]]],["p-fea6fe32",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["p-f97233a8",[[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasUploadedImage":[32],"uploadedFileName":[32]}]]],["p-af133520",[[0,"verdocs-date-input",{"value":[1537],"label":[1],"placeholder":[1],"helpText":[1,"help-text"],"disabled":[4],"required":[4],"showingPw":[32],"focused":[32],"containerId":[32],"focusField":[64]}]]],["p-7f76166a",[[0,"verdocs-envelope-recipient-summary",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"canSendAnother":[4,"can-send-another"],"canView":[4,"can-view"],"canDone":[4,"can-done"],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32],"gettingLinks":[32],"links":[32],"loading":[32],"envelope":[32]}]]],["p-cd8ac44e",[[0,"verdocs-multiselect",{"label":[1],"placeholder":[1],"options":[16],"selectedOptions":[16],"showPicker":[32]}]]],["p-8f50f83f",[[0,"verdocs-signing-progress",{"mode":[1],"focusedField":[1,"focused-field"],"fields":[16],"recipientFields":[16]}]]],["p-54ab818c",[[260,"verdocs-button-panel",{"icon":[1],"showPanel":[64],"hidePanel":[64],"toggle":[64]}]]],["p-418f3dd2",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["p-9f3a2cef",[[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["p-3a5d4aa0",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["p-52621662",[[0,"verdocs-table",{"columns":[16],"data":[16]}]]],["p-1fbed8c0",[[260,"verdocs-tabs",{"tabs":[16],"selectedTab":[2,"selected-tab"]}]]],["p-208bbc49",[[0,"verdocs-template-card",{"template":[16]}]]],["p-b5997615",[[0,"verdocs-template-tags",{"tags":[16]}]]],["p-7d3955b7",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["p-cdcef698",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["p-375a7dea",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"containerId":[32]}]]],["p-5455e818",[[0,"verdocs-template-star",{"endpoint":[16],"template":[1040],"updating":[32]}]]],["p-b3f941c2",[[0,"verdocs-envelope-update-recipient",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"originalRecipient":[32],"updatedRecipient":[32]}],[0,"verdocs-envelope-recipient-link",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"recipient":[32]}]]],["p-301f0247",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"showCancel":[4,"show-cancel"],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"zip":[32],"address":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"name_locked":[32],"auth_methods":[32],"passcode":[32],"firstNameFieldId":[32],"lastNameFieldId":[32],"emailFieldId":[32],"phoneFieldId":[32],"activeEntitlements":[32],"authMethodsLoading":[32]},[[4,"click","handleDocumentClick"]]]]],["p-2da68853",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["p-97fadf95",[[0,"verdocs-switch",{"checked":[1028],"theme":[1],"disabled":[4]}]]],["p-84275b8d",[[0,"verdocs-text-input",{"value":[1537],"label":[1],"placeholder":[1],"description":[1],"autocomplete":[1],"helpText":[1,"help-text"],"clearable":[4],"copyable":[4],"type":[1],"disabled":[4],"required":[4],"showingPw":[32]}],[0,"verdocs-help-icon",{"text":[1],"icon":[1],"containerId":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["p-8ec770c3",[[0,"verdocs-template-field-properties",{"endpoint":[16],"templateId":[1,"template-id"],"fieldName":[1025,"field-name"],"helpText":[1,"help-text"],"dirty":[32],"label":[32],"type":[32],"name":[32],"required":[32],"readonly":[32],"roleName":[32],"group":[32],"fieldType":[32],"options":[32],"placeholder":[32],"defaultValue":[32],"showingHelp":[32],"loading":[32],"template":[32]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}],[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"size":[1],"disabled":[4]}],[0,"verdocs-component-error",{"message":[1]}],[0,"verdocs-loader"]]],["p-723d6bde",[[0,"verdocs-template-role-properties",{"endpoint":[16],"templateId":[1,"template-id"],"roleName":[1,"role-name"],"dirty":[32],"saving":[32],"name":[32],"type":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"delegator":[32],"loading":[32],"template":[32]}],[260,"verdocs-menu-panel",{"side":[1],"overlay":[4],"width":[2]},[[4,"click","handleClick"]]]]],["p-46d6279e",[[0,"verdocs-quick-filter",{"options":[16],"label":[1],"value":[1537],"placeholder":[1],"open":[32]}],[0,"verdocs-pagination",{"selectedPage":[1538,"selected-page"],"itemCount":[2,"item-count"],"perPage":[2,"per-page"]}]]],["p-e9158fec",[[0,"verdocs-dropdown",{"options":[16],"containerId":[32],"showPicker":[32]}]]],["p-1a91a922",[[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"placement":[1],"containerId":[32]}],[0,"verdocs-template-document-page",{"endpoint":[16],"editable":[4],"disabled":[4],"done":[4],"templateId":[513,"template-id"],"documentId":[513,"document-id"],"pageNumber":[514,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32],"xScale":[32],"yScale":[32],"loading":[32],"template":[32]}]]],["p-6a3ca6bf",[[0,"verdocs-file-chooser",{"endpoint":[16],"file":[32]}],[0,"verdocs-progress-bar",{"label":[1],"showPercent":[4,"show-percent"],"percent":[2]}]]],["p-92f51592",[[0,"verdocs-spinner",{"size":[2],"mode":[1]}]]],["p-9538ac0e",[[260,"verdocs-dialog",{"persistent":[4]}]]],["p-590900d7",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"buttonLabel":[1,"button-label"],"showCancel":[4,"show-cancel"],"closed":[32]}]]],["p-9bd55619",[[0,"verdocs-flag",{"variant":[1],"label":[1],"showSkip":[4,"show-skip"]}]]],["p-f3924e9e",[[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1537,"template-id"],"toolbarTargetId":[1,"toolbar-target-id"],"placing":[32],"showMustSelectRole":[32],"selectedRoleName":[32],"loading":[32],"template":[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-roles",{"endpoint":[16],"templateId":[1,"template-id"],"showingRoleDialog":[32],"sender":[32],"dragging":[32],"loading":[32],"template":[32]}],[0,"verdocs-send",{"endpoint":[16],"templateId":[513,"template-id"],"environment":[1],"showCancel":[4,"show-cancel"],"brandKey":[1025,"brand-key"],"containerId":[32],"view":[32],"editingRoleId":[32],"sessionContacts":[32],"sending":[32],"brands":[32],"organization":[32],"expiresInDays":[32],"noContact":[32],"senderDefaults":[32],"senderName":[32],"senderEmail":[32],"rolesCompleted":[32],"loading":[32],"template":[32],"reset":[64]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-attachments",{"endpoint":[16],"templateId":[1,"template-id"],"uploading":[32],"progressLabel":[32],"progressPercent":[32],"showDeleteError":[32],"confirmDeleteDocument":[32],"loading":[32],"template":[32]}],[0,"verdocs-template-build-tabs",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-2e382167",[[0,"verdocs-sign-footer",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"isDone":[4,"is-done"],"askingQuestion":[32],"declinine":[32],"envelope":[32]}],[0,"verdocs-download-dialog",{"signed":[4],"polling":[4],"documents":[16],"hasCertificate":[4,"has-certificate"]}],[0,"verdocs-envelope-document-page",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"type":[1],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}],[0,"verdocs-question-dialog",{"question":[1025],"closed":[32]}]]],["p-bf38aa98",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"headerTargetId":[1,"header-target-id"],"canceling":[32],"showCancelDone":[32],"showLoadError":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"showDownloadDialog":[32],"polling":[32]}],[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"recipient":[16],"choices":[16],"agreed":[32],"response":[32],"updatedRecipient":[32],"dobContainerId":[32]}],[0,"verdocs-adopt-signature-dialog",{"name":[1],"nameLocked":[4,"name-locked"],"fontLoaded":[32],"enteredName":[32],"enteredInitials":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasDrawnInitials":[32]}],[0,"verdocs-otp-dialog",{"endpoint":[1040],"method":[1],"resendDisabled":[32],"response":[32]}],[0,"verdocs-passcode-dialog",{"endpoint":[1040],"response":[32]}],[0,"verdocs-disclosure-dialog",{"disclosures":[1],"delegator":[4],"accepted":[32]}],[0,"verdocs-delegate-dialog",{"endpoint":[1040],"envelope":[16],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"message":[32]}]]],["p-afd010d6",[[0,"verdocs-organization-card",{"organization":[16],"hovered":[32]},[[1,"mouseover","onMouseOver"],[1,"mouseout","onMouseOut"]]],[260,"verdocs-portal",{"anchor":[1],"voffset":[2]},[[11,"scroll","handleScroll"],[9,"resize","handleResize"],[4,"click","handleClick"]]]]],["p-f6ad24c5",[[0,"verdocs-field-attachment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"dialogOpen":[32],"selectedFile":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-checkbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-date",{"source":[513],"sourceid":[513],"fieldname":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"field":[16],"isPreview":[516,"is-preview"],"containerId":[32],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-dropdown",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-initial",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"disabled":[516],"initials":[513],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"initialid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempInitials":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-radio",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"required":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-signature",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"name":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"signatureid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempSignature":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"],[0,"blur","onBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textarea",{"endpoint":[16],"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"multiline":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-timestamp",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[2],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-upload-dialog",{"maxSize":[1026,"max-size"],"existingFile":[1032,"existing-file"],"draggingOver":[32],"confirmDelete":[32],"selectedFiles":[32],"errorMessage":[32]}]]]]'),e)}));
2
2
  //# sourceMappingURL=verdocs-web-sdk.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/web-sdk",
3
- "version": "6.13.0",
3
+ "version": "6.13.1",
4
4
  "private": false,
5
5
  "description": "Verdocs Web SDK",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import{p as e,H as s,c as i,h as t,d as n,t as o}from"./p-yZBlG3YQ.js";import{getTemplate as r,getBrands as a,getOrganization as d,getOrganizationContacts as l,isValidEmail as c,createEnvelope as p,getRGBA as h,formatFullName as f}from"@verdocs/js-sdk";import{D as v,g as u}from"./p-Cq60Emo_.js";import{u as m,d as x}from"./p-ByrpRZ3E.js";import{V as b}from"./p-D97GxsI-.js";import{S as g}from"./p-C1sRVZWv.js";import{S as w}from"./p-C7hFgM52.js";import{d as k}from"./p-Bb5V9TQx.js";import{d as y}from"./p-DGNIsXfr.js";import{d as D}from"./p-C-v22G3g.js";import{d as E}from"./p-C8yiLtCJ.js";import{d as S}from"./p-DqzFuSNN.js";import{d as C}from"./p-DreV6Npp.js";const z=e=>((e===null||e===void 0?void 0:e.roles)||[]).map((e=>e.name));const N=(e,s)=>Math.max(z(e).findIndex((e=>e===s)),0);const j=()=>`verdocs-send{--send-ink:var(--verdocs-body-color, #111827);--send-ink-2:#374151;--send-muted:#6b7280;--send-faint:#9ca3af;--send-rule:#e5e7eb;--send-control-border:#d1d5db;--send-accent:var(--verdocs-link-color, #4c56cb);--send-accent-tint:#f4f5fc;--send-accent-tint-2:#e6e7f8;--send-warning-bg:#fffbeb;--send-warning-border:#fde68a;--send-warning-icon:#d97706;--send-warning-text:#78350f;--send-radius:var(--verdocs-dialog-radius, 8px);--send-min-height:480px;--send-max-width:480px;display:none;position:relative;overflow:hidden;width:100%;max-width:var(--verdocs-send-max-width, var(--send-max-width));-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;color:var(--send-ink);font-size:14px;border-radius:var(--send-radius);border:1px solid var(--send-rule);font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-send *{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-send.sendable{display:block}verdocs-send .track{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:var(--send-min-height);-webkit-transition:-webkit-transform 220ms ease-out;transition:-webkit-transform 220ms ease-out;transition:transform 220ms ease-out;transition:transform 220ms ease-out, -webkit-transform 220ms ease-out}verdocs-send.detail-open .track{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@media (prefers-reduced-motion: reduce){verdocs-send .track{-webkit-transition:none;transition:none}}verdocs-send .pane{padding:16px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .main-pane{-ms-flex:1;flex:1}verdocs-send .detail-pane{position:absolute;top:0;left:100%;bottom:0;width:100%;overflow:hidden}verdocs-send .detail{-ms-flex:1;flex:1;min-height:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .detail-body-wrap{position:relative;-ms-flex:1;flex:1;min-height:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .detail-body{-ms-flex:1;flex:1;min-height:0;overflow-y:auto}verdocs-send .scroll-fade{position:absolute;left:0;right:0;bottom:0;height:36px;opacity:0;pointer-events:none;-webkit-transition:opacity 150ms ease-out;transition:opacity 150ms ease-out;background:-webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#ffffff));background:linear-gradient(rgba(255, 255, 255, 0), #ffffff)}verdocs-send .scrollable:not(.at-end)>.scroll-fade{opacity:1}verdocs-send .recipient-detail verdocs-contact-picker{-ms-flex:1;flex:1;min-height:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .section-title{font-size:12px;font-weight:600;color:var(--send-ink-2);margin:0 0 6px 0}verdocs-send .delivery-title{margin-top:16px}verdocs-send .step{font-size:11px;color:var(--send-muted);padding:10px 0 4px 0}verdocs-send .recipient,verdocs-send .kv{all:unset;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-ms-flex-align:center;align-items:center;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;border-top:1px solid var(--send-rule);color:var(--send-ink);font-family:inherit}verdocs-send .recipient:focus-visible,verdocs-send .kv:focus-visible{outline:2px solid var(--send-accent);outline-offset:-2px;border-radius:4px}verdocs-send .recipient .chevron,verdocs-send .kv .chevron{-ms-flex:0 0 16px;flex:0 0 16px;width:16px;height:16px;color:var(--send-faint)}verdocs-send .recipient .chevron svg,verdocs-send .kv .chevron svg{width:16px;height:16px;display:block}verdocs-send .recipient{padding:8px 6px 8px 0}verdocs-send .recipient:last-child{border-bottom:1px solid var(--send-rule)}verdocs-send .recipient .who{-ms-flex:1;flex:1;min-width:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .recipient .role-name{font-size:13px;font-weight:600}verdocs-send .recipient .who-detail{font-size:12px;color:var(--send-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-send .recipient .who-detail.configure{color:var(--send-accent);font-weight:500}verdocs-send .recipient .options{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:4px;margin-top:3px}verdocs-send .recipient .pill{height:18px;padding:0 6px;border-radius:999px;font-size:10px;font-weight:500;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;background:var(--send-accent-tint);color:var(--send-ink-2)}verdocs-send .role-dot{-ms-flex:0 0 10px;flex:0 0 10px;width:10px;height:10px;border-radius:50%;border:1px solid rgba(0, 0, 0, 0.1)}verdocs-send .kv{height:40px;padding:0 6px 0 0;font-size:13px}verdocs-send .kv:last-child{border-bottom:1px solid var(--send-rule)}verdocs-send .kv:disabled{cursor:default;color:var(--send-muted)}verdocs-send .kv .key{-ms-flex:0 0 84px;flex:0 0 84px;color:var(--send-muted)}verdocs-send .kv .value{-ms-flex:1;flex:1;min-width:0;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-send .kv .value small{font-size:inherit;font-weight:400;color:var(--send-muted)}verdocs-send .kv .value.off{color:var(--send-warning-icon)}verdocs-send .main-spacer,verdocs-send .detail-spacer{-ms-flex:1;flex:1}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:14px;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}verdocs-send .buttons .error-message{width:100%;color:#cc0000;font-size:13px;margin-bottom:10px}verdocs-send .detail-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin:-2px 0 14px 0}verdocs-send .detail-header .back{all:unset;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;cursor:pointer;font-size:13px;font-weight:500;color:var(--send-accent);font-family:inherit;-ms-flex:0 0 52px;flex:0 0 52px}verdocs-send .detail-header .back .icon,verdocs-send .detail-header .back .icon svg{width:16px;height:16px;display:block}verdocs-send .detail-header .back:focus-visible{outline:2px solid var(--send-accent);outline-offset:2px;border-radius:4px}verdocs-send .detail-header .detail-title{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;font-size:14px;font-weight:600;text-align:center}verdocs-send .detail-header .detail-header-spacer{-ms-flex:0 0 52px;flex:0 0 52px}verdocs-send .detail-footer{margin-top:10px;padding-top:12px;border-top:1px solid var(--send-rule)}verdocs-send .detail-footer verdocs-button,verdocs-send .detail-footer verdocs-button button{width:100%}verdocs-send .hint{font-size:12px;line-height:1.5;color:var(--send-muted);margin:10px 0 0 0}verdocs-send .option-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .option{all:unset;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-ms-flex-align:center;align-items:center;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;padding:10px 0;font-size:13px;font-family:inherit;color:var(--send-ink);border-top:1px solid var(--send-rule)}verdocs-send .option:first-child{border-top:0}verdocs-send .option:focus-visible{outline:2px solid var(--send-accent);outline-offset:-2px;border-radius:4px}verdocs-send .option .radio{-ms-flex:0 0 16px;flex:0 0 16px;width:16px;height:16px;border-radius:50%;border:1px solid var(--send-control-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-send .option.selected .radio{border-color:var(--send-accent)}verdocs-send .option.selected .radio::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--send-accent)}verdocs-send .option .swatch{-ms-flex:0 0 22px;flex:0 0 22px;width:22px;height:22px;border-radius:5px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:9px;font-weight:700;color:#ffffff;overflow:hidden}verdocs-send .option .swatch.logo{background:#ffffff;border:1px solid var(--send-rule)}verdocs-send .option .swatch img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain;display:block}verdocs-send .option .option-label{-ms-flex:1;flex:1;min-width:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .option .option-label small{font-size:11px;color:var(--send-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-send .option-divider{height:0;margin:2px 0;border-top:1px solid var(--send-control-border)}verdocs-send .option-divider+.option{border-top:0}verdocs-send .hint a{color:var(--send-accent);font-weight:500;text-decoration:none;border-bottom:1px solid var(--send-accent-tint-2)}verdocs-send .hint a .icon,verdocs-send .hint a .icon svg{width:11px;height:11px;display:inline-block;vertical-align:-1px;margin-left:2px}verdocs-send .expires-field{position:relative}verdocs-send .expires-field input{width:100%;height:36px;padding:0 52px 0 10px;font-size:14px;font-family:inherit;color:var(--send-ink);background:#ffffff;border:1px solid var(--send-control-border);border-radius:6px;outline:none}verdocs-send .expires-field input:focus{border-color:var(--send-accent);-webkit-box-shadow:0 0 0 2px var(--send-accent-tint-2);box-shadow:0 0 0 2px var(--send-accent-tint-2)}verdocs-send .expires-field input::-webkit-input-placeholder{color:var(--send-faint)}verdocs-send .expires-field input::-moz-placeholder{color:var(--send-faint)}verdocs-send .expires-field input:-ms-input-placeholder{color:var(--send-faint)}verdocs-send .expires-field input::-ms-input-placeholder{color:var(--send-faint)}verdocs-send .expires-field input::placeholder{color:var(--send-faint)}verdocs-send .expires-field .suffix{position:absolute;right:10px;top:0;height:36px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:13px;color:var(--send-muted);pointer-events:none}verdocs-send .warning{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-top:12px;padding:10px 12px;font-size:12px;line-height:1.5;border-radius:6px;color:var(--send-warning-text);background:var(--send-warning-bg);border:1px solid var(--send-warning-border)}verdocs-send .warning>.icon{-ms-flex:0 0 18px;flex:0 0 18px;width:18px;height:18px;margin-top:1px;color:var(--send-warning-icon)}verdocs-send .warning>.icon svg{width:18px;height:18px;display:block}verdocs-send .warning a{color:var(--send-accent);font-weight:500;text-decoration:none;border-bottom:1px solid var(--send-accent-tint-2)}verdocs-send .warning a .icon,verdocs-send .warning a .icon svg{width:11px;height:11px;display:inline-block;vertical-align:-1px;margin-left:2px}verdocs-send verdocs-checkbox{display:block;padding:4px 0;font-size:13px}`;const B='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 6 6 6-6 6"/></svg>';const M='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>';const I='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4M12 17h.01"/></svg>';const _='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6M10 14 21 3M21 14v7H3V3h7"/></svg>';const T="https://app.verdocs.com/assets/blue-logo.svg";const L=.25;const R=60;const V=500;const $=1;const H=120;const O=120;const G={email:"Email",passcode:"Passcode",sms:"SMS",kba:"KBA",id:"ID check"};const A=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.beforeSend=i(this,"beforeSend");this.send=i(this,"send");this.exit=i(this,"exit");this.sdkError=i(this,"sdkError");this.searchContacts=i(this,"searchContacts");this.templateListenerId=null;this.endpoint=v;this.templateId=null;this.environment="";this.showCancel=true;this.brandKey="";this.swipeStart=null;this.swallowNextClick=false;this.loadedOrganizationId="";this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.view="main";this.editingRoleId="";this.sessionContacts=[];this.sending=false;this.brands=[];this.organization=null;this.expiresInDays="";this.noContact=false;this.rolesCompleted={};this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}componentDidLoad(){this.el.addEventListener("click",(e=>{if(this.swallowNextClick){this.swallowNextClick=false;e.stopPropagation();e.preventDefault()}}),true)}componentDidRender(){var e,s;m(this.el.querySelector(".detail-body"));(e=this.el.querySelector(".main-pane"))===null||e===void 0?void 0:e.toggleAttribute("inert",this.view!=="main");(s=this.el.querySelector(".detail-pane"))===null||s===void 0?void 0:s.toggleAttribute("inert",this.view==="main")}async listenToTemplate(){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();w.subscribe("templates",this.templateId,(()=>r(this.endpoint,this.templateId)),true,(e=>{console.log("[SEND] Got new template",e);this.template=e;this.loading=false;this.rolesCompleted={};this.view="main";this.editingRoleId="";this.recomputeRolesCompleted();this.loadBrands()}))}loadBrands(){var e;const s=(e=this.template)===null||e===void 0?void 0:e.organization_id;if(!s||s===this.loadedOrganizationId){return}const i=!!this.loadedOrganizationId;this.loadedOrganizationId=s;this.brands=[];this.organization=null;if(i){this.brandKey=""}const t=()=>{var e;return((e=this.template)===null||e===void 0?void 0:e.organization_id)===s};a(this.endpoint,s).then((e=>{if(t()){this.brands=e||[]}})).catch((e=>console.log("[SEND] Unable to load brands",e)));d(this.endpoint,s).then((e=>{if(t()){this.organization=e}})).catch((e=>console.log("[SEND] Unable to load organization",e)))}handleExpiryInput(e){const s=(e.target.value||"").replace(/[^0-9]/g,"");this.expiresInDays=s?String(Math.min(Math.max(Number(s),$),H)):"";e.target.value=this.expiresInDays}effectiveExpiryDays(){const e=Number(this.expiresInDays);return e>=$?e:O}expiresAt(){return new Date(Date.now()+this.effectiveExpiryDays()*24*60*60*1e3)}unlistenToTemplate(){if(this.templateListenerId){w.store.delListener(this.templateListenerId);this.templateListenerId=null}}async reset(){this.rolesCompleted={};this.view="main";this.editingRoleId="";this.brandKey="";this.expiresInDays="";this.noContact=false}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,s,i;try{this.endpoint.onSessionChanged(((e,s,i)=>{if(!i){return}const t={id:i.id,first_name:i.first_name,last_name:i.last_name,email:i.email,phone:i.phone};if(i){this.sessionContacts=[t];l(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e);this.sessionContacts=[...e,t]})).catch((e=>{console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return}if(!this.templateId){console.log(`[SEND] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(t){console.log("[SEND] Error with send session",t);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new g(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(i=t.response)===null||i===void 0?void 0:i.data))}}recomputeRolesCompleted(){var e;this.rolesCompleted={};const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{const i=e.sequence;s[i]||(s[i]=[]);const t=`r-${i}-${s[i].length}`;s[i].push({...e,id:t,role_name:e.name,first_name:e.first_name,last_name:e.last_name});if(e.first_name&&c(e.email)){this.rolesCompleted[t]={...e,id:t,role_name:e.name,first_name:e.first_name,last_name:e.last_name}}}))}getSequenceNumbers(){var e;const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{s[e.sequence]=true}));return Object.keys(s).map((e=>+e)).sort(((e,s)=>e-s))}getRolesAtLevel(e){var s;const i=(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).filter((s=>s.sequence===e)).map(((s,i)=>({...s,id:`r-${e}-${i}`,role_name:s.name,first_name:s.first_name,last_name:s.last_name})));return i}getRoleById(e){for(const s of this.getSequenceNumbers()){const i=this.getRolesAtLevel(s).find((s=>s.id===e));if(i){return i}}return null}getRecipientOptionLabels(e){if(!e){return[]}const s=(e.auth_methods||[]).filter((e=>e!=="email")).map((e=>G[e]||e));if(e.delegator){s.push("May delegate")}if(e.name_locked){s.push("Name locked")}return s}getDefaultBrand(){var e;const s=(e=this.organization)===null||e===void 0?void 0:e.default_brand_id;return s&&this.brands.find((e=>e.id===s))||null}getDefaultBrandLabel(){var e;const s=(e=this.getDefaultBrand())===null||e===void 0?void 0:e.name;return`Default (${s||"Verdocs"})`}getSelectedBrandLabel(){if(!this.brandKey){return this.getDefaultBrandLabel()}const e=this.brands.find((e=>e.key===this.brandKey));return(e===null||e===void 0?void 0:e.name)||(e===null||e===void 0?void 0:e.key)||this.brandKey}showView(e){this.view=e}handleSelectContact(e,s){e.preventDefault();this.rolesCompleted={...this.rolesCompleted,[s.id]:{...s,...e.detail}};this.editingRoleId="";this.view="main"}handleClickRole(e,s){e.stopPropagation();this.editingRoleId=s.id;this.view="recipient"}handleSend(e){var s;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;const i=Intl.DateTimeFormat().resolvedOptions();const t={template_id:this.templateId,name:((s=this.template)===null||s===void 0?void 0:s.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),timezone:i.timeZone,locale:i.locale,expires_at:this.expiresAt().toISOString()};t.no_contact=this.noContact;if(this.brandKey){t.brand_key=this.brandKey}const n=this.beforeSend.emit({...t,name:t.name,template:this.template});if(n.defaultPrevented){console.log("[SEND] Send cancelled by parent",t);this.sending=false;return}console.log("[SEND] Creating envelope",t);p(this.endpoint,t).then((e=>{var s;console.log("[SEND] Send envelope",e);this.reset().catch((e=>console.log("Unknown Error",e)));this.sending=false;(s=this.send)===null||s===void 0?void 0:s.emit({...t,name:t.name,envelope_id:e.id,envelope:e})})).catch((e=>{var s,i,t;console.log("[SEND] Send error",e);b(((i=(s=e.response)===null||s===void 0?void 0:s.data)===null||i===void 0?void 0:i.error)||"Error creating envelope, please try again later.");this.sending=false;(t=this.sdkError)===null||t===void 0?void 0:t.emit(e)}))}handleCancel(e){var s;e.stopPropagation();(s=this.exit)===null||s===void 0?void 0:s.emit()}handleSwipeStart(e){var s,i;this.swallowNextClick=false;const t=e.currentTarget;const n=t.getBoundingClientRect();const o=!!((i=(s=e.target)===null||s===void 0?void 0:s.closest)===null||i===void 0?void 0:i.call(s,"input, textarea, select, [contenteditable]"));if(this.view==="main"||o||e.clientX-n.left>n.width*L){this.swipeStart=null;return}this.swipeStart={x:e.clientX,y:e.clientY,time:Date.now()}}handleSwipeEnd(e){const s=this.swipeStart;this.swipeStart=null;if(!s){return}const i=e.clientX-s.x;const t=Math.abs(e.clientY-s.y);if(i>=R&&i>t&&Date.now()-s.time<=V){this.swallowNextClick=true;this.showView("main")}}renderDetailHeader(e){return t("div",{class:"detail-header"},t("button",{type:"button",class:"back",onClick:()=>this.showView("main")},t("span",{class:"icon",innerHTML:M}),"Back"),t("div",{class:"detail-title"},e),t("div",{class:"detail-header-spacer"}))}renderDetailBody(e){return t("div",{class:"detail-body-wrap"},t("div",{class:"detail-body",onScroll:e=>m(e.target)},e),t("div",{class:"scroll-fade"}))}renderDoneButton(){return t("div",{class:"detail-footer"},t("verdocs-button",{label:"Done",size:"small",onClick:()=>this.showView("main")}))}renderRecipientView(){var e;const s=this.getRoleById(this.editingRoleId);if(!s){return t("div",{class:"detail recipient-detail"},this.renderDetailHeader("Recipient"))}const i=N(this.template,s.role_name);return t("div",{class:"detail recipient-detail"},this.renderDetailHeader([t("span",{class:"role-dot",style:{backgroundColor:h(i)}}),s.role_name]),t("verdocs-contact-picker",{key:s.id,showCancel:false,onExit:()=>this.showView("main"),onNext:e=>this.handleSelectContact(e,s),contactSuggestions:this.sessionContacts,templateRole:(e=this.rolesCompleted[s.id])!==null&&e!==void 0?e:s,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}}))}renderBrandSwatch(e,s){const i=(e===null||e===void 0?void 0:e.favicon_url)||(e===null||e===void 0?void 0:e.thumbnail_url)||(e?null:T);if(i){return t("span",{class:"swatch logo"},t("img",{src:i,alt:""}))}return t("span",{class:"swatch",style:{backgroundColor:(e===null||e===void 0?void 0:e.primary_color)||"#4c56cb"}},s.substring(0,2).toUpperCase())}renderBrandOption(e,s,i,n){return t("button",{type:"button",class:{option:true,selected:this.brandKey===e},onClick:()=>this.brandKey=e},t("span",{class:"radio"}),n,t("span",{class:"option-label"},s,t("small",null,i)))}renderBrandView(){const e=this.getDefaultBrand();const s=this.brands.filter((s=>s.id!==(e===null||e===void 0?void 0:e.id))).sort(((e,s)=>(e.name||e.key).localeCompare(s.name||s.key)));const i=this.brands.length>0;return t("div",{class:"detail"},this.renderDetailHeader("Brand"),this.renderDetailBody([t("div",{class:"option-list"},this.renderBrandOption("",this.getDefaultBrandLabel(),"Organization default",this.renderBrandSwatch(e,(e===null||e===void 0?void 0:e.name)||"V")),s.length>0&&t("div",{class:"option-divider"}),s.map((e=>this.renderBrandOption(e.key,e.name||e.key,e.key,this.renderBrandSwatch(e,e.name||e.key))))),!i&&t("p",{class:"hint"},"Configure the look and feel of the signing experience by"," ",t("a",{href:`${u(this.endpoint)}/settings/branding`,target:"_blank",rel:"noopener"},"Creating a Brand",t("span",{class:"icon",innerHTML:_})),".")]),this.renderDoneButton())}renderExpiresView(){const e=this.expiresAt();const s=`${e.toLocaleDateString(undefined,{month:"short",day:"numeric",year:"numeric"})} at ${e.toLocaleTimeString(undefined,{hour:"numeric",minute:"2-digit"})}`;return t("div",{class:"detail"},this.renderDetailHeader("Expiration"),this.renderDetailBody([t("div",{class:"expires-field"},t("input",{type:"text",inputMode:"numeric","aria-label":"Expires in (days)",placeholder:String(O),value:this.expiresInDays,disabled:this.sending,onInput:e=>this.handleExpiryInput(e)}),t("span",{class:"suffix"},"days")),t("p",{class:"hint"},"This envelope will expire on ",s,". Expirations may be set from ",$,"-",H," days. If left blank, this will default to ",O,".")]),this.renderDoneButton())}renderNotificationsView(){return t("div",{class:"detail"},this.renderDetailHeader("Notifications"),this.renderDetailBody([t("verdocs-checkbox",{size:"small",label:"Disable notifications",checked:this.noContact,onInput:e=>this.noContact=!!e.target.checked}),this.noContact&&t("div",{class:"warning"},t("span",{class:"icon",innerHTML:I}),t("div",null,"Disabling notifications turns off invitations and reminders to recipients as well as status updates to you. You may obtain invite links in the recipient summary or via an API call. We strongly recommend enabling"," ",t("a",{href:`${u(this.endpoint)}/settings/webhooks`,target:"_blank",rel:"noopener"},"Webhooks",t("span",{class:"icon",innerHTML:_}))," ","to help automate this process."))]),this.renderDoneButton())}renderDetail(){switch(this.view){case"recipient":return this.renderRecipientView();case"brand":return this.renderBrandView();case"expires":return this.renderExpiresView();case"notifications":return this.renderNotificationsView();default:return null}}render(){var e;if(this.loading){return t(n,null,t("verdocs-loader",null))}if(!this.endpoint.session){return t(n,{style:{display:"flex"}},t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const s=this.getSequenceNumbers();const i=Object.values(this.rolesCompleted).filter((e=>c(e.email)&&e.first_name&&e.last_name));const o=i.length>=z(this.template).length;const r=i.map((e=>e.email.toLowerCase()));const a=new Set(r).size<r.length;const d=this.expiresAt();const l=d.toLocaleDateString(undefined,{month:"short",day:"numeric"});return t(n,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable,"detail-open":this.view!=="main"}},t("div",{class:"track"},t("div",{class:"pane main-pane","aria-hidden":this.view!=="main"?"true":"false"},t("div",{class:"section-title"},"Recipients"),t("div",{class:"recipients"},s.map((e=>[s.length>1&&t("div",{class:"step"},"Step ",e),this.getRolesAtLevel(e).map((e=>{const s=N(this.template,e.role_name);const n=this.rolesCompleted[e.id];const o=n&&i.findIndex((s=>s.role_name===e.role_name))>-1;const r=this.getRecipientOptionLabels(n);return t("button",{type:"button",class:"recipient","data-ri":s,"data-rn":e.role_name,onClick:s=>this.handleClickRole(s,e)},t("span",{class:"role-dot",style:{backgroundColor:h(s)}}),t("span",{class:"who"},t("span",{class:"role-name"},e.role_name),o?t("span",{class:"who-detail"},f(n)," · ",n.email):t("span",{class:"who-detail configure"},"Configure recipient"),r.length>0&&t("span",{class:"options"},r.map((e=>t("span",{class:"pill"},e))))),t("span",{class:"chevron",innerHTML:B}))}))]))),t("div",{class:"section-title delivery-title"},"Delivery"),t("div",{class:"delivery"},t("button",{type:"button",class:"kv",onClick:()=>this.showView("brand"),disabled:this.sending},t("span",{class:"key"},"Brand"),t("span",{class:"value"},this.getSelectedBrandLabel()),t("span",{class:"chevron",innerHTML:B})),t("button",{type:"button",class:"kv",onClick:()=>this.showView("expires"),disabled:this.sending},t("span",{class:"key"},"Expires"),t("span",{class:"value"},this.effectiveExpiryDays()," days ",t("small",null,"· ",l)),t("span",{class:"chevron",innerHTML:B})),t("button",{type:"button",class:"kv",onClick:()=>this.showView("notifications"),disabled:this.sending},t("span",{class:"key"},"Notifications"),t("span",{class:{value:true,off:this.noContact}},this.noContact?"Off":"On"),t("span",{class:"chevron",innerHTML:B}))),t("div",{class:"main-spacer"}),t("div",{class:"buttons"},a&&t("div",{class:"error-message"},"Recipients cannot share the same email."),this.sending&&t("verdocs-spinner",null),this.showCancel&&t("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),t("verdocs-button",{label:"Send",size:"small",disabled:!o||this.sending||a,onClick:e=>this.handleSend(e)}))),t("div",{class:"pane detail-pane","aria-hidden":this.view==="main"?"true":"false",onPointerDown:e=>this.handleSwipeStart(e),onPointerUp:e=>this.handleSwipeEnd(e),onPointerCancel:()=>this.swipeStart=null},this.renderDetail())))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return j()}},[0,"verdocs-send",{endpoint:[16],templateId:[513,"template-id"],environment:[1],showCancel:[4,"show-cancel"],brandKey:[1025,"brand-key"],containerId:[32],view:[32],editingRoleId:[32],sessionContacts:[32],sending:[32],brands:[32],organization:[32],expiresInDays:[32],noContact:[32],rolesCompleted:[32],loading:[32],template:[32],reset:[64]},undefined,{templateId:[{onTemplateIdChanged:0}]}]);function P(){if(typeof customElements==="undefined"){return}const e=["verdocs-send","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-flag","verdocs-loader","verdocs-spinner"];e.forEach((e=>{switch(e){case"verdocs-send":if(!customElements.get(o(e))){customElements.define(o(e),A)}break;case"verdocs-button":if(!customElements.get(o(e))){k()}break;case"verdocs-checkbox":if(!customElements.get(o(e))){y()}break;case"verdocs-component-error":if(!customElements.get(o(e))){D()}break;case"verdocs-contact-picker":if(!customElements.get(o(e))){x()}break;case"verdocs-flag":if(!customElements.get(o(e))){E()}break;case"verdocs-loader":if(!customElements.get(o(e))){S()}break;case"verdocs-spinner":if(!customElements.get(o(e))){C()}break}}))}export{A as V,P as d};
2
- //# sourceMappingURL=p-CnUZ9w2T.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getRoleNames","template","roles","map","role","name","getRoleIndex","role_name","Math","max","findIndex","verdocsSendCss","chevronRightIcon","chevronLeftIcon","warningIcon","externalLinkIcon","VERDOCS_LOGO_URL","SWIPE_START_FRACTION","SWIPE_MIN_DISTANCE","SWIPE_MAX_DURATION","MIN_EXPIRY_DAYS","MAX_EXPIRY_DAYS","DEFAULT_EXPIRY_DAYS","AUTH_METHOD_LABELS","email","passcode","sms","kba","id","VerdocsSend","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","templateListenerId","endpoint","DefaultEndpoint","templateId","environment","showCancel","brandKey","swipeStart","swallowNextClick","loadedOrganizationId","containerId","random","toString","substring","view","editingRoleId","sessionContacts","sending","brands","organization","expiresInDays","noContact","rolesCompleted","loading","disconnectedCallback","unlistenToTemplate","componentDidLoad","el","addEventListener","e","stopPropagation","preventDefault","componentDidRender","updateScrollFade","querySelector","_a","toggleAttribute","_b","listenToTemplate","console","log","Store","subscribe","getTemplate","recomputeRolesCompleted","loadBrands","organizationId","organization_id","changedOrganization","stillCurrent","getBrands","then","catch","getOrganization","handleExpiryInput","digits","target","value","replace","String","min","Number","effectiveExpiryDays","days","expiresAt","Date","now","store","delListener","reset","onTemplateIdChanged","newTemplateId","componentWillLoad","onSessionChanged","_endpoint","_session","profile","me","first_name","last_name","phone","getOrganizationContacts","contacts","loadSession","session","sdkError","emit","SDKError","message","response","status","_c","data","rolesAtLevel","forEach","level","sequence","length","push","isValidEmail","getSequenceNumbers","sequences","Object","keys","s","sort","a","b","getRolesAtLevel","filter","index","getRoleById","match","find","getRecipientOptionLabels","recipient","labels","auth_methods","method","delegator","name_locked","getDefaultBrand","defaultId","default_brand_id","brand","getDefaultBrandLabel","getSelectedBrandLabel","key","showView","handleSelectContact","detail","handleClickRole","handleSend","localeData","Intl","DateTimeFormat","resolvedOptions","details","template_id","initial_reminder","followup_reminders","recipients","values","timezone","timeZone","locale","expires_at","toISOString","no_contact","brand_key","beforeSendResult","beforeSend","defaultPrevented","createEnvelope","r","send","envelope_id","envelope","VerdocsToast","error","handleCancel","exit","handleSwipeStart","pane","currentTarget","rect","getBoundingClientRect","onTextEntry","closest","call","clientX","left","width","x","y","clientY","time","handleSwipeEnd","start","dx","dy","abs","renderDetailHeader","title","h","class","type","onClick","innerHTML","renderDetailBody","content","onScroll","renderDoneButton","label","size","renderRecipientView","roleIndex","style","backgroundColor","getRGBA","onExit","onNext","contactSuggestions","templateRole","onSearchContacts","searchContacts","renderBrandSwatch","fallbackInitial","image","favicon_url","thumbnail_url","src","alt","primary_color","toUpperCase","renderBrandOption","sub","swatch","option","selected","renderBrandView","defaultBrand","others","localeCompare","hasBrands","href","getWebAppUrl","rel","renderExpiresView","when","toLocaleDateString","undefined","month","day","year","toLocaleTimeString","hour","minute","inputMode","placeholder","disabled","onInput","renderNotificationsView","checked","renderDetail","render","Host","display","levels","rolesAssigned","allRolesAssigned","assignedEmails","toLowerCase","hasDuplicateEmails","Set","expiresShort","sendable","is_sendable","completed","assigned","optionLabels","formatFullName","off","variant","onPointerDown","onPointerUp","onPointerCancel"],"sources":["src/utils/Templates.ts","src/components/embeds/verdocs-send/verdocs-send.scss?tag=verdocs-send","src/components/embeds/verdocs-send/verdocs-send.tsx"],"sourcesContent":["import {ITemplate} from '@verdocs/js-sdk';\n\nexport const getRoleNames = (template: ITemplate | null) => (template?.roles || []).map(role => role.name);\n\nexport const getRoleIndex = (template: ITemplate | null, role_name: string) =>\n Math.max(\n getRoleNames(template).findIndex(name => name === role_name),\n 0,\n );\n","@import '../../../theme.scss';\n\nverdocs-send {\n --send-ink: var(--verdocs-body-color, #111827);\n --send-ink-2: #374151;\n --send-muted: #6b7280;\n --send-faint: #9ca3af;\n --send-rule: #e5e7eb;\n --send-control-border: #d1d5db;\n --send-accent: var(--verdocs-link-color, #{$secondary-color});\n --send-accent-tint: #f4f5fc;\n --send-accent-tint-2: #e6e7f8;\n --send-warning-bg: #fffbeb;\n --send-warning-border: #fde68a;\n --send-warning-icon: #d97706;\n --send-warning-text: #78350f;\n --send-radius: var(--verdocs-dialog-radius, 8px);\n --send-min-height: 480px;\n --send-max-width: 480px;\n\n display: none;\n position: relative;\n overflow: hidden;\n width: 100%;\n max-width: var(--verdocs-send-max-width, var(--send-max-width));\n box-sizing: border-box;\n background: #ffffff;\n color: var(--send-ink);\n font-size: 14px;\n border-radius: var(--send-radius);\n border: 1px solid var(--send-rule);\n font-family: $verdocs-primary-font;\n\n * {\n box-sizing: border-box;\n }\n\n &.sendable {\n display: block;\n }\n\n // The main pane sets the card's height. The detail pane sits beside it, off-canvas to the\n // right, and the track slides one pane-width left when a detail view is open. Detail views\n // taller than the card scroll inside it.\n .track {\n position: relative;\n display: flex;\n flex-direction: column;\n min-height: var(--send-min-height);\n transition: transform 220ms ease-out;\n }\n\n &.detail-open .track {\n transform: translateX(-100%);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .track {\n transition: none;\n }\n }\n\n .pane {\n padding: 16px;\n display: flex;\n flex-direction: column;\n }\n\n .main-pane {\n flex: 1;\n }\n\n .detail-pane {\n position: absolute;\n top: 0;\n left: 100%;\n bottom: 0;\n width: 100%;\n overflow: hidden;\n }\n\n .detail {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n // The body scrolls between a fixed header and a pinned Done button. The fade sits over the\n // body's bottom edge and shows only while there is more below (classes set by updateScrollFade).\n .detail-body-wrap {\n position: relative;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n .detail-body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n\n .scroll-fade {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 36px;\n opacity: 0;\n pointer-events: none;\n transition: opacity 150ms ease-out;\n background: linear-gradient(rgba(255, 255, 255, 0), #ffffff);\n }\n\n .scrollable:not(.at-end) > .scroll-fade {\n opacity: 1;\n }\n\n .recipient-detail verdocs-contact-picker {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n .section-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--send-ink-2);\n margin: 0 0 6px 0;\n }\n\n .delivery-title {\n margin-top: 16px;\n }\n\n .step {\n font-size: 11px;\n color: var(--send-muted);\n padding: 10px 0 4px 0;\n }\n\n .recipient,\n .kv {\n all: unset;\n display: flex;\n width: 100%;\n cursor: pointer;\n align-items: center;\n column-gap: 10px;\n border-top: 1px solid var(--send-rule);\n color: var(--send-ink);\n font-family: inherit;\n\n &:focus-visible {\n outline: 2px solid var(--send-accent);\n outline-offset: -2px;\n border-radius: 4px;\n }\n\n .chevron {\n flex: 0 0 16px;\n width: 16px;\n height: 16px;\n color: var(--send-faint);\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n }\n }\n\n .recipient {\n padding: 8px 6px 8px 0;\n\n &:last-child {\n border-bottom: 1px solid var(--send-rule);\n }\n\n .who {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n }\n\n .role-name {\n font-size: 13px;\n font-weight: 600;\n }\n\n .who-detail {\n font-size: 12px;\n color: var(--send-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.configure {\n color: var(--send-accent);\n font-weight: 500;\n }\n }\n\n .options {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin-top: 3px;\n }\n\n .pill {\n height: 18px;\n padding: 0 6px;\n border-radius: 999px;\n font-size: 10px;\n font-weight: 500;\n display: inline-flex;\n align-items: center;\n background: var(--send-accent-tint);\n color: var(--send-ink-2);\n }\n }\n\n .role-dot {\n flex: 0 0 10px;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: 1px solid rgba(0, 0, 0, 0.1);\n }\n\n .kv {\n height: 40px;\n padding: 0 6px 0 0;\n font-size: 13px;\n\n &:last-child {\n border-bottom: 1px solid var(--send-rule);\n }\n\n &:disabled {\n cursor: default;\n color: var(--send-muted);\n }\n\n .key {\n flex: 0 0 84px;\n color: var(--send-muted);\n }\n\n .value {\n flex: 1;\n min-width: 0;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n small {\n font-size: inherit;\n font-weight: 400;\n color: var(--send-muted);\n }\n\n &.off {\n color: var(--send-warning-icon);\n }\n }\n }\n\n .main-spacer,\n .detail-spacer {\n flex: 1;\n }\n\n .buttons {\n display: flex;\n margin-top: 14px;\n column-gap: 10px;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n\n .error-message {\n width: 100%;\n color: $verdocs-red-1;\n font-size: 13px;\n margin-bottom: 10px;\n }\n }\n\n // Detail views\n .detail-header {\n display: flex;\n align-items: center;\n column-gap: 8px;\n margin: -2px 0 14px 0;\n\n .back {\n all: unset;\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n color: var(--send-accent);\n font-family: inherit;\n flex: 0 0 52px;\n\n .icon,\n .icon svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:focus-visible {\n outline: 2px solid var(--send-accent);\n outline-offset: 2px;\n border-radius: 4px;\n }\n }\n\n .detail-title {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n column-gap: 8px;\n font-size: 14px;\n font-weight: 600;\n text-align: center;\n }\n\n .detail-header-spacer {\n flex: 0 0 52px;\n }\n }\n\n .detail-footer {\n margin-top: 10px;\n padding-top: 12px;\n border-top: 1px solid var(--send-rule);\n\n verdocs-button,\n verdocs-button button {\n width: 100%;\n }\n }\n\n .hint {\n font-size: 12px;\n line-height: 1.5;\n color: var(--send-muted);\n margin: 10px 0 0 0;\n }\n\n .option-list {\n display: flex;\n flex-direction: column;\n }\n\n .option {\n all: unset;\n display: flex;\n width: 100%;\n cursor: pointer;\n align-items: center;\n column-gap: 10px;\n padding: 10px 0;\n font-size: 13px;\n font-family: inherit;\n color: var(--send-ink);\n border-top: 1px solid var(--send-rule);\n\n &:first-child {\n border-top: 0;\n }\n\n &:focus-visible {\n outline: 2px solid var(--send-accent);\n outline-offset: -2px;\n border-radius: 4px;\n }\n\n .radio {\n flex: 0 0 16px;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n border: 1px solid var(--send-control-border);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.selected .radio {\n border-color: var(--send-accent);\n\n &::after {\n content: '';\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--send-accent);\n }\n }\n\n .swatch {\n flex: 0 0 22px;\n width: 22px;\n height: 22px;\n border-radius: 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 9px;\n font-weight: 700;\n color: #ffffff;\n overflow: hidden;\n\n &.logo {\n background: #ffffff;\n border: 1px solid var(--send-rule);\n }\n\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n display: block;\n }\n }\n\n .option-label {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n\n small {\n font-size: 11px;\n color: var(--send-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n }\n\n .option-divider {\n height: 0;\n margin: 2px 0;\n border-top: 1px solid var(--send-control-border);\n\n + .option {\n border-top: 0;\n }\n }\n\n .hint a {\n color: var(--send-accent);\n font-weight: 500;\n text-decoration: none;\n border-bottom: 1px solid var(--send-accent-tint-2);\n\n .icon,\n .icon svg {\n width: 11px;\n height: 11px;\n display: inline-block;\n vertical-align: -1px;\n margin-left: 2px;\n }\n }\n\n .expires-field {\n position: relative;\n\n input {\n width: 100%;\n height: 36px;\n padding: 0 52px 0 10px;\n font-size: 14px;\n font-family: inherit;\n color: var(--send-ink);\n background: #ffffff;\n border: 1px solid var(--send-control-border);\n border-radius: 6px;\n outline: none;\n\n &:focus {\n border-color: var(--send-accent);\n box-shadow: 0 0 0 2px var(--send-accent-tint-2);\n }\n\n &::placeholder {\n color: var(--send-faint);\n }\n }\n\n .suffix {\n position: absolute;\n right: 10px;\n top: 0;\n height: 36px;\n display: flex;\n align-items: center;\n font-size: 13px;\n color: var(--send-muted);\n pointer-events: none;\n }\n }\n\n .warning {\n display: flex;\n column-gap: 10px;\n margin-top: 12px;\n padding: 10px 12px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 6px;\n color: var(--send-warning-text);\n background: var(--send-warning-bg);\n border: 1px solid var(--send-warning-border);\n\n > .icon {\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n margin-top: 1px;\n color: var(--send-warning-icon);\n\n svg {\n width: 18px;\n height: 18px;\n display: block;\n }\n }\n\n a {\n color: var(--send-accent);\n font-weight: 500;\n text-decoration: none;\n border-bottom: 1px solid var(--send-accent-tint-2);\n\n .icon,\n .icon svg {\n width: 11px;\n height: 11px;\n display: inline-block;\n vertical-align: -1px;\n margin-left: 2px;\n }\n }\n }\n\n verdocs-checkbox {\n display: block;\n padding: 4px 0;\n font-size: 13px;\n }\n}\n","import type {IBrand, IOrganization, TRecipientAuthMethod} from '@verdocs/js-sdk';\nimport {Component, Element, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipientFromTemplate, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {createEnvelope, formatFullName, getBrands, getOrganization, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {DefaultEndpoint, getWebAppUrl} from '../../../utils/Environment';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {updateScrollFade} from '../../../utils/ScrollFade';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst chevronRightIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m9 6 6 6-6 6\"/></svg>';\n\nconst chevronLeftIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m15 18-6-6 6-6\"/></svg>';\n\nconst warningIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"/><path d=\"M12 9v4M12 17h.01\"/></svg>';\n\nconst externalLinkIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 3h6v6M10 14 21 3M21 14v7H3V3h7\"/></svg>';\n\nconst VERDOCS_LOGO_URL = 'https://app.verdocs.com/assets/blue-logo.svg';\n\n// Swipe mechanics for mobile users in detail views\nconst SWIPE_START_FRACTION = 0.25;\nconst SWIPE_MIN_DISTANCE = 60;\nconst SWIPE_MAX_DURATION = 500;\n\n// Expiration controls. The API is less strict, but Web users prefer a simpler setup so we just range-limit it 1..120 here.\nconst MIN_EXPIRY_DAYS = 1;\nconst MAX_EXPIRY_DAYS = 120;\nconst DEFAULT_EXPIRY_DAYS = 120;\n\nconst AUTH_METHOD_LABELS: Record<TRecipientAuthMethod, string> = {\n email: 'Email',\n passcode: 'Passcode',\n sms: 'SMS',\n kba: 'KBA',\n id: 'ID check',\n};\n\ntype TSendView = 'main' | 'recipient' | 'brand' | 'expires' | 'notifications';\n\nexport interface ISendEventDetail extends ICreateEnvelopeFromTemplateRequest {\n name: string;\n template_id: string;\n recipients: ICreateEnvelopeRecipientFromTemplate[];\n template: ITemplate;\n}\n\nexport interface ISentEventDetail extends ICreateEnvelopeFromTemplateRequest {\n name: string;\n template_id: string;\n recipients: ICreateEnvelopeRecipientFromTemplate[];\n envelope_id: string;\n envelope: IEnvelope;\n}\n\n/**\n * Display a form to send a template to one or more recipients in an envelope for signing.\n * Host applications should ensure the template is \"sendable\" before displaying this component.\n * To be sendable, a template must have at least one document attached, at least one participant\n * defined, and at least one field assigned to every \"signer\" participant. This component will\n * hide itself if the template is not sendable.\n *\n * ```ts\n * <verdocs-send\n * templateId={TEMPLATE_ID}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={({ detail }) => { console.log('Send cancelled.', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-send',\n styleUrl: 'verdocs-send.scss',\n shadow: false,\n})\nexport class VerdocsSend {\n private templateListenerId = null;\n\n @Element() el: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = DefaultEndpoint;\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true}) templateId: string | null = null;\n\n /**\n * The environment the control is being called from, e.g. 'web'. This has an impact on how certain\n * operations such as email communications are handled to ensure users receive the correct URLs for\n * their invitations. Setting this to unknown values may produce unexpected/incorrect behaviors.\n * If environment is not known, do this set this property.\n */\n @Prop() environment: string = '';\n\n /**\n * Whether to show the cancel button. It may be useful to disable this in environments where\n * the embed is shown in a non-wizard flow with its own navigation for the user to exit.\n */\n @Prop() showCancel = true;\n\n /**\n * Preselect a brand by key, overriding the organization default.\n */\n @Prop({mutable: true}) brandKey = '';\n\n /**\n * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<ISendEventDetail>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<ISentEventDetail>;\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 if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user enters text in a search field. The parent application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n private swipeStart: {x: number; y: number; time: number} | null = null;\n private swallowNextClick = false;\n private loadedOrganizationId = '';\n\n @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() view: TSendView = 'main';\n @State() editingRoleId = '';\n @State() sessionContacts: {id: string; first_name: string; last_name: string; email: string; phone: string}[] = [];\n @State() sending = false;\n @State() brands: IBrand[] = [];\n @State() organization: IOrganization | null = null;\n @State() expiresInDays = '';\n @State() noContact = false;\n @State() rolesCompleted: Record<string, Partial<IRecipient>> = {};\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n componentDidLoad() {\n this.el.addEventListener(\n 'click',\n e => {\n if (this.swallowNextClick) {\n this.swallowNextClick = false;\n e.stopPropagation();\n e.preventDefault();\n }\n },\n true,\n );\n }\n\n // Make off-canvas controls leave the tab order\n componentDidRender() {\n updateScrollFade(this.el.querySelector('.detail-body'));\n this.el.querySelector('.main-pane')?.toggleAttribute('inert', this.view !== 'main');\n this.el.querySelector('.detail-pane')?.toggleAttribute('inert', this.view === 'main');\n }\n\n async listenToTemplate() {\n console.log('[SEND] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n true,\n (template: ITemplate) => {\n console.log('[SEND] Got new template', template);\n this.template = template;\n this.loading = false;\n this.rolesCompleted = {};\n this.view = 'main';\n this.editingRoleId = '';\n this.recomputeRolesCompleted();\n this.loadBrands();\n },\n );\n }\n\n loadBrands() {\n const organizationId = this.template?.organization_id;\n if (!organizationId || organizationId === this.loadedOrganizationId) {\n return;\n }\n\n const changedOrganization = !!this.loadedOrganizationId;\n this.loadedOrganizationId = organizationId;\n this.brands = [];\n this.organization = null;\n if (changedOrganization) {\n this.brandKey = '';\n }\n\n const stillCurrent = () => this.template?.organization_id === organizationId;\n\n getBrands(this.endpoint, organizationId)\n .then(brands => {\n if (stillCurrent()) {\n this.brands = brands || [];\n }\n })\n .catch(e => console.log('[SEND] Unable to load brands', e));\n\n getOrganization(this.endpoint, organizationId)\n .then(organization => {\n if (stillCurrent()) {\n this.organization = organization;\n }\n })\n .catch(e => console.log('[SEND] Unable to load organization', e));\n }\n\n handleExpiryInput(e: any) {\n const digits = (e.target.value || '').replace(/[^0-9]/g, '');\n this.expiresInDays = digits ? String(Math.min(Math.max(Number(digits), MIN_EXPIRY_DAYS), MAX_EXPIRY_DAYS)) : '';\n e.target.value = this.expiresInDays;\n }\n\n effectiveExpiryDays(): number {\n const days = Number(this.expiresInDays);\n return days >= MIN_EXPIRY_DAYS ? days : DEFAULT_EXPIRY_DAYS;\n }\n\n expiresAt(): Date {\n return new Date(Date.now() + this.effectiveExpiryDays() * 24 * 60 * 60 * 1000);\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method()\n async reset() {\n this.rolesCompleted = {};\n this.view = 'main';\n this.editingRoleId = '';\n this.brandKey = '';\n this.expiresInDays = '';\n this.noContact = false;\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[SEND] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.onSessionChanged((_endpoint, _session, profile) => {\n if (!profile) {\n return;\n }\n\n const me = {\n id: profile.id,\n first_name: profile.first_name,\n last_name: profile.last_name,\n email: profile.email,\n phone: profile.phone,\n };\n\n if (profile) {\n this.sessionContacts = [me];\n\n getOrganizationContacts(this.endpoint)\n .then(contacts => {\n console.log('[SEND] Got contacts', contacts);\n this.sessionContacts = [...contacts, me];\n })\n .catch(e => {\n console.log('[SEND] Error getting contacts', e);\n });\n }\n });\n\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[SEND] Unable to start Send operation, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[SEND] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SEND] Error with send session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n recomputeRolesCompleted() {\n this.rolesCompleted = {};\n\n const rolesAtLevel: Record<number, Partial<IRecipient>[]> = {};\n (this.template?.roles || []).forEach(role => {\n const level = role.sequence;\n rolesAtLevel[level] ||= [];\n const id = `r-${level}-${rolesAtLevel[level].length}`;\n rolesAtLevel[level].push({...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name});\n\n // if (role.first_name && (isValidEmail(role.email) || isValidPhone(role.phone))) {\n if (role.first_name && isValidEmail(role.email)) {\n this.rolesCompleted[id] = {...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name};\n }\n });\n }\n\n getSequenceNumbers() {\n // This is cleaner with a Set but we found a regression in some target environments where\n // this breaks down. Reverting to an older technique while we diagnose it.\n const sequences: Record<number, boolean> = {};\n (this.template?.roles || []).forEach(role => {\n sequences[role.sequence] = true;\n });\n return Object.keys(sequences)\n .map(s => +s)\n .sort((a, b) => a - b);\n }\n\n getRolesAtLevel(level: number) {\n const rolesAtLevel = (this.template?.roles || [])\n .filter(role => role.sequence === level)\n .map((role, index) => ({\n ...role,\n id: `r-${level}-${index}`,\n role_name: role.name,\n first_name: role.first_name,\n last_name: role.last_name,\n }));\n return rolesAtLevel as Partial<IRecipient>[];\n }\n\n getRoleById(id: string): Partial<IRecipient> | null {\n for (const level of this.getSequenceNumbers()) {\n const match = this.getRolesAtLevel(level).find(role => role.id === id);\n if (match) {\n return match;\n }\n }\n\n return null;\n }\n\n // We only show options the sender switched on.\n getRecipientOptionLabels(recipient: Partial<IRecipient> | undefined): string[] {\n if (!recipient) {\n return [];\n }\n\n const labels = (recipient.auth_methods || []).filter(method => method !== 'email').map(method => AUTH_METHOD_LABELS[method] || method);\n if (recipient.delegator) {\n labels.push('May delegate');\n }\n\n if (recipient.name_locked) {\n labels.push('Name locked');\n }\n\n return labels;\n }\n\n getDefaultBrand(): IBrand | null {\n const defaultId = this.organization?.default_brand_id;\n return (defaultId && this.brands.find(brand => brand.id === defaultId)) || null;\n }\n\n getDefaultBrandLabel() {\n const name = this.getDefaultBrand()?.name;\n return `Default (${name || 'Verdocs'})`;\n }\n\n getSelectedBrandLabel() {\n if (!this.brandKey) {\n return this.getDefaultBrandLabel();\n }\n\n const brand = this.brands.find(b => b.key === this.brandKey);\n return brand?.name || brand?.key || this.brandKey;\n }\n\n showView(view: TSendView) {\n this.view = view;\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n e.preventDefault();\n this.rolesCompleted = {...this.rolesCompleted, [role.id]: {...role, ...e.detail}};\n this.editingRoleId = '';\n this.view = 'main';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.editingRoleId = role.id;\n this.view = 'recipient';\n }\n\n handleSend(e: any) {\n if (this.sending) {\n console.log('[SEND] Skipping duplicate send', e);\n return;\n }\n\n console.log('[SEND] Sending', e);\n e.preventDefault();\n e.stopPropagation();\n\n this.sending = true;\n const localeData = Intl.DateTimeFormat().resolvedOptions();\n\n const details: ICreateEnvelopeFromTemplateRequest = {\n template_id: this.templateId,\n name: this.template?.name || 'New Envelope',\n environment: this.environment,\n initial_reminder: 0,\n followup_reminders: 0,\n recipients: Object.values(this.rolesCompleted) as ICreateEnvelopeRecipientFromTemplate[],\n timezone: localeData.timeZone,\n locale: localeData.locale,\n expires_at: this.expiresAt().toISOString(),\n };\n\n details.no_contact = this.noContact;\n if (this.brandKey) {\n details.brand_key = this.brandKey;\n }\n\n const beforeSendResult = this.beforeSend.emit({...details, name: details.name!, template: this.template});\n if (beforeSendResult.defaultPrevented) {\n console.log('[SEND] Send cancelled by parent', details);\n this.sending = false;\n return;\n }\n\n console.log('[SEND] Creating envelope', details);\n createEnvelope(this.endpoint, details)\n .then(r => {\n console.log('[SEND] Send envelope', r);\n this.reset().catch((e: any) => console.log('Unknown Error', e));\n this.sending = false;\n this.send?.emit({...details, name: details.name!, envelope_id: r.id, envelope: r});\n })\n .catch(e => {\n console.log('[SEND] Send error', e);\n VerdocsToast(e.response?.data?.error || 'Error creating envelope, please try again later.');\n this.sending = false;\n this.sdkError?.emit(e);\n });\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.exit?.emit();\n }\n\n handleSwipeStart(e: PointerEvent) {\n this.swallowNextClick = false;\n const pane = e.currentTarget as HTMLElement;\n const rect = pane.getBoundingClientRect();\n const onTextEntry = !!(e.target as HTMLElement)?.closest?.('input, textarea, select, [contenteditable]');\n if (this.view === 'main' || onTextEntry || e.clientX - rect.left > rect.width * SWIPE_START_FRACTION) {\n this.swipeStart = null;\n return;\n }\n\n this.swipeStart = {x: e.clientX, y: e.clientY, time: Date.now()};\n }\n\n handleSwipeEnd(e: PointerEvent) {\n const start = this.swipeStart;\n this.swipeStart = null;\n if (!start) {\n return;\n }\n\n const dx = e.clientX - start.x;\n const dy = Math.abs(e.clientY - start.y);\n if (dx >= SWIPE_MIN_DISTANCE && dx > dy && Date.now() - start.time <= SWIPE_MAX_DURATION) {\n this.swallowNextClick = true;\n this.showView('main');\n }\n }\n\n renderDetailHeader(title: any) {\n return (\n <div class=\"detail-header\">\n <button type=\"button\" class=\"back\" onClick={() => this.showView('main')}>\n <span class=\"icon\" innerHTML={chevronLeftIcon} />\n Back\n </button>\n <div class=\"detail-title\">{title}</div>\n <div class=\"detail-header-spacer\" />\n </div>\n );\n }\n\n renderDetailBody(content: any) {\n return (\n <div class=\"detail-body-wrap\">\n <div class=\"detail-body\" onScroll={(e: any) => updateScrollFade(e.target)}>\n {content}\n </div>\n <div class=\"scroll-fade\" />\n </div>\n );\n }\n\n renderDoneButton() {\n return (\n <div class=\"detail-footer\">\n <verdocs-button label=\"Done\" size=\"small\" onClick={() => this.showView('main')} />\n </div>\n );\n }\n\n renderRecipientView() {\n const role = this.getRoleById(this.editingRoleId);\n if (!role) {\n return <div class=\"detail recipient-detail\">{this.renderDetailHeader('Recipient')}</div>;\n }\n\n const roleIndex = getRoleIndex(this.template, role.role_name);\n return (\n <div class=\"detail recipient-detail\">\n {this.renderDetailHeader([<span class=\"role-dot\" style={{backgroundColor: getRGBA(roleIndex)}} />, role.role_name])}\n <verdocs-contact-picker\n key={role.id}\n showCancel={false}\n onExit={() => this.showView('main')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={(this.rolesCompleted[role.id] ?? role) as IRecipient}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </div>\n );\n }\n\n renderBrandSwatch(brand: IBrand | null, fallbackInitial: string) {\n const image = brand?.favicon_url || brand?.thumbnail_url || (brand ? null : VERDOCS_LOGO_URL);\n if (image) {\n return (\n <span class=\"swatch logo\">\n <img src={image} alt=\"\" />\n </span>\n );\n }\n\n return (\n <span class=\"swatch\" style={{backgroundColor: brand?.primary_color || '#4c56cb'}}>\n {fallbackInitial.substring(0, 2).toUpperCase()}\n </span>\n );\n }\n\n renderBrandOption(key: string, label: string, sub: string, swatch: any) {\n return (\n <button type=\"button\" class={{option: true, selected: this.brandKey === key}} onClick={() => (this.brandKey = key)}>\n <span class=\"radio\" />\n {swatch}\n <span class=\"option-label\">\n {label}\n <small>{sub}</small>\n </span>\n </button>\n );\n }\n\n renderBrandView() {\n const defaultBrand = this.getDefaultBrand();\n const others = this.brands.filter(brand => brand.id !== defaultBrand?.id).sort((a, b) => (a.name || a.key).localeCompare(b.name || b.key));\n const hasBrands = this.brands.length > 0;\n\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Brand')}\n {this.renderDetailBody([\n <div class=\"option-list\">\n {this.renderBrandOption('', this.getDefaultBrandLabel(), 'Organization default', this.renderBrandSwatch(defaultBrand, defaultBrand?.name || 'V'))}\n {others.length > 0 && <div class=\"option-divider\" />}\n {others.map(brand => this.renderBrandOption(brand.key, brand.name || brand.key, brand.key, this.renderBrandSwatch(brand, brand.name || brand.key)))}\n </div>,\n !hasBrands && (\n <p class=\"hint\">\n Configure the look and feel of the signing experience by{' '}\n <a href={`${getWebAppUrl(this.endpoint)}/settings/branding`} target=\"_blank\" rel=\"noopener\">\n Creating a Brand\n <span class=\"icon\" innerHTML={externalLinkIcon} />\n </a>\n .\n </p>\n ),\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderExpiresView() {\n const expiresAt = this.expiresAt();\n const when = `${expiresAt.toLocaleDateString(undefined, {month: 'short', day: 'numeric', year: 'numeric'})} at ${expiresAt.toLocaleTimeString(undefined, {hour: 'numeric', minute: '2-digit'})}`;\n\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Expiration')}\n {this.renderDetailBody([\n <div class=\"expires-field\">\n <input\n type=\"text\"\n inputMode=\"numeric\"\n aria-label=\"Expires in (days)\"\n placeholder={String(DEFAULT_EXPIRY_DAYS)}\n value={this.expiresInDays}\n disabled={this.sending}\n onInput={(e: any) => this.handleExpiryInput(e)}\n />\n <span class=\"suffix\">days</span>\n </div>,\n <p class=\"hint\">\n This envelope will expire on {when}. Expirations may be set from {MIN_EXPIRY_DAYS}-{MAX_EXPIRY_DAYS} days. If left blank, this will default to {DEFAULT_EXPIRY_DAYS}.\n </p>,\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderNotificationsView() {\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Notifications')}\n {this.renderDetailBody([\n <verdocs-checkbox size=\"small\" label=\"Disable notifications\" checked={this.noContact} onInput={(e: any) => (this.noContact = !!e.target.checked)} />,\n this.noContact && (\n <div class=\"warning\">\n <span class=\"icon\" innerHTML={warningIcon} />\n <div>\n Disabling notifications turns off invitations and reminders to recipients as well as status updates to you. You may obtain invite links in the recipient summary or\n via an API call. We strongly recommend enabling{' '}\n <a href={`${getWebAppUrl(this.endpoint)}/settings/webhooks`} target=\"_blank\" rel=\"noopener\">\n Webhooks\n <span class=\"icon\" innerHTML={externalLinkIcon} />\n </a>{' '}\n to help automate this process.\n </div>\n </div>\n ),\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderDetail() {\n switch (this.view) {\n case 'recipient':\n return this.renderRecipientView();\n case 'brand':\n return this.renderBrandView();\n case 'expires':\n return this.renderExpiresView();\n case 'notifications':\n return this.renderNotificationsView();\n default:\n return null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host style={{display: 'flex'}}>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const levels = this.getSequenceNumbers();\n const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) && recipient.first_name && recipient.last_name);\n const allRolesAssigned = rolesAssigned.length >= getRoleNames(this.template).length;\n const assignedEmails = rolesAssigned.map(r => r.email.toLowerCase());\n const hasDuplicateEmails = new Set(assignedEmails).size < assignedEmails.length;\n const expiresAt = this.expiresAt();\n const expiresShort = expiresAt.toLocaleDateString(undefined, {month: 'short', day: 'numeric'});\n\n return (\n <Host class={{'sendable': this.template?.is_sendable, 'detail-open': this.view !== 'main'}}>\n <div class=\"track\">\n <div class=\"pane main-pane\" aria-hidden={this.view !== 'main' ? 'true' : 'false'}>\n <div class=\"section-title\">Recipients</div>\n <div class=\"recipients\">\n {levels.map(level => [\n levels.length > 1 && <div class=\"step\">Step {level}</div>,\n this.getRolesAtLevel(level).map(role => {\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const completed = this.rolesCompleted[role.id];\n const assigned = completed && rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n const optionLabels = this.getRecipientOptionLabels(completed);\n\n return (\n <button type=\"button\" class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} onClick={e => this.handleClickRole(e, role)}>\n <span class=\"role-dot\" style={{backgroundColor: getRGBA(roleIndex)}} />\n <span class=\"who\">\n <span class=\"role-name\">{role.role_name}</span>\n {assigned ? (\n <span class=\"who-detail\">\n {formatFullName(completed)} · {completed.email}\n </span>\n ) : (\n <span class=\"who-detail configure\">Configure recipient</span>\n )}\n {optionLabels.length > 0 && (\n <span class=\"options\">\n {optionLabels.map(label => (\n <span class=\"pill\">{label}</span>\n ))}\n </span>\n )}\n </span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n );\n }),\n ])}\n </div>\n\n <div class=\"section-title delivery-title\">Delivery</div>\n <div class=\"delivery\">\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('brand')} disabled={this.sending}>\n <span class=\"key\">Brand</span>\n <span class=\"value\">{this.getSelectedBrandLabel()}</span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('expires')} disabled={this.sending}>\n <span class=\"key\">Expires</span>\n <span class=\"value\">\n {this.effectiveExpiryDays()} days <small>· {expiresShort}</small>\n </span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('notifications')} disabled={this.sending}>\n <span class=\"key\">Notifications</span>\n <span class={{value: true, off: this.noContact}}>{this.noContact ? 'Off' : 'On'}</span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n </div>\n\n <div class=\"main-spacer\" />\n\n <div class=\"buttons\">\n {hasDuplicateEmails && <div class=\"error-message\">Recipients cannot share the same email.</div>}\n {this.sending && <verdocs-spinner />}\n {this.showCancel && <verdocs-button label=\"Cancel\" size=\"small\" variant=\"outline\" onClick={e => this.handleCancel(e)} disabled={this.sending} />}\n <verdocs-button label=\"Send\" size=\"small\" disabled={!allRolesAssigned || this.sending || hasDuplicateEmails} onClick={e => this.handleSend(e)} />\n </div>\n </div>\n\n <div\n class=\"pane detail-pane\"\n aria-hidden={this.view === 'main' ? 'true' : 'false'}\n onPointerDown={e => this.handleSwipeStart(e)}\n onPointerUp={e => this.handleSwipeEnd(e)}\n onPointerCancel={() => (this.swipeStart = null)}\n >\n {this.renderDetail()}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"upBAEO,MAAMA,EAAgBC,KAAgCA,IAAQ,MAARA,SAAQ,SAARA,EAAUC,QAAS,IA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A,OAAKC,MAAM,gBAEXD,EAAA,OAAKC,MAAM,WACRoE,GAAsBrE,EAAA,OAAKC,MAAM,iBAAe,2CAChD1L,KAAKkB,SAAWuK,EAAA,wBAChBzL,KAAKM,YAAcmL,EAAA,kBAAgBS,MAAM,SAASC,KAAK,QAAQqE,QAAQ,UAAU5E,QAAS9J,GAAK9B,KAAKiK,aAAanI,GAAImN,SAAUjP,KAAKkB,UACrIuK,EAAA,kBAAgBS,MAAM,OAAOC,KAAK,QAAQ8C,UAAWU,GAAoB3P,KAAKkB,SAAW4O,EAAoBlE,QAAS9J,GAAK9B,KAAKqI,WAAWvG,OAI/I2J,EAAA,OACEC,MAAM,mBAAkB,cACX1L,KAAKe,OAAS,OAAS,OAAS,QAC7C0P,cAAe3O,GAAK9B,KAAKmK,iBAAiBrI,GAC1C4O,YAAa5O,GAAK9B,KAAKkL,eAAepJ,GACtC6O,gBAAiB,IAAO3Q,KAAKQ,WAAa,MAEzCR,KAAKqP,iB","ignoreList":[]}
@@ -1,2 +0,0 @@
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