@verdocs/web-sdk 5.0.41 → 5.0.43

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 (98) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +18 -33
  3. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
  4. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +0 -2
  5. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
  6. package/dist/cjs/verdocs-preview_7.cjs.entry.js +0 -1
  7. package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
  8. package/dist/cjs/verdocs-sign.cjs.entry.js +116 -90
  9. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  10. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  11. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +0 -1
  12. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  13. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +123 -95
  14. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  15. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +7 -8
  16. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
  17. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +0 -2
  18. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
  19. package/dist/components/{p-36368807.js → p-4a04090c.js} +3 -3
  20. package/dist/components/{p-36368807.js.map → p-4a04090c.js.map} +1 -1
  21. package/dist/components/{p-c1d312d8.js → p-4a4bf38c.js} +2 -3
  22. package/dist/components/p-4a4bf38c.js.map +1 -0
  23. package/dist/components/{p-6bfb8eba.js → p-73a39d5a.js} +19 -34
  24. package/dist/components/p-73a39d5a.js.map +1 -0
  25. package/dist/components/{p-795b4192.js → p-91eae04c.js} +3 -3
  26. package/dist/components/{p-795b4192.js.map → p-91eae04c.js.map} +1 -1
  27. package/dist/components/{p-52c195dd.js → p-92cce3dc.js} +1 -3
  28. package/dist/components/{p-52c195dd.js.map → p-92cce3dc.js.map} +1 -1
  29. package/dist/components/{p-7481c7db.js → p-b474c324.js} +2 -2
  30. package/dist/components/{p-7481c7db.js.map → p-b474c324.js.map} +1 -1
  31. package/dist/components/verdocs-build.js +6 -6
  32. package/dist/components/verdocs-contact-picker.js +1 -1
  33. package/dist/components/verdocs-field-date.js +1 -1
  34. package/dist/components/verdocs-preview.js +1 -1
  35. package/dist/components/verdocs-send.js +1 -1
  36. package/dist/components/verdocs-sign.js +119 -92
  37. package/dist/components/verdocs-sign.js.map +1 -1
  38. package/dist/components/verdocs-template-document-page.js +1 -1
  39. package/dist/components/verdocs-template-fields.js +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/verdocs-contact-picker_2.entry.js +18 -33
  42. package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
  43. package/dist/esm/verdocs-field-attachment_13.entry.js +0 -2
  44. package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
  45. package/dist/esm/verdocs-preview_7.entry.js +0 -1
  46. package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
  47. package/dist/esm/verdocs-sign.entry.js +117 -91
  48. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  49. package/dist/esm/verdocs-web-sdk.js +1 -1
  50. package/dist/esm-es5/loader.js +1 -1
  51. package/dist/esm-es5/loader.js.map +1 -1
  52. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  53. package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
  54. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  55. package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
  56. package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
  57. package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
  58. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  59. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  60. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  61. package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
  62. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +4 -2
  63. package/dist/verdocs-web-sdk/p-0c1898f6.system.js +1 -1
  64. package/dist/verdocs-web-sdk/p-0c1898f6.system.js.map +1 -1
  65. package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js +2 -0
  66. package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js.map +1 -0
  67. package/dist/verdocs-web-sdk/p-56170f1d.entry.js +2 -0
  68. package/dist/verdocs-web-sdk/p-56170f1d.entry.js.map +1 -0
  69. package/dist/verdocs-web-sdk/{p-7f982a59.system.entry.js → p-6cfb51e3.system.entry.js} +2 -2
  70. package/dist/verdocs-web-sdk/p-6cfb51e3.system.entry.js.map +1 -0
  71. package/dist/verdocs-web-sdk/{p-62bde242.system.entry.js → p-89c69404.system.entry.js} +2 -2
  72. package/dist/verdocs-web-sdk/p-89c69404.system.entry.js.map +1 -0
  73. package/dist/verdocs-web-sdk/p-b232ef42.system.entry.js +2 -0
  74. package/dist/verdocs-web-sdk/p-b232ef42.system.entry.js.map +1 -0
  75. package/dist/verdocs-web-sdk/p-d47c58de.entry.js +2 -0
  76. package/dist/verdocs-web-sdk/p-d47c58de.entry.js.map +1 -0
  77. package/dist/verdocs-web-sdk/{p-7962eb00.entry.js → p-e7ca4f15.entry.js} +2 -2
  78. package/dist/verdocs-web-sdk/p-e7ca4f15.entry.js.map +1 -0
  79. package/dist/verdocs-web-sdk/{p-dda88c7f.entry.js → p-e8268ed9.entry.js} +2 -2
  80. package/dist/verdocs-web-sdk/p-e8268ed9.entry.js.map +1 -0
  81. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  82. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
  83. package/package.json +3 -3
  84. package/dist/components/p-6bfb8eba.js.map +0 -1
  85. package/dist/components/p-c1d312d8.js.map +0 -1
  86. package/dist/custom-elements.json +0 -2198
  87. package/dist/verdocs-web-sdk/p-1c8788f5.entry.js +0 -2
  88. package/dist/verdocs-web-sdk/p-1c8788f5.entry.js.map +0 -1
  89. package/dist/verdocs-web-sdk/p-62bde242.system.entry.js.map +0 -1
  90. package/dist/verdocs-web-sdk/p-7962eb00.entry.js.map +0 -1
  91. package/dist/verdocs-web-sdk/p-7f982a59.system.entry.js.map +0 -1
  92. package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js +0 -2
  93. package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js.map +0 -1
  94. package/dist/verdocs-web-sdk/p-dda88c7f.entry.js.map +0 -1
  95. package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js +0 -2
  96. package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js.map +0 -1
  97. package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js +0 -2
  98. package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"verdocs-send.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-send/verdocs-send.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAG7I,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,QAAQ,EA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AI,CAAe,EAClE,gBAAgB,EAAE,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA,EAAA,GAC1D,CACa,CAClB,CACG,CACP,CAAC;oBACJ,CAAC,CAAC,CACE,CACP,CAAC;gBAEF,WAAK,KAAK,EAAE,kBAAkB;oBAC3B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;oBACzB,WAAK,KAAK,EAAC,UAAU,uBAAuB,CACxC,CACF;YAEN,WAAK,KAAK,EAAC,SAAS;gBAClB,sBAAgB,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,GAAI;gBAC5H,sBAAgB,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI;gBAC1H,IAAI,CAAC,OAAO,IAAI,0BAAmB,CAChC,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport {createEnvelope, formatFullName, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipient, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst editIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"></path></svg>';\n\nconst startIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z\"></path></svg>';\n\nconst stepIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\"></path></svg>';\n\nconst doneIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z\"></path></svg>';\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={templateId}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={(e) => { 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 /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The 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 * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string; template: ITemplate}>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string; envelope_id: string; envelope: IEnvelope}>;\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 @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() showPickerForId = '';\n @State() sessionContacts = [];\n @State() sending = 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 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.recomputeRolesCompleted();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method() async reset() {\n this.rolesCompleted = {};\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 - 1;\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 getLevelIcon(level: 'start' | 'end' | 'sequence') {\n if (level === 'start') {\n return <div class=\"level-icon\" innerHTML={startIcon} />;\n } else if (level === 'end') {\n return <div class=\"level-icon\" innerHTML={doneIcon} />;\n } else {\n return <div class=\"level-icon\" innerHTML={stepIcon} />;\n }\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n console.log('hsc', e.detail, role);\n e.preventDefault();\n this.rolesCompleted[role.id] = {...role, ...e.detail};\n this.showPickerForId = '';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.showPickerForId = role.id;\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\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 ICreateEnvelopeRecipient[],\n // TODO: Pre-filled fields support\n fields: [],\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 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\n return (\n <Host class={{sendable: this.template?.is_sendable}}>\n <div class=\"recipients\">\n <div class=\"left-line\" />\n <div class={`level level-start`}>\n {this.getLevelIcon('start')}\n <div class=\"complete\">Send Envelope</div>\n </div>\n\n {levels.map(level => (\n <div class={`level level-${level}`}>\n {this.getLevelIcon('sequence')}\n\n {this.getRolesAtLevel(level).map(role => {\n const unknown = !role.email || !role.first_name || !role.last_name;\n const roleName = this.rolesCompleted[role.id]?.first_name ? formatFullName(this.rolesCompleted[role.id]) : unknown ? role.role_name : formatFullName(role);\n const elId = `verdocs-send-recipient-${role.role_name}`;\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const rgba = getRGBA(roleIndex);\n const completed = rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n\n const style = {\n backgroundColor: rgba,\n border: completed ? '2px solid #55bc81' : '2px solid #dddddd',\n };\n\n return unknown ? (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={this.rolesCompleted[role.id] ?? role}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n ) : (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {/*<div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={{borderColor: rgba}} onClick={e => this.handleClickRole(e, role)} id={elId}>*/}\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\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 </verdocs-portal>\n )}\n </div>\n );\n })}\n </div>\n ))}\n\n <div class={`level level-done`}>\n {this.getLevelIcon('end')}\n <div class=\"complete\">Signing Complete</div>\n </div>\n </div>\n\n <div class=\"buttons\">\n <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} onClick={e => this.handleSend(e)} />\n {this.sending && <verdocs-spinner />}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"verdocs-send.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-send/verdocs-send.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAG7I,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,QAAQ,GACZ,0PAA0P,CAAC;AAE7P,MAAM,SAAS,GACb,kOAAkO,CAAC;AAErO,MAAM,QAAQ,GACZ,gQAAgQ,CAAC;AAEnQ,MAAM,QAAQ,GACZ,8PAA8P,CAAC;AAEjQ;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,OAAO,WAAW;IALxB;QAMU,uBAAkB,GAAG,IAAI,CAAC;QAElC;;WAEG;QACK,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;QAEjE;;WAEG;QACoB,eAAU,GAAkB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C,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,GAAI;gBAC5H,sBAAgB,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI;gBAC1H,IAAI,CAAC,OAAO,IAAI,0BAAmB,CAChC,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport {createEnvelope, formatFullName, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipient, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst editIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"></path></svg>';\n\nconst startIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z\"></path></svg>';\n\nconst stepIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\"></path></svg>';\n\nconst doneIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z\"></path></svg>';\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={templateId}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={(e) => { 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 /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The 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 * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string; template: ITemplate}>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string; envelope_id: string; envelope: IEnvelope}>;\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 @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() showPickerForId = '';\n @State() sessionContacts = [];\n @State() sending = 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 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.recomputeRolesCompleted();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method() async reset() {\n this.rolesCompleted = {};\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 - 1;\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 getLevelIcon(level: 'start' | 'end' | 'sequence') {\n if (level === 'start') {\n return <div class=\"level-icon\" innerHTML={startIcon} />;\n } else if (level === 'end') {\n return <div class=\"level-icon\" innerHTML={doneIcon} />;\n } else {\n return <div class=\"level-icon\" innerHTML={stepIcon} />;\n }\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n e.preventDefault();\n this.rolesCompleted[role.id] = {...role, ...e.detail};\n this.showPickerForId = '';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.showPickerForId = role.id;\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\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 ICreateEnvelopeRecipient[],\n // TODO: Pre-filled fields support\n fields: [],\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 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\n return (\n <Host class={{sendable: this.template?.is_sendable}}>\n <div class=\"recipients\">\n <div class=\"left-line\" />\n <div class={`level level-start`}>\n {this.getLevelIcon('start')}\n <div class=\"complete\">Send Envelope</div>\n </div>\n\n {levels.map(level => (\n <div class={`level level-${level}`}>\n {this.getLevelIcon('sequence')}\n\n {this.getRolesAtLevel(level).map(role => {\n const unknown = !role.email || !role.first_name || !role.last_name;\n const roleName = this.rolesCompleted[role.id]?.first_name ? formatFullName(this.rolesCompleted[role.id]) : unknown ? role.role_name : formatFullName(role);\n const elId = `verdocs-send-recipient-${role.role_name}`;\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const rgba = getRGBA(roleIndex);\n const completed = rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n\n const style = {\n backgroundColor: rgba,\n border: completed ? '2px solid #55bc81' : '2px solid #dddddd',\n };\n\n return unknown ? (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={this.rolesCompleted[role.id] ?? role}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n ) : (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {/*<div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={{borderColor: rgba}} onClick={e => this.handleClickRole(e, role)} id={elId}>*/}\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\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 </verdocs-portal>\n )}\n </div>\n );\n })}\n </div>\n ))}\n\n <div class={`level level-done`}>\n {this.getLevelIcon('end')}\n <div class=\"complete\">Signing Complete</div>\n </div>\n </div>\n\n <div class=\"buttons\">\n <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} onClick={e => this.handleSend(e)} />\n {this.sending && <verdocs-spinner />}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import { Host, Fragment, h } from "@stencil/core";
2
- import { updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint } from "@verdocs/js-sdk";
3
- import { updateEnvelopeField, sortFields, submitKbaIdentity, submitKbaChallengeResponse } from "@verdocs/js-sdk";
4
- import { fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment, getKbaStep } from "@verdocs/js-sdk";
5
- import { getEnvelope, integerSequence, isValidEmail, isValidPhone, submitKbaPin, updateEnvelopeFieldInitials } from "@verdocs/js-sdk";
2
+ import { authenticateSigner } from "@verdocs/js-sdk";
6
3
  import { createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, formatFullName } from "@verdocs/js-sdk";
4
+ import { getEnvelope, integerSequence, isValidEmail, isValidPhone, updateEnvelopeFieldInitials } from "@verdocs/js-sdk";
7
5
  import { getFieldId, renderDocumentField, saveAttachment, updateDocumentFieldValue } from "../../../utils/utils";
6
+ import { updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint } from "@verdocs/js-sdk";
7
+ import { fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment } from "@verdocs/js-sdk";
8
+ import { updateEnvelopeField, sortFields } from "@verdocs/js-sdk";
8
9
  import { VerdocsToast } from "../../../utils/Toast";
9
10
  import { SDKError } from "../../../utils/errors";
10
11
  import { Store } from "../../../utils/Datastore";
@@ -82,7 +83,10 @@ export class VerdocsSign {
82
83
  this.showFinishLater = false;
83
84
  this.agreed = false;
84
85
  this.documentsSingularPlural = 'document';
85
- this.kbaStep = '';
86
+ // TODO
87
+ // @State() authStep: TRecipientAuthMethod | null = null;
88
+ this.authStep = null;
89
+ this.authDetails = null;
86
90
  this.kbaQuestions = [];
87
91
  this.showSpinner = false;
88
92
  this.kbaChoices = [];
@@ -130,15 +134,29 @@ export class VerdocsSign {
130
134
  }
131
135
  this.recipientIndex = this.roleNames.findIndex(roleName => roleName == this.roleId);
132
136
  if (this.recipientIndex > -1) {
137
+ console.log('[SIGN] Processing recipient', this.authStep);
133
138
  this.recipient = this.sortedRecipients[this.recipientIndex];
134
139
  this.agreed = this.recipient.agreed;
140
+ this.submitted = this.recipient.status === 'submitted';
141
+ this.authStep = this.recipient.auth_step;
142
+ if (this.authStep) {
143
+ console.log('[SIGN] Authentication required', this.authStep);
144
+ }
145
+ const auth_method_states = (this.recipient.auth_method_states || {});
146
+ if (Object.values(auth_method_states).includes('failed')) {
147
+ this.fatalErrorHeader = 'Recipient Verification Failed';
148
+ this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
149
+ this.isDone = true;
150
+ }
151
+ // TODO
152
+ // this.kbaQuestions = (r as any).questions?.question || [];
153
+ // this.kbaChoices = [];
135
154
  }
136
155
  else {
137
156
  console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);
138
157
  }
139
158
  // TODO: Envelope "complete" | "declined" | "canceled"
140
159
  // TODO: Recipient "canceled"
141
- this.submitted = this.recipient.status === 'submitted';
142
160
  this.isDone = this.submitted;
143
161
  this.showDone = this.submitted;
144
162
  if (this.envelope.status === 'canceled') {
@@ -154,24 +172,6 @@ export class VerdocsSign {
154
172
  }
155
173
  this.checkRecipientFields();
156
174
  (_d = this.envelopeLoaded) === null || _d === void 0 ? void 0 : _d.emit({ endpoint: this.endpoint, envelope: this.envelope });
157
- if (!this.isDone) {
158
- getKbaStep(this.endpoint, this.envelopeId, this.roleId)
159
- .then(r => {
160
- var _a;
161
- console.log('[SIGN] KBA Step', r);
162
- this.kbaStep = r.kba_step;
163
- if (this.kbaStep === 'failed') {
164
- this.fatalErrorHeader = 'Identity Verification Failed';
165
- this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
166
- this.isDone = true;
167
- }
168
- else {
169
- this.kbaQuestions = ((_a = r.questions) === null || _a === void 0 ? void 0 : _a.question) || [];
170
- this.kbaChoices = [];
171
- }
172
- })
173
- .catch(e => console.log('Error getting KBA step', e));
174
- }
175
175
  }
176
176
  catch (e) {
177
177
  console.log('[SIGN] Error with signing session', e);
@@ -590,7 +590,29 @@ export class VerdocsSign {
590
590
  });
591
591
  this.checkRecipientFields();
592
592
  }
