@verdocs/web-sdk 6.8.7 → 6.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Datastore-B-sxWSPD.js → Datastore-C-Pojt3E.js} +3 -3
- package/dist/{esm-es5/Datastore-bS8INhRF.js.map → cjs/Datastore-C-Pojt3E.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-ecG41L2k.js → utils-kkGeJs-8.js} +6 -3
- package/dist/cjs/utils-kkGeJs-8.js.map +1 -0
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +119 -51
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +16 -9
- package/dist/cjs/verdocs-field-payment.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +42 -31
- package/dist/cjs/verdocs-sign.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-signing-progress.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +13 -0
- package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +15 -5
- package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js +15 -5
- package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +15 -5
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +15 -5
- package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +13 -5
- package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-payment/verdocs-field-payment.js +18 -8
- package/dist/collection/components/fields/verdocs-field-payment/verdocs-field-payment.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.js +15 -5
- package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +13 -5
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +15 -5
- package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +15 -5
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js +17 -5
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +38 -27
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
- package/dist/collection/utils/Datastore.js +1 -1
- package/dist/collection/utils/Datastore.js.map +1 -1
- package/dist/collection/utils/utils.js +4 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/{p-CRIrD66O.js → p---tnXjlx.js} +3 -3
- package/dist/components/{p-CRIrD66O.js.map → p---tnXjlx.js.map} +1 -1
- package/dist/components/{p-BgNCVox7.js → p-1oPQs4-S.js} +3 -3
- package/dist/components/{p-BgNCVox7.js.map → p-1oPQs4-S.js.map} +1 -1
- package/dist/components/{p-CFi6VKgU.js → p-2sD6OXzl.js} +19 -10
- package/dist/components/p-2sD6OXzl.js.map +1 -0
- package/dist/components/{p-CWGxLuye.js → p-7dtIf4QF.js} +19 -10
- package/dist/components/p-7dtIf4QF.js.map +1 -0
- package/dist/components/{p-CherENoi.js → p-BCiVZnf0.js} +3 -3
- package/dist/components/{p-CherENoi.js.map → p-BCiVZnf0.js.map} +1 -1
- package/dist/components/{p-DLV8jNf8.js → p-BUaaBFra.js} +17 -10
- package/dist/components/p-BUaaBFra.js.map +1 -0
- package/dist/components/{p-BZRJWqKI.js → p-BVu-nE_L.js} +19 -10
- package/dist/components/p-BVu-nE_L.js.map +1 -0
- package/dist/components/{p-By2QlfRC.js → p-BihWiABu.js} +19 -10
- package/dist/components/p-BihWiABu.js.map +1 -0
- package/dist/components/{p-eZKhg-2i.js → p-BqoZV7Do.js} +3 -3
- package/dist/components/{p-eZKhg-2i.js.map → p-BqoZV7Do.js.map} +1 -1
- package/dist/components/{p-D1tvdWaA.js → p-BrtyCjOf.js} +4 -4
- package/dist/components/{p-D1tvdWaA.js.map → p-BrtyCjOf.js.map} +1 -1
- package/dist/components/{p-tSwumenv.js → p-Bzs-6uU0.js} +3 -3
- package/dist/components/{p-tSwumenv.js.map → p-Bzs-6uU0.js.map} +1 -1
- package/dist/components/{p-Dj_oFCRK.js → p-C02BWoNV.js} +17 -10
- package/dist/components/p-C02BWoNV.js.map +1 -0
- package/dist/{esm/Datastore-bS8INhRF.js → components/p-C7hFgM52.js} +3 -3
- package/dist/components/p-C7hFgM52.js.map +1 -0
- package/dist/components/{p-CjDMm6od.js → p-CD24uAWY.js} +19 -10
- package/dist/components/p-CD24uAWY.js.map +1 -0
- package/dist/components/{p-_igYrwND.js → p-CDR7tIN-.js} +3 -3
- package/dist/components/{p-_igYrwND.js.map → p-CDR7tIN-.js.map} +1 -1
- package/dist/components/{p-tyY7kKNB.js → p-CPIwQCo_.js} +21 -10
- package/dist/components/p-CPIwQCo_.js.map +1 -0
- package/dist/components/{p-CYRfkDZa.js → p-Cj8PYi4t.js} +29 -16
- package/dist/components/p-Cj8PYi4t.js.map +1 -0
- package/dist/components/{p-Bafj7hI1.js → p-Cli5nWln.js} +19 -10
- package/dist/components/p-Cli5nWln.js.map +1 -0
- package/dist/components/{p-Dpu4D5bv.js → p-Cx0Mif05.js} +6 -3
- package/dist/components/p-Cx0Mif05.js.map +1 -0
- package/dist/components/{p-BF4y1YRU.js → p-CzvUUEq1.js} +3 -3
- package/dist/components/{p-BF4y1YRU.js.map → p-CzvUUEq1.js.map} +1 -1
- package/dist/components/{p-DzM2oGUr.js → p-D1TqIILD.js} +19 -10
- package/dist/components/p-D1TqIILD.js.map +1 -0
- package/dist/components/{p-_cxVjdiK.js → p-DNYvorxL.js} +43 -44
- package/dist/components/p-DNYvorxL.js.map +1 -0
- package/dist/components/{p-Cal5IvqT.js → p-DmEzMnt3.js} +3 -3
- package/dist/components/{p-Cal5IvqT.js.map → p-DmEzMnt3.js.map} +1 -1
- package/dist/components/{p-C5fwD53I.js → p-Dz6Xrh7z.js} +3 -3
- package/dist/components/{p-C5fwD53I.js.map → p-Dz6Xrh7z.js.map} +1 -1
- package/dist/components/{p-DaWDoIag.js → p-IJa78J36.js} +4 -4
- package/dist/components/{p-DaWDoIag.js.map → p-IJa78J36.js.map} +1 -1
- package/dist/components/{p-DtpXCLdt.js → p-RdlD8c2P.js} +5 -5
- package/dist/components/{p-DtpXCLdt.js.map → p-RdlD8c2P.js.map} +1 -1
- package/dist/components/{p-DmyvK-Tr.js → p-aH_YLUuP.js} +15 -15
- package/dist/components/{p-DmyvK-Tr.js.map → p-aH_YLUuP.js.map} +1 -1
- package/dist/components/{p-DyfpSDn-.js → p-zAW1BOj6.js} +3 -3
- package/dist/components/{p-DyfpSDn-.js.map → p-zAW1BOj6.js.map} +1 -1
- package/dist/components/verdocs-build.js +21 -21
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelope-recipient-link.js +1 -1
- package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +3 -3
- package/dist/components/verdocs-envelope-update-recipient.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +2 -2
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -1
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-payment.js +20 -11
- package/dist/components/verdocs-field-payment.js.map +1 -1
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-field-textarea.js +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-quick-filter.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign-footer.js +1 -1
- package/dist/components/verdocs-sign.js +5 -5
- package/dist/components/verdocs-signing-progress.js +1 -1
- package/dist/components/verdocs-template-attachments.js +1 -1
- package/dist/components/verdocs-template-build-tabs.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-field-properties.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-template-role-properties.js +1 -1
- package/dist/components/verdocs-template-roles.js +1 -1
- package/dist/components/verdocs-template-settings.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/{components/p-bS8INhRF.js → esm/Datastore-C7hFgM52.js} +3 -3
- package/dist/{cjs/Datastore-B-sxWSPD.js.map → esm/Datastore-C7hFgM52.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-CerrMWqr.js → utils-CPSY5rft.js} +6 -3
- package/dist/esm/utils-CPSY5rft.js.map +1 -0
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +1 -1
- package/dist/esm/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-download-dialog_4.entry.js +2 -2
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_11.entry.js +119 -51
- package/dist/esm/verdocs-field-payment.entry.js +16 -9
- package/dist/esm/verdocs-field-payment.entry.js.map +1 -1
- package/dist/esm/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/esm/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +42 -31
- package/dist/esm/verdocs-sign.entry.js +2 -2
- package/dist/esm/verdocs-signing-progress.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
- package/dist/esm/verdocs-template-settings.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{Datastore-bS8INhRF.js → Datastore-C7hFgM52.js} +2 -2
- package/dist/{esm/Datastore-bS8INhRF.js.map → esm-es5/Datastore-C7hFgM52.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/utils-CPSY5rft.js +2 -0
- package/dist/esm-es5/utils-CPSY5rft.js.map +1 -0
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-download-dialog_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-signing-progress.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-preview/verdocs-preview.d.ts +2 -0
- package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-date/verdocs-field-date.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +1 -1
- package/dist/types/components/fields/verdocs-field-payment/verdocs-field-payment.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-radio/verdocs-field-radio.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-signature/verdocs-field-signature.d.ts +1 -1
- package/dist/types/components/fields/verdocs-field-textarea/verdocs-field-textarea.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +2 -1
- package/dist/types/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.d.ts +2 -1
- package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +3 -2
- package/dist/verdocs-web-sdk/{p-2ff00959.system.entry.js → p-032e8fb0.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fe5aabfb.entry.js → p-04981f9f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7f7da7d6.system.entry.js → p-066eaea8.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-53be15dc.entry.js → p-0b59a4a5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-8229308e.system.entry.js → p-107a1995.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b04c507f.system.entry.js → p-1b5b8ffa.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-be9c544d.system.entry.js → p-2ba8c771.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-2ebc769e.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-2ebc769e.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-5ee3ef82.entry.js → p-311bb5b2.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-069169a7.entry.js → p-3202f0eb.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-edc49225.entry.js → p-3648e4c0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-3648e4c0.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-64b9e2de.entry.js → p-3be22031.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f4c4a49e.system.entry.js → p-4424623c.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7a086c18.entry.js → p-4f820bee.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2fc50938.system.entry.js → p-53530f64.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f1ca6e1c.system.entry.js → p-60cfa50a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-93e9df57.system.entry.js → p-641dbbfa.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-6c8883ff.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-8e8c0110.entry.js.map → p-6c8883ff.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-6d41df5d.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-6d41df5d.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-8062bb99.entry.js → p-6d5af60f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6038e4c1.system.entry.js → p-774961dc.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-63c0f31d.system.entry.js → p-822694c1.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9b367391.system.entry.js → p-91316504.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0c24c1b8.entry.js → p-92b4f218.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-adcbb1c2.entry.js → p-9586b268.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-CC3ukJv1.system.js.map → p-BFC8G6sY.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-LGooaeHw.system.js.map → p-BJ0cUjeu.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-CRk-MpSX.system.js.map → p-BJx8Y9VG.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BUFQbxzf.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-CWh-S6N5.system.js.map → p-BuHYXI2L.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-bS8INhRF.js → p-C7hFgM52.js} +2 -2
- package/dist/verdocs-web-sdk/{p-bS8INhRF.js.map → p-C7hFgM52.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-C9JdpYtM.js +2 -0
- package/dist/verdocs-web-sdk/p-C9JdpYtM.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-COM7km0I.system.js.map → p-CVmJ8lYI.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-Cd268O-w.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-C5U_96FD.system.js.map → p-CyPGia16.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-DGti20Vc.system.js +2 -0
- package/dist/verdocs-web-sdk/p-DGti20Vc.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-BcNo_mbk.system.js.map → p-DmQa-gqf.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-dY2me2i5.system.js.map → p-Dmc2VIXX.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-H1Y4Zb4E.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-C-5pmv-B.system.js.map → p-N4-IQ3Cb.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-wKFmf5bX.system.js.map → p-TQtp_Nv2.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-BvI8gTGk.system.js.map → p-WCWuCFHk.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-ESsv28K0.system.js.map → p-a51WVEiq.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-c0c4b822.entry.js → p-a7e0e67a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-267c890e.entry.js → p-ad41a644.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-333d4a2e.system.entry.js → p-b7d907b4.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-b83472cd.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b83472cd.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-e4b13df9.system.entry.js → p-bcffad7a.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-8d5c3516.entry.js → p-c7bfe2f1.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-d4e3efdb.system.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-d4e3efdb.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-081b245d.system.entry.js → p-d52e6117.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0faa3e84.entry.js → p-e262ea96.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-8b2d4ca5.entry.js → p-f7f33a99.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-lEpx1l-p.system.js → p-fEbwslLK.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-lEpx1l-p.system.js.map → p-fEbwslLK.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-0fcfde01.entry.js → p-fc308ef0.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-fc308ef0.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0-YdlCL1.system.js.map → p-x_N0ZS08.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-DFNdvv2j.system.js.map → p-yFbTWZrj.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-D1RF_rpl.system.js.map → p-yUsULl32.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-field-payment.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/utils-ecG41L2k.js.map +0 -1
- package/dist/components/p-BZRJWqKI.js.map +0 -1
- package/dist/components/p-Bafj7hI1.js.map +0 -1
- package/dist/components/p-By2QlfRC.js.map +0 -1
- package/dist/components/p-CFi6VKgU.js.map +0 -1
- package/dist/components/p-CWGxLuye.js.map +0 -1
- package/dist/components/p-CYRfkDZa.js.map +0 -1
- package/dist/components/p-CjDMm6od.js.map +0 -1
- package/dist/components/p-DLV8jNf8.js.map +0 -1
- package/dist/components/p-Dj_oFCRK.js.map +0 -1
- package/dist/components/p-Dpu4D5bv.js.map +0 -1
- package/dist/components/p-DzM2oGUr.js.map +0 -1
- package/dist/components/p-_cxVjdiK.js.map +0 -1
- package/dist/components/p-bS8INhRF.js.map +0 -1
- package/dist/components/p-tyY7kKNB.js.map +0 -1
- package/dist/esm/utils-CerrMWqr.js.map +0 -1
- package/dist/esm-es5/utils-CerrMWqr.js +0 -2
- package/dist/esm-es5/utils-CerrMWqr.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0fcfde01.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-2e4d6431.system.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-2e4d6431.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-6bbe3f73.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-6bbe3f73.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-8e8c0110.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-B390zQJa.js +0 -2
- package/dist/verdocs-web-sdk/p-B390zQJa.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Bb7iRsoQ.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CT1VA0C-.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CaEXyfjG.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-a6b008ef.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-a6b008ef.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-aaad7b8a.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-aaad7b8a.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-edc49225.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f589tneI.system.js +0 -2
- package/dist/verdocs-web-sdk/p-f589tneI.system.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-2ff00959.system.entry.js.map → p-032e8fb0.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fe5aabfb.entry.js.map → p-04981f9f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7f7da7d6.system.entry.js.map → p-066eaea8.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-53be15dc.entry.js.map → p-0b59a4a5.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8229308e.system.entry.js.map → p-107a1995.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b04c507f.system.entry.js.map → p-1b5b8ffa.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-be9c544d.system.entry.js.map → p-2ba8c771.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-5ee3ef82.entry.js.map → p-311bb5b2.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-069169a7.entry.js.map → p-3202f0eb.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-64b9e2de.entry.js.map → p-3be22031.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f4c4a49e.system.entry.js.map → p-4424623c.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7a086c18.entry.js.map → p-4f820bee.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-2fc50938.system.entry.js.map → p-53530f64.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f1ca6e1c.system.entry.js.map → p-60cfa50a.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-93e9df57.system.entry.js.map → p-641dbbfa.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8062bb99.entry.js.map → p-6d5af60f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-6038e4c1.system.entry.js.map → p-774961dc.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-63c0f31d.system.entry.js.map → p-822694c1.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9b367391.system.entry.js.map → p-91316504.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-0c24c1b8.entry.js.map → p-92b4f218.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-adcbb1c2.entry.js.map → p-9586b268.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c0c4b822.entry.js.map → p-a7e0e67a.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-267c890e.entry.js.map → p-ad41a644.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-333d4a2e.system.entry.js.map → p-b7d907b4.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e4b13df9.system.entry.js.map → p-bcffad7a.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8d5c3516.entry.js.map → p-c7bfe2f1.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-081b245d.system.entry.js.map → p-d52e6117.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-0faa3e84.entry.js.map → p-e262ea96.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8b2d4ca5.entry.js.map → p-f7f33a99.entry.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):o(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=a(0),s["throw"]=a(1),s["return"]=a(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++){if(i||!(r in t)){if(!i)i=Array.prototype.slice.call(t,0,r);i[r]=t[r]}}return e.concat(i||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-BIRwgFLv.js";import{VerdocsEndpoint,getTemplate,integerSequence,getOrganizationContacts,isValidEmail,createEnvelope,formatFullName,getRGBA,createTemplateDocument,deleteTemplateDocument,updateField,createField,updateTemplateRole,createTemplateRole}from"@verdocs/js-sdk";import{a as renderDocumentField,g as getFieldId,h as updateCssTransform,i as removeCssTransform,j as setControlStyles,d as defaultHeight,k as defaultWidth}from"./utils-CerrMWqr.js";import{S as SDKError}from"./errors-C1sRVZWv.js";import{S as Store}from"./Datastore-bS8INhRF.js";import{D as DefaultEndpoint}from"./Environment-C_Xku1v2.js";import{V as VerdocsToast}from"./Toast-D97GxsI-.js";import{a as DocIcon,P as PngIcon,J as JpgIcon,b as PdfIcon,F as FileIcon,c as PageCountIcon,T as TrashIcon,D as DocumentPageIcon}from"./Icons-BU5rnXp2.js";import{i as interact}from"./interact.min-BepJAdBZ.js";import"./index-dzBXqXlK.js";import"./Types-BqoC0yeA.js";import"./_commonjsHelpers-BFTU3MAI.js";var verdocsPreviewCss='verdocs-preview{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var VerdocsPreview=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError");this.templateListenerId=null;this.renderedPages={};this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[PREVIEW] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(r){console.log("[PREVIEW] Error with preview session",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t;var n=e.detail;this.renderedPages["".concat(n.documentId,":").concat(n.pageNumber)]=n;var r=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).filter((function(e){if(e["document_id"]){return e["document_id"]===n.documentId&&e.page===n.pageNumber}return e.page===n.pageNumber}));r.forEach((function(e){return renderDocumentField("template",e,n,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}return h(Host,null,(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){var n=integerSequence(1,t.pages);return h(Fragment,null,n.map((function(n){var r;var o=((r=t.page_sizes)===null||r===void 0?void 0:r[n])||{width:612,height:792};return h("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:n,disabled:true,editable:false,done:false,virtualWidth:o.width,virtualHeight:o.height,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsPreview.style=verdocsPreviewCss;var getRoleNames=function(e){return((e===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.name}))};var getRoleIndex=function(e,t){return Math.max(getRoleNames(e).findIndex((function(e){return e===t})),0)};var verdocsSendCss='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-send .buttons .error-message{width:100%;color:#cc0000;font-size:13px;margin-bottom:10px}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var editIcon='<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>';var startIcon='<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>';var stepIcon='<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>';var doneIcon='<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>';var VerdocsSend=function(){function e(e){registerInstance(this,e);this.beforeSend=createEvent(this,"beforeSend");this.send=createEvent(this,"send");this.exit=createEvent(this,"exit");this.sdkError=createEvent(this,"sdkError");this.searchContacts=createEvent(this,"searchContacts");this.templateListenerId=null;this.endpoint=DefaultEndpoint;this.templateId=null;this.environment="";this.showCancel=true;this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),true,(function(t){console.log("[SEND] Got new template",t);e.template=t;e.loading=false;e.rolesCompleted={};e.recomputeRolesCompleted()}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.onTemplateIdChanged=function(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;var r=this;return __generator(this,(function(o){try{this.endpoint.onSessionChanged((function(e,t,n){if(!n){return}var o={id:n.id,first_name:n.first_name,last_name:n.last_name,email:n.email,phone:n.phone};if(n){r.sessionContacts=[o];getOrganizationContacts(r.endpoint).then((function(e){console.log("[SEND] Got contacts",e);r.sessionContacts=__spreadArray(__spreadArray([],e,true),[o],false)})).catch((function(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[2]}if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(r){console.log("[SEND] Error with send session",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.recomputeRolesCompleted=function(){var e=this;var t;this.rolesCompleted={};var n={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){var r=t.sequence;n[r]||(n[r]=[]);var o="r-".concat(r,"-").concat(n[r].length);n[r].push(__assign(__assign({},t),{id:o,role_name:t.name,first_name:t.first_name,last_name:t.last_name}));if(t.first_name&&isValidEmail(t.email)){e.rolesCompleted[o]=__assign(__assign({},t),{id:o,role_name:t.name,first_name:t.first_name,last_name:t.last_name})}}))};e.prototype.getSequenceNumbers=function(){var e;var t={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((function(e){t[e.sequence]=true}));return Object.keys(t).map((function(e){return+e})).sort((function(e,t){return e-t}))};e.prototype.getRolesAtLevel=function(e){var t;var n=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((function(t){return t.sequence===e})).map((function(t,n){return __assign(__assign({},t),{id:"r-".concat(e,"-").concat(n),role_name:t.name,first_name:t.first_name,last_name:t.last_name})}));return n};e.prototype.getLevelIcon=function(e){if(e==="start"){return h("div",{class:"level-icon",innerHTML:startIcon})}else if(e==="end"){return h("div",{class:"level-icon",innerHTML:doneIcon})}else{return h("div",{class:"level-icon",innerHTML:stepIcon})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var n;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var r={template_id:this.templateId,name:((n=this.template)===null||n===void 0?void 0:n.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted)};var o=this.beforeSend.emit(__assign(__assign({},r),{name:r.name,template:this.template}));if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",r);this.sending=false;return}console.log("[SEND] Creating envelope",r);createEnvelope(this.endpoint,r).then((function(e){var n;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(n=t.send)===null||n===void 0?void 0:n.emit(__assign(__assign({},r),{name:r.name,envelope_id:e.id,envelope:e}))})).catch((function(e){var n,r,o;console.log("[SEND] Send error",e);VerdocsToast(((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)||"Error creating envelope, please try again later.");t.sending=false;(o=t.sdkError)===null||o===void 0?void 0:o.emit(e)}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,{style:{display:"flex"}},h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var n=this.getSequenceNumbers();var r=Object.values(this.rolesCompleted).filter((function(e){return isValidEmail(e.email)&&e.first_name&&e.last_name}));var o=r.length>=getRoleNames(this.template).length;var i=r.map((function(e){return e.email.toLowerCase()}));var s=new Set(i).size<i.length;return h(Host,{class:{sendable:(t=this.template)===null||t===void 0?void 0:t.is_sendable}},h("div",{class:"recipients"},h("div",{class:"left-line"}),h("div",{class:"level level-start"},this.getLevelIcon("start"),h("div",{class:"complete"},"Send Envelope")),n.map((function(t){return h("div",{class:"level level-".concat(t)},e.getLevelIcon("sequence"),e.getRolesAtLevel(t).map((function(t){var n,o,i;var s=!t.email||!t.first_name||!t.last_name;var a=((n=e.rolesCompleted[t.id])===null||n===void 0?void 0:n.first_name)?formatFullName(e.rolesCompleted[t.id]):s?t.role_name:formatFullName(t);var l="verdocs-send-recipient-".concat(t.role_name);var c=getRoleIndex(e.template,t.role_name);var d=getRGBA(c);var u=r.findIndex((function(e){return e.role_name===t.role_name}))>-1;var f={backgroundColor:d,border:u?"2px solid #55bc81":"2px solid #dddddd"};return s?h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(n){return e.handleClickRole(n,t)},id:l},a,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:l,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(o=e.rolesCompleted[t.id])!==null&&o!==void 0?o:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}}))):h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(n){return e.handleClickRole(n,t)},id:l},a,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:l,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(i=e.rolesCompleted[t.id])!==null&&i!==void 0?i:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}})))})))})),h("div",{class:"level level-done"},this.getLevelIcon("end"),h("div",{class:"complete"},"Signing Complete"))),h("div",{class:"buttons"},s&&h("div",{class:"error-message"},"Recipients cannot share the same email."),this.showCancel&&h("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),h("verdocs-button",{label:"Send",size:"small",disabled:!o||this.sending||s,onClick:function(t){return e.handleSend(t)}}),this.sending&&h("verdocs-spinner",null)))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsSend.style=verdocsSendCss;var verdocsTemplateAttachmentsCss='verdocs-template-attachments{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-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;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var VerdocsTemplateAttachments=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit");this.next=createEvent(this,"next");this.templateUpdated=createEvent(this,"templateUpdated");this.sdkError=createEvent(this,"sdkError");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}this.listenToTemplate()}catch(r){console.log("[TEMPLATE ATTACHMENTS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();i=e.detail.file;if(!i){return[2]}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,createTemplateDocument(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this))];case 2:s=c.sent();console.log("[ATTACHMENTS] Created attachment",s);a=this;return[4,Store.getTemplate(this.endpoint,this.templateId,true)];case 3:a.template=c.sent();console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:l=c.sent();console.log("[ATTACHMENTS] Error creating template",l);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(l.message,(r=l.response)===null||r===void 0?void 0:r.status,(o=l.response)===null||o===void 0?void 0:o.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.template})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,deleteTemplateDocument(this.endpoint,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,Store.getTemplate(this.endpoint,this.templateId,true)];case 2:e.template=t.sent();console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){if((((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return PdfIcon;case"image/jpeg":return JpgIcon;case"image/png":return PngIcon;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return DocIcon}return FileIcon};e.prototype.render=function(){var e=this;var t,n;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return h(Host,{class:"loading"},h("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return h(Host,{class:"empty"})}return h(Host,null,h("h5",null,"Existing Attachments"),h("div",{class:"attachments"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){return h("div",{class:"attachment"},h("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),h("div",{class:"filename",title:t.name},t.name),h("div",{class:"pages"},h("div",{class:"count"},t.pages),h("div",{class:"pages-icon",innerHTML:PageCountIcon})),h("div",{class:"trash-icon",innerHTML:TrashIcon,onClick:function(){return e.handleDelete(t)}}))}))),h("h5",null,"Attach a New Document"),this.uploading?h("div",{class:"loader-wrapper"},h("verdocs-loader",null),this.progressLabel&&h("div",{class:"progress-wrapper"},h("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):h("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),h("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!(((n=this.template)===null||n===void 0?void 0:n.documents)||[]).length||this.uploading})),this.showDeleteError&&h("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&h("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}();VerdocsTemplateAttachments.style=verdocsTemplateAttachmentsCss;var verdocsTemplateBuildTabsCss='verdocs-template-build-tabs{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end;-ms-flex:0 0 50px;flex:0 0 50px;width:100%;background:#ffffff;color:#72757d;border-bottom:1px solid #dddddd;-webkit-filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-build-tabs .tab{position:relative;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:50px;padding:0 4px;background:#e7e7e7;font-weight:700;font-size:12px;cursor:pointer}@media (min-width: 768px){verdocs-template-build-tabs .tab{padding:0 8px 0 24px;font-size:14px}}verdocs-template-build-tabs .tab svg{position:absolute;top:0;right:-19px;z-index:10;pointer-events:none;display:none}@media (min-width: 768px){verdocs-template-build-tabs .tab svg{display:block}}verdocs-template-build-tabs .tab.active{background:#ffffff;color:#707ae5}verdocs-template-build-tabs .tab.disabled{cursor:default;color:#d1d5db}';var VerdocsTemplateBuildTabs=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError");this.stepChanged=createEvent(this,"stepChanged");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[BUILD_TABS] Template ID changed",e);this.listenToTemplate()};e.prototype.onStepChanged=function(e){console.log("[BUILD_TABS] Step changed",e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="attachments";console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");return[2]}this.listenToTemplate()}catch(r){console.log("[BUILD_TABS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.handleSelect=function(e){var t;if(e.disabled||e.id===this.step){return}this.step=e.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.id)};e.prototype.render=function(){var e=this;var t,n,r;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var o=(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>0;var i=o&&(((n=this.template)===null||n===void 0?void 0:n.roles)||[]).length>0;var s=i&&(((r=this.template)===null||r===void 0?void 0:r.fields)||[]).length>0;var a=[{id:"attachments",label:"Attachments",disabled:false},{id:"roles",label:"Workflow",disabled:!o},{id:"fields",label:"Fields",disabled:!i},{id:"preview",label:"Preview & Send",disabled:!s}];return h(Host,null,a.map((function(t){var n=t.id===e.step;var r=["tab"];if(n)r.push("active");if(t.disabled)r.push("disabled");return h("div",{class:r.join(" "),onClick:function(){return e.handleSelect(t)}},h("span",null,t.label),h("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"19",height:"50",viewBox:"0 0 19 50"},h("polygon",{points:"0,0 19,25 0,50",fill:n?"#ffffff":"#e7e7e7"})))})))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateBuildTabs.style=verdocsTemplateBuildTabsCss;var verdocsTemplateFieldsCss="verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-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)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-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-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";var iconTextbox='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';var iconCheck='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';var iconRadio='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';var iconDatepicker='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';var iconSignature='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var iconInitial='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';var iconDropdown='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';var iconAttachment='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';var separator='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';var menuOptions=[{id:"signature",tooltip:"Signature",icon:iconSignature,class:"signature"},{id:"initial",tooltip:"Initials",icon:iconInitial,class:"initial"},{id:"sep1",tooltip:"",icon:separator,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:iconTextbox,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:iconCheck,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:iconRadio,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:iconDropdown,class:"dropdown"},{id:"sep2",tooltip:"",icon:separator,class:"separator"},{id:"date",tooltip:"Date",icon:iconDatepicker,class:"date"},{id:"attachment",tooltip:"Attachment",icon:iconAttachment,class:"attachment"}];var VerdocsTemplateFields=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError");this.templateUpdated=createEvent(this,"templateUpdated");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}e.prototype.onTemplateIdChanged=function(){this.listenToTemplate()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return[2]}this.listenToTemplate()}catch(r){console.log("[FIELDS] Error with fields session",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.componentDidRender=function(){interact.dynamicDrop(true);var e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}};e.prototype.componentWillUpdate=function(){var e=this;var t,n;var r=__spreadArray([],((t=this.template)===null||t===void 0?void 0:t.roles)||[],true).sort((function(e,t){var n,r;return((n=e.sequence)!==null&&n!==void 0?n:0)-((r=t.sequence)!==null&&r!==void 0?r:0)}));if(!this.selectedRoleName||!r.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((n=r[0])===null||n===void 0?void 0:n.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){var n;e.template=t;e.loading=false;if(!e.selectedRoleName){var r=__spreadArray([],t.roles||[],true).sort((function(e,t){var n,r;return((n=e.sequence)!==null&&n!==void 0?n:0)-((r=t.sequence)!==null&&r!==void 0?r:0)}));e.selectedRoleName=((n=r[0])===null||n===void 0?void 0:n.name)||""}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.attachFieldAttributes=function(e,t,n){var r=this;n.addEventListener("settingsChanged",(function(){var e;console.log("[FIELDS] Field settings changed, updating template...");(e=r.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:r.endpoint,template:r.template,event:"updated-field"})}));n.addEventListener("deleted",(function(){var e;n.remove();console.log("[FIELDS] Field deleted, updating template...");(e=r.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:r.endpoint,template:r.template,event:"deleted-field"})}));n.setAttribute("templateid",this.templateId);n.setAttribute("fieldname",t.name);n.setAttribute("documentid",String(e.documentId));n.setAttribute("pageNumber",String(e.pageNumber));n.setAttribute("pagenumber",String(t.page));n.setAttribute("xScale",String(e.xScale));n.setAttribute("yScale",String(e.yScale));n.setAttribute("name",t.name);this.makeDraggable(n)};e.prototype.handlePageRendered=function(e){var t=this;var n,r;var o,i;var s=e.detail;console.log("[FIELDS] Page rendered",s.documentId,s.pageNumber,s.xScale,s.yScale);(n=(o=this.cachedPageInfo)[i=s.documentId])!==null&&n!==void 0?n:o[i]={};this.cachedPageInfo[s.documentId][s.pageNumber]=s;this.pageHeights[s.pageNumber]=s.naturalHeight;(((r=this.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(e){return e&&e.page===s.pageNumber})).forEach((function(e){var n=getFieldId(e);var r=document.getElementById(n);if(r){t.attachFieldAttributes(s,e,r)}}))};e.prototype.makeDraggable=function(e){interact(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i,s;return __generator(this,(function(a){t=+(e.target.getAttribute("posX")||0);n=+(e.target.getAttribute("posY")||0);r=+(e.target.getAttribute("xScale")||1);o=+(e.target.getAttribute("yScale")||1);i=e.dx/r+t;s=e.dy/o+n;e.target.setAttribute("posX",i);e.target.setAttribute("posy",s);updateCssTransform(e.target,"translate","".concat(i,"px, ").concat(s,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,l,c,d,u,f,h,v,p,g,m,x,b,E,w,S,_,y,I,C,T,k,D,q,M,R,A,O,P,H,L,V,z,F;return __generator(this,(function(Z){switch(Z.label){case 0:c=e.target.getAttribute("fieldname");d=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((function(e){return e.name===c}));if(!d){console.log("[FIELDS] Unable to find field",c,e.target);return[2]}u=e.target.getAttribute("pagenumber");f=e.target.getAttribute("documentid");h=this.cachedPageInfo[f][u],v=h.naturalWidth,p=v===void 0?612:v,g=h.naturalHeight,m=g===void 0?792:g,x=h.renderedHeight,b=x===void 0?792:x;E=e.target.getBoundingClientRect();w=e.target.parentElement;S=w.getBoundingClientRect();_=d.width||defaultWidth(d.type);y=d.height||defaultHeight(d.type);I=Math.max(E.left-S.left,0);C=Math.max(b-(S.bottom-E.bottom),0);T=parseInt(u);if(C>b){T=Math.min(T+1,((o=(r=((n=this.template)===null||n===void 0?void 0:n.documents)||[])===null||r===void 0?void 0:r[0])===null||o===void 0?void 0:o.pages)||1);C-=b;b=this.cachedPageInfo[f][T].renderedHeight;console.log("Next page",{newPageNumber:T,newY:C,renderedHeight:b})}else if(C<0){T=Math.max(T-1,1);b=this.cachedPageInfo[f][T].renderedHeight;C+=b;console.log("[FIELDS] Next page",{newPageNumber:T,newY:C,renderedHeight:b})}k=this.viewCoordinatesToPageCoordinates(I,C,f,u,p-_,m-y),D=k.x,q=k.y;Z.label=1;case 1:Z.trys.push([1,3,,4]);M={x:D,y:q,page:T};return[4,updateField(this.endpoint,this.templateId,c,M)];case 2:R=Z.sent();console.log("[FIELDS] Updated",R);A=JSON.parse(JSON.stringify(this.template));O=A.fields.findIndex((function(e){return e.name===c}));if(O>-1){A.fields[O]=R}Store.updateTemplate(this.templateId,A);e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);P=this.cachedPageInfo[f][u],H=P.xScale,L=H===void 0?1:H,V=P.yScale,z=V===void 0?1:V;setControlStyles(e.target,R,L,z);(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:A,event:"updated-field"});return[3,4];case 3:F=Z.sent();VerdocsToast("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",F);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(F.message,(a=F.response)===null||a===void 0?void 0:a.status,(l=F.response)===null||l===void 0?void 0:l.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);return[3,4];case 4:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var n;var r=1;var o;do{o="".concat(e,"P").concat(t,"-").concat(r);r++}while((((n=this.template)===null||n===void 0?void 0:n.fields)||[]).some((function(e){return e&&e.name===o})));return o};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,n,r,o,i){var s=this.cachedPageInfo[n][r],a=s.xScale,l=a===void 0?1:a,c=s.yScale,d=c===void 0?1:c,u=s.renderedHeight,f=u===void 0?792:u;var h=Math.floor(Math.min(e/l,o));var v=Math.floor(Math.min(Math.max(f-t,0)/d,i));return{x:h,y:v}};e.prototype.handleClickPage=function(e,t,n){return __awaiter(this,void 0,void 0,(function(){var r,o,i,s,a,l,c,d,u,f,h,v,p,g,m,x;return __generator(this,(function(b){switch(b.label){case 0:if(!this.placing)return[3,2];console.log("Placing field",{documentId:t,pageNumber:n});o=e.offsetX;i=e.offsetY;s=defaultWidth(this.placing);a=defaultHeight(this.placing);l=this.cachedPageInfo[t][n];c=l.naturalWidth,d=c===void 0?612:c,u=l.naturalHeight,f=u===void 0?792:u;h=this.viewCoordinatesToPageCoordinates(o,i,t,n,d-s,f-a);v=Math.floor(h.x);p=Math.floor(h.y);g={name:this.generateFieldName(this.placing,n),role_name:this.selectedRoleName,template_id:this.templateId,document_id:l.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:n,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:v,y:p,width:s,height:a,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};console.log("[FIELDS] Will save new field",g);return[4,createField(this.endpoint,this.templateId,g)];case 1:m=b.sent();console.log("[FIELDS] Saved field",m);x=JSON.parse(JSON.stringify(this.template));x.fields.push(m);Store.updateTemplate(this.templateId,x);(r=this.templateUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,template:x,event:"added-field"});this.placing=null;b.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var n,r,o;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var i=__spreadArray([],((n=this.template)===null||n===void 0?void 0:n.roles)||[],true).sort((function(e,t){var n,r;return((n=e.sequence)!==null&&n!==void 0?n:0)-((r=t.sequence)!==null&&r!==void 0?r:0)}));var s=i.map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return h(Host,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},h("div",{id:"verdocs-template-fields-toolbar"},h("div",{class:"add-for"},"Add field:"),h("verdocs-select-input",{value:this.selectedRoleName,options:s,onInput:function(e){return t.selectedRoleName=e.target.value}}),menuOptions.map((function(e){return h("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),h("div",{class:"pages"},(((r=this.template)===null||r===void 0?void 0:r.documents)||[]).map((function(e){var n=integerSequence(1,e.pages);return n.map((function(n){var r;var o=e.page_sizes[n];return h(Fragment,null,((r=t.template)===null||r===void 0?void 0:r.documents.length)>1&&h("div",{class:"document-separator"},h("div",{innerHTML:DocumentPageIcon}),h("span",null,e.name)),h("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:n,virtualWidth:(o===null||o===void 0?void 0:o.width)||612,virtualHeight:(o===null||o===void 0?void 0:o.height)||792,disabled:true,editable:true,done:false,onClick:function(r){return t.handleClickPage(r,e.id,n)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&h("verdocs-ok-dialog",{heading:"Unable to add field",message:(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:function(){return t.showMustSelectRole=false}}))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateFields.style=verdocsTemplateFieldsCss;
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):o(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=a(0),s["throw"]=a(1),s["return"]=a(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++){if(i||!(r in t)){if(!i)i=Array.prototype.slice.call(t,0,r);i[r]=t[r]}}return e.concat(i||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-BIRwgFLv.js";import{i as interact}from"./interact.min-BepJAdBZ.js";import{VerdocsEndpoint,getTemplate,integerSequence,getOrganizationContacts,isValidEmail,createEnvelope,formatFullName,getRGBA,createTemplateDocument,deleteTemplateDocument,updateField,createField,updateTemplateRole,createTemplateRole}from"@verdocs/js-sdk";import{a as renderDocumentField,g as getFieldId,h as updateCssTransform,i as removeCssTransform,j as setControlStyles,d as defaultHeight,k as defaultWidth}from"./utils-CPSY5rft.js";import{S as SDKError}from"./errors-C1sRVZWv.js";import{S as Store}from"./Datastore-C7hFgM52.js";import{D as DefaultEndpoint}from"./Environment-C_Xku1v2.js";import{V as VerdocsToast}from"./Toast-D97GxsI-.js";import{a as DocIcon,P as PngIcon,J as JpgIcon,b as PdfIcon,F as FileIcon,c as PageCountIcon,T as TrashIcon,D as DocumentPageIcon}from"./Icons-BU5rnXp2.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-BqoC0yeA.js";var verdocsPreviewCss='verdocs-preview{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var VerdocsPreview=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError");this.templateListenerId=null;this.renderedPages={};this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[PREVIEW] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(r){console.log("[PREVIEW] Error with preview session",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.componentDidRender=function(){var e;(e=this.hostEl)===null||e===void 0?void 0:e.querySelectorAll(".verdocs-field").forEach((function(e){interact(e).unset()}))};e.prototype.handlePageRendered=function(e){var t;var n=e.detail;this.renderedPages["".concat(n.documentId,":").concat(n.pageNumber)]=n;var r=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).filter((function(e){if(e["document_id"]){return e["document_id"]===n.documentId&&e.page===n.pageNumber}return e.page===n.pageNumber}));r.forEach((function(e){return renderDocumentField("template",e,n,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}return h(Host,null,(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){var n=integerSequence(1,t.pages);return h(Fragment,null,n.map((function(n){var r;var o=((r=t.page_sizes)===null||r===void 0?void 0:r[n])||{width:612,height:792};return h("verdocs-template-document-page",{templateId:t.template_id,documentId:t.id,pageNumber:n,disabled:true,editable:false,done:false,virtualWidth:o.width,virtualHeight:o.height,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))};Object.defineProperty(e.prototype,"hostEl",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsPreview.style=verdocsPreviewCss;var getRoleNames=function(e){return((e===null||e===void 0?void 0:e.roles)||[]).map((function(e){return e.name}))};var getRoleIndex=function(e,t){return Math.max(getRoleNames(e).findIndex((function(e){return e===t})),0)};var verdocsSendCss='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-send .buttons .error-message{width:100%;color:#cc0000;font-size:13px;margin-bottom:10px}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var editIcon='<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>';var startIcon='<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>';var stepIcon='<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>';var doneIcon='<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>';var VerdocsSend=function(){function e(e){registerInstance(this,e);this.beforeSend=createEvent(this,"beforeSend");this.send=createEvent(this,"send");this.exit=createEvent(this,"exit");this.sdkError=createEvent(this,"sdkError");this.searchContacts=createEvent(this,"searchContacts");this.templateListenerId=null;this.endpoint=DefaultEndpoint;this.templateId=null;this.environment="";this.showCancel=true;this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),true,(function(t){console.log("[SEND] Got new template",t);e.template=t;e.loading=false;e.rolesCompleted={};e.recomputeRolesCompleted()}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.onTemplateIdChanged=function(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;var r=this;return __generator(this,(function(o){try{this.endpoint.onSessionChanged((function(e,t,n){if(!n){return}var o={id:n.id,first_name:n.first_name,last_name:n.last_name,email:n.email,phone:n.phone};if(n){r.sessionContacts=[o];getOrganizationContacts(r.endpoint).then((function(e){console.log("[SEND] Got contacts",e);r.sessionContacts=__spreadArray(__spreadArray([],e,true),[o],false)})).catch((function(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[2]}if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}this.listenToTemplate()}catch(r){console.log("[SEND] Error with send session",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.recomputeRolesCompleted=function(){var e=this;var t;this.rolesCompleted={};var n={};(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).forEach((function(t){var r=t.sequence;n[r]||(n[r]=[]);var o="r-".concat(r,"-").concat(n[r].length);n[r].push(__assign(__assign({},t),{id:o,role_name:t.name,first_name:t.first_name,last_name:t.last_name}));if(t.first_name&&isValidEmail(t.email)){e.rolesCompleted[o]=__assign(__assign({},t),{id:o,role_name:t.name,first_name:t.first_name,last_name:t.last_name})}}))};e.prototype.getSequenceNumbers=function(){var e;var t={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((function(e){t[e.sequence]=true}));return Object.keys(t).map((function(e){return+e})).sort((function(e,t){return e-t}))};e.prototype.getRolesAtLevel=function(e){var t;var n=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((function(t){return t.sequence===e})).map((function(t,n){return __assign(__assign({},t),{id:"r-".concat(e,"-").concat(n),role_name:t.name,first_name:t.first_name,last_name:t.last_name})}));return n};e.prototype.getLevelIcon=function(e){if(e==="start"){return h("div",{class:"level-icon",innerHTML:startIcon})}else if(e==="end"){return h("div",{class:"level-icon",innerHTML:doneIcon})}else{return h("div",{class:"level-icon",innerHTML:stepIcon})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var n;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var r={template_id:this.templateId,name:((n=this.template)===null||n===void 0?void 0:n.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted)};var o=this.beforeSend.emit(__assign(__assign({},r),{name:r.name,template:this.template}));if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",r);this.sending=false;return}console.log("[SEND] Creating envelope",r);createEnvelope(this.endpoint,r).then((function(e){var n;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(n=t.send)===null||n===void 0?void 0:n.emit(__assign(__assign({},r),{name:r.name,envelope_id:e.id,envelope:e}))})).catch((function(e){var n,r,o;console.log("[SEND] Send error",e);VerdocsToast(((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)||"Error creating envelope, please try again later.");t.sending=false;(o=t.sdkError)===null||o===void 0?void 0:o.emit(e)}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,{style:{display:"flex"}},h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var n=this.getSequenceNumbers();var r=Object.values(this.rolesCompleted).filter((function(e){return isValidEmail(e.email)&&e.first_name&&e.last_name}));var o=r.length>=getRoleNames(this.template).length;var i=r.map((function(e){return e.email.toLowerCase()}));var s=new Set(i).size<i.length;return h(Host,{class:{sendable:(t=this.template)===null||t===void 0?void 0:t.is_sendable}},h("div",{class:"recipients"},h("div",{class:"left-line"}),h("div",{class:"level level-start"},this.getLevelIcon("start"),h("div",{class:"complete"},"Send Envelope")),n.map((function(t){return h("div",{class:"level level-".concat(t)},e.getLevelIcon("sequence"),e.getRolesAtLevel(t).map((function(t){var n,o,i;var s=!t.email||!t.first_name||!t.last_name;var a=((n=e.rolesCompleted[t.id])===null||n===void 0?void 0:n.first_name)?formatFullName(e.rolesCompleted[t.id]):s?t.role_name:formatFullName(t);var l="verdocs-send-recipient-".concat(t.role_name);var c=getRoleIndex(e.template,t.role_name);var d=getRGBA(c);var u=r.findIndex((function(e){return e.role_name===t.role_name}))>-1;var f={backgroundColor:d,border:u?"2px solid #55bc81":"2px solid #dddddd"};return s?h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(n){return e.handleClickRole(n,t)},id:l},a,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:l,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(o=e.rolesCompleted[t.id])!==null&&o!==void 0?o:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}}))):h("div",{class:"recipient","data-ri":c,"data-rn":t.role_name,style:f,onClick:function(n){return e.handleClickRole(n,t)},id:l},a,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-portal",{anchor:l,onClickAway:function(){return e.showPickerForId=""}},h("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(i=e.rolesCompleted[t.id])!==null&&i!==void 0?i:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}})))})))})),h("div",{class:"level level-done"},this.getLevelIcon("end"),h("div",{class:"complete"},"Signing Complete"))),h("div",{class:"buttons"},s&&h("div",{class:"error-message"},"Recipients cannot share the same email."),this.showCancel&&h("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),h("verdocs-button",{label:"Send",size:"small",disabled:!o||this.sending||s,onClick:function(t){return e.handleSend(t)}}),this.sending&&h("verdocs-spinner",null)))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsSend.style=verdocsSendCss;var verdocsTemplateAttachmentsCss='verdocs-template-attachments{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-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;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var VerdocsTemplateAttachments=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit");this.next=createEvent(this,"next");this.templateUpdated=createEvent(this,"templateUpdated");this.sdkError=createEvent(this,"sdkError");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}this.listenToTemplate()}catch(r){console.log("[TEMPLATE ATTACHMENTS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,l;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();i=e.detail.file;if(!i){return[2]}console.log("[ATTACHMENTS] Uploading...",i);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,createTemplateDocument(this.endpoint,this.templateId,i,this.handleUploadProgress.bind(this))];case 2:s=c.sent();console.log("[ATTACHMENTS] Created attachment",s);a=this;return[4,Store.getTemplate(this.endpoint,this.templateId,true)];case 3:a.template=c.sent();console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:l=c.sent();console.log("[ATTACHMENTS] Error creating template",l);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(l.message,(r=l.response)===null||r===void 0?void 0:r.status,(o=l.response)===null||o===void 0?void 0:o.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.template})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,deleteTemplateDocument(this.endpoint,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,Store.getTemplate(this.endpoint,this.templateId,true)];case 2:e.template=t.sent();console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){if((((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return PdfIcon;case"image/jpeg":return JpgIcon;case"image/png":return PngIcon;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return DocIcon}return FileIcon};e.prototype.render=function(){var e=this;var t,n;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return h(Host,{class:"loading"},h("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return h(Host,{class:"empty"})}return h(Host,null,h("h5",null,"Existing Attachments"),h("div",{class:"attachments"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((function(t){return h("div",{class:"attachment"},h("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),h("div",{class:"filename",title:t.name},t.name),h("div",{class:"pages"},h("div",{class:"count"},t.pages),h("div",{class:"pages-icon",innerHTML:PageCountIcon})),h("div",{class:"trash-icon",innerHTML:TrashIcon,onClick:function(){return e.handleDelete(t)}}))}))),h("h5",null,"Attach a New Document"),this.uploading?h("div",{class:"loader-wrapper"},h("verdocs-loader",null),this.progressLabel&&h("div",{class:"progress-wrapper"},h("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):h("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),h("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!(((n=this.template)===null||n===void 0?void 0:n.documents)||[]).length||this.uploading})),this.showDeleteError&&h("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&h("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}();VerdocsTemplateAttachments.style=verdocsTemplateAttachmentsCss;var verdocsTemplateBuildTabsCss='verdocs-template-build-tabs{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end;-ms-flex:0 0 50px;flex:0 0 50px;width:100%;background:#ffffff;color:#72757d;border-bottom:1px solid #dddddd;-webkit-filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-build-tabs .tab{position:relative;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:50px;padding:0 4px;background:#e7e7e7;font-weight:700;font-size:12px;cursor:pointer}@media (min-width: 768px){verdocs-template-build-tabs .tab{padding:0 8px 0 24px;font-size:14px}}verdocs-template-build-tabs .tab svg{position:absolute;top:0;right:-19px;z-index:10;pointer-events:none;display:none}@media (min-width: 768px){verdocs-template-build-tabs .tab svg{display:block}}verdocs-template-build-tabs .tab.active{background:#ffffff;color:#707ae5}verdocs-template-build-tabs .tab.disabled{cursor:default;color:#d1d5db}';var VerdocsTemplateBuildTabs=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError");this.stepChanged=createEvent(this,"stepChanged");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.onTemplateIdChanged=function(e){console.log("[BUILD_TABS] Template ID changed",e);this.listenToTemplate()};e.prototype.onStepChanged=function(e){console.log("[BUILD_TABS] Step changed",e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="attachments";console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");return[2]}this.listenToTemplate()}catch(r){console.log("[BUILD_TABS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.handleSelect=function(e){var t;if(e.disabled||e.id===this.step){return}this.step=e.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.id)};e.prototype.render=function(){var e=this;var t,n,r;if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var o=(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>0;var i=o&&(((n=this.template)===null||n===void 0?void 0:n.roles)||[]).length>0;var s=i&&(((r=this.template)===null||r===void 0?void 0:r.fields)||[]).length>0;var a=[{id:"attachments",label:"Attachments",disabled:false},{id:"roles",label:"Workflow",disabled:!o},{id:"fields",label:"Fields",disabled:!i},{id:"preview",label:"Preview & Send",disabled:!s}];return h(Host,null,a.map((function(t){var n=t.id===e.step;var r=["tab"];if(n)r.push("active");if(t.disabled)r.push("disabled");return h("div",{class:r.join(" "),onClick:function(){return e.handleSelect(t)}},h("span",null,t.label),h("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"19",height:"50",viewBox:"0 0 19 50"},h("polygon",{points:"0,0 19,25 0,50",fill:n?"#ffffff":"#e7e7e7"})))})))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateBuildTabs.style=verdocsTemplateBuildTabsCss;var verdocsTemplateFieldsCss="verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-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)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-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-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";var iconTextbox='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';var iconCheck='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';var iconRadio='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';var iconDatepicker='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';var iconSignature='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var iconInitial='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';var iconDropdown='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';var iconAttachment='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';var separator='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';var menuOptions=[{id:"signature",tooltip:"Signature",icon:iconSignature,class:"signature"},{id:"initial",tooltip:"Initials",icon:iconInitial,class:"initial"},{id:"sep1",tooltip:"",icon:separator,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:iconTextbox,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:iconCheck,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:iconRadio,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:iconDropdown,class:"dropdown"},{id:"sep2",tooltip:"",icon:separator,class:"separator"},{id:"date",tooltip:"Date",icon:iconDatepicker,class:"date"},{id:"attachment",tooltip:"Attachment",icon:iconAttachment,class:"attachment"}];var VerdocsTemplateFields=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError");this.templateUpdated=createEvent(this,"templateUpdated");this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}e.prototype.onTemplateIdChanged=function(){this.listenToTemplate()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.handleFieldSettingsChanged=function(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})};e.prototype.handleFieldDeleted=function(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return[2]}this.listenToTemplate()}catch(r){console.log("[FIELDS] Error with fields session",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.componentDidRender=function(){var e=this;interact.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((function(t){e.makeDraggable(t)}));var t=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var n=document.getElementById("verdocs-template-fields-toolbar");if(t&&n){n.remove();t.append(n)}};e.prototype.componentWillUpdate=function(){var e=this;var t,n;var r=__spreadArray([],((t=this.template)===null||t===void 0?void 0:t.roles)||[],true).sort((function(e,t){var n,r;return((n=e.sequence)!==null&&n!==void 0?n:0)-((r=t.sequence)!==null&&r!==void 0?r:0)}));if(!this.selectedRoleName||!r.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((n=r[0])===null||n===void 0?void 0:n.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.disconnectedCallback=function(){this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){var n;console.log("Template updated");e.template=t;e.loading=false;if(!e.selectedRoleName){var r=__spreadArray([],t.roles||[],true).sort((function(e,t){var n,r;return((n=e.sequence)!==null&&n!==void 0?n:0)-((r=t.sequence)!==null&&r!==void 0?r:0)}));e.selectedRoleName=((n=r[0])===null||n===void 0?void 0:n.name)||""}}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.handlePageRendered=function(e){var t=this;var n,r;var o,i;var s=e.detail;console.log("[FIELDS] Page rendered",s.documentId,s.pageNumber,s.xScale,s.yScale);(n=(o=this.cachedPageInfo)[i=s.documentId])!==null&&n!==void 0?n:o[i]={};this.cachedPageInfo[s.documentId][s.pageNumber]=s;this.pageHeights[s.pageNumber]=s.naturalHeight;(((r=this.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(e){return e&&e.page===s.pageNumber})).forEach((function(e){var n=getFieldId(e);var r=document.getElementById(n);if(r){r.setAttribute("templateid",t.templateId);r.setAttribute("fieldname",e.name);r.setAttribute("documentid",String(e.document_id));r.setAttribute("pagenumber",String(e.page));r.setAttribute("xScale",String(s.xScale));r.setAttribute("yScale",String(s.yScale));t.makeDraggable(r)}}))};e.prototype.makeDraggable=function(e){interact(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i,s;return __generator(this,(function(a){t=+(e.target.getAttribute("posX")||0);n=+(e.target.getAttribute("posY")||0);r=+(e.target.getAttribute("xScale")||1);o=+(e.target.getAttribute("yScale")||1);i=e.dx/r+t;s=e.dy/o+n;e.target.setAttribute("posX",i);e.target.setAttribute("posy",s);updateCssTransform(e.target,"translate","".concat(i,"px, ").concat(s,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,l,c,d,u,f,h,v,p,g,m,x,b,E,w,S,_,y,I,C,T,k,D,q,M,R,A,O,P,H,L,V,z,Z;return __generator(this,(function(j){switch(j.label){case 0:c=e.target.getAttribute("fieldname");d=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((function(e){return e.name===c}));if(!d){console.log("[FIELDS] Unable to find field",c,e.target);return[2]}u=e.target.getAttribute("pagenumber");f=e.target.getAttribute("documentid");h=this.cachedPageInfo[f][u],v=h.naturalWidth,p=v===void 0?612:v,g=h.naturalHeight,m=g===void 0?792:g,x=h.renderedHeight,b=x===void 0?792:x;E=e.target.getBoundingClientRect();w=e.target.parentElement;S=w.getBoundingClientRect();_=d.width||defaultWidth(d.type);y=d.height||defaultHeight(d.type);I=Math.max(E.left-S.left,0);C=Math.max(b-(S.bottom-E.bottom),0);T=parseInt(u);if(C>b){T=Math.min(T+1,((o=(r=((n=this.template)===null||n===void 0?void 0:n.documents)||[])===null||r===void 0?void 0:r[0])===null||o===void 0?void 0:o.pages)||1);C-=b;b=this.cachedPageInfo[f][T].renderedHeight;console.log("Next page",{newPageNumber:T,newY:C,renderedHeight:b})}else if(C<0){T=Math.max(T-1,1);b=this.cachedPageInfo[f][T].renderedHeight;C+=b;console.log("[FIELDS] Next page",{newPageNumber:T,newY:C,renderedHeight:b})}k=this.viewCoordinatesToPageCoordinates(I,C,f,u,p-_,m-y),D=k.x,q=k.y;j.label=1;case 1:j.trys.push([1,3,,4]);M={x:D,y:q,page:T};return[4,updateField(this.endpoint,this.templateId,c,M)];case 2:R=j.sent();console.log("[FIELDS] Updated",R);A=JSON.parse(JSON.stringify(this.template));O=A.fields.findIndex((function(e){return e.name===c}));if(O>-1){A.fields[O]=R}Store.updateTemplate(this.templateId,A);e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);P=this.cachedPageInfo[f][u],H=P.xScale,L=H===void 0?1:H,V=P.yScale,z=V===void 0?1:V;setControlStyles(e.target,R,L,z);(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:A,event:"updated-field"});return[3,4];case 3:Z=j.sent();VerdocsToast("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",Z);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(Z.message,(a=Z.response)===null||a===void 0?void 0:a.status,(l=Z.response)===null||l===void 0?void 0:l.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");removeCssTransform(e.target);return[3,4];case 4:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var n;var r=1;var o;do{o="".concat(e,"P").concat(t,"-").concat(r);r++}while((((n=this.template)===null||n===void 0?void 0:n.fields)||[]).some((function(e){return e&&e.name===o})));return o};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,n,r,o,i){var s=this.cachedPageInfo[n][r],a=s.xScale,l=a===void 0?1:a,c=s.yScale,d=c===void 0?1:c,u=s.renderedHeight,f=u===void 0?792:u;var h=Math.floor(Math.min(e/l,o));var v=Math.floor(Math.min(Math.max(f-t,0)/d,i));return{x:h,y:v}};e.prototype.handleClickPage=function(e,t,n){return __awaiter(this,void 0,void 0,(function(){var r,o,i,s,a,l,c,d,u,f,h,v,p,g,m,x;return __generator(this,(function(b){switch(b.label){case 0:if(!this.placing)return[3,2];o=e.offsetX;i=e.offsetY;s=defaultWidth(this.placing);a=defaultHeight(this.placing);l=this.cachedPageInfo[t][n];c=l.naturalWidth,d=c===void 0?612:c,u=l.naturalHeight,f=u===void 0?792:u;h=this.viewCoordinatesToPageCoordinates(o,i,t,n,d-s,f-a);v=Math.floor(h.x);p=Math.floor(h.y);g={name:this.generateFieldName(this.placing,n),role_name:this.selectedRoleName,template_id:this.templateId,document_id:l.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:n,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:v,y:p,width:s,height:a,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};return[4,createField(this.endpoint,this.templateId,g)];case 1:m=b.sent();console.log("[FIELDS] Created field",m);x=JSON.parse(JSON.stringify(this.template));x.fields.push(m);Store.updateTemplate(this.templateId,x);(r=this.templateUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,template:x,event:"added-field"});this.placing=null;b.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var n,r,o;console.log("Rendering");if(this.loading){return h(Host,null,h("verdocs-loader",null))}if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var i=__spreadArray([],((n=this.template)===null||n===void 0?void 0:n.roles)||[],true).sort((function(e,t){var n,r;return((n=e.sequence)!==null&&n!==void 0?n:0)-((r=t.sequence)!==null&&r!==void 0?r:0)}));var s=i.map((function(e){return{value:e.name,label:e.full_name?"".concat(e.name,": ").concat(e.full_name):e.name}}));return h(Host,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},h("div",{id:"verdocs-template-fields-toolbar"},h("div",{class:"add-for"},"Add field:"),h("verdocs-select-input",{value:this.selectedRoleName,options:s,onInput:function(e){return t.selectedRoleName=e.target.value}}),menuOptions.map((function(e){return h("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),h("div",{class:"pages"},(((r=this.template)===null||r===void 0?void 0:r.documents)||[]).map((function(e){var n=integerSequence(1,e.pages);return n.map((function(n){var r;var o=e.page_sizes[n];return h(Fragment,null,((r=t.template)===null||r===void 0?void 0:r.documents.length)>1&&h("div",{class:"document-separator"},h("div",{innerHTML:DocumentPageIcon}),h("span",null,e.name)),h("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:n,virtualWidth:(o===null||o===void 0?void 0:o.width)||612,virtualHeight:(o===null||o===void 0?void 0:o.height)||792,disabled:true,editable:true,done:false,onClick:function(r){return t.handleClickPage(r,e.id,n)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&h("verdocs-ok-dialog",{heading:"Unable to add field",message:(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:function(){return t.showMustSelectRole=false}}))};Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"]}},enumerable:false,configurable:true});return e}();VerdocsTemplateFields.style=verdocsTemplateFieldsCss;
|
|
2
2
|
/**!
|
|
3
3
|
* Sortable 1.15.7
|
|
4
4
|
* @author RubaXa <trash@rubaxa.org>
|