@verdocs/web-sdk 6.9.12 → 6.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +3 -3
  2. package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js.map +1 -1
  3. package/dist/cjs/verdocs-auth.cjs.entry.js +4 -0
  4. package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
  5. package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js +9 -8
  6. package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js.map +1 -1
  7. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
  8. package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +7 -7
  11. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-preview_6.cjs.entry.js +4 -0
  13. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  14. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-sign.cjs.entry.js +7 -3
  17. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  18. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  23. package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js +6 -5
  24. package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js.map +1 -1
  25. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +1 -1
  26. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -1
  27. package/dist/collection/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.js +1 -1
  28. package/dist/collection/components/dialogs/verdocs-passcode-dialog/verdocs-passcode-dialog.js +1 -1
  29. package/dist/collection/components/dialogs/verdocs-question-dialog/verdocs-question-dialog.js +1 -1
  30. package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
  31. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  32. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  33. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  34. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +4 -0
  35. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
  36. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +4 -0
  37. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  38. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -3
  39. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  40. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +1 -1
  41. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
  42. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  43. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  44. package/dist/collection/components/envelopes/verdocs-sign-footer/verdocs-sign-footer.js +1 -1
  45. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  46. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  47. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +7 -7
  48. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  49. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  50. package/dist/components/{p-BxOEoXie.js → p-BIc5CIpg.js} +2 -2
  51. package/dist/components/{p-DjOTs59Z.js → p-BcQsqsDy.js} +2 -2
  52. package/dist/components/{p-Dtndevf4.js → p-BfKv6ivN.js} +2 -2
  53. package/dist/components/{p-Ce29XBfJ.js → p-Bkae9I4G.js} +2 -2
  54. package/dist/components/{p-Ce29XBfJ.js.map → p-Bkae9I4G.js.map} +1 -1
  55. package/dist/components/{p-D3qUITiS.js → p-BwUTiBud.js} +2 -2
  56. package/dist/components/{p-BVhOFpVZ.js → p-C8r3qDBh.js} +2 -2
  57. package/dist/components/p-C8r3qDBh.js.map +1 -0
  58. package/dist/components/{p-DsEO0-XR.js → p-CGWVITS0.js} +2 -2
  59. package/dist/components/{p-BvtSJusb.js → p-CGt7KiUu.js} +2 -2
  60. package/dist/components/{p-u16vefxk.js → p-CQUV5gMT.js} +2 -2
  61. package/dist/components/{p-Dmw-lE3L.js → p-CSIVZcVx.js} +2 -2
  62. package/dist/components/{p-C-V6jrel.js → p-DClinO5r.js} +2 -2
  63. package/dist/components/{p-Bpe5Awxh.js → p-DGws2Zgt.js} +2 -2
  64. package/dist/components/p-DGws2Zgt.js.map +1 -0
  65. package/dist/components/{p-DVGumEtx.js → p-DRgoGiAA.js} +2 -2
  66. package/dist/components/{p-BT8wzCXz.js → p-DSK9z7EN.js} +2 -2
  67. package/dist/components/{p-tub_01MP.js → p-DXbBz25U.js} +2 -2
  68. package/dist/components/{p-DIOVejyL.js → p-DyhyfLyV.js} +2 -2
  69. package/dist/components/{p-Yxa93LOl.js → p-db6IAGB0.js} +2 -2
  70. package/dist/components/{p-CDMCVJys.js → p-qDQgyl7L.js} +2 -2
  71. package/dist/components/{p-CFEw4Xbi.js → p-sPseFic3.js} +2 -2
  72. package/dist/components/verdocs-auth.js +1 -1
  73. package/dist/components/verdocs-auth.js.map +1 -1
  74. package/dist/components/verdocs-build.js +1 -1
  75. package/dist/components/verdocs-download-dialog.js +1 -1
  76. package/dist/components/verdocs-envelope-document-page.js +1 -1
  77. package/dist/components/verdocs-envelope-sidebar.js +1 -1
  78. package/dist/components/verdocs-envelopes-list.js +1 -1
  79. package/dist/components/verdocs-field-attachment.js +1 -1
  80. package/dist/components/verdocs-initial-dialog.js +1 -1
  81. package/dist/components/verdocs-ok-dialog.js +1 -1
  82. package/dist/components/verdocs-otp-dialog.js +1 -1
  83. package/dist/components/verdocs-passcode-dialog.js +1 -1
  84. package/dist/components/verdocs-preview.js +1 -1
  85. package/dist/components/verdocs-question-dialog.js +1 -1
  86. package/dist/components/verdocs-quick-functions.js +1 -1
  87. package/dist/components/verdocs-search-tabs.js +1 -1
  88. package/dist/components/verdocs-send.js +1 -1
  89. package/dist/components/verdocs-sign-footer.js +1 -1
  90. package/dist/components/verdocs-sign.js +1 -1
  91. package/dist/components/verdocs-sign.js.map +1 -1
  92. package/dist/components/verdocs-signature-dialog.js +1 -1
  93. package/dist/components/verdocs-status-indicator.js +1 -1
  94. package/dist/components/verdocs-template-attachments.js +1 -1
  95. package/dist/components/verdocs-template-card.js +1 -1
  96. package/dist/components/verdocs-template-document-page.js +1 -1
  97. package/dist/components/verdocs-template-fields.js +1 -1
  98. package/dist/components/verdocs-template-role-properties.js +1 -1
  99. package/dist/components/verdocs-template-roles.js +1 -1
  100. package/dist/components/verdocs-template-star.js +1 -1
  101. package/dist/components/verdocs-template-tags.js +1 -1
  102. package/dist/components/verdocs-templates-list.js +1 -1
  103. package/dist/components/verdocs-upload-dialog.js +1 -1
  104. package/dist/components/verdocs-view.js +1 -1
  105. package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +3 -3
  106. package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
  107. package/dist/esm/verdocs-auth.entry.js +4 -0
  108. package/dist/esm/verdocs-auth.entry.js.map +1 -1
  109. package/dist/esm/verdocs-download-dialog_4.entry.js +9 -8
  110. package/dist/esm/verdocs-download-dialog_4.entry.js.map +1 -1
  111. package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
  112. package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
  113. package/dist/esm/verdocs-initial-dialog.entry.js +1 -1
  114. package/dist/esm/verdocs-menu-panel_2.entry.js +7 -7
  115. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  116. package/dist/esm/verdocs-preview_6.entry.js +4 -0
  117. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  118. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  119. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  120. package/dist/esm/verdocs-sign.entry.js +7 -3
  121. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  122. package/dist/esm/verdocs-signature-dialog.entry.js +1 -1
  123. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  124. package/dist/esm/verdocs-template-card.entry.js +1 -1
  125. package/dist/esm/verdocs-template-star.entry.js +1 -1
  126. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  127. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
  128. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
  129. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  130. package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
  131. package/dist/esm-es5/verdocs-download-dialog_4.entry.js +1 -1
  132. package/dist/esm-es5/verdocs-download-dialog_4.entry.js.map +1 -1
  133. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  134. package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
  135. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  136. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
  137. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  138. package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
  139. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  140. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  141. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  142. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  143. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  144. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
  145. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  146. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  147. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  148. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  149. package/dist/verdocs-web-sdk/{p-2f96e7c9.system.entry.js → p-0625e073.system.entry.js} +2 -2
  150. package/dist/verdocs-web-sdk/{p-40f5ecf3.system.entry.js → p-07a07c6b.system.entry.js} +2 -2
  151. package/dist/verdocs-web-sdk/p-15a1b8b5.system.entry.js +2 -0
  152. package/dist/verdocs-web-sdk/p-15a1b8b5.system.entry.js.map +1 -0
  153. package/dist/verdocs-web-sdk/{p-6abf8f8f.entry.js → p-1f898c53.entry.js} +2 -2
  154. package/dist/verdocs-web-sdk/{p-6abf8f8f.entry.js.map → p-1f898c53.entry.js.map} +1 -1
  155. package/dist/verdocs-web-sdk/p-2fa4010a.system.entry.js +2 -0
  156. package/dist/verdocs-web-sdk/p-2fa4010a.system.entry.js.map +1 -0
  157. package/dist/verdocs-web-sdk/{p-4798c2a5.system.entry.js → p-36aa8081.system.entry.js} +2 -2
  158. package/dist/verdocs-web-sdk/{p-c5b70927.system.entry.js → p-3c9a2290.system.entry.js} +2 -2
  159. package/dist/verdocs-web-sdk/p-48e2baa9.entry.js +2 -0
  160. package/dist/verdocs-web-sdk/p-48e2baa9.entry.js.map +1 -0
  161. package/dist/verdocs-web-sdk/{p-d09a4bb9.entry.js → p-4934f908.entry.js} +2 -2
  162. package/dist/verdocs-web-sdk/{p-6754dfcf.system.entry.js → p-4d8bf603.system.entry.js} +2 -2
  163. package/dist/verdocs-web-sdk/p-4fe507ee.entry.js +2 -0
  164. package/dist/verdocs-web-sdk/{p-810e09ca.entry.js → p-5678acd8.entry.js} +2 -2
  165. package/dist/verdocs-web-sdk/{p-cfb275c5.entry.js → p-609527c7.entry.js} +2 -2
  166. package/dist/verdocs-web-sdk/{p-1f1fc6d7.entry.js → p-82d0e009.entry.js} +2 -2
  167. package/dist/verdocs-web-sdk/p-90400330.entry.js +2 -0
  168. package/dist/verdocs-web-sdk/{p-d4f72da9.entry.js → p-98adcb3a.entry.js} +2 -2
  169. package/dist/verdocs-web-sdk/{p-ed953cca.entry.js → p-996cc1f6.entry.js} +2 -2
  170. package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
  171. package/dist/verdocs-web-sdk/{p-9756028f.entry.js → p-ae92881f.entry.js} +2 -2
  172. package/dist/verdocs-web-sdk/p-ae92881f.entry.js.map +1 -0
  173. package/dist/verdocs-web-sdk/{p-04d2fa80.system.entry.js → p-b1146326.system.entry.js} +2 -2
  174. package/dist/verdocs-web-sdk/{p-1929a794.system.entry.js → p-b2aa0637.system.entry.js} +2 -2
  175. package/dist/verdocs-web-sdk/{p-64034b55.system.entry.js → p-b35a1ea8.system.entry.js} +2 -2
  176. package/dist/verdocs-web-sdk/{p-64034b55.system.entry.js.map → p-b35a1ea8.system.entry.js.map} +1 -1
  177. package/dist/verdocs-web-sdk/{p-1827477d.system.entry.js → p-b6390a11.system.entry.js} +2 -2
  178. package/dist/verdocs-web-sdk/p-b81c87ee.system.entry.js +2 -0
  179. package/dist/verdocs-web-sdk/p-b81c87ee.system.entry.js.map +1 -0
  180. package/dist/verdocs-web-sdk/{p-d3d177d0.system.entry.js → p-ba39a8ce.system.entry.js} +2 -2
  181. package/dist/verdocs-web-sdk/{p-495ed75e.system.entry.js → p-bd17bff7.system.entry.js} +2 -2
  182. package/dist/verdocs-web-sdk/{p-e632e92c.entry.js → p-c2b70cb9.entry.js} +2 -2
  183. package/dist/verdocs-web-sdk/{p-ca03555a.system.entry.js → p-c3660cce.system.entry.js} +2 -2
  184. package/dist/verdocs-web-sdk/{p-421c231a.entry.js → p-cbfc895c.entry.js} +2 -2
  185. package/dist/verdocs-web-sdk/{p-f85f8560.system.entry.js → p-d5cfbdac.system.entry.js} +2 -2
  186. package/dist/verdocs-web-sdk/p-d5cfbdac.system.entry.js.map +1 -0
  187. package/dist/verdocs-web-sdk/{p-842c345c.entry.js → p-e207c469.entry.js} +2 -2
  188. package/dist/verdocs-web-sdk/p-e679a32a.entry.js +2 -0
  189. package/dist/verdocs-web-sdk/p-e679a32a.entry.js.map +1 -0
  190. package/dist/verdocs-web-sdk/{p-d3b798ae.system.entry.js → p-e991121e.system.entry.js} +2 -2
  191. package/dist/verdocs-web-sdk/p-ed5c3f2d.entry.js +2 -0
  192. package/dist/verdocs-web-sdk/p-ed5c3f2d.entry.js.map +1 -0
  193. package/dist/verdocs-web-sdk/{p-f97ca49e.entry.js → p-fff5d042.entry.js} +2 -2
  194. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  195. package/package.json +2 -2
  196. package/dist/components/p-BVhOFpVZ.js.map +0 -1
  197. package/dist/components/p-Bpe5Awxh.js.map +0 -1
  198. package/dist/verdocs-web-sdk/p-0240a6e1.system.entry.js +0 -2
  199. package/dist/verdocs-web-sdk/p-0240a6e1.system.entry.js.map +0 -1
  200. package/dist/verdocs-web-sdk/p-12676649.entry.js +0 -2
  201. package/dist/verdocs-web-sdk/p-12676649.entry.js.map +0 -1
  202. package/dist/verdocs-web-sdk/p-1a6869c9.system.entry.js +0 -2
  203. package/dist/verdocs-web-sdk/p-1a6869c9.system.entry.js.map +0 -1
  204. package/dist/verdocs-web-sdk/p-3f5ad836.system.entry.js +0 -2
  205. package/dist/verdocs-web-sdk/p-3f5ad836.system.entry.js.map +0 -1
  206. package/dist/verdocs-web-sdk/p-62b6402f.entry.js +0 -2
  207. package/dist/verdocs-web-sdk/p-682c5a5c.entry.js +0 -2
  208. package/dist/verdocs-web-sdk/p-9756028f.entry.js.map +0 -1
  209. package/dist/verdocs-web-sdk/p-9c6cca6e.entry.js +0 -2
  210. package/dist/verdocs-web-sdk/p-9c6cca6e.entry.js.map +0 -1
  211. package/dist/verdocs-web-sdk/p-c89d74b2.entry.js +0 -2
  212. package/dist/verdocs-web-sdk/p-c89d74b2.entry.js.map +0 -1
  213. package/dist/verdocs-web-sdk/p-f85f8560.system.entry.js.map +0 -1
  214. /package/dist/components/{p-BxOEoXie.js.map → p-BIc5CIpg.js.map} +0 -0
  215. /package/dist/components/{p-DjOTs59Z.js.map → p-BcQsqsDy.js.map} +0 -0
  216. /package/dist/components/{p-Dtndevf4.js.map → p-BfKv6ivN.js.map} +0 -0
  217. /package/dist/components/{p-D3qUITiS.js.map → p-BwUTiBud.js.map} +0 -0
  218. /package/dist/components/{p-DsEO0-XR.js.map → p-CGWVITS0.js.map} +0 -0
  219. /package/dist/components/{p-BvtSJusb.js.map → p-CGt7KiUu.js.map} +0 -0
  220. /package/dist/components/{p-u16vefxk.js.map → p-CQUV5gMT.js.map} +0 -0
  221. /package/dist/components/{p-Dmw-lE3L.js.map → p-CSIVZcVx.js.map} +0 -0
  222. /package/dist/components/{p-C-V6jrel.js.map → p-DClinO5r.js.map} +0 -0
  223. /package/dist/components/{p-DVGumEtx.js.map → p-DRgoGiAA.js.map} +0 -0
  224. /package/dist/components/{p-BT8wzCXz.js.map → p-DSK9z7EN.js.map} +0 -0
  225. /package/dist/components/{p-tub_01MP.js.map → p-DXbBz25U.js.map} +0 -0
  226. /package/dist/components/{p-DIOVejyL.js.map → p-DyhyfLyV.js.map} +0 -0
  227. /package/dist/components/{p-Yxa93LOl.js.map → p-db6IAGB0.js.map} +0 -0
  228. /package/dist/components/{p-CDMCVJys.js.map → p-qDQgyl7L.js.map} +0 -0
  229. /package/dist/components/{p-CFEw4Xbi.js.map → p-sPseFic3.js.map} +0 -0
  230. /package/dist/verdocs-web-sdk/{p-2f96e7c9.system.entry.js.map → p-0625e073.system.entry.js.map} +0 -0
  231. /package/dist/verdocs-web-sdk/{p-40f5ecf3.system.entry.js.map → p-07a07c6b.system.entry.js.map} +0 -0
  232. /package/dist/verdocs-web-sdk/{p-4798c2a5.system.entry.js.map → p-36aa8081.system.entry.js.map} +0 -0
  233. /package/dist/verdocs-web-sdk/{p-c5b70927.system.entry.js.map → p-3c9a2290.system.entry.js.map} +0 -0
  234. /package/dist/verdocs-web-sdk/{p-d09a4bb9.entry.js.map → p-4934f908.entry.js.map} +0 -0
  235. /package/dist/verdocs-web-sdk/{p-6754dfcf.system.entry.js.map → p-4d8bf603.system.entry.js.map} +0 -0
  236. /package/dist/verdocs-web-sdk/{p-62b6402f.entry.js.map → p-4fe507ee.entry.js.map} +0 -0
  237. /package/dist/verdocs-web-sdk/{p-810e09ca.entry.js.map → p-5678acd8.entry.js.map} +0 -0
  238. /package/dist/verdocs-web-sdk/{p-cfb275c5.entry.js.map → p-609527c7.entry.js.map} +0 -0
  239. /package/dist/verdocs-web-sdk/{p-1f1fc6d7.entry.js.map → p-82d0e009.entry.js.map} +0 -0
  240. /package/dist/verdocs-web-sdk/{p-682c5a5c.entry.js.map → p-90400330.entry.js.map} +0 -0
  241. /package/dist/verdocs-web-sdk/{p-d4f72da9.entry.js.map → p-98adcb3a.entry.js.map} +0 -0
  242. /package/dist/verdocs-web-sdk/{p-ed953cca.entry.js.map → p-996cc1f6.entry.js.map} +0 -0
  243. /package/dist/verdocs-web-sdk/{p-04d2fa80.system.entry.js.map → p-b1146326.system.entry.js.map} +0 -0
  244. /package/dist/verdocs-web-sdk/{p-1929a794.system.entry.js.map → p-b2aa0637.system.entry.js.map} +0 -0
  245. /package/dist/verdocs-web-sdk/{p-1827477d.system.entry.js.map → p-b6390a11.system.entry.js.map} +0 -0
  246. /package/dist/verdocs-web-sdk/{p-d3d177d0.system.entry.js.map → p-ba39a8ce.system.entry.js.map} +0 -0
  247. /package/dist/verdocs-web-sdk/{p-495ed75e.system.entry.js.map → p-bd17bff7.system.entry.js.map} +0 -0
  248. /package/dist/verdocs-web-sdk/{p-e632e92c.entry.js.map → p-c2b70cb9.entry.js.map} +0 -0
  249. /package/dist/verdocs-web-sdk/{p-ca03555a.system.entry.js.map → p-c3660cce.system.entry.js.map} +0 -0
  250. /package/dist/verdocs-web-sdk/{p-421c231a.entry.js.map → p-cbfc895c.entry.js.map} +0 -0
  251. /package/dist/verdocs-web-sdk/{p-842c345c.entry.js.map → p-e207c469.entry.js.map} +0 -0
  252. /package/dist/verdocs-web-sdk/{p-d3b798ae.system.entry.js.map → p-e991121e.system.entry.js.map} +0 -0
  253. /package/dist/verdocs-web-sdk/{p-f97ca49e.entry.js.map → p-fff5d042.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as i,d as o,t as n}from"./p-yZBlG3YQ.js";import{getTemplate as l,getOrganizationContacts as r,isValidEmail as d,createEnvelope as a,formatFullName as c,getRGBA as p}from"@verdocs/js-sdk";import{D as h}from"./p-C_Xku1v2.js";import{V as v}from"./p-D97GxsI-.js";import{S as m}from"./p-C1sRVZWv.js";import{S as f}from"./p-C7hFgM52.js";import{d as u}from"./p-Bdf8pPWm.js";import{d as x}from"./p-REnrt0JM.js";import{d as b}from"./p-CyDWJAOZ.js";import{d as g}from"./p-DeQsR41s.js";import{d as w}from"./p-wUsR0Dpa.js";import{d as k}from"./p-B-_kYJtC.js";import{d as E}from"./p-DQTI8vRX.js";import{d as S}from"./p-BXQO5Vza.js";const C=e=>((e===null||e===void 0?void 0:e.roles)||[]).map((e=>e.name));const y=(e,s)=>Math.max(C(e).findIndex((e=>e===s)),0);const D=()=>`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)}`;const z='<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>';const N='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';const j='<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>';const _='<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>';const L=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.beforeSend=t(this,"beforeSend");this.send=t(this,"send");this.exit=t(this,"exit");this.sdkError=t(this,"sdkError");this.searchContacts=t(this,"searchContacts");this.templateListenerId=null;this.endpoint=h;this.templateId=null;this.environment="";this.showCancel=true;this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();f.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),true,(e=>{console.log("[SEND] Got new template",e);this.template=e;this.loading=false;this.rolesCompleted={};this.recomputeRolesCompleted()}))}unlistenToTemplate(){if(this.templateListenerId){f.store.delListener(this.templateListenerId);this.templateListenerId=null}}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,s,t;try{this.endpoint.onSessionChanged(((e,s,t)=>{if(!t){return}const i={id:t.id,first_name:t.first_name,last_name:t.last_name,email:t.email,phone:t.phone};if(t){this.sessionContacts=[i];r(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e);this.sessionContacts=[...e,i]})).catch((e=>{console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return}if(!this.templateId){console.log(`[SEND] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(i){console.log("[SEND] Error with send session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(i.message,(s=i.response)===null||s===void 0?void 0:s.status,(t=i.response)===null||t===void 0?void 0:t.data))}}recomputeRolesCompleted(){var e;this.rolesCompleted={};const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{const t=e.sequence;s[t]||(s[t]=[]);const i=`r-${t}-${s[t].length}`;s[t].push({...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name});if(e.first_name&&d(e.email)){this.rolesCompleted[i]={...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name}}}))}getSequenceNumbers(){var e;const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{s[e.sequence]=true}));return Object.keys(s).map((e=>+e)).sort(((e,s)=>e-s))}getRolesAtLevel(e){var s;const t=(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).filter((s=>s.sequence===e)).map(((s,t)=>({...s,id:`r-${e}-${t}`,role_name:s.name,first_name:s.first_name,last_name:s.last_name})));return t}getLevelIcon(e){if(e==="start"){return i("div",{class:"level-icon",innerHTML:N})}else if(e==="end"){return i("div",{class:"level-icon",innerHTML:_})}else{return i("div",{class:"level-icon",innerHTML:j})}}handleSelectContact(e,s){e.preventDefault();this.rolesCompleted[s.id]={...s,...e.detail};this.showPickerForId=""}handleClickRole(e,s){e.stopPropagation();this.showPickerForId=s.id}handleSend(e){var s;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;const t={template_id:this.templateId,name:((s=this.template)===null||s===void 0?void 0:s.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted)};const i=this.beforeSend.emit({...t,name:t.name,template:this.template});if(i.defaultPrevented){console.log("[SEND] Send cancelled by parent",t);this.sending=false;return}console.log("[SEND] Creating envelope",t);a(this.endpoint,t).then((e=>{var s;console.log("[SEND] Send envelope",e);this.reset().catch((e=>console.log("Unknown Error",e)));this.sending=false;(s=this.send)===null||s===void 0?void 0:s.emit({...t,name:t.name,envelope_id:e.id,envelope:e})})).catch((e=>{var s,t,i;console.log("[SEND] Send error",e);v(((t=(s=e.response)===null||s===void 0?void 0:s.data)===null||t===void 0?void 0:t.error)||"Error creating envelope, please try again later.");this.sending=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(e)}))}handleCancel(e){var s;e.stopPropagation();(s=this.exit)===null||s===void 0?void 0:s.emit()}render(){var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const s=this.getSequenceNumbers();const t=Object.values(this.rolesCompleted).filter((e=>d(e.email)&&e.first_name&&e.last_name));const n=t.length>=C(this.template).length;const l=t.map((e=>e.email.toLowerCase()));const r=new Set(l).size<l.length;return i(o,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:`level level-start`},this.getLevelIcon("start"),i("div",{class:"complete"},"Send Envelope")),s.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon("sequence"),this.getRolesAtLevel(e).map((e=>{var s,o,n;const l=!e.email||!e.first_name||!e.last_name;const r=((s=this.rolesCompleted[e.id])===null||s===void 0?void 0:s.first_name)?c(this.rolesCompleted[e.id]):l?e.role_name:c(e);const d=`verdocs-send-recipient-${e.role_name}`;const a=y(this.template,e.role_name);const h=p(a);const v=t.findIndex((s=>s.role_name===e.role_name))>-1;const m={backgroundColor:h,border:v?"2px solid #55bc81":"2px solid #dddddd"};return l?i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(o=this.rolesCompleted[e.id])!==null&&o!==void 0?o:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(n=this.rolesCompleted[e.id])!==null&&n!==void 0?n:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}})))}))))),i("div",{class:`level level-done`},this.getLevelIcon("end"),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},r&&i("div",{class:"error-message"},"Recipients cannot share the same email."),this.showCancel&&i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!n||this.sending||r,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return D()}},[0,"verdocs-send",{endpoint:[16],templateId:[513,"template-id"],environment:[1],showCancel:[4,"show-cancel"],containerId:[32],showPickerForId:[32],sessionContacts:[32],sending:[32],rolesCompleted:[32],loading:[32],template:[32],reset:[64]},undefined,{templateId:[{onTemplateIdChanged:0}]}]);function M(){if(typeof customElements==="undefined"){return}const e=["verdocs-send","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-flag","verdocs-loader","verdocs-portal","verdocs-spinner"];e.forEach((e=>{switch(e){case"verdocs-send":if(!customElements.get(n(e))){customElements.define(n(e),L)}break;case"verdocs-button":if(!customElements.get(n(e))){u()}break;case"verdocs-checkbox":if(!customElements.get(n(e))){x()}break;case"verdocs-component-error":if(!customElements.get(n(e))){b()}break;case"verdocs-contact-picker":if(!customElements.get(n(e))){g()}break;case"verdocs-flag":if(!customElements.get(n(e))){w()}break;case"verdocs-loader":if(!customElements.get(n(e))){k()}break;case"verdocs-portal":if(!customElements.get(n(e))){E()}break;case"verdocs-spinner":if(!customElements.get(n(e))){S()}break}}))}export{L as V,M as d};
2
- //# sourceMappingURL=p-Bpe5Awxh.js.map
1
+ import{p as e,H as s,c as t,h as i,d as o,t as n}from"./p-yZBlG3YQ.js";import{getTemplate as l,getOrganizationContacts as r,isValidEmail as d,createEnvelope as a,formatFullName as c,getRGBA as p}from"@verdocs/js-sdk";import{D as h}from"./p-C_Xku1v2.js";import{V as v}from"./p-D97GxsI-.js";import{S as m}from"./p-C1sRVZWv.js";import{S as f}from"./p-C7hFgM52.js";import{d as u}from"./p-Bdf8pPWm.js";import{d as x}from"./p-REnrt0JM.js";import{d as b}from"./p-CyDWJAOZ.js";import{d as g}from"./p-DeQsR41s.js";import{d as w}from"./p-wUsR0Dpa.js";import{d as k}from"./p-B-_kYJtC.js";import{d as E}from"./p-DQTI8vRX.js";import{d as S}from"./p-BXQO5Vza.js";const C=e=>((e===null||e===void 0?void 0:e.roles)||[]).map((e=>e.name));const y=(e,s)=>Math.max(C(e).findIndex((e=>e===s)),0);const D=()=>`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)}`;const z='<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>';const N='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';const j='<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>';const _='<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>';const I=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.beforeSend=t(this,"beforeSend");this.send=t(this,"send");this.exit=t(this,"exit");this.sdkError=t(this,"sdkError");this.searchContacts=t(this,"searchContacts");this.templateListenerId=null;this.endpoint=h;this.templateId=null;this.environment="";this.showCancel=true;this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();f.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),true,(e=>{console.log("[SEND] Got new template",e);this.template=e;this.loading=false;this.rolesCompleted={};this.recomputeRolesCompleted()}))}unlistenToTemplate(){if(this.templateListenerId){f.store.delListener(this.templateListenerId);this.templateListenerId=null}}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,s,t;try{this.endpoint.onSessionChanged(((e,s,t)=>{if(!t){return}const i={id:t.id,first_name:t.first_name,last_name:t.last_name,email:t.email,phone:t.phone};if(t){this.sessionContacts=[i];r(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e);this.sessionContacts=[...e,i]})).catch((e=>{console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return}if(!this.templateId){console.log(`[SEND] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(i){console.log("[SEND] Error with send session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(i.message,(s=i.response)===null||s===void 0?void 0:s.status,(t=i.response)===null||t===void 0?void 0:t.data))}}recomputeRolesCompleted(){var e;this.rolesCompleted={};const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{const t=e.sequence;s[t]||(s[t]=[]);const i=`r-${t}-${s[t].length}`;s[t].push({...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name});if(e.first_name&&d(e.email)){this.rolesCompleted[i]={...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name}}}))}getSequenceNumbers(){var e;const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{s[e.sequence]=true}));return Object.keys(s).map((e=>+e)).sort(((e,s)=>e-s))}getRolesAtLevel(e){var s;const t=(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).filter((s=>s.sequence===e)).map(((s,t)=>({...s,id:`r-${e}-${t}`,role_name:s.name,first_name:s.first_name,last_name:s.last_name})));return t}getLevelIcon(e){if(e==="start"){return i("div",{class:"level-icon",innerHTML:N})}else if(e==="end"){return i("div",{class:"level-icon",innerHTML:_})}else{return i("div",{class:"level-icon",innerHTML:j})}}handleSelectContact(e,s){e.preventDefault();this.rolesCompleted[s.id]={...s,...e.detail};this.showPickerForId=""}handleClickRole(e,s){e.stopPropagation();this.showPickerForId=s.id}handleSend(e){var s;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;const t=Intl.DateTimeFormat().resolvedOptions();const i={template_id:this.templateId,name:((s=this.template)===null||s===void 0?void 0:s.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),timezone:t.timeZone,locale:t.locale};const o=this.beforeSend.emit({...i,name:i.name,template:this.template});if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",i);this.sending=false;return}console.log("[SEND] Creating envelope",i);a(this.endpoint,i).then((e=>{var s;console.log("[SEND] Send envelope",e);this.reset().catch((e=>console.log("Unknown Error",e)));this.sending=false;(s=this.send)===null||s===void 0?void 0:s.emit({...i,name:i.name,envelope_id:e.id,envelope:e})})).catch((e=>{var s,t,i;console.log("[SEND] Send error",e);v(((t=(s=e.response)===null||s===void 0?void 0:s.data)===null||t===void 0?void 0:t.error)||"Error creating envelope, please try again later.");this.sending=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(e)}))}handleCancel(e){var s;e.stopPropagation();(s=this.exit)===null||s===void 0?void 0:s.emit()}render(){var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const s=this.getSequenceNumbers();const t=Object.values(this.rolesCompleted).filter((e=>d(e.email)&&e.first_name&&e.last_name));const n=t.length>=C(this.template).length;const l=t.map((e=>e.email.toLowerCase()));const r=new Set(l).size<l.length;return i(o,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:`level level-start`},this.getLevelIcon("start"),i("div",{class:"complete"},"Send Envelope")),s.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon("sequence"),this.getRolesAtLevel(e).map((e=>{var s,o,n;const l=!e.email||!e.first_name||!e.last_name;const r=((s=this.rolesCompleted[e.id])===null||s===void 0?void 0:s.first_name)?c(this.rolesCompleted[e.id]):l?e.role_name:c(e);const d=`verdocs-send-recipient-${e.role_name}`;const a=y(this.template,e.role_name);const h=p(a);const v=t.findIndex((s=>s.role_name===e.role_name))>-1;const m={backgroundColor:h,border:v?"2px solid #55bc81":"2px solid #dddddd"};return l?i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(o=this.rolesCompleted[e.id])!==null&&o!==void 0?o:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(n=this.rolesCompleted[e.id])!==null&&n!==void 0?n:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}})))}))))),i("div",{class:`level level-done`},this.getLevelIcon("end"),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},r&&i("div",{class:"error-message"},"Recipients cannot share the same email."),this.showCancel&&i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!n||this.sending||r,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return D()}},[0,"verdocs-send",{endpoint:[16],templateId:[513,"template-id"],environment:[1],showCancel:[4,"show-cancel"],containerId:[32],showPickerForId:[32],sessionContacts:[32],sending:[32],rolesCompleted:[32],loading:[32],template:[32],reset:[64]},undefined,{templateId:[{onTemplateIdChanged:0}]}]);function L(){if(typeof customElements==="undefined"){return}const e=["verdocs-send","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-flag","verdocs-loader","verdocs-portal","verdocs-spinner"];e.forEach((e=>{switch(e){case"verdocs-send":if(!customElements.get(n(e))){customElements.define(n(e),I)}break;case"verdocs-button":if(!customElements.get(n(e))){u()}break;case"verdocs-checkbox":if(!customElements.get(n(e))){x()}break;case"verdocs-component-error":if(!customElements.get(n(e))){b()}break;case"verdocs-contact-picker":if(!customElements.get(n(e))){g()}break;case"verdocs-flag":if(!customElements.get(n(e))){w()}break;case"verdocs-loader":if(!customElements.get(n(e))){k()}break;case"verdocs-portal":if(!customElements.get(n(e))){E()}break;case"verdocs-spinner":if(!customElements.get(n(e))){S()}break}}))}export{I as V,L as d};
2
+ //# sourceMappingURL=p-DGws2Zgt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getRoleNames","template","roles","map","role","name","getRoleIndex","role_name","Math","max","findIndex","verdocsSendCss","editIcon","startIcon","stepIcon","doneIcon","VerdocsSend","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","templateListenerId","endpoint","DefaultEndpoint","templateId","environment","showCancel","containerId","random","toString","substring","showPickerForId","sessionContacts","sending","rolesCompleted","loading","disconnectedCallback","unlistenToTemplate","listenToTemplate","console","log","Store","subscribe","getTemplate","recomputeRolesCompleted","store","delListener","reset","onTemplateIdChanged","newTemplateId","componentWillLoad","onSessionChanged","_endpoint","_session","profile","me","id","first_name","last_name","email","phone","getOrganizationContacts","then","contacts","catch","e","loadSession","session","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","rolesAtLevel","forEach","level","sequence","length","push","isValidEmail","getSequenceNumbers","sequences","Object","keys","s","sort","a","b","getRolesAtLevel","filter","index","getLevelIcon","h","class","innerHTML","handleSelectContact","preventDefault","detail","handleClickRole","stopPropagation","handleSend","localeData","Intl","DateTimeFormat","resolvedOptions","details","template_id","initial_reminder","followup_reminders","recipients","values","timezone","timeZone","locale","beforeSendResult","beforeSend","defaultPrevented","createEnvelope","r","send","envelope_id","envelope","VerdocsToast","error","handleCancel","exit","render","Host","style","display","levels","rolesAssigned","recipient","allRolesAssigned","assignedEmails","toLowerCase","hasDuplicateEmails","Set","size","sendable","is_sendable","unknown","roleName","formatFullName","elId","roleIndex","rgba","getRGBA","completed","backgroundColor","border","onClick","anchor","onClickAway","onExit","onNext","contactSuggestions","templateRole","onSearchContacts","searchContacts","label","variant","disabled"],"sources":["src/utils/Templates.ts","src/components/embeds/verdocs-send/verdocs-send.scss?tag=verdocs-send","src/components/embeds/verdocs-send/verdocs-send.tsx"],"sourcesContent":["import {ITemplate} from '@verdocs/js-sdk';\n\nexport const getRoleNames = (template: ITemplate | null) => (template?.roles || []).map(role => role.name);\n\nexport const getRoleIndex = (template: ITemplate | null, role_name: string) =>\n Math.max(\n getRoleNames(template).findIndex(name => name === role_name),\n 0,\n );\n","@import '../../../theme.scss';\n\nverdocs-send {\n padding: 10px;\n position: relative;\n background: #ffffff;\n flex-direction: column;\n font-family: $verdocs-primary-font;\n\n &.sendable {\n display: flex;\n }\n\n .recipients {\n position: relative;\n }\n\n // To avoid the need to compute things like heights, this layer is simply displayed \"on top\" of all the level rows. Its\n // background obscures the horizontal lines.\n .left-line {\n top: 32px;\n left: 20px;\n z-index: 1;\n width: 12px;\n bottom: 30px;\n position: absolute;\n background: #ffffff;\n border-left: 3px dotted #9b9b9b;\n }\n\n .level {\n display: flex;\n column-gap: 10px;\n margin-left: 50px;\n position: relative;\n flex-direction: row;\n padding: 8px 0 4px 0;\n border-bottom: 1px solid #97979744;\n\n .level-icon {\n top: 14px;\n z-index: 2;\n left: -40px;\n width: 24px;\n height: 24px;\n position: absolute;\n background: #ffffff;\n\n svg {\n fill: #00000089;\n }\n }\n\n .recipient {\n height: 30px;\n display: flex;\n flex: 0 0 30px;\n color: #000000;\n cursor: pointer;\n font-size: 14px;\n align-items: center;\n border-radius: 30px;\n flex-direction: row;\n background: #dddddd;\n white-space: nowrap;\n border: 2px solid #dddddd;\n padding: 2px 10px 2px 14px;\n\n .icon {\n width: 22px;\n height: 22px;\n flex: 0 0 22px;\n margin: 0 0 0 10px;\n\n svg {\n width: 22px;\n height: 22px;\n fill: #333333;\n outline: none;\n }\n }\n }\n\n .complete {\n flex: 1;\n height: 30px;\n display: flex;\n color: #000000;\n font-size: 14px;\n align-items: center;\n flex-direction: row;\n padding: 3px 10px 3px 2px;\n }\n }\n\n .buttons {\n display: flex;\n margin-top: 10px;\n column-gap: 15px;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n\n .error-message {\n width: 100%;\n color: #cc0000;\n font-size: 13px;\n margin-bottom: 10px;\n }\n }\n\n verdocs-contact-picker {\n left: 0;\n top: 41px;\n z-index: 10;\n position: absolute;\n border: 1px solid #dddddd;\n box-shadow: 0 0 6px 3px rgb(0 0 0 / 10%);\n }\n}\n","import {Component, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport {createEnvelope, formatFullName, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipientFromTemplate, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {DefaultEndpoint} from '../../../utils/Environment';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst editIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"></path></svg>';\n\nconst startIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z\"></path></svg>';\n\nconst stepIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\"></path></svg>';\n\nconst doneIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z\"></path></svg>';\n\n/**\n * Display a form to send a template to one or more recipients in an envelope for signing.\n * Host applications should ensure the template is \"sendable\" before displaying this component.\n * To be sendable, a template must have at least one document attached, at least one participant\n * defined, and at least one field assigned to every \"signer\" participant. This component will\n * hide itself if the template is not sendable.\n *\n * ```ts\n * <verdocs-send\n * templateId={TEMPLATE_ID}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={({ detail }) => { console.log('Send cancelled.', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-send',\n styleUrl: 'verdocs-send.scss',\n shadow: false,\n})\nexport class VerdocsSend {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = DefaultEndpoint;\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true}) templateId: string | null = null;\n\n /**\n * The environment the control is being called from, e.g. 'web'. This has an impact on how certain\n * operations such as email communications are handled to ensure users receive the correct URLs for\n * their invitations. Setting this to unknown values may produce unexpected/incorrect behaviors.\n * If environment is not known, do this set this property.\n */\n @Prop() environment: string = '';\n\n /**\n * Whether to show the cancel button. It may be useful to disable this in environments where\n * the embed is shown in a non-wizard flow with its own navigation for the user to exit.\n */\n @Prop() showCancel = true;\n\n /**\n * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<{recipients: ICreateEnvelopeRecipientFromTemplate[]; name: string; template_id: string; template: ITemplate}>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipientFromTemplate[]; name: string; template_id: string; envelope_id: string; envelope: IEnvelope}>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user enters text in a search field. The parent application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() showPickerForId = '';\n @State() sessionContacts = [];\n @State() sending = false;\n @State() rolesCompleted: Record<string, Partial<IRecipient>> = {};\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n console.log('[SEND] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n true,\n (template: ITemplate) => {\n console.log('[SEND] Got new template', template);\n this.template = template;\n this.loading = false;\n this.rolesCompleted = {};\n this.recomputeRolesCompleted();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method() async reset() {\n this.rolesCompleted = {};\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[SEND] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.onSessionChanged((_endpoint, _session, profile) => {\n if (!profile) {\n return;\n }\n\n const me = {\n id: profile.id,\n first_name: profile.first_name,\n last_name: profile.last_name,\n email: profile.email,\n phone: profile.phone,\n };\n\n if (profile) {\n this.sessionContacts = [me];\n\n getOrganizationContacts(this.endpoint)\n .then(contacts => {\n console.log('[SEND] Got contacts', contacts);\n this.sessionContacts = [...contacts, me];\n })\n .catch(e => {\n console.log('[SEND] Error getting contacts', e);\n });\n }\n });\n\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[SEND] Unable to start Send operation, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[SEND] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SEND] Error with send session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n recomputeRolesCompleted() {\n this.rolesCompleted = {};\n\n const rolesAtLevel: Record<number, Partial<IRecipient>[]> = {};\n (this.template?.roles || []).forEach(role => {\n const level = role.sequence;\n rolesAtLevel[level] ||= [];\n const id = `r-${level}-${rolesAtLevel[level].length}`;\n rolesAtLevel[level].push({...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name});\n\n // if (role.first_name && (isValidEmail(role.email) || isValidPhone(role.phone))) {\n if (role.first_name && isValidEmail(role.email)) {\n this.rolesCompleted[id] = {...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name};\n }\n });\n }\n\n getSequenceNumbers() {\n // This is cleaner with a Set but we found a regression in some target environments where\n // this breaks down. Reverting to an older technique while we diagnose it.\n const sequences: Record<number, boolean> = {};\n (this.template?.roles || []).forEach(role => {\n sequences[role.sequence] = true;\n });\n return Object.keys(sequences)\n .map(s => +s)\n .sort((a, b) => a - b);\n }\n\n getRolesAtLevel(level: number) {\n const rolesAtLevel = (this.template?.roles || [])\n .filter(role => role.sequence === level)\n .map((role, index) => ({\n ...role,\n id: `r-${level}-${index}`,\n role_name: role.name,\n first_name: role.first_name,\n last_name: role.last_name,\n }));\n return rolesAtLevel as Partial<IRecipient>[];\n }\n\n getLevelIcon(level: 'start' | 'end' | 'sequence') {\n if (level === 'start') {\n return <div class=\"level-icon\" innerHTML={startIcon} />;\n } else if (level === 'end') {\n return <div class=\"level-icon\" innerHTML={doneIcon} />;\n } else {\n return <div class=\"level-icon\" innerHTML={stepIcon} />;\n }\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n e.preventDefault();\n this.rolesCompleted[role.id] = {...role, ...e.detail};\n this.showPickerForId = '';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.showPickerForId = role.id;\n }\n\n handleSend(e: any) {\n if (this.sending) {\n console.log('[SEND] Skipping duplicate send', e);\n return;\n }\n\n console.log('[SEND] Sending', e);\n e.preventDefault();\n e.stopPropagation();\n\n this.sending = true;\n const localeData = Intl.DateTimeFormat().resolvedOptions();\n\n const details: ICreateEnvelopeFromTemplateRequest = {\n template_id: this.templateId,\n name: this.template?.name || 'New Envelope',\n environment: this.environment,\n initial_reminder: 0,\n followup_reminders: 0,\n recipients: Object.values(this.rolesCompleted) as ICreateEnvelopeRecipientFromTemplate[],\n // @ts-expect-error - v6.9.13\n timezone: localeData.timeZone,\n locale: localeData.locale,\n };\n\n const beforeSendResult = this.beforeSend.emit({...details, name: details.name!, template: this.template});\n if (beforeSendResult.defaultPrevented) {\n console.log('[SEND] Send cancelled by parent', details);\n this.sending = false;\n return;\n }\n\n console.log('[SEND] Creating envelope', details);\n createEnvelope(this.endpoint, details)\n .then(r => {\n console.log('[SEND] Send envelope', r);\n this.reset().catch((e: any) => console.log('Unknown Error', e));\n this.sending = false;\n this.send?.emit({...details, name: details.name!, envelope_id: r.id, envelope: r});\n })\n .catch(e => {\n console.log('[SEND] Send error', e);\n VerdocsToast(e.response?.data?.error || 'Error creating envelope, please try again later.');\n this.sending = false;\n this.sdkError?.emit(e);\n });\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.exit?.emit();\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host style={{display: 'flex'}}>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const levels = this.getSequenceNumbers();\n const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) && recipient.first_name && recipient.last_name);\n const allRolesAssigned = rolesAssigned.length >= getRoleNames(this.template).length;\n const assignedEmails = rolesAssigned.map(r => r.email.toLowerCase());\n const hasDuplicateEmails = new Set(assignedEmails).size < assignedEmails.length;\n\n return (\n <Host class={{sendable: this.template?.is_sendable}}>\n <div class=\"recipients\">\n <div class=\"left-line\" />\n <div class={`level level-start`}>\n {this.getLevelIcon('start')}\n <div class=\"complete\">Send Envelope</div>\n </div>\n\n {levels.map(level => (\n <div class={`level level-${level}`}>\n {this.getLevelIcon('sequence')}\n\n {this.getRolesAtLevel(level).map(role => {\n const unknown = !role.email || !role.first_name || !role.last_name;\n const roleName = this.rolesCompleted[role.id]?.first_name ? formatFullName(this.rolesCompleted[role.id]) : unknown ? role.role_name : formatFullName(role);\n const elId = `verdocs-send-recipient-${role.role_name}`;\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const rgba = getRGBA(roleIndex);\n const completed = rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n\n const style = {\n backgroundColor: rgba,\n border: completed ? '2px solid #55bc81' : '2px solid #dddddd',\n };\n\n return unknown ? (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={this.rolesCompleted[role.id] ?? role}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n ) : (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {/*<div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={{borderColor: rgba}} onClick={e => this.handleClickRole(e, role)} id={elId}>*/}\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={(this.rolesCompleted[role.id] ?? role) as IRecipient}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n );\n })}\n </div>\n ))}\n\n <div class={`level level-done`}>\n {this.getLevelIcon('end')}\n <div class=\"complete\">Signing Complete</div>\n </div>\n </div>\n\n <div class=\"buttons\">\n {hasDuplicateEmails && <div class=\"error-message\">Recipients cannot share the same email.</div>}\n {this.showCancel && <verdocs-button label=\"Cancel\" size=\"small\" variant=\"outline\" onClick={e => this.handleCancel(e)} disabled={this.sending} />}\n <verdocs-button label=\"Send\" size=\"small\" disabled={!allRolesAssigned || this.sending || hasDuplicateEmails} onClick={e => this.handleSend(e)} />\n {this.sending && <verdocs-spinner />}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as i,d as a,F as r,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplateDocumentPageDisplayUri as l,getTemplate as c}from"@verdocs/js-sdk";import{t as m,f as n,g as p}from"./p-BCwFpXpV.js";import{S as h}from"./p-C7hFgM52.js";import{d as u}from"./p-Bdf8pPWm.js";import{d as f}from"./p-REnrt0JM.js";import{d as v}from"./p-CyDWJAOZ.js";import{d as b}from"./p-DT0LGcPi.js";import{d as g}from"./p-BT8wzCXz.js";import{d as x}from"./p-BasWFMeN.js";import{d as y}from"./p-DwPH0TQ4.js";import{d as k}from"./p-BwEGkh_6.js";import{d as w}from"./p-DXLcCG08.js";import{d as E}from"./p-B845hxhl.js";import{d as j}from"./p-5E7bNT3k.js";import{d as P}from"./p-Cfiprngx.js";import{d as D}from"./p-pyA5cdVX.js";import{d as S}from"./p-DhO1wfh-.js";import{d as W}from"./p-wUsR0Dpa.js";import{d as B}from"./p-CioaaWeS.js";import{d as T}from"./p-B-_kYJtC.js";import{d as C}from"./p-D3qUITiS.js";import{d as $}from"./p-DQTI8vRX.js";import{d as I}from"./p-BXGNkmyr.js";import{d as R}from"./p-D3ohABOv.js";import{d as H}from"./p-DYtSnUj9.js";import{d as N}from"./p-u16vefxk.js";const X=()=>`verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-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-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}`;const z=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.pageRendered=s(this,"pageRendered");this.templateListenerId=null;this.endpoint=d.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await l(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(m((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>c(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(a,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(a,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var s;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.document_id===this.documentId&&e.page===this.pageNumber)).map((e=>{var t,s;const a=p(e);let{name:o,type:d,multiline:l}=e;const{xScale:c,yScale:m,templateId:h,editable:u,disabled:f,done:v,pageNumber:b}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((s=e["settings"])===null||s===void 0?void 0:s.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,multiline:l,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"date":return i("verdocs-field-date",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:o,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});default:return i(r,null,o)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return this}static get style(){return X()}},[0,"verdocs-template-document-page",{endpoint:[16],editable:[4],disabled:[4],done:[4],templateId:[513,"template-id"],documentId:[513,"document-id"],pageNumber:[514,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32],pageDisplayUri:[32],xScale:[32],yScale:[32],loading:[32],template:[32]}]);function F(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-document-page","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-field-properties","verdocs-text-input","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-document-page":if(!customElements.get(o(e))){customElements.define(o(e),z)}break;case"verdocs-button":if(!customElements.get(o(e))){u()}break;case"verdocs-checkbox":if(!customElements.get(o(e))){f()}break;case"verdocs-component-error":if(!customElements.get(o(e))){v()}break;case"verdocs-dialog":if(!customElements.get(o(e))){b()}break;case"verdocs-field-attachment":if(!customElements.get(o(e))){g()}break;case"verdocs-field-checkbox":if(!customElements.get(o(e))){x()}break;case"verdocs-field-date":if(!customElements.get(o(e))){y()}break;case"verdocs-field-dropdown":if(!customElements.get(o(e))){k()}break;case"verdocs-field-initial":if(!customElements.get(o(e))){w()}break;case"verdocs-field-radio":if(!customElements.get(o(e))){E()}break;case"verdocs-field-signature":if(!customElements.get(o(e))){j()}break;case"verdocs-field-textarea":if(!customElements.get(o(e))){P()}break;case"verdocs-field-textbox":if(!customElements.get(o(e))){D()}break;case"verdocs-field-timestamp":if(!customElements.get(o(e))){S()}break;case"verdocs-flag":if(!customElements.get(o(e))){W()}break;case"verdocs-help-icon":if(!customElements.get(o(e))){B()}break;case"verdocs-loader":if(!customElements.get(o(e))){T()}break;case"verdocs-ok-dialog":if(!customElements.get(o(e))){C()}break;case"verdocs-portal":if(!customElements.get(o(e))){$()}break;case"verdocs-select-input":if(!customElements.get(o(e))){I()}break;case"verdocs-template-field-properties":if(!customElements.get(o(e))){R()}break;case"verdocs-text-input":if(!customElements.get(o(e))){H()}break;case"verdocs-upload-dialog":if(!customElements.get(o(e))){N()}break}}))}export{z as V,F as d};
2
- //# sourceMappingURL=p-DVGumEtx.js.map
1
+ import{p as e,H as t,c as s,h as i,d as a,F as r,t as d}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as o,getTemplateDocumentPageDisplayUri as l,getTemplate as c}from"@verdocs/js-sdk";import{t as m,f as n,g as p}from"./p-BCwFpXpV.js";import{S as h}from"./p-C7hFgM52.js";import{d as u}from"./p-Bdf8pPWm.js";import{d as f}from"./p-REnrt0JM.js";import{d as v}from"./p-CyDWJAOZ.js";import{d as b}from"./p-DT0LGcPi.js";import{d as g}from"./p-DSK9z7EN.js";import{d as x}from"./p-BasWFMeN.js";import{d as y}from"./p-DwPH0TQ4.js";import{d as k}from"./p-BwEGkh_6.js";import{d as w}from"./p-DXLcCG08.js";import{d as E}from"./p-B845hxhl.js";import{d as j}from"./p-5E7bNT3k.js";import{d as P}from"./p-Cfiprngx.js";import{d as D}from"./p-pyA5cdVX.js";import{d as B}from"./p-DhO1wfh-.js";import{d as S}from"./p-wUsR0Dpa.js";import{d as W}from"./p-CioaaWeS.js";import{d as T}from"./p-B-_kYJtC.js";import{d as C}from"./p-BwUTiBud.js";import{d as $}from"./p-DQTI8vRX.js";import{d as N}from"./p-BXGNkmyr.js";import{d as R}from"./p-D3ohABOv.js";import{d as H}from"./p-DYtSnUj9.js";import{d as I}from"./p-CQUV5gMT.js";const U=()=>`verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-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-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}`;const F=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.pageRendered=s(this,"pageRendered");this.templateListenerId=null;this.endpoint=o.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await l(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(m((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>c(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(a,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(a,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var s;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.document_id===this.documentId&&e.page===this.pageNumber)).map((e=>{var t,s;const a=p(e);let{name:d,type:o,multiline:l}=e;const{xScale:c,yScale:m,templateId:h,editable:u,disabled:f,done:v,pageNumber:b}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((s=e["settings"])===null||s===void 0?void 0:s.leading)>0){o="textarea";l=true}switch(o){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,multiline:l,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"date":return i("verdocs-field-date",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:d,source:"template",sourceid:h,editable:u,disabled:f,done:v,xscale:c,yscale:m,pagenumber:b,isPreview:true,style:n(e,c,m)});default:return i(r,null,d)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return this}static get style(){return U()}},[0,"verdocs-template-document-page",{endpoint:[16],editable:[4],disabled:[4],done:[4],templateId:[513,"template-id"],documentId:[513,"document-id"],pageNumber:[514,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32],pageDisplayUri:[32],xScale:[32],yScale:[32],loading:[32],template:[32]}]);function G(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-document-page","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-field-properties","verdocs-text-input","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-document-page":if(!customElements.get(d(e))){customElements.define(d(e),F)}break;case"verdocs-button":if(!customElements.get(d(e))){u()}break;case"verdocs-checkbox":if(!customElements.get(d(e))){f()}break;case"verdocs-component-error":if(!customElements.get(d(e))){v()}break;case"verdocs-dialog":if(!customElements.get(d(e))){b()}break;case"verdocs-field-attachment":if(!customElements.get(d(e))){g()}break;case"verdocs-field-checkbox":if(!customElements.get(d(e))){x()}break;case"verdocs-field-date":if(!customElements.get(d(e))){y()}break;case"verdocs-field-dropdown":if(!customElements.get(d(e))){k()}break;case"verdocs-field-initial":if(!customElements.get(d(e))){w()}break;case"verdocs-field-radio":if(!customElements.get(d(e))){E()}break;case"verdocs-field-signature":if(!customElements.get(d(e))){j()}break;case"verdocs-field-textarea":if(!customElements.get(d(e))){P()}break;case"verdocs-field-textbox":if(!customElements.get(d(e))){D()}break;case"verdocs-field-timestamp":if(!customElements.get(d(e))){B()}break;case"verdocs-flag":if(!customElements.get(d(e))){S()}break;case"verdocs-help-icon":if(!customElements.get(d(e))){W()}break;case"verdocs-loader":if(!customElements.get(d(e))){T()}break;case"verdocs-ok-dialog":if(!customElements.get(d(e))){C()}break;case"verdocs-portal":if(!customElements.get(d(e))){$()}break;case"verdocs-select-input":if(!customElements.get(d(e))){N()}break;case"verdocs-template-field-properties":if(!customElements.get(d(e))){R()}break;case"verdocs-text-input":if(!customElements.get(d(e))){H()}break;case"verdocs-upload-dialog":if(!customElements.get(d(e))){I()}break}}))}export{F as V,G as d};
2
+ //# sourceMappingURL=p-DRgoGiAA.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as o,d as i,F as r,t as a}from"./p-yZBlG3YQ.js";import{i as l}from"./p-CGNX5HqF.js";import{S as n}from"./p-BDv5kBUR.js";import{S as d}from"./p-C7hFgM52.js";import{d as c}from"./p-Bdf8pPWm.js";import{d as h}from"./p-REnrt0JM.js";import{d as p}from"./p-CyDWJAOZ.js";import{d as f}from"./p-DT0LGcPi.js";import{d as m}from"./p-CioaaWeS.js";import{d as v}from"./p-B-_kYJtC.js";import{d as u}from"./p-D3qUITiS.js";import{d as g}from"./p-DQTI8vRX.js";import{d as b}from"./p-BXGNkmyr.js";import{d as x}from"./p-D3ohABOv.js";import{d as k}from"./p-DYtSnUj9.js";import{d as w}from"./p-u16vefxk.js";const y=()=>`verdocs-field-attachment{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-sizing:border-box;box-sizing:border-box;width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-attachment label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-attachment svg{width:16px;height:16px}verdocs-field-attachment.disabled svg{opacity:0.5}verdocs-field-attachment.disabled svg span{cursor:inherit}verdocs-field-attachment .attach{cursor:inherit;width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:var(--verdocs-field-radius)}verdocs-field-attachment.required .attach{border:1px solid var(--verdocs-required-field-border)}verdocs-field-attachment verdocs-button-panel{top:1px;left:-19px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-attachment verdocs-button-panel[data-active],verdocs-field-attachment verdocs-button-panel:hover{opacity:1}verdocs-field-attachment verdocs-button-panel .icon svg{fill:#333333}verdocs-field-attachment verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-attachment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-attachment .settings-icon svg{fill:#707ae5}verdocs-field-attachment .settings-icon:hover{opacity:1}`;const j=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="var(--verdocs-field-text-color, currentColor)"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>`;const E=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="var(--verdocs-attachment-icon-color, #339933)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-check"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m9 15 2 2 4-4"/></svg>`;const C=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.settingsChanged=s(this,"settingsChanged");this.attached=s(this,"attached");this.deleted=s(this,"deleted");this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.dialogOpen=false;this.selectedFile=null;this.focused=false;this.handleUploadNext=e=>{var t;console.log("Upload next",e);this.dialogOpen=false;this.selectedFile=e.detail[0];(t=this.attached)===null||t===void 0?void 0:t.emit(e.detail[0])};this.handleUploadRemove=e=>{var t;e.preventDefault();e.stopPropagation();this.dialogOpen=false;this.selectedFile=null;(t=this.deleted)===null||t===void 0?void 0:t.emit({fieldName:this.fieldname})}}handleBlur(){this.focused=false}async focusField(){this.el.focus();this.focused=true;this.dialogOpen=true}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.showPanel){e.showPanel()}}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.hidePanel){e.hidePanel()}}onEditableChanged(e,t){if(t&&!e){l(this.el).unset()}}disconnectedCallback(){l(this.el).unset()}handleShow(){this.dialogOpen=true}render(){const{source:e,sourceid:t,fieldname:s,editable:a=false,done:l=false,disabled:c=false,focused:h,xscale:p=1,yscale:f=1}=this;const{index:m,field:v}=d.getField(e,t,s,this.field);const{required:u=false,value:g="",label:b="",readonly:x=false,settings:k={}}=v||{};const w=`signer-${m%10+1}`;const y=g||!!this.selectedFile;if(l){return o(i,{class:{"verdocs-field":true,done:l}},o("div",{class:"attach",innerHTML:y?E:j}))}return o(i,{class:{"verdocs-field":true,required:u,disabled:c,done:l,focused:h,[w]:true}},b&&o("label",null,b),o("div",{class:"attach",innerHTML:y?E:j,onClick:()=>!c&&!x&&this.handleShow()}),a&&o(r,null,o("div",{id:`verdocs-settings-panel-trigger-${s}`,style:{transform:`scale(${Math.floor(1/p*1e3)/1e3}, ${Math.floor(1/f*1e3)/1e3})`},class:"settings-icon",innerHTML:n,onClick:e=>{e.stopPropagation();this.showingProperties=!this.showingProperties}}),this.showingProperties&&o("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${s}`,onClickAway:()=>this.showingProperties=false},o("verdocs-template-field-properties",{templateId:t,fieldName:s,onClose:()=>this.showingProperties=false,onDelete:()=>{var e;(e=this.deleted)===null||e===void 0?void 0:e.emit({fieldName:s});return this.hideSettingsPanel()},onSettingsChanged:e=>{var t;(t=this.settingsChanged)===null||t===void 0?void 0:t.emit(e.detail);return this.hideSettingsPanel()},helpText:"Attachments allow the user to attach their own documents (e.g. resumes or disclosures) to a signing flow."}))),this.dialogOpen&&o("verdocs-portal",null,o("verdocs-upload-dialog",{existingFile:k,onNext:e=>this.handleUploadNext(e),onRemove:e=>this.handleUploadRemove(e),onExit:()=>this.dialogOpen=false})))}get el(){return this}static get watchers(){return{editable:[{onEditableChanged:0}]}}static get style(){return y()}},[0,"verdocs-field-attachment",{source:[513],sourceid:[513],fieldname:[513],field:[16],isPreview:[516,"is-preview"],disabled:[516],editable:[516],moveable:[516],done:[516],xscale:[514],yscale:[514],pagenumber:[514],showingProperties:[32],dialogOpen:[32],selectedFile:[32],focused:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]},[[0,"blur","handleBlur"]],{editable:[{onEditableChanged:0}]}]);function B(){if(typeof customElements==="undefined"){return}const e=["verdocs-field-attachment","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-field-properties","verdocs-text-input","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-field-attachment":if(!customElements.get(a(e))){customElements.define(a(e),C)}break;case"verdocs-button":if(!customElements.get(a(e))){c()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){h()}break;case"verdocs-component-error":if(!customElements.get(a(e))){p()}break;case"verdocs-dialog":if(!customElements.get(a(e))){f()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){m()}break;case"verdocs-loader":if(!customElements.get(a(e))){v()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){u()}break;case"verdocs-portal":if(!customElements.get(a(e))){g()}break;case"verdocs-select-input":if(!customElements.get(a(e))){b()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){x()}break;case"verdocs-text-input":if(!customElements.get(a(e))){k()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){w()}break}}))}export{C as V,B as d};
2
- //# sourceMappingURL=p-BT8wzCXz.js.map
1
+ import{p as e,H as t,c as s,h as o,d as i,F as r,t as a}from"./p-yZBlG3YQ.js";import{i as l}from"./p-CGNX5HqF.js";import{S as n}from"./p-BDv5kBUR.js";import{S as d}from"./p-C7hFgM52.js";import{d as c}from"./p-Bdf8pPWm.js";import{d as h}from"./p-REnrt0JM.js";import{d as p}from"./p-CyDWJAOZ.js";import{d as f}from"./p-DT0LGcPi.js";import{d as m}from"./p-CioaaWeS.js";import{d as v}from"./p-B-_kYJtC.js";import{d as u}from"./p-BwUTiBud.js";import{d as g}from"./p-DQTI8vRX.js";import{d as b}from"./p-BXGNkmyr.js";import{d as x}from"./p-D3ohABOv.js";import{d as k}from"./p-DYtSnUj9.js";import{d as w}from"./p-CQUV5gMT.js";const y=()=>`verdocs-field-attachment{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);-webkit-box-sizing:border-box;box-sizing:border-box;width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-attachment label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-attachment svg{width:16px;height:16px}verdocs-field-attachment.disabled svg{opacity:0.5}verdocs-field-attachment.disabled svg span{cursor:inherit}verdocs-field-attachment .attach{cursor:inherit;width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:var(--verdocs-field-radius)}verdocs-field-attachment.required .attach{border:1px solid var(--verdocs-required-field-border)}verdocs-field-attachment verdocs-button-panel{top:1px;left:-19px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-attachment verdocs-button-panel[data-active],verdocs-field-attachment verdocs-button-panel:hover{opacity:1}verdocs-field-attachment verdocs-button-panel .icon svg{fill:#333333}verdocs-field-attachment verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-attachment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-attachment .settings-icon svg{fill:#707ae5}verdocs-field-attachment .settings-icon:hover{opacity:1}`;const j=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="var(--verdocs-field-text-color, currentColor)"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>`;const E=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="var(--verdocs-attachment-icon-color, #339933)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-check"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m9 15 2 2 4-4"/></svg>`;const C=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.settingsChanged=s(this,"settingsChanged");this.attached=s(this,"attached");this.deleted=s(this,"deleted");this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.dialogOpen=false;this.selectedFile=null;this.focused=false;this.handleUploadNext=e=>{var t;console.log("Upload next",e);this.dialogOpen=false;this.selectedFile=e.detail[0];(t=this.attached)===null||t===void 0?void 0:t.emit(e.detail[0])};this.handleUploadRemove=e=>{var t;e.preventDefault();e.stopPropagation();this.dialogOpen=false;this.selectedFile=null;(t=this.deleted)===null||t===void 0?void 0:t.emit({fieldName:this.fieldname})}}handleBlur(){this.focused=false}async focusField(){this.el.focus();this.focused=true;this.dialogOpen=true}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.showPanel){e.showPanel()}}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.hidePanel){e.hidePanel()}}onEditableChanged(e,t){if(t&&!e){l(this.el).unset()}}disconnectedCallback(){l(this.el).unset()}handleShow(){this.dialogOpen=true}render(){const{source:e,sourceid:t,fieldname:s,editable:a=false,done:l=false,disabled:c=false,focused:h,xscale:p=1,yscale:f=1}=this;const{index:m,field:v}=d.getField(e,t,s,this.field);const{required:u=false,value:g="",label:b="",readonly:x=false,settings:k={}}=v||{};const w=`signer-${m%10+1}`;const y=g||!!this.selectedFile;if(l){return o(i,{class:{"verdocs-field":true,done:l}},o("div",{class:"attach",innerHTML:y?E:j}))}return o(i,{class:{"verdocs-field":true,required:u,disabled:c,done:l,focused:h,[w]:true}},b&&o("label",null,b),o("div",{class:"attach",innerHTML:y?E:j,onClick:()=>!c&&!x&&this.handleShow()}),a&&o(r,null,o("div",{id:`verdocs-settings-panel-trigger-${s}`,style:{transform:`scale(${Math.floor(1/p*1e3)/1e3}, ${Math.floor(1/f*1e3)/1e3})`},class:"settings-icon",innerHTML:n,onClick:e=>{e.stopPropagation();this.showingProperties=!this.showingProperties}}),this.showingProperties&&o("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${s}`,onClickAway:()=>this.showingProperties=false},o("verdocs-template-field-properties",{templateId:t,fieldName:s,onClose:()=>this.showingProperties=false,onDelete:()=>{var e;(e=this.deleted)===null||e===void 0?void 0:e.emit({fieldName:s});return this.hideSettingsPanel()},onSettingsChanged:e=>{var t;(t=this.settingsChanged)===null||t===void 0?void 0:t.emit(e.detail);return this.hideSettingsPanel()},helpText:"Attachments allow the user to attach their own documents (e.g. resumes or disclosures) to a signing flow."}))),this.dialogOpen&&o("verdocs-portal",null,o("verdocs-upload-dialog",{existingFile:k,onNext:e=>this.handleUploadNext(e),onRemove:e=>this.handleUploadRemove(e),onExit:()=>this.dialogOpen=false})))}get el(){return this}static get watchers(){return{editable:[{onEditableChanged:0}]}}static get style(){return y()}},[0,"verdocs-field-attachment",{source:[513],sourceid:[513],fieldname:[513],field:[16],isPreview:[516,"is-preview"],disabled:[516],editable:[516],moveable:[516],done:[516],xscale:[514],yscale:[514],pagenumber:[514],showingProperties:[32],dialogOpen:[32],selectedFile:[32],focused:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]},[[0,"blur","handleBlur"]],{editable:[{onEditableChanged:0}]}]);function B(){if(typeof customElements==="undefined"){return}const e=["verdocs-field-attachment","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-field-properties","verdocs-text-input","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-field-attachment":if(!customElements.get(a(e))){customElements.define(a(e),C)}break;case"verdocs-button":if(!customElements.get(a(e))){c()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){h()}break;case"verdocs-component-error":if(!customElements.get(a(e))){p()}break;case"verdocs-dialog":if(!customElements.get(a(e))){f()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){m()}break;case"verdocs-loader":if(!customElements.get(a(e))){v()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){u()}break;case"verdocs-portal":if(!customElements.get(a(e))){g()}break;case"verdocs-select-input":if(!customElements.get(a(e))){b()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){x()}break;case"verdocs-text-input":if(!customElements.get(a(e))){k()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){w()}break}}))}export{C as V,B as d};
2
+ //# sourceMappingURL=p-DSK9z7EN.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as s,h as r,d as a,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as n,toggleTemplateStar as o}from"@verdocs/js-sdk";const l=()=>`verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}`;const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>`;const f=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.starChange=s(this,"starChange");this.sdkError=s(this,"sdkError");this.endpoint=n.getDefault();this.updating=false}async componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}toggle(t){t.stopPropagation();this.updating=true;o(n.getDefault(),this.template.id).then((t=>{this.updating=false;this.template.star_counter=t.star_counter;this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=false;console.log("[STAR] Error toggling template star",t.message);this.sdkError.emit(t)}))}render(){return r(a,{key:"11f23b3f7dc779128e3ce967619491255d2f46e5"},r("div",{key:"a8b0281d77522a51cc5ed57e752327b79749986d",class:`star ${this.updating?"updating":""}`,innerHTML:this.template.star_counter?d:c,onClick:t=>this.toggle(t)}),r("div",{key:"ca4e6ed0e494f0255cce552150ac17008f76ae3e",class:"count"},this.template.star_counter||"--"))}static get style(){return l()}},[0,"verdocs-template-star",{endpoint:[16],template:[1040],updating:[32]}]);function m(){if(typeof customElements==="undefined"){return}const t=["verdocs-template-star"];t.forEach((t=>{switch(t){case"verdocs-template-star":if(!customElements.get(i(t))){customElements.define(i(t),f)}break}}))}export{f as V,m as d};
2
- //# sourceMappingURL=p-tub_01MP.js.map
1
+ import{p as t,H as e,c as s,h as r,d as a,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as n,toggleTemplateStar as o}from"@verdocs/js-sdk";const l=()=>`verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}`;const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>`;const f=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.starChange=s(this,"starChange");this.sdkError=s(this,"sdkError");this.endpoint=n.getDefault();this.updating=false}async componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}toggle(t){t.stopPropagation();this.updating=true;o(n.getDefault(),this.template.id).then((t=>{this.updating=false;this.template.star_counter=t.star_counter;this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=false;console.log("[STAR] Error toggling template star",t.message);this.sdkError.emit(t)}))}render(){return r(a,{key:"c60505c6215779f063eaa7896dc2c0278d78e877"},r("div",{key:"cd1c9b41b3ac03fe72333d4244729f55b42ef33d",class:`star ${this.updating?"updating":""}`,innerHTML:this.template.star_counter?d:c,onClick:t=>this.toggle(t)}),r("div",{key:"0e7ecdeb2646424f052152b7c7bb16543ff260d3",class:"count"},this.template.star_counter||"--"))}static get style(){return l()}},[0,"verdocs-template-star",{endpoint:[16],template:[1040],updating:[32]}]);function m(){if(typeof customElements==="undefined"){return}const t=["verdocs-template-star"];t.forEach((t=>{switch(t){case"verdocs-template-star":if(!customElements.get(i(t))){customElements.define(i(t),f)}break}}))}export{f as V,m as d};
2
+ //# sourceMappingURL=p-DXbBz25U.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as i,h as s,d as o,t as a}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as h,getEnvelopeDocumentPageDisplayUri as d}from"@verdocs/js-sdk";import{t as n}from"./p-BCwFpXpV.js";import{d as r}from"./p-wUsR0Dpa.js";const c=()=>`verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-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-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}`;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.pageRendered=i(this,"pageRendered");this.endpoint=h.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId=`verdocs-envelope-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber,this.type)}componentDidLoad(){this.resizeObserver=new ResizeObserver(n((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})}render(){const e=`${this.renderedHeight}px`;return s(o,{key:"7ed2187dfb4ef248411d777ad2837ba18a85ec45",id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>t.type==="div"?s("div",{class:"verdocs-envelope-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}}):this.pageDisplayUri?s("img",{class:"verdocs-envelope-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):s("div",null))))}get container(){return this}static get style(){return c()}},[0,"verdocs-envelope-document-page",{endpoint:[16],envelopeId:[1,"envelope-id"],documentId:[1,"document-id"],pageNumber:[2,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],type:[1],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32],pageDisplayUri:[32]}]);function p(){if(typeof customElements==="undefined"){return}const e=["verdocs-envelope-document-page","verdocs-flag"];e.forEach((e=>{switch(e){case"verdocs-envelope-document-page":if(!customElements.get(a(e))){customElements.define(a(e),l)}break;case"verdocs-flag":if(!customElements.get(a(e))){r()}break}}))}export{l as V,p as d};
2
- //# sourceMappingURL=p-DIOVejyL.js.map
1
+ import{p as e,H as t,c as i,h as s,d as o,t as h}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as a,getEnvelopeDocumentPageDisplayUri as n}from"@verdocs/js-sdk";import{t as d}from"./p-BCwFpXpV.js";import{d as r}from"./p-wUsR0Dpa.js";const c=()=>`verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-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-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}`;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.pageRendered=i(this,"pageRendered");this.endpoint=a.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId=`verdocs-envelope-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}async componentWillLoad(){this.pageDisplayUri=await n(this.endpoint,this.documentId,this.pageNumber,this.type)}componentDidLoad(){this.resizeObserver=new ResizeObserver(d((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})}render(){const e=`${this.renderedHeight}px`;return s(o,{key:"633b71e22df815319ad854618b74b035a6e43603",id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>t.type==="div"?s("div",{class:"verdocs-envelope-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}}):this.pageDisplayUri?s("img",{class:"verdocs-envelope-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):s("div",null))))}get container(){return this}static get style(){return c()}},[0,"verdocs-envelope-document-page",{endpoint:[16],envelopeId:[1,"envelope-id"],documentId:[1,"document-id"],pageNumber:[2,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],type:[1],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32],pageDisplayUri:[32]}]);function p(){if(typeof customElements==="undefined"){return}const e=["verdocs-envelope-document-page","verdocs-flag"];e.forEach((e=>{switch(e){case"verdocs-envelope-document-page":if(!customElements.get(h(e))){customElements.define(h(e),l)}break;case"verdocs-flag":if(!customElements.get(h(e))){r()}break}}))}export{l as V,p as d};
2
+ //# sourceMappingURL=p-DyhyfLyV.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,c as s,h as o,d as i,F as l,t as a}from"./p-yZBlG3YQ.js";import{i as d}from"./p-CGNX5HqF.js";import{VerdocsEndpoint as r,getTemplate as n,updateField as c,createField as p,integerSequence as m}from"@verdocs/js-sdk";import{g as h,h as v,i as f,j as g,d as u,k as x}from"./p-BCwFpXpV.js";import{D as w}from"./p-BDv5kBUR.js";import{V as b}from"./p-D97GxsI-.js";import{S as k}from"./p-C1sRVZWv.js";import{S as E}from"./p-C7hFgM52.js";import{d as q}from"./p-Bdf8pPWm.js";import{d as C}from"./p-REnrt0JM.js";import{d as Z}from"./p-CyDWJAOZ.js";import{d as V}from"./p-DT0LGcPi.js";import{d as M}from"./p-BT8wzCXz.js";import{d as y}from"./p-BasWFMeN.js";import{d as H}from"./p-DwPH0TQ4.js";import{d as j}from"./p-BwEGkh_6.js";import{d as S}from"./p-DXLcCG08.js";import{d as D}from"./p-B845hxhl.js";import{d as L}from"./p-5E7bNT3k.js";import{d as I}from"./p-Cfiprngx.js";import{d as Q}from"./p-pyA5cdVX.js";import{d as B}from"./p-DhO1wfh-.js";import{d as T}from"./p-wUsR0Dpa.js";import{d as F}from"./p-CioaaWeS.js";import{d as z}from"./p-B-_kYJtC.js";import{d as N}from"./p-D3qUITiS.js";import{d as P}from"./p-DQTI8vRX.js";import{d as R}from"./p-BXGNkmyr.js";import{d as X}from"./p-DVGumEtx.js";import{d as U}from"./p-D3ohABOv.js";import{d as W}from"./p-DYtSnUj9.js";import{d as Y}from"./p-Bxmki12o.js";import{d as $}from"./p-u16vefxk.js";const _=()=>`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}`;const G='<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>';const O='<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>';const A='<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>';const J='<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>';const K='<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>';const ee='<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>';const te='<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>';const se='<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>';const oe='<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>';const ie=[{id:"signature",tooltip:"Signature",icon:K,class:"signature"},{id:"initial",tooltip:"Initials",icon:ee,class:"initial"},{id:"sep1",tooltip:"",icon:oe,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:G,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:O,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:A,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:te,class:"dropdown"},{id:"sep2",tooltip:"",icon:oe,class:"separator"},{id:"date",tooltip:"Date",icon:J,class:"date"},{id:"attachment",tooltip:"Attachment",icon:se,class:"attachment"}];const le=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.templateUpdated=s(this,"templateUpdated");this.templateListenerId=null;this.endpoint=r.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={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(o){console.log("[FIELDS] Error with fields session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new k(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(s=o.response)===null||s===void 0?void 0:s.data))}}componentDidRender(){d.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const s=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));if(!this.selectedRoleName||!s.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();E.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const s=[...e.roles||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){E.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,s;var o,i;const l=e.detail;console.log("[FIELDS] Page rendered",l.documentId,l.pageNumber,l.xScale,l.yScale);(t=(o=this.cachedPageInfo)[i=l.documentId])!==null&&t!==void 0?t:o[i]={};this.cachedPageInfo[l.documentId][l.pageNumber]=l;this.pageHeights[l.pageNumber]=l.naturalHeight;(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.page===l.pageNumber)).forEach((e=>{const t=h(e);const s=document.getElementById(t);if(s){s.setAttribute("templateid",this.templateId);s.setAttribute("fieldname",e.name);s.setAttribute("documentid",String(e.document_id));s.setAttribute("pagenumber",String(e.page));s.setAttribute("xScale",String(l.xScale));s.setAttribute("yScale",String(l.yScale));this.makeDraggable(s)}}))}makeDraggable(e){d(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const s=+(e.target.getAttribute("posY")||0);const o=+(e.target.getAttribute("xScale")||1);const i=+(e.target.getAttribute("yScale")||1);const l=e.dx/o+t;const a=e.dy/i+s;e.target.setAttribute("posX",l);e.target.setAttribute("posy",a);v(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,s,o,i,l,a,d,r;const n=e.target.getAttribute("fieldname");const p=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===n));if(!p){console.log("[FIELDS] Unable to find field",n,e.target);return}const m=e.target.getAttribute("pagenumber");const h=e.target.getAttribute("documentid");let{naturalWidth:v=612,naturalHeight:w=792,renderedHeight:q=792}=this.cachedPageInfo[h][m];const C=e.target.getBoundingClientRect();const Z=e.target.parentElement;const V=Z.getBoundingClientRect();const M=p.width||x(p.type);const y=p.height||u(p.type);const H=Math.max(C.left-V.left,0);let j=Math.max(q-(V.bottom-C.bottom),0);let S=parseInt(m);if(j>q){S=Math.min(S+1,((i=(o=((s=this.template)===null||s===void 0?void 0:s.documents)||[])===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.pages)||1);j-=q;q=this.cachedPageInfo[h][S].renderedHeight;console.log("Next page",{newPageNumber:S,newY:j,renderedHeight:q})}else if(j<0){S=Math.max(S-1,1);q=this.cachedPageInfo[h][S].renderedHeight;j+=q;console.log("[FIELDS] Next page",{newPageNumber:S,newY:j,renderedHeight:q})}const{x:D,y:L}=this.viewCoordinatesToPageCoordinates(H,j,h,m,v-M,w-y);try{const t={x:D,y:L,page:S};const s=await c(this.endpoint,this.templateId,n,t);console.log("[FIELDS] Updated",s);const o=JSON.parse(JSON.stringify(this.template));const i=o.fields.findIndex((e=>e.name===n));if(i>-1){o.fields[i]=s}E.updateTemplate(this.templateId,o);e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target);const{xScale:a=1,yScale:d=1}=this.cachedPageInfo[h][m];g(e.target,s,a,d);(l=this.templateUpdated)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:o,event:"updated-field"})}catch(t){b("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(a=this.sdkError)===null||a===void 0?void 0:a.emit(new k(t.message,(d=t.response)===null||d===void 0?void 0:d.status,(r=t.response)===null||r===void 0?void 0:r.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target)}}generateFieldName(e,t){var s;let o=1;let i;do{i=`${e}P${t}-${o}`;o++}while((((s=this.template)===null||s===void 0?void 0:s.fields)||[]).some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,s,o,i,l){const{xScale:a=1,yScale:d=1,renderedHeight:r=792}=this.cachedPageInfo[s][o];const n=Math.floor(Math.min(e/a,i));const c=Math.floor(Math.min(Math.max(r-t,0)/d,l));return{x:n,y:c}}async handleClickPage(e,t,s){var o;if(this.placing){const i=e.offsetX;const l=e.offsetY;const a=x(this.placing);const d=u(this.placing);const r=this.cachedPageInfo[t][s];const{naturalWidth:n=612,naturalHeight:c=792}=r;const m=this.viewCoordinatesToPageCoordinates(i,l,t,s,n-a,c-d);const h=Math.floor(m.x);const v=Math.floor(m.y);const f={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,document_id:r.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:s,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:d,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const g=await p(this.endpoint,this.templateId,f);console.log("[FIELDS] Created field",g);const w=JSON.parse(JSON.stringify(this.template));w.fields.push(g);E.updateTemplate(this.templateId,w);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:w,event:"added-field"});this.placing=null}}render(){var e,t,s;console.log("Rendering");if(this.loading){return o(i,null,o("verdocs-loader",null))}if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const a=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));const d=a.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:d,onInput:e=>this.selectedRoleName=e.target.value}),ie.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),o("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=m(1,e.pages);return t.map((t=>{var s;const i=e.page_sizes[t];return o(l,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&o("div",{class:"document-separator"},o("div",{innerHTML:w}),o("span",null,e.name)),o("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(i===null||i===void 0?void 0:i.width)||612,virtualHeight:(i===null||i===void 0?void 0:i.height)||792,disabled:true,editable:true,done:false,onClick:s=>this.handleClickPage(s,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&o("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return _()}},[0,"verdocs-template-fields",{endpoint:[16],templateId:[1537,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],showMustSelectRole:[32],selectedRoleName:[32],loading:[32],template:[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{templateId:[{onTemplateIdChanged:0}]}]);function ae(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-fields","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-document-page","verdocs-template-field-properties","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-fields":if(!customElements.get(a(e))){customElements.define(a(e),le)}break;case"verdocs-button":if(!customElements.get(a(e))){q()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){C()}break;case"verdocs-component-error":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){V()}break;case"verdocs-field-attachment":if(!customElements.get(a(e))){M()}break;case"verdocs-field-checkbox":if(!customElements.get(a(e))){y()}break;case"verdocs-field-date":if(!customElements.get(a(e))){H()}break;case"verdocs-field-dropdown":if(!customElements.get(a(e))){j()}break;case"verdocs-field-initial":if(!customElements.get(a(e))){S()}break;case"verdocs-field-radio":if(!customElements.get(a(e))){D()}break;case"verdocs-field-signature":if(!customElements.get(a(e))){L()}break;case"verdocs-field-textarea":if(!customElements.get(a(e))){I()}break;case"verdocs-field-textbox":if(!customElements.get(a(e))){Q()}break;case"verdocs-field-timestamp":if(!customElements.get(a(e))){B()}break;case"verdocs-flag":if(!customElements.get(a(e))){T()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){F()}break;case"verdocs-loader":if(!customElements.get(a(e))){z()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){N()}break;case"verdocs-portal":if(!customElements.get(a(e))){P()}break;case"verdocs-select-input":if(!customElements.get(a(e))){R()}break;case"verdocs-template-document-page":if(!customElements.get(a(e))){X()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){U()}break;case"verdocs-text-input":if(!customElements.get(a(e))){W()}break;case"verdocs-toolbar-icon":if(!customElements.get(a(e))){Y()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){$()}break}}))}export{le as V,ae as d};
2
- //# sourceMappingURL=p-Yxa93LOl.js.map
1
+ import{p as e,H as t,c as s,h as o,d as i,F as l,t as a}from"./p-yZBlG3YQ.js";import{i as d}from"./p-CGNX5HqF.js";import{VerdocsEndpoint as r,getTemplate as n,updateField as c,createField as p,integerSequence as m}from"@verdocs/js-sdk";import{g as h,h as v,i as f,j as g,d as u,k as w}from"./p-BCwFpXpV.js";import{D as x}from"./p-BDv5kBUR.js";import{V as b}from"./p-D97GxsI-.js";import{S as k}from"./p-C1sRVZWv.js";import{S as E}from"./p-C7hFgM52.js";import{d as q}from"./p-Bdf8pPWm.js";import{d as C}from"./p-REnrt0JM.js";import{d as Z}from"./p-CyDWJAOZ.js";import{d as V}from"./p-DT0LGcPi.js";import{d as M}from"./p-DSK9z7EN.js";import{d as y}from"./p-BasWFMeN.js";import{d as H}from"./p-DwPH0TQ4.js";import{d as j}from"./p-BwEGkh_6.js";import{d as S}from"./p-DXLcCG08.js";import{d as D}from"./p-B845hxhl.js";import{d as L}from"./p-5E7bNT3k.js";import{d as I}from"./p-Cfiprngx.js";import{d as Q}from"./p-pyA5cdVX.js";import{d as B}from"./p-DhO1wfh-.js";import{d as T}from"./p-wUsR0Dpa.js";import{d as F}from"./p-CioaaWeS.js";import{d as z}from"./p-B-_kYJtC.js";import{d as N}from"./p-BwUTiBud.js";import{d as P}from"./p-DQTI8vRX.js";import{d as R}from"./p-BXGNkmyr.js";import{d as U}from"./p-DRgoGiAA.js";import{d as W}from"./p-D3ohABOv.js";import{d as X}from"./p-DYtSnUj9.js";import{d as A}from"./p-Bxmki12o.js";import{d as Y}from"./p-CQUV5gMT.js";const $=()=>`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}`;const _='<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>';const G='<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>';const O='<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>';const J='<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>';const K='<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>';const ee='<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>';const te='<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>';const se='<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>';const oe='<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>';const ie=[{id:"signature",tooltip:"Signature",icon:K,class:"signature"},{id:"initial",tooltip:"Initials",icon:ee,class:"initial"},{id:"sep1",tooltip:"",icon:oe,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:_,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:G,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:O,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:te,class:"dropdown"},{id:"sep2",tooltip:"",icon:oe,class:"separator"},{id:"date",tooltip:"Date",icon:J,class:"date"},{id:"attachment",tooltip:"Attachment",icon:se,class:"attachment"}];const le=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.templateUpdated=s(this,"templateUpdated");this.templateListenerId=null;this.endpoint=r.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={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(o){console.log("[FIELDS] Error with fields session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new k(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(s=o.response)===null||s===void 0?void 0:s.data))}}componentDidRender(){d.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const s=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));if(!this.selectedRoleName||!s.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();E.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const s=[...e.roles||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){E.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,s;var o,i;const l=e.detail;console.log("[FIELDS] Page rendered",l.documentId,l.pageNumber,l.xScale,l.yScale);(t=(o=this.cachedPageInfo)[i=l.documentId])!==null&&t!==void 0?t:o[i]={};this.cachedPageInfo[l.documentId][l.pageNumber]=l;this.pageHeights[l.pageNumber]=l.naturalHeight;(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.page===l.pageNumber)).forEach((e=>{const t=h(e);const s=document.getElementById(t);if(s){s.setAttribute("templateid",this.templateId);s.setAttribute("fieldname",e.name);s.setAttribute("documentid",String(e.document_id));s.setAttribute("pagenumber",String(e.page));s.setAttribute("xScale",String(l.xScale));s.setAttribute("yScale",String(l.yScale));this.makeDraggable(s)}}))}makeDraggable(e){d(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const s=+(e.target.getAttribute("posY")||0);const o=+(e.target.getAttribute("xScale")||1);const i=+(e.target.getAttribute("yScale")||1);const l=e.dx/o+t;const a=e.dy/i+s;e.target.setAttribute("posX",l);e.target.setAttribute("posy",a);v(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,s,o,i,l,a,d,r;const n=e.target.getAttribute("fieldname");const p=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===n));if(!p){console.log("[FIELDS] Unable to find field",n,e.target);return}const m=e.target.getAttribute("pagenumber");const h=e.target.getAttribute("documentid");let{naturalWidth:v=612,naturalHeight:x=792,renderedHeight:q=792}=this.cachedPageInfo[h][m];const C=e.target.getBoundingClientRect();const Z=e.target.parentElement;const V=Z.getBoundingClientRect();const M=p.width||w(p.type);const y=p.height||u(p.type);const H=Math.max(C.left-V.left,0);let j=Math.max(q-(V.bottom-C.bottom),0);let S=parseInt(m);if(j>q){S=Math.min(S+1,((i=(o=((s=this.template)===null||s===void 0?void 0:s.documents)||[])===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.pages)||1);j-=q;q=this.cachedPageInfo[h][S].renderedHeight;console.log("Next page",{newPageNumber:S,newY:j,renderedHeight:q})}else if(j<0){S=Math.max(S-1,1);q=this.cachedPageInfo[h][S].renderedHeight;j+=q;console.log("[FIELDS] Next page",{newPageNumber:S,newY:j,renderedHeight:q})}const{x:D,y:L}=this.viewCoordinatesToPageCoordinates(H,j,h,m,v-M,x-y);try{const t={x:D,y:L,page:S};const s=await c(this.endpoint,this.templateId,n,t);console.log("[FIELDS] Updated",s);const o=JSON.parse(JSON.stringify(this.template));const i=o.fields.findIndex((e=>e.name===n));if(i>-1){o.fields[i]=s}E.updateTemplate(this.templateId,o);e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target);const{xScale:a=1,yScale:d=1}=this.cachedPageInfo[h][m];g(e.target,s,a,d);(l=this.templateUpdated)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:o,event:"updated-field"})}catch(t){b("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(a=this.sdkError)===null||a===void 0?void 0:a.emit(new k(t.message,(d=t.response)===null||d===void 0?void 0:d.status,(r=t.response)===null||r===void 0?void 0:r.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target)}}generateFieldName(e,t){var s;let o=1;let i;do{i=`${e}P${t}-${o}`;o++}while((((s=this.template)===null||s===void 0?void 0:s.fields)||[]).some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,s,o,i,l){const{xScale:a=1,yScale:d=1,renderedHeight:r=792}=this.cachedPageInfo[s][o];const n=Math.floor(Math.min(e/a,i));const c=Math.floor(Math.min(Math.max(r-t,0)/d,l));return{x:n,y:c}}async handleClickPage(e,t,s){var o;if(this.placing){const i=e.offsetX;const l=e.offsetY;const a=w(this.placing);const d=u(this.placing);const r=this.cachedPageInfo[t][s];const{naturalWidth:n=612,naturalHeight:c=792}=r;const m=this.viewCoordinatesToPageCoordinates(i,l,t,s,n-a,c-d);const h=Math.floor(m.x);const v=Math.floor(m.y);const f={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,document_id:r.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:s,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:d,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const g=await p(this.endpoint,this.templateId,f);console.log("[FIELDS] Created field",g);const x=JSON.parse(JSON.stringify(this.template));x.fields.push(g);E.updateTemplate(this.templateId,x);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:x,event:"added-field"});this.placing=null}}render(){var e,t,s;console.log("Rendering");if(this.loading){return o(i,null,o("verdocs-loader",null))}if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const a=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));const d=a.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:d,onInput:e=>this.selectedRoleName=e.target.value}),ie.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),o("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=m(1,e.pages);return t.map((t=>{var s;const i=e.page_sizes[t];return o(l,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&o("div",{class:"document-separator"},o("div",{innerHTML:x}),o("span",null,e.name)),o("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(i===null||i===void 0?void 0:i.width)||612,virtualHeight:(i===null||i===void 0?void 0:i.height)||792,disabled:true,editable:true,done:false,onClick:s=>this.handleClickPage(s,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&o("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return $()}},[0,"verdocs-template-fields",{endpoint:[16],templateId:[1537,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],showMustSelectRole:[32],selectedRoleName:[32],loading:[32],template:[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{templateId:[{onTemplateIdChanged:0}]}]);function ae(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-fields","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-document-page","verdocs-template-field-properties","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-fields":if(!customElements.get(a(e))){customElements.define(a(e),le)}break;case"verdocs-button":if(!customElements.get(a(e))){q()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){C()}break;case"verdocs-component-error":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){V()}break;case"verdocs-field-attachment":if(!customElements.get(a(e))){M()}break;case"verdocs-field-checkbox":if(!customElements.get(a(e))){y()}break;case"verdocs-field-date":if(!customElements.get(a(e))){H()}break;case"verdocs-field-dropdown":if(!customElements.get(a(e))){j()}break;case"verdocs-field-initial":if(!customElements.get(a(e))){S()}break;case"verdocs-field-radio":if(!customElements.get(a(e))){D()}break;case"verdocs-field-signature":if(!customElements.get(a(e))){L()}break;case"verdocs-field-textarea":if(!customElements.get(a(e))){I()}break;case"verdocs-field-textbox":if(!customElements.get(a(e))){Q()}break;case"verdocs-field-timestamp":if(!customElements.get(a(e))){B()}break;case"verdocs-flag":if(!customElements.get(a(e))){T()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){F()}break;case"verdocs-loader":if(!customElements.get(a(e))){z()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){N()}break;case"verdocs-portal":if(!customElements.get(a(e))){P()}break;case"verdocs-select-input":if(!customElements.get(a(e))){R()}break;case"verdocs-template-document-page":if(!customElements.get(a(e))){U()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){W()}break;case"verdocs-text-input":if(!customElements.get(a(e))){X()}break;case"verdocs-toolbar-icon":if(!customElements.get(a(e))){A()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){Y()}break}}))}export{le as V,ae as d};
2
+ //# sourceMappingURL=p-db6IAGB0.js.map