593
+ handleAuthenticateSigner(params) {
594
+ console.log('[SIGN] Submitting authentication step', params);
595
+ authenticateSigner(this.endpoint, params)
596
+ .then(r => {
597
+ console.log('[SIGN] Authentication successful', r);
598
+ this.authStep = r.auth_step;
599
+ this.authDetails = r.auth_details;
600
+ })
601
+ .catch(e => {
602
+ var _a, _b, _c, _d, _e;
603
+ console.log('[SIGN] Error submitting authentication step', e);
604
+ if ((_c = (_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.includes('failed')) {
605
+ this.fatalErrorHeader = 'Recipient Verification Failed';
606
+ this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
607
+ this.isDone = true;
608
+ }
609
+ else {
610
+ VerdocsToast(((_e = (_d = e.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) || 'Unable to verify your identity. Please try again.', { style: 'error' });
611
+ }
612
+ });
613
+ }
593
614
  render() {
615
+ console.log('[SIGN] Rendering', { authStep: this.authStep });
594
616
  if (this.showLoadError) {
595
617
  return (h(Host, null, h("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: () => {
596
618
  window.location.reload();
@@ -613,86 +635,91 @@ export class VerdocsSign {
613
635
  if (!this.agreed) {
614
636
  return (h(Host, { class: "agreed" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "By checking this box, you:", onInput: () => this.handleClickAgree() }), h("ul", null, h("li", null, "Agree to use electronic records and signatures, and confirm you have read the", ' ', h("a", { href: "https://verdocs.com/en/electronic-record-signature-disclosure/", target: "_blank" }, "Electronic Record and Signatures Disclosure"), "."), h("li", null, "Agree to Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/eula", target: "_blank" }, "End User License Agreement"), ' ', "and confirm you have read Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/privacy-policy/", target: "_blank" }, "Privacy Policy"), "."))))));
615
637
  }
616
- if (this.kbaStep === 'pin') {
617
- return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "text", step: 1, steps: 1, helptitle: "Document is protected by a PIN code", helptext: "Please enter your PIN code to proceed. If you do not have one, please contact the sender.", label: "PIN Code", onNext: async (e) => {
618
- submitKbaPin(this.endpoint, this.envelopeId, this.roleId, e.detail)
619
- .then(r => {
620
- console.log('[SIGN] PIN code submission result', r);
621
- if (r.kba_step === 'complete') {
622
- this.kbaStep = '';
623
- }
624
- })
625
- .catch(e => {
626
- var _a, _b, _c, _d;
627
- console.log('[SIGN] Error submitting PIN', e);
628
- if (((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === 'Rejecting PIN submission, too many attempts') {
629
- this.fatalErrorHeader = 'PIN Verification Failed';
630
- this.fatalErrorMessage = 'Too many failed attempts. The sender has been notified.';
631
- this.isDone = true;
632
- }
633
- else {
634
- VerdocsToast(((_d = (_c = e.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error) || 'Unable to verify PIN code. Please try again.', { style: 'error' });
635
- }
636
- });
637
- } })))));
638
+ if (this.authStep === 'passcode') {
639
+ return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "text", step: 1, steps: 1, helptitle: "Document is protected by a Passcode", helptext: "Please enter your Passcode to proceed. If you do not have one, please contact the sender.", label: "Passcode", onNext: e => this.handleAuthenticateSigner({ auth_method: 'passcode', code: e.detail }) })))));
638
640
  }
639
- if (this.kbaStep === 'identity') {
641
+ if (this.authStep === 'kba') {
640
642
  return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "identity", helptitle: "Document requires identity verification", helptext: "Please complete your contact details to proceed.", recipient: this.recipient, onNext: async (e) => {
641
643
  const recipDetails = e.detail;
642
- submitKbaIdentity(this.endpoint, this.envelopeId, this.roleId, {
643
- firstName: recipDetails.first_name,
644
- lastName: recipDetails.last_name,
644
+ this.handleAuthenticateSigner({
645
+ auth_method: 'kba',
646
+ first_name: recipDetails.first_name,
647
+ last_name: recipDetails.last_name,
645
648
  address: recipDetails.address,
646
649
  city: recipDetails.city,
647
650
  state: recipDetails.state,
648
651
  zip: recipDetails.zip,
649
- ssnLast4: recipDetails.ssn_last_4,
650
- })
651
- .then(r => {
652
- console.log('[SIGN] Identity submission result', r);
653
- this.kbaStep = r.kba_step;
654
- })
655
- .catch(e => {
656
- var _a, _b;
657
- console.log('[SIGN] Error submitting identity', e);
658
- VerdocsToast(((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || 'Unable to verify identity.', { style: 'error' });
652
+ ssn_last_4: recipDetails.ssn_last_4,
653
+ dob: recipDetails.dob,
659
654
  });
660
655
  } })))));
661
656
  }
662
- if (this.kbaStep === 'challenge') {
663
- const questionNumber = this.kbaChoices.length;
664
- const kbaQuestion = this.kbaQuestions[questionNumber];
665
- return (h(Host, { class: "kba" }, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name))), h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, this.kbaChoices.length >= this.kbaQuestions.length ? (h("verdocs-spinner", null)) : (h("verdocs-kba-dialog", { mode: "choice", helptitle: "Your identity requires additional verification", helptext: (kbaQuestion === null || kbaQuestion === void 0 ? void 0 : kbaQuestion.prompt) || 'Please select one of the options below.', choices: (kbaQuestion === null || kbaQuestion === void 0 ? void 0 : kbaQuestion.answer) || ['Skip Question'], step: questionNumber + 1, steps: this.kbaQuestions.length, onNext: async (e) => {
666
- var _a, _b, _c;
667
- const answer = e.detail;
668
- this.kbaChoices = [...this.kbaChoices, answer];
669
- if (this.kbaChoices.length >= this.kbaQuestions.length) {
670
- const responses = this.kbaQuestions.map((q, i) => ({ type: q.type, answer: this.kbaChoices[i] }));
671
- console.log('Submitting KBA responses', this.kbaChoices, responses);
672
- try {
673
- const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);
674
- console.log('KBA challenge response', response);
675
- this.kbaStep = response.kba_step;
676
- if (this.kbaStep === 'failed') {
677
- this.fatalErrorHeader = 'Identity Verification Failed';
678
- this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
679
- this.isDone = true;
680
- }
681
- else {
682
- this.kbaQuestions = ((_a = response.questions) === null || _a === void 0 ? void 0 : _a.question) || [];
683
- this.kbaChoices = [];
684
- }
685
- }
686
- catch (e) {
687
- console.log('Error submitting KBA challenge', e);
688
- this.kbaStep = '';
689
- this.fatalErrorHeader = 'Unable to Verify Identity';
690
- this.fatalErrorMessage = ((_c = (_b = e.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.error) || 'Please try again later.';
691
- this.isDone = true;
692
- }
693
- }
694
- } }))))));
695
- }
657
+ // if (this.kbaStep === 'challenge') {
658
+ // const questionNumber = this.kbaChoices.length;
659
+ // const kbaQuestion = this.kbaQuestions[questionNumber];
660
+ // return (
661
+ // <Host class="kba">
662
+ // <div id="verdocs-sign-header">
663
+ // <div class="inner">
664
+ // <img src="https://verdocs.com/assets/white-logo.svg" alt="Verdocs Logo" class="logo" />
665
+ // <div class="title">{this.envelope.name}</div>
666
+ // </div>
667
+ // </div>
668
+ //
669
+ // <div class="document" style={{paddingTop: '15px'}}>
670
+ // <img
671
+ // src="https://public-assets.verdocs.com/loading-placeholder.png"
672
+ // style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}
673
+ // alt="Placeholder page"
674
+ // />
675
+ // </div>
676
+ //
677
+ // <div class="cover">
678
+ // <div class="kba">
679
+ // {this.kbaChoices.length >= this.kbaQuestions.length ? (
680
+ // <verdocs-spinner />
681
+ // ) : (
682
+ // <verdocs-kba-dialog
683
+ // mode="choice"
684
+ // helptitle="Your identity requires additional verification"
685
+ // helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}
686
+ // choices={kbaQuestion?.answer || ['Skip Question']}
687
+ // step={questionNumber + 1}
688
+ // steps={this.kbaQuestions.length}
689
+ // onNext={async (e: any) => {
690
+ // const answer = e.detail as string;
691
+ // this.kbaChoices = [...this.kbaChoices, answer];
692
+ // if (this.kbaChoices.length >= this.kbaQuestions.length) {
693
+ // const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));
694
+ // console.log('Submitting KBA responses', this.kbaChoices, responses);
695
+ // try {
696
+ // const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);
697
+ // console.log('KBA challenge response', response);
698
+ // this.kbaStep = response.kba_step;
699
+ // if (this.kbaStep === 'failed') {
700
+ // this.fatalErrorHeader = 'Identity Verification Failed';
701
+ // this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';
702
+ // this.isDone = true;
703
+ // } else {
704
+ // this.kbaQuestions = (response as any).questions?.question || [];
705
+ // this.kbaChoices = [];
706
+ // }
707
+ // } catch (e) {
708
+ // console.log('Error submitting KBA challenge', e);
709
+ // this.kbaStep = '';
710
+ // this.fatalErrorHeader = 'Unable to Verify Identity';
711
+ // this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';
712
+ // this.isDone = true;
713
+ // }
714
+ // }
715
+ // }}
716
+ // />
717
+ // )}
718
+ // </div>
719
+ // </div>
720
+ // </Host>
721
+ // );
722
+ // }
696
723
  return (h(Host, null, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater && h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) }))), h("div", { class: "document", style: { paddingTop: '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
697
724
  const pageNumbers = integerSequence(1, envelopeDocument.pages);
698
725
  return (h(Fragment, null, pageNumbers.map(pageNumber => {
@@ -855,7 +882,8 @@ export class VerdocsSign {
855
882
  "showFinishLater": {},
856
883
  "agreed": {},
857
884
  "documentsSingularPlural": {},
858
- "kbaStep": {},
885
+ "authStep": {},
886
+ "authDetails": {},
859
887
  "kbaQuestions": {},
860
888
  "showSpinner": {},
861
889
  "kbaChoices": {},