@verdocs/web-sdk 2.3.14 → 2.3.15

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 (343) hide show
  1. package/dist/cjs/{EnvelopeStore-f8c301e1.js → EnvelopeStore-efc35530.js} +1 -1
  2. package/dist/cjs/{Envelopes-99ca79fe.js → Envelopes-0b9deb2c.js} +2 -6
  3. package/dist/cjs/{Profiles-54271244.js → Profiles-1a26e4eb.js} +0 -34
  4. package/dist/cjs/{TemplateStore-d9936a68.js → TemplateStore-17b9fdfe.js} +1 -1
  5. package/dist/cjs/{Types-ee5afdf8.js → Types-fb95ed6b.js} +2 -1
  6. package/dist/cjs/{VerdocsEndpoint-2d85658d.js → VerdocsEndpoint-8f298664.js} +197 -563
  7. package/dist/cjs/{_commonjsHelpers-0c557e26.js → _commonjsHelpers-1fbbf0eb.js} +0 -5
  8. package/dist/cjs/interact.min-7c05ff8a.js +12 -0
  9. package/dist/cjs/ipc-test.cjs.entry.js +2 -2
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/{utils-2ddfdf9e.js → utils-0916d10f.js} +3 -3
  12. package/dist/cjs/verdocs-activity-box.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-auth.cjs.entry.js +8 -34
  14. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +12 -3
  16. package/dist/cjs/{verdocs-contact-picker_2.cjs.entry.js → verdocs-contact-picker_3.cjs.entry.js} +78 -6
  17. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +5 -5
  18. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
  19. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +5 -4
  20. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +5 -5
  21. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +4 -4
  22. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +4 -4
  23. package/dist/cjs/verdocs-field-date.cjs.entry.js +5 -5
  24. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +4 -5
  25. package/dist/cjs/verdocs-field-initial.cjs.entry.js +4 -4
  26. package/dist/cjs/verdocs-field-payment.cjs.entry.js +4 -4
  27. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +4 -4
  28. package/dist/cjs/verdocs-field-signature.cjs.entry.js +4 -4
  29. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +10 -9
  30. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +9 -9
  31. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +5 -5
  32. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  33. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +2 -1
  34. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +4 -4
  35. package/dist/cjs/verdocs-preview_8.cjs.entry.js +9 -8
  36. package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +79 -0
  37. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  38. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +70 -37
  39. package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
  40. package/dist/cjs/verdocs-sign.cjs.entry.js +11 -8
  41. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +5 -5
  42. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +55 -47
  43. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  44. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  45. package/dist/cjs/verdocs-view.cjs.entry.js +5 -5
  46. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  47. package/dist/collection/collection-manifest.json +1 -1
  48. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.css +0 -0
  49. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +181 -0
  50. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.stories.js +20 -0
  51. package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +20 -1
  52. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +6 -34
  53. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +2 -1
  54. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -3
  55. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +4 -1
  56. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -0
  57. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -0
  58. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +0 -1
  59. package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +2 -1
  60. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.css +1 -1
  61. package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -0
  62. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
  63. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +10 -0
  64. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +43 -35
  65. package/dist/collection/utils/Types.js +2 -1
  66. package/dist/components/Envelopes.js +2 -6
  67. package/dist/components/TemplateStore.js +1 -1
  68. package/dist/components/Types2.js +2 -1
  69. package/dist/components/VerdocsEndpoint.js +197 -562
  70. package/dist/components/_commonjsHelpers.js +1 -5
  71. package/dist/components/index.d.ts +1 -1
  72. package/dist/components/index.js +1 -1
  73. package/dist/components/index3.js +40 -29
  74. package/dist/components/interact.min.js +5 -6
  75. package/dist/components/verdocs-auth.js +12 -46
  76. package/dist/components/verdocs-build.js +22 -16
  77. package/dist/components/verdocs-contact-picker2.js +1 -1
  78. package/dist/components/verdocs-envelope-sidebar.js +1 -0
  79. package/dist/components/verdocs-field-date.js +1 -1
  80. package/dist/components/verdocs-field-dropdown.js +0 -1
  81. package/dist/components/verdocs-field-textarea.js +5 -4
  82. package/dist/components/verdocs-field-textbox.js +4 -4
  83. package/dist/components/verdocs-field-timestamp.js +1 -1
  84. package/dist/components/verdocs-ok-dialog2.js +3 -1
  85. package/dist/components/verdocs-portal.d.ts +11 -0
  86. package/dist/components/verdocs-portal.js +6 -0
  87. package/dist/components/verdocs-portal2.js +93 -0
  88. package/dist/components/verdocs-search.js +2 -8
  89. package/dist/components/verdocs-send2.js +12 -5
  90. package/dist/components/verdocs-settings-organization2.js +22 -1
  91. package/dist/components/verdocs-sign.js +7 -3
  92. package/dist/components/verdocs-template-create2.js +2 -2
  93. package/dist/components/verdocs-template-field-properties2.js +10 -0
  94. package/dist/components/verdocs-template-fields2.js +46 -38
  95. package/dist/components/verdocs-template-roles2.js +4 -4
  96. package/dist/custom-elements.json +2067 -0
  97. package/dist/docs.json +139 -108
  98. package/dist/esm/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
  99. package/dist/esm/{Envelopes-21ffb899.js → Envelopes-627c5239.js} +2 -6
  100. package/dist/esm/{Profiles-4cc942ef.js → Profiles-d4df4d1c.js} +1 -32
  101. package/dist/esm/{TemplateStore-018fc1db.js → TemplateStore-ad77a294.js} +1 -1
  102. package/dist/esm/Types-1628dc71.js +5 -0
  103. package/dist/esm/{VerdocsEndpoint-b011af25.js → VerdocsEndpoint-56fa3371.js} +197 -562
  104. package/dist/esm/{_commonjsHelpers-5ec8f9b7.js → _commonjsHelpers-8a9f3b18.js} +1 -5
  105. package/dist/esm/interact.min-ef5402f3.js +10 -0
  106. package/dist/esm/ipc-test.entry.js +2 -2
  107. package/dist/esm/loader.js +1 -1
  108. package/dist/esm/{utils-d269cea3.js → utils-ca3121df.js} +3 -3
  109. package/dist/esm/verdocs-activity-box.entry.js +2 -2
  110. package/dist/esm/verdocs-auth.entry.js +8 -34
  111. package/dist/esm/verdocs-build.entry.js +2 -2
  112. package/dist/esm/verdocs-button-panel_2.entry.js +12 -3
  113. package/dist/esm/{verdocs-contact-picker_2.entry.js → verdocs-contact-picker_3.entry.js} +78 -7
  114. package/dist/esm/verdocs-envelope-document-page.entry.js +5 -5
  115. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  116. package/dist/esm/verdocs-envelope-sidebar.entry.js +5 -4
  117. package/dist/esm/verdocs-envelopes-list.entry.js +5 -5
  118. package/dist/esm/verdocs-field-attachment.entry.js +4 -4
  119. package/dist/esm/verdocs-field-checkbox.entry.js +4 -4
  120. package/dist/esm/verdocs-field-date.entry.js +5 -5
  121. package/dist/esm/verdocs-field-dropdown.entry.js +4 -5
  122. package/dist/esm/verdocs-field-initial.entry.js +4 -4
  123. package/dist/esm/verdocs-field-payment.entry.js +4 -4
  124. package/dist/esm/verdocs-field-radio-button.entry.js +4 -4
  125. package/dist/esm/verdocs-field-signature.entry.js +4 -4
  126. package/dist/esm/verdocs-field-textarea.entry.js +10 -9
  127. package/dist/esm/verdocs-field-textbox.entry.js +9 -9
  128. package/dist/esm/verdocs-field-timestamp.entry.js +5 -5
  129. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  130. package/dist/esm/verdocs-ok-dialog.entry.js +2 -1
  131. package/dist/esm/verdocs-pagination_2.entry.js +4 -4
  132. package/dist/esm/verdocs-preview_8.entry.js +9 -8
  133. package/dist/esm/verdocs-quick-functions_2.entry.js +74 -0
  134. package/dist/esm/verdocs-search.entry.js +1 -1
  135. package/dist/esm/verdocs-settings-api-keys_4.entry.js +68 -35
  136. package/dist/esm/verdocs-settings.entry.js +1 -1
  137. package/dist/esm/verdocs-sign.entry.js +11 -8
  138. package/dist/esm/verdocs-template-document-page_2.entry.js +5 -5
  139. package/dist/esm/verdocs-template-fields_4.entry.js +55 -47
  140. package/dist/esm/verdocs-template-star.entry.js +1 -1
  141. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  142. package/dist/esm/verdocs-view.entry.js +5 -5
  143. package/dist/esm/verdocs-web-sdk.js +1 -1
  144. package/dist/esm-es5/{EnvelopeStore-15cc99ef.js → EnvelopeStore-17c0bc52.js} +1 -1
  145. package/dist/esm-es5/Envelopes-627c5239.js +1 -0
  146. package/dist/esm-es5/Profiles-d4df4d1c.js +1 -0
  147. package/dist/esm-es5/{TemplateStore-018fc1db.js → TemplateStore-ad77a294.js} +1 -1
  148. package/dist/esm-es5/Types-1628dc71.js +1 -0
  149. package/dist/esm-es5/VerdocsEndpoint-56fa3371.js +1 -0
  150. package/dist/esm-es5/_commonjsHelpers-8a9f3b18.js +1 -0
  151. package/dist/esm-es5/interact.min-ef5402f3.js +1 -0
  152. package/dist/esm-es5/ipc-test.entry.js +1 -1
  153. package/dist/esm-es5/loader.js +1 -1
  154. package/dist/esm-es5/{utils-d269cea3.js → utils-ca3121df.js} +2 -2
  155. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  156. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  157. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  158. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  159. package/dist/esm-es5/verdocs-contact-picker_3.entry.js +1 -0
  160. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  161. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  162. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  163. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  164. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  165. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  166. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  167. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  168. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  169. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  170. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  171. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  172. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  173. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  174. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  175. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  176. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  177. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  178. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  179. package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -0
  180. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  181. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  182. package/dist/esm-es5/verdocs-settings.entry.js +1 -1
  183. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  184. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  185. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  186. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  187. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  188. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  189. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  190. package/dist/types/components/controls/verdocs-portal/verdocs-portal.d.ts +37 -0
  191. package/dist/types/components/{elements/verdocs-search-activity/verdocs-search-activity.stories.d.ts → controls/verdocs-portal/verdocs-portal.stories.d.ts} +3 -6
  192. package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.d.ts +4 -0
  193. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +0 -2
  194. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  195. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +1 -0
  196. package/dist/types/components.d.ts +50 -34
  197. package/dist/types/utils/Types.d.ts +1 -1
  198. package/dist/types/utils/utils.d.ts +2 -2
  199. package/dist/verdocs-web-sdk/{p-a35314fe.js → p-02a71e03.js} +1 -1
  200. package/dist/verdocs-web-sdk/{p-7805f0e0.entry.js → p-035a3ce2.entry.js} +1 -1
  201. package/dist/verdocs-web-sdk/p-035f6b38.js +1 -0
  202. package/dist/verdocs-web-sdk/{p-1406ffd2.entry.js → p-05e6bc91.entry.js} +1 -1
  203. package/dist/verdocs-web-sdk/{p-df6a373e.system.entry.js → p-062ca25f.system.entry.js} +1 -1
  204. package/dist/verdocs-web-sdk/{p-10af7aec.system.entry.js → p-0685d939.system.entry.js} +1 -1
  205. package/dist/verdocs-web-sdk/p-0abf0058.system.entry.js +1 -0
  206. package/dist/verdocs-web-sdk/p-0c425f97.system.entry.js +1 -0
  207. package/dist/verdocs-web-sdk/p-17598002.system.entry.js +1 -0
  208. package/dist/verdocs-web-sdk/{p-04d7d759.system.entry.js → p-17bf98f2.system.entry.js} +1 -1
  209. package/dist/verdocs-web-sdk/p-1a7aa04b.entry.js +1 -0
  210. package/dist/verdocs-web-sdk/p-1ba9f457.system.js +1 -0
  211. package/dist/verdocs-web-sdk/{p-2f04fb38.system.entry.js → p-1cb878c8.system.entry.js} +1 -1
  212. package/dist/verdocs-web-sdk/{p-261d376e.system.entry.js → p-1e38b22f.system.entry.js} +1 -1
  213. package/dist/verdocs-web-sdk/{p-ebc4142c.js → p-1f78be32.js} +1 -1
  214. package/dist/verdocs-web-sdk/p-22e0d2bc.entry.js +1 -0
  215. package/dist/verdocs-web-sdk/{p-4f439363.entry.js → p-2ccbf54d.entry.js} +1 -1
  216. package/dist/verdocs-web-sdk/{p-77abc3ce.entry.js → p-37dfdc84.entry.js} +1 -1
  217. package/dist/verdocs-web-sdk/p-3e607686.js +1 -0
  218. package/dist/verdocs-web-sdk/{p-a171983b.system.entry.js → p-3f3807b0.system.entry.js} +1 -1
  219. package/dist/verdocs-web-sdk/{p-8da1555a.entry.js → p-410c63e6.entry.js} +1 -1
  220. package/dist/verdocs-web-sdk/{p-3a702f79.entry.js → p-46624bec.entry.js} +1 -1
  221. package/dist/verdocs-web-sdk/{p-a0b02d83.system.entry.js → p-4d98f194.system.entry.js} +1 -1
  222. package/dist/verdocs-web-sdk/{p-af3e9624.entry.js → p-4e47ed1c.entry.js} +1 -1
  223. package/dist/verdocs-web-sdk/p-5645b8cd.entry.js +1 -0
  224. package/dist/verdocs-web-sdk/{p-e3a9d167.system.entry.js → p-59769c39.system.entry.js} +1 -1
  225. package/dist/verdocs-web-sdk/{p-39cbfe15.entry.js → p-6331d113.entry.js} +1 -1
  226. package/dist/verdocs-web-sdk/{p-9b07a2a7.entry.js → p-637187de.entry.js} +1 -1
  227. package/dist/verdocs-web-sdk/p-6dd69d82.system.entry.js +1 -0
  228. package/dist/verdocs-web-sdk/p-746fce21.entry.js +1 -0
  229. package/dist/verdocs-web-sdk/p-76f8c30a.entry.js +1 -0
  230. package/dist/verdocs-web-sdk/{p-5df0fa7a.system.entry.js → p-79168c6a.system.entry.js} +1 -1
  231. package/dist/verdocs-web-sdk/p-7b30c523.system.entry.js +1 -0
  232. package/dist/verdocs-web-sdk/p-7d5dbd9a.js +1 -0
  233. package/dist/verdocs-web-sdk/{p-eb595245.system.js → p-82b5e475.system.js} +1 -1
  234. package/dist/verdocs-web-sdk/{p-eef694e8.entry.js → p-82d4afbf.entry.js} +1 -1
  235. package/dist/verdocs-web-sdk/{p-f1257cd0.system.entry.js → p-82d9fa84.system.entry.js} +1 -1
  236. package/dist/verdocs-web-sdk/p-839f6f0d.js +1 -0
  237. package/dist/verdocs-web-sdk/{p-c694cf93.system.js → p-840827b7.system.js} +1 -1
  238. package/dist/verdocs-web-sdk/p-85df0da6.entry.js +1 -0
  239. package/dist/verdocs-web-sdk/{p-62f090c7.system.entry.js → p-870707e8.system.entry.js} +1 -1
  240. package/dist/verdocs-web-sdk/p-8aae8d16.system.js +1 -0
  241. package/dist/verdocs-web-sdk/{p-14aefeb2.system.entry.js → p-8af68516.system.entry.js} +1 -1
  242. package/dist/verdocs-web-sdk/{p-ace35be6.entry.js → p-8b0a5309.entry.js} +1 -1
  243. package/dist/verdocs-web-sdk/p-8c0fafde.system.entry.js +1 -0
  244. package/dist/verdocs-web-sdk/{p-aa51514f.system.entry.js → p-9360b085.system.entry.js} +1 -1
  245. package/dist/verdocs-web-sdk/{p-a310f65b.entry.js → p-94009f45.entry.js} +1 -1
  246. package/dist/verdocs-web-sdk/{p-7e8d64fb.system.js → p-9615b087.system.js} +1 -1
  247. package/dist/verdocs-web-sdk/p-999fbe79.js +1 -0
  248. package/dist/verdocs-web-sdk/p-9a5c0882.system.entry.js +1 -0
  249. package/dist/verdocs-web-sdk/p-9bf2d124.system.js +1 -0
  250. package/dist/verdocs-web-sdk/{p-5c50a778.system.entry.js → p-9ceff040.system.entry.js} +1 -1
  251. package/dist/verdocs-web-sdk/{p-fde6b724.entry.js → p-9d2995a9.entry.js} +1 -1
  252. package/dist/verdocs-web-sdk/p-9fc06f7b.entry.js +1 -0
  253. package/dist/verdocs-web-sdk/{p-0df58c57.entry.js → p-a40b3946.entry.js} +1 -1
  254. package/dist/verdocs-web-sdk/{p-35769d0c.system.entry.js → p-ac98f6f1.system.entry.js} +1 -1
  255. package/dist/verdocs-web-sdk/{p-bd0bc3dd.system.entry.js → p-acc873cf.system.entry.js} +1 -1
  256. package/dist/verdocs-web-sdk/{p-126ba5d2.system.entry.js → p-b467d981.system.entry.js} +1 -1
  257. package/dist/verdocs-web-sdk/p-b5eb8024.entry.js +1 -0
  258. package/dist/verdocs-web-sdk/{p-50ac71f3.system.entry.js → p-b6231fd3.system.entry.js} +1 -1
  259. package/dist/verdocs-web-sdk/{p-609c7fab.system.entry.js → p-b648ab63.system.entry.js} +1 -1
  260. package/dist/verdocs-web-sdk/{p-a52a832b.system.entry.js → p-b7a815e9.system.entry.js} +1 -1
  261. package/dist/verdocs-web-sdk/{p-0ad1fd33.entry.js → p-b9443a01.entry.js} +1 -1
  262. package/dist/verdocs-web-sdk/{p-0e5449d1.system.entry.js → p-ba653c39.system.entry.js} +1 -1
  263. package/dist/verdocs-web-sdk/{p-3abfff14.entry.js → p-c80237f9.entry.js} +1 -1
  264. package/dist/verdocs-web-sdk/p-cd20fb77.system.js +1 -0
  265. package/dist/verdocs-web-sdk/{p-6bda7dce.entry.js → p-cf703fe4.entry.js} +1 -1
  266. package/dist/verdocs-web-sdk/p-d0a09719.entry.js +1 -0
  267. package/dist/verdocs-web-sdk/{p-013d1556.system.entry.js → p-d1ea580b.system.entry.js} +1 -1
  268. package/dist/verdocs-web-sdk/{p-37187046.system.entry.js → p-d39e4a26.system.entry.js} +1 -1
  269. package/dist/verdocs-web-sdk/{p-137cedc8.entry.js → p-d59b6988.entry.js} +1 -1
  270. package/dist/verdocs-web-sdk/p-d61fda4b.entry.js +1 -0
  271. package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +1 -0
  272. package/dist/verdocs-web-sdk/{p-b73415c3.system.entry.js → p-d99a05e4.system.entry.js} +1 -1
  273. package/dist/verdocs-web-sdk/p-dc2ad047.js +1 -0
  274. package/dist/verdocs-web-sdk/{p-0f94d635.entry.js → p-dd2c2edc.entry.js} +1 -1
  275. package/dist/verdocs-web-sdk/{p-79dc4f76.entry.js → p-e1bc55f8.entry.js} +1 -1
  276. package/dist/verdocs-web-sdk/p-e28878eb.system.entry.js +1 -0
  277. package/dist/verdocs-web-sdk/p-e2ae3679.entry.js +1 -0
  278. package/dist/verdocs-web-sdk/p-e4dc3264.system.entry.js +1 -0
  279. package/dist/verdocs-web-sdk/{p-b17a20b8.entry.js → p-e760f894.entry.js} +1 -1
  280. package/dist/verdocs-web-sdk/p-eda5691a.entry.js +1 -0
  281. package/dist/verdocs-web-sdk/{p-cf765153.entry.js → p-eeca4c30.entry.js} +1 -1
  282. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  283. package/dist/verdocs-web-sdk/{p-7b63017c.js → p-f3dde708.js} +1 -1
  284. package/dist/verdocs-web-sdk/{p-3f9fbf94.entry.js → p-f42c84f1.entry.js} +1 -1
  285. package/dist/verdocs-web-sdk/{p-dd8845d4.system.entry.js → p-f6b7439f.system.entry.js} +1 -1
  286. package/dist/verdocs-web-sdk/p-fcd0a40a.system.js +1 -0
  287. package/dist/verdocs-web-sdk/{p-343672f5.system.entry.js → p-fe67b620.system.entry.js} +1 -1
  288. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  289. package/package.json +7 -6
  290. package/dist/cjs/interact.min-ba5cc513.js +0 -13
  291. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +0 -220
  292. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.css +0 -66
  293. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +0 -187
  294. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +0 -14
  295. package/dist/components/Organizations.js +0 -32
  296. package/dist/components/verdocs-search-activity.d.ts +0 -11
  297. package/dist/components/verdocs-search-activity.js +0 -6
  298. package/dist/components/verdocs-search-activity2.js +0 -170
  299. package/dist/esm/Types-de18e225.js +0 -4
  300. package/dist/esm/interact.min-cf83fa88.js +0 -11
  301. package/dist/esm/verdocs-quick-functions_3.entry.js +0 -214
  302. package/dist/esm-es5/Envelopes-21ffb899.js +0 -1
  303. package/dist/esm-es5/Profiles-4cc942ef.js +0 -1
  304. package/dist/esm-es5/Types-de18e225.js +0 -1
  305. package/dist/esm-es5/VerdocsEndpoint-b011af25.js +0 -1
  306. package/dist/esm-es5/_commonjsHelpers-5ec8f9b7.js +0 -1
  307. package/dist/esm-es5/interact.min-cf83fa88.js +0 -1
  308. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +0 -1
  309. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +0 -1
  310. package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +0 -33
  311. package/dist/verdocs-web-sdk/p-01166179.system.entry.js +0 -1
  312. package/dist/verdocs-web-sdk/p-04580be0.entry.js +0 -1
  313. package/dist/verdocs-web-sdk/p-0d28cf05.js +0 -1
  314. package/dist/verdocs-web-sdk/p-15cb963a.system.entry.js +0 -1
  315. package/dist/verdocs-web-sdk/p-17d0e5f4.entry.js +0 -1
  316. package/dist/verdocs-web-sdk/p-23be436b.entry.js +0 -1
  317. package/dist/verdocs-web-sdk/p-2ccbcfeb.system.js +0 -1
  318. package/dist/verdocs-web-sdk/p-30b4bd45.js +0 -1
  319. package/dist/verdocs-web-sdk/p-3305a941.system.js +0 -1
  320. package/dist/verdocs-web-sdk/p-409e992a.entry.js +0 -1
  321. package/dist/verdocs-web-sdk/p-4a94ee00.system.entry.js +0 -1
  322. package/dist/verdocs-web-sdk/p-51756c1b.system.entry.js +0 -1
  323. package/dist/verdocs-web-sdk/p-5a91bf23.js +0 -1
  324. package/dist/verdocs-web-sdk/p-6307e6ae.entry.js +0 -1
  325. package/dist/verdocs-web-sdk/p-66d66e2b.entry.js +0 -1
  326. package/dist/verdocs-web-sdk/p-76907130.entry.js +0 -1
  327. package/dist/verdocs-web-sdk/p-7fd7152d.system.js +0 -1
  328. package/dist/verdocs-web-sdk/p-89aa696c.system.entry.js +0 -1
  329. package/dist/verdocs-web-sdk/p-961708ac.entry.js +0 -1
  330. package/dist/verdocs-web-sdk/p-983da2f6.js +0 -1
  331. package/dist/verdocs-web-sdk/p-9934f3ec.system.entry.js +0 -1
  332. package/dist/verdocs-web-sdk/p-a5425a9b.entry.js +0 -1
  333. package/dist/verdocs-web-sdk/p-b2d698f7.system.entry.js +0 -1
  334. package/dist/verdocs-web-sdk/p-bb2c866b.system.entry.js +0 -1
  335. package/dist/verdocs-web-sdk/p-bbee73c8.system.js +0 -1
  336. package/dist/verdocs-web-sdk/p-bfcf8ad2.entry.js +0 -1
  337. package/dist/verdocs-web-sdk/p-cbbf849f.system.js +0 -1
  338. package/dist/verdocs-web-sdk/p-cbd0802f.entry.js +0 -1
  339. package/dist/verdocs-web-sdk/p-de60d3a8.js +0 -1
  340. package/dist/verdocs-web-sdk/p-eab67c09.js +0 -1
  341. package/dist/verdocs-web-sdk/p-ecf04564.system.entry.js +0 -1
  342. package/dist/verdocs-web-sdk/p-ee195e5e.entry.js +0 -1
  343. package/dist/verdocs-web-sdk/p-f65a1b9e.system.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as s,h as i,H as l}from"./p-14b44491.js";import{l as t,c as a}from"./p-5a91bf23.js";import{g as o,a as n,b as r}from"./p-29f64c27.js";import"./p-05788c2b.js";import{V as d}from"./p-30b4bd45.js";import{i as p}from"./p-5e808a0b.js";import{s as c}from"./p-a35314fe.js";import{V as h}from"./p-ed416acf.js";import{S as v}from"./p-7a1b2643.js";import"./p-eab67c09.js";import"./p-aa124212.js";import"./p-de60d3a8.js";import"./p-c220af42.js";const x=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}],m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}],f=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}],u=class{constructor(i){e(this,i),this.changeView=s(this,"changeView",7),this.changeStatus=s(this,"changeStatus",7),this.changeSort=s(this,"changeSort",7),this.changeMatch=s(this,"changeMatch",7),this.sdkError=s(this,"sdkError",7),this.viewEnvelope=s(this,"viewEnvelope",7),this.finishEnvelope=s(this,"finishEnvelope",7),this.endpoint=d.getDefault(),this.view=void 0,this.status="all",this.sort="created_at",this.match="",this.showPagination=!0,this.rowsPerPage=10,this.selectedPage=0,this.count=0,this.initiallyLoaded=!1,this.loading=!0,this.selectedEnvelopes=[],this.envelopes=[]}handleViewUpdated(){return this.queryEnvelopes()}handleStatusUpdated(){return this.queryEnvelopes()}handleSortUpdated(){return this.queryEnvelopes()}handleMatchUpdated(){return this.queryEnvelopes()}handlePageUpdated(){return this.queryEnvelopes()}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[ENVELOPES] Must be authenticated")}async componentDidLoad(){await this.queryEnvelopes(),this.initiallyLoaded=!0}async queryEnvelopes(){var e,s,i;try{this.loading=!0;let e={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]};break;case"inbox":e={...e};break;case"sent":e={...e,is_owner:!0};break;case"action":e={...e,status:["pending","in progress"]};break;case"waiting":e={...e,is_owner:!0,status:["pending","in progress"]};break;case"completed":e={...e,status:["complete"]};break;default:e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]}}"all"===this.view&&"all"!==this.status&&(e.status=[this.status]),this.match.trim();const s=await t(this.endpoint,e);this.envelopes=s.envelopes,this.count=s.total,this.loading=!1}catch(l){this.loading=!1,console.log("[ENVELOPES] Error listing envelopes",l),null===(e=this.sdkError)||void 0===e||e.emit(new v(l.message,null===(s=l.response)||void 0===s?void 0:s.status,null===(i=l.response)||void 0===i?void 0:i.data))}}handleDownload(){c(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){c(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}render(){return i(l,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.match,clearable:!0,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:e=>{var s;this.match=e.target.value.trim(),null===(s=this.changeMatch)||void 0===s||s.emit(this.match)}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:x,onOptionSelected:e=>{this.view=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:m,onOptionSelected:e=>{this.status=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:f,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const l=o(e),t=r(this.endpoint.session,e),d=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!(l.find((e=>{var s;return e.email===(null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||""}))&&t&&n((null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||"",l))},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!t}];return i("div",{class:"envelope",key:e.id,onClick:()=>{var s;return null===(s=this.viewEnvelope)||void 0===s?void 0:s.emit({endpoint:this.endpoint,envelope:e})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:-1!==this.selectedEnvelopes.findIndex((s=>s.id===e.id)),onClick:e=>e.stopPropagation(),onInput:s=>{this.selectedEnvelopes=s.target.checked?[...this.selectedEnvelopes,e]:this.selectedEnvelopes.filter((s=>s.id!==e.id))}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>',class:"envelope-icon"}),i("div",{class:"envelope-name"},e.name,":  ",i("div",{class:"envelope-recipients"},e.recipients.map((e=>e.full_name)).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:e,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(e.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:d,onOptionSelected:s=>{var i,l;switch(s.detail.id){case"view":null===(i=this.viewEnvelope)||void 0===i||i.emit({endpoint:this.endpoint,envelope:e});break;case"finish":null===(l=this.finishEnvelope)||void 0===l||l.emit({endpoint:this.endpoint,envelope:e});break;case"download":this.downloadEnvelope(e);break;case"cancel":window.confirm("Are you sure you want to cancel this envelope?")&&(a(this.endpoint,e.id).then((()=>h("Envelope canceled"))).catch((e=>h("Unable to cancel envelope: "+e.messabge,{style:"error"}))),this.queryEnvelopes().catch((()=>{})))}}})))})),!this.initiallyLoaded&&i("div",{style:{width:"100%"}},p(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null))}static get watchers(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}}};u.style='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';export{u as verdocs_envelopes_list}
1
+ import{r as e,c as s,h as i,H as l}from"./p-14b44491.js";import{l as t,c as a}from"./p-dc2ad047.js";import{g as o,a as n,b as r}from"./p-29f64c27.js";import"./p-05788c2b.js";import{V as d}from"./p-035f6b38.js";import{i as p}from"./p-5e808a0b.js";import{s as c}from"./p-02a71e03.js";import{V as h}from"./p-ed416acf.js";import{S as v}from"./p-7a1b2643.js";import"./p-7d5dbd9a.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const x=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}],m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}],f=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}],u=class{constructor(i){e(this,i),this.changeView=s(this,"changeView",7),this.changeStatus=s(this,"changeStatus",7),this.changeSort=s(this,"changeSort",7),this.changeMatch=s(this,"changeMatch",7),this.sdkError=s(this,"sdkError",7),this.viewEnvelope=s(this,"viewEnvelope",7),this.finishEnvelope=s(this,"finishEnvelope",7),this.endpoint=d.getDefault(),this.view=void 0,this.status="all",this.sort="created_at",this.match="",this.showPagination=!0,this.rowsPerPage=10,this.selectedPage=0,this.count=0,this.initiallyLoaded=!1,this.loading=!0,this.selectedEnvelopes=[],this.envelopes=[]}handleViewUpdated(){return this.queryEnvelopes()}handleStatusUpdated(){return this.queryEnvelopes()}handleSortUpdated(){return this.queryEnvelopes()}handleMatchUpdated(){return this.queryEnvelopes()}handlePageUpdated(){return this.queryEnvelopes()}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[ENVELOPES] Must be authenticated")}async componentDidLoad(){await this.queryEnvelopes(),this.initiallyLoaded=!0}async queryEnvelopes(){var e,s,i;try{this.loading=!0;let e={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]};break;case"inbox":e={...e};break;case"sent":e={...e,is_owner:!0};break;case"action":e={...e,status:["pending","in progress"]};break;case"waiting":e={...e,is_owner:!0,status:["pending","in progress"]};break;case"completed":e={...e,status:["complete"]};break;default:e={...e,status:"all"===this.status?["pending","in progress","complete","declined","canceled"]:[this.status]}}"all"===this.view&&"all"!==this.status&&(e.status=[this.status]),this.match.trim();const s=await t(this.endpoint,e);this.envelopes=s.envelopes,this.count=s.total,this.loading=!1}catch(l){this.loading=!1,console.log("[ENVELOPES] Error listing envelopes",l),null===(e=this.sdkError)||void 0===e||e.emit(new v(l.message,null===(s=l.response)||void 0===s?void 0:s.status,null===(i=l.response)||void 0===i?void 0:i.data))}}handleDownload(){c(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){c(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e),h("Download error: "+e.message,{style:"error"})}))}render(){return i(l,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.match,clearable:!0,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:e=>{var s;this.match=e.target.value.trim(),null===(s=this.changeMatch)||void 0===s||s.emit(this.match)}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:x,onOptionSelected:e=>{this.view=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:m,onOptionSelected:e=>{this.status=e.detail.value}}),"all"===this.view&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:f,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const l=o(e),t=r(this.endpoint.session,e),d=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!(l.find((e=>{var s;return e.email===(null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||""}))&&t&&n((null===(s=this.endpoint.session)||void 0===s?void 0:s.email)||"",l))},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!t}];return i("div",{class:"envelope",key:e.id,onClick:()=>{var s;return null===(s=this.viewEnvelope)||void 0===s?void 0:s.emit({endpoint:this.endpoint,envelope:e})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:-1!==this.selectedEnvelopes.findIndex((s=>s.id===e.id)),onClick:e=>e.stopPropagation(),onInput:s=>{this.selectedEnvelopes=s.target.checked?[...this.selectedEnvelopes,e]:this.selectedEnvelopes.filter((s=>s.id!==e.id))}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>',class:"envelope-icon"}),i("div",{class:"envelope-name"},e.name,":  ",i("div",{class:"envelope-recipients"},e.recipients.map((e=>e.full_name)).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:e,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(e.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:d,onOptionSelected:s=>{var i,l;switch(s.detail.id){case"view":null===(i=this.viewEnvelope)||void 0===i||i.emit({endpoint:this.endpoint,envelope:e});break;case"finish":null===(l=this.finishEnvelope)||void 0===l||l.emit({endpoint:this.endpoint,envelope:e});break;case"download":this.downloadEnvelope(e);break;case"cancel":window.confirm("Are you sure you want to cancel this envelope?")&&(a(this.endpoint,e.id).then((()=>h("Envelope canceled"))).catch((e=>h("Unable to cancel envelope: "+e.messabge,{style:"error"}))),this.queryEnvelopes().catch((()=>{})))}}})))})),!this.initiallyLoaded&&i("div",{style:{width:"100%"}},p(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null))}static get watchers(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}}};u.style='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';export{u as verdocs_envelopes_list}
@@ -1 +1 @@
1
- import{r as i,c as t,h as e,H as o}from"./p-14b44491.js";import{g as a}from"./p-5a91bf23.js";import"./p-05788c2b.js";import{V as s}from"./p-30b4bd45.js";import{i as n}from"./p-5e808a0b.js";import{S as r}from"./p-7a1b2643.js";const l=class{constructor(e){i(this,e),this.sdkError=t(this,"sdkError",7),this.viewEnvelope=t(this,"viewEnvelope",7),this.viewAll=t(this,"viewAll",7),this.endpoint=s.getDefault(),this.items=5,this.view=void 0,this.header=void 0,this.title="",this.count=0,this.loading=!0,this.entries=[]}async componentWillLoad(){var i,t,e;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[ACTIVITIES] Must be authenticated");this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o),null===(i=this.sdkError)||void 0===i||i.emit(new r(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(e=o.response)||void 0===e?void 0:e.data))}}handleItemsUpdated(){return this.loadActivity()}handleViewUpdated(){return this.loadActivity()}async loadActivity(){this.loading=!0;const i=await a(this.endpoint,0);let t;"action"===this.view?(t="Action Required",this.entries=i.action_required.result,this.count=i.action_required.total):"waiting"===this.view?(t="Waiting on Others",this.entries=i.waiting_others.result,this.count=i.waiting_others.total):"completed"===this.view&&(t="Completed",this.entries=i.completed.result,this.count=i.completed.total),this.title=void 0!==this.header?this.header:t,this.loading=!1}render(){return this.loading?e(o,{style:{minHeight:"300px"}},this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(0)")),n(0,this.items).map((()=>e("div",{class:"loading-placeholder"},e("div",{class:"loading-placeholder-bg"}))))):e(o,null,this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(",this.count,")"),e("div",{class:"spacer"}),e("verdocs-button",{label:"View All",size:"small",onClick:()=>{var i;return null===(i=this.viewAll)||void 0===i?void 0:i.emit({endpoint:this.endpoint,view:this.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((i=>e("div",{class:"activity-entry",onClick:()=>{var t;null===(t=this.viewEnvelope)||void 0===t||t.emit({endpoint:this.endpoint,entry:i})}},e("div",{class:"title"},i.name,e("br",null)," ",e("strong",null,i.recipient.name)),e("div",{class:"time-ago"},function(i){if(null==i)return"";var t;if("string"==typeof i||"number"==typeof i)t=new Date(i);else{if("object"!=typeof i)return"";t=i}var e=Math.floor(((new Date).getTime()-t.getTime())/1e3);return e>=31536e3?Math.floor(e/31536e3)+"Y":e>=604800?Math.floor(e/604800)+"W":e>=86400?Math.floor(e/86400)+"D":e>=3600?Math.floor(e/3600)+"H":e>=60?Math.floor(e/60)+"M":"".concat(e,"S")}(i.updated_at))))):e("img",{src:"https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png",alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))}static get watchers(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}}};l.style='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';export{l as verdocs_activity_box}
1
+ import{r as i,c as t,h as e,H as o}from"./p-14b44491.js";import{g as a}from"./p-dc2ad047.js";import"./p-05788c2b.js";import{V as s}from"./p-035f6b38.js";import{i as n}from"./p-5e808a0b.js";import{S as r}from"./p-7a1b2643.js";const l=class{constructor(e){i(this,e),this.sdkError=t(this,"sdkError",7),this.viewEnvelope=t(this,"viewEnvelope",7),this.viewAll=t(this,"viewAll",7),this.endpoint=s.getDefault(),this.items=5,this.view=void 0,this.header=void 0,this.title="",this.count=0,this.loading=!0,this.entries=[]}async componentWillLoad(){var i,t,e;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[ACTIVITIES] Must be authenticated");this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o),null===(i=this.sdkError)||void 0===i||i.emit(new r(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(e=o.response)||void 0===e?void 0:e.data))}}handleItemsUpdated(){return this.loadActivity()}handleViewUpdated(){return this.loadActivity()}async loadActivity(){this.loading=!0;const i=await a(this.endpoint,0);let t;"action"===this.view?(t="Action Required",this.entries=i.action_required.result,this.count=i.action_required.total):"waiting"===this.view?(t="Waiting on Others",this.entries=i.waiting_others.result,this.count=i.waiting_others.total):"completed"===this.view&&(t="Completed",this.entries=i.completed.result,this.count=i.completed.total),this.title=void 0!==this.header?this.header:t,this.loading=!1}render(){return this.loading?e(o,{style:{minHeight:"300px"}},this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(0)")),n(0,this.items).map((()=>e("div",{class:"loading-placeholder"},e("div",{class:"loading-placeholder-bg"}))))):e(o,null,this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(",this.count,")"),e("div",{class:"spacer"}),e("verdocs-button",{label:"View All",size:"small",onClick:()=>{var i;return null===(i=this.viewAll)||void 0===i?void 0:i.emit({endpoint:this.endpoint,view:this.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((i=>e("div",{class:"activity-entry",onClick:()=>{var t;null===(t=this.viewEnvelope)||void 0===t||t.emit({endpoint:this.endpoint,entry:i})}},e("div",{class:"title"},i.name,e("br",null)," ",e("strong",null,i.recipient.name)),e("div",{class:"time-ago"},function(i){if(null==i)return"";var t;if("string"==typeof i||"number"==typeof i)t=new Date(i);else{if("object"!=typeof i)return"";t=i}var e=Math.floor(((new Date).getTime()-t.getTime())/1e3);return e>=31536e3?Math.floor(e/31536e3)+"Y":e>=604800?Math.floor(e/604800)+"W":e>=86400?Math.floor(e/86400)+"D":e>=3600?Math.floor(e/3600)+"H":e>=60?Math.floor(e/60)+"M":"".concat(e,"S")}(i.updated_at))))):e("img",{src:"https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png",alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))}static get watchers(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}}};l.style='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';export{l as verdocs_activity_box}
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function r(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):s(e.value).then(a,r)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,s&&(o=a[0]&2?s["return"]:a[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,a[1])).done)return o;if(s=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];s=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-8aae8d16.system.js","./p-1d60151a.system.js","./p-eaf0b189.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-9615b087.system.js","./p-d8cd6b59.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-dc9c4361.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,n,s,o,a,r,l,c,d,v,p,h;return{setters:[function(e){t=e.r;i=e.c;n=e.h;s=e.H},function(e){o=e.c},function(e){a=e.u},function(e){r=e.r},function(){},function(e){l=e.V},function(e){c=e.g},function(e){d=e.F},function(e){v=e.V},function(e){p=e.S},function(e){h=e.f},function(){}],execute:function(){var u='verdocs-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;place-content:center space-between;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;margin-right:10px;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-type{-ms-flex:1 1 88px;flex:1 1 88px;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:88px;min-width:88px;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 100px;flex:1 1 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}';var f='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>';var g='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>';var w='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var m={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-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.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>'};var b=e("verdocs_envelope_sidebar",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.toggle=i(this,"toggle",7);this.another=i(this,"another",7);this.store=null;this.endpoint=l.getDefault();this.envelopeId="";this.activeTab=1;this.panelOpen=false;this.showManageDialog=false;this.showRecipientDialog="";this.showCancelDialog=false;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.envelopeId){console.log("[SIDEBAR] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[SIDEBAR] Unable to start session, must be authenticated");return[2]}n=this;return[4,c(this.endpoint,this.envelopeId,true)];case 1:n.store=o.sent();this.sortEnvelopeRecipients();this.loading=false;return[3,3];case 2:s=o.sent();console.log("[SIDEBAR] Error loading envelope",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new p(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.sortEnvelopeRecipients=function(){var e,t;(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.recipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.setTab=function(e){var t;this.panelOpen=e!==this.activeTab||!this.panelOpen;(t=this.toggle)===null||t===void 0?void 0:t.emit({open:this.panelOpen});this.activeTab=e};e.prototype.canResendRecipient=function(e){var t,i;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.status)};e.prototype.handleRecipientAction=function(e,t){var i,n;console.log("[SIDEBAR] Recipient action",t,e);switch(t){case"reminder":r(this.endpoint,this.envelopeId,e.role_name).then((function(){v("Reminder Sent",{style:"success"})})).catch((function(e){console.log("[SIDEBAR] Error resending invitation",e);v("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":v("This feature will be enabled in a future release. Please try again later.",{style:"info"});break;case"details":v("This feature will be enabled in a future release. Please try again later.",{style:"info"});break}(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:(n=this.store)===null||n===void 0?void 0:n.state,event:t})};e.prototype.cancelEnvelope=function(){var e=this;this.loading=true;o(this.endpoint,this.envelopeId).then((function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n;return __generator(this,(function(s){switch(s.label){case 0:console.log("[SIDEBAR] Envelope canceled",t);v("Envelope canceled",{style:"success"});n=this;return[4,c(this.endpoint,this.envelopeId,true)];case 1:n.store=s.sent();this.sortEnvelopeRecipients();this.loading=false;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:(i=this.store)===null||i===void 0?void 0:i.state,event:"canceled"});return[2]}}))}))})).catch((function(t){console.log("[SIDEBAR] Error canceling envelope",t);e.loading=false;v("Error canceling envelope: "+t.message,{style:"error"})}))};e.prototype.prepareHistoryEntries=function(){var e=this;var t,i,n,s,o,a,r,l,c,d,v,p;var h=[];var u=((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.histories)||[];h.push({icon:"pencil",message:"Envelope created.",date:new Date((s=(n=this.store)===null||n===void 0?void 0:n.state)===null||s===void 0?void 0:s.created_at)});if(((a=(o=this.store)===null||o===void 0?void 0:o.state)===null||a===void 0?void 0:a.status)==="complete"){h.push({icon:"pencil",message:"Envelope completed.",date:new Date((l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.updated_at)})}var f=u.some((function(e){return e.event==="owner:canceled"}));if(((d=(c=this.store)===null||c===void 0?void 0:c.state)===null||d===void 0?void 0:d.status)==="canceled"&&!f){h.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date((p=(v=this.store)===null||v===void 0?void 0:v.state)===null||p===void 0?void 0:p.canceled_at)})}u.forEach((function(t){var i;var n=(i=e.store.state)===null||i===void 0?void 0:i.recipients.find((function(e){return e.role_name===t.role_name}));var s=(n===null||n===void 0?void 0:n.full_name)||"";switch(t.event.toLowerCase()){case"recipient:signed":h.push({icon:"gesture",message:"Signed by ".concat(s,"."),date:new Date(t.created_at)});break;case"recipient:declined":h.push({icon:"clear",message:"Declined by ".concat(s,"."),date:new Date(t.created_at)});break;case"recipient:opened":switch(t.event_detail){case"email":case"mail":h.push({icon:"visibility",message:"Opened by ".concat(s,", via email."),date:new Date(t.created_at)});break;case"sms":h.push({icon:"visibility",message:"Opened by ".concat(s,", via SMS."),date:new Date(t.created_at)});break;case"in_person_link":h.push({icon:"visibility",message:"Opened by ".concat(s,", via In-person link."),date:new Date(t.created_at)});break;case"in_app":h.push({icon:"visibility",message:"Opened by ".concat(s,", via dashboard."),date:new Date(t.created_at)});break;default:h.push({icon:"visibility",message:"Opened by ".concat(s,"."),date:new Date(t.created_at)})}break;case"recipient:submitted":switch(t.event_detail){case"approver":h.push({icon:"check_circle",message:"Approved by ".concat(s,"."),date:new Date(t.created_at)});break;default:h.push({icon:"send",message:"Submitted by ".concat(s,"."),date:new Date(t.created_at)});break}break;case"recipient:prepared":h.push({icon:"send",message:"Prepared by ".concat(s,"."),date:new Date(t.created_at)});break;case"recipient:claimed":if(t.event_detail==="guest"){h.push({icon:"account_circle",message:"".concat(s," claimed the Verdoc as a guest."),date:new Date(t.created_at)})}else if(t.event_detail==="profile"){h.push({icon:"verified_user",message:"".concat(s," claimed the Verdoc as a verified user."),date:new Date(t.created_at)})}break;case"recipient:agreed":h.push({icon:"done",message:"".concat(s," agreed to use electronic records and signatures."),date:new Date(t.created_at)});break;case"recipient:invited":if(t.event_detail==="sms"){h.push({icon:"textsms",message:"".concat(s," has been invited via SMS."),date:new Date(t.created_at)})}else{h.push({icon:"mail",message:"".concat(s," has been invited via email."),date:new Date(t.created_at)})}break;case"invitation:resent":h.push({icon:"mail",message:"Invitation was resent to ".concat(s," ").concat(t.event_detail==="reminder"?" by reminder":"","."),date:new Date(t.created_at)});break;case"envelope:cc":h.push({icon:"contact_mail",message:"A copy has been sent to ".concat(s,"."),date:new Date(t.created_at)});break;case"recipient:delegated":h.push({icon:"people",message:t.event_detail,date:new Date(t.created_at)});break;case"recipient:updated_info":h.push({icon:"perm_identity",message:t.event_detail,date:new Date(t.created_at)});break;case"owner:updated_recipient_info":h.push({icon:"perm_identity",message:t.event_detail,date:new Date(t.created_at)});break;case"created":h.push({icon:"create",message:"Envelope was created.",date:new Date(t.created_at)});break;case"completed":h.push({icon:"done_all",message:"Envelope was completed.",date:new Date(t.created_at)});break;case"canceled":case"owner:canceled":h.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(t.created_at)});break;case"owner:get_in_person_link":h.push({icon:"link",message:"Owner accessed the In-person link for ".concat(n,"."),date:new Date(t.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",t);break}}));h.sort((function(e,t){return t.date.getTime()-e.date.getTime()}));return h};e.prototype.render=function(){var e=this;var t,i,o,r,l,c,v,p,u,b,x,y,_,k,z,D,M,E,V,B,S,I,L,H,R;if(!this.store.state){return n(s,null)}var T=this.endpoint.getSession();var C=a(T,this.store.state);var A=this.prepareHistoryEntries();var j=((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.status)!=="pending"&&((r=(o=this.store)===null||o===void 0?void 0:o.state)===null||r===void 0?void 0:r.status)!=="in progress";return n(s,{class:this.panelOpen?"open":""},n("div",{class:"side-buttons"},n("button",{class:this.activeTab===1?"active":"",onClick:function(){return e.setTab(1)},innerHTML:f}),n("button",{class:this.activeTab===2?"active":"",onClick:function(){return e.setTab(2)},innerHTML:g}),n("button",{class:this.activeTab===3?"active":"",onClick:function(){return e.setTab(3)},innerHTML:w})),this.activeTab===1&&n("div",{class:"content"},n("div",{class:"title"},"Details"),n("div",{class:"label"},"Envelope ID"),n("div",{class:"value"},(c=(l=this.store)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.id),n("div",{class:"label"},"Date Created"),n("div",{class:"value"},h(new Date((p=(v=this.store)===null||v===void 0?void 0:v.state)===null||p===void 0?void 0:p.created_at),d)),n("div",{class:"label"},"Last Modified"),n("div",{class:"value"},h(new Date((b=(u=this.store)===null||u===void 0?void 0:u.state)===null||b===void 0?void 0:b.updated_at),d)),n("div",{class:"label"},"Status"),n("div",{class:"value"},(y=(x=this.store)===null||x===void 0?void 0:x.state)===null||y===void 0?void 0:y.status),n("div",{class:"label"},"Verdoc Owner ID"),n("div",{class:"value"},(k=(_=this.store)===null||_===void 0?void 0:_.state)===null||k===void 0?void 0:k.profile_id),n("div",{class:"label"},"Verdoc Owner Name"),n("div",{class:"value"},(M=(D=(z=this.store)===null||z===void 0?void 0:z.state)===null||D===void 0?void 0:D.profile)===null||M===void 0?void 0:M.first_name," ",(B=(V=(E=this.store)===null||E===void 0?void 0:E.state)===null||V===void 0?void 0:V.profile)===null||B===void 0?void 0:B.last_name),n("div",{class:"label"},"Verdoc Owner Email"),n("div",{class:"value"},(L=(I=(S=this.store)===null||S===void 0?void 0:S.state)===null||I===void 0?void 0:I.profile)===null||L===void 0?void 0:L.email)),this.activeTab===2&&n("div",{class:"content"},n("div",{class:"title"},"Recipients"),(R=(H=this.store)===null||H===void 0?void 0:H.state)===null||R===void 0?void 0:R.recipients.map((function(t,i){var s;var o=t.status!=="submitted"&&t.status!=="canceled"&&t.status!=="declined";var a=e.canResendRecipient(t);return n("div",{class:"recipient-detail"},n("div",{class:"recipient-header"},n("div",{class:"recipient-number"},i+1),n("div",{class:"recipient-type"},t.role_name),n("div",{class:(s={"recipient-status":true},s[t.status]=true,s)},t.status),C&&!j&&n("verdocs-dropdown",{onOptionSelected:function(i){return e.handleRecipientAction(t,i.detail.id)},options:[{id:"reminder",label:"Send Reminder",disabled:!a},{id:"inperson",label:"Get In-Person Link",disabled:!o}]})),n("dic",{class:"recipient-content"},n("div",{class:"recipient-name"},t.full_name),n("div",{class:"recipient-name"},t.email),n("div",{class:"recipient-name"},t.phone)))})),C&&n("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Verdoc",onClick:function(){return e.showCancelDialog=!j},disabled:j})),this.activeTab===3&&n("div",{class:"content"},n("div",{class:"title"},"History"),A.map((function(e){return n("div",{class:"history-entry"},n("div",{class:"activity-icon",innerHTML:m[e.icon]||e.icon}),n("div",{class:"activity-details"},n("div",{class:"activity-text"},e.message),n("div",{class:"activity-date"},h(e.date,d))))}))),this.showRecipientDialog&&n("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:function(){return e.showRecipientDialog=""}}),this.showManageDialog&&n("verdocs-envelope-recipient-summary",{envelopeId:this.envelopeId,canView:false,onAnother:function(){var t;e.showManageDialog=false;(t=e.another)===null||t===void 0?void 0:t.emit({envelope:e.store.state})},onNext:function(){return e.showManageDialog=false}}),this.showCancelDialog&&n("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:function(){e.showCancelDialog=false;e.cancelEnvelope()}}))};return e}());b.style=u}}}));
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as s}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as o,b as l,u as a}from"./p-035f6b38.js";import{r as n,b as r}from"./p-02a71e03.js";import{g as d,a as c}from"./p-f3dde708.js";import{S as p}from"./p-7a1b2643.js";import{j as h}from"./p-dc2ad047.js";import{a as v,i as m}from"./p-e8ce0b6f.js";import{g as u}from"./p-6de76553.js";import{c as x,d as f}from"./p-567a6e7c.js";import{D as b,P as g,J as y,a as w,F as k,b as S,T as E}from"./p-637fee9b.js";import{V as z}from"./p-ed416acf.js";import"./p-7d5dbd9a.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";const C=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=o.getDefault(),this.templateId=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[PREVIEW] Unable to start builder session, must be authenticated");this.store=await d(this.endpoint,this.templateId,!0),console.log(`[PREVIEW] Loading template ${this.templateId}`,this.endpoint.session)}catch(s){console.log("[PREVIEW] Error with preview session",s),null===(e=this.sdkError)||void 0===e||e.emit(new p(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}handlePageRendered(e){var t,i;const s=e.detail;(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.fields.filter((e=>e.page_sequence===s.pageNumber))).forEach((e=>n(e,s,r(c(this.store),e.role_name),{disabled:!0,editable:!1,draggable:!1})))}render(){var e,t,o,l;if(!(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded))return i(s,null,i("verdocs-loader",null));const a=[...null===(l=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===l?void 0:l.pages];return a.sort(((e,t)=>e.sequence-t.sequence)),i(s,null,a.map((e=>i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}};C.style='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';const T='<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>',I=class{constructor(i){e(this,i),this.send=t(this,"send",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.searchContacts=t(this,"searchContacts",7),this.levels=[],this.store=null,this.endpoint=o.getDefault(),this.templateId=null,this.environment="web",this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`,this.rolesAtLevel={},this.showPickerForId="",this.sessionContacts=[],this.sending=!1,this.rolesCompleted={}}async reset(){this.rolesCompleted={}}async componentWillLoad(){var e,t,i,s,o,l,a,n,r,c;try{const n=this.endpoint.loadSession();if(!this.templateId)return void console.log(`[SEND] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SEND] Unable to start builder session, must be authenticated");if(this.store=await d(this.endpoint,this.templateId,!0),(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_sendable)||console.warn("[SEND] Template is not sendable",this.templateId),null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.roles){const e={};this.rolesCompleted={},null===(l=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===l||l.roles.forEach((t=>{const i=t.sequence-1;e[i]||(e[i]=[]);const s=`r-${i}-${e[i].length}`;e[i].push({...t,id:s}),t.full_name&&(t.email||t.phone)&&(this.rolesCompleted[s]={...t,id:s})})),this.rolesAtLevel=e,this.levels=Object.keys(e).map((e=>+e)),this.levels.sort(((e,t)=>e-t))}(null===(a=null==n?void 0:n.session)||void 0===a?void 0:a.profile)&&this.sessionContacts.push({id:n.session.profile.id,name:`${n.session.profile.first_name} ${n.session.profile.last_name}`,email:n.session.profile.email,phone:n.session.profile.phone})}catch(e){console.log("[SEND] Error with preview session",e),null===(n=this.sdkError)||void 0===n||n.emit(new p(e.message,null===(r=e.response)||void 0===r?void 0:r.status,null===(c=e.response)||void 0===c?void 0:c.data))}}getLevelIcon(e){return i("div",e<0?{class:"level-icon",innerHTML:'<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>'}:e>=this.levels.length?{class:"level-icon",innerHTML:'<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>'}:{class:"level-icon",innerHTML:'<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>'})}handleSelectContact(e,t){e.preventDefault(),this.rolesCompleted[t.id]={...t,...e.detail},this.showPickerForId=""}handleClickRole(e,t){e.stopPropagation(),this.showPickerForId=t.id}handleSend(e){var t,i;if(this.sending)return void console.log("Skipping duplicate send",e);console.log("Sending",e),e.preventDefault(),e.stopPropagation(),this.sending=!0;const s={template_id:this.templateId,name:null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",s),h(this.endpoint,s).then((e=>{var t;console.log("[SEND] Send envelope",e),this.reset().catch((e=>console.log("Unknown Error",e))),this.sending=!1,null===(t=this.send)||void 0===t||t.emit({...s,envelope_id:e.id,envelope:e})})).catch((e=>{console.log("Send error",e),this.sending=!1}))}handleCancel(e){var t;e.stopPropagation(),null===(t=this.exit)||void 0===t||t.emit()}render(){var e,t,o,l;const a=((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).map((e=>e.name))||[],n=Object.values(this.rolesCompleted).filter((e=>v(e.email)||m(e.phone))).length>=a.length;return i(s,{class:{sendable:null===(l=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===l?void 0:l.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),this.levels.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon(e),this.rolesAtLevel[e].map((e=>{var t,s,o,l,n,d;const c=`verdocs-send-recipient-${e.name}`;return e.email?i("div",{class:"recipient",style:{borderColor:u(r(a,e.name))},onClick:t=>this.handleClickRole(t,e),id:c},null!==(n=null===(l=this.rolesCompleted[e.id])||void 0===l?void 0:l.full_name)&&void 0!==n?n:e.full_name,i("div",{class:"icon",innerHTML:T}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:c,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(d=this.rolesCompleted[e.id])&&void 0!==d?d:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}}))):i("div",{class:"recipient",style:{backgroundColor:u(r(a,e.name))},onClick:t=>this.handleClickRole(t,e),id:c},null!==(s=null===(t=this.rolesCompleted[e.id])||void 0===t?void 0:t.full_name)&&void 0!==s?s:e.name,i("div",{class:"icon",innerHTML:T}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:c,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:t=>this.handleSelectContact(t,e),contactSuggestions:this.sessionContacts,templateRole:null!==(o=this.rolesCompleted[e.id])&&void 0!==o?o:e,onSearchContacts:e=>{var t;return null===(t=this.searchContacts)||void 0===t?void 0:t.emit(e.detail)}})))}))))),i("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},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,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}};I.style='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}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 #97979744}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:#00000089}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-direction:row;flex-direction:row}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 L=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.templateUpdated=t(this,"templateUpdated",7),this.sdkError=t(this,"sdkError",7),this.endpoint=o.getDefault(),this.templateId="",this.uploading=!1,this.progressLabel="Uploading...",this.progressPercent=0,this.showDeleteError=!1,this.confirmDeleteDocument=null,this.store=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await d(this.endpoint,this.templateId,!1)}catch(s){console.log("[TEMPLATE ATTACHMENTS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new p(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}handleCancel(e){e.stopPropagation(),this.exit.emit()}handleUploadProgress(e){e>=99?(this.progressPercent=100,this.progressLabel="Processing..."):this.progressPercent=e}async handleUpload(e){var t,i,s,o;e.stopPropagation();const l=e.detail.file;if(l){console.log("[ATTACHMENTS] Uploading...",l),this.uploading=!0,this.progressLabel="Uploading...";try{const e=await x(this.endpoint,this.templateId,l,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e),this.store=await d(this.endpoint,this.templateId,!0),console.log("[ATTACHMENTS] Updated template",this.store.state),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"}),this.uploading=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e),null===(i=this.sdkError)||void 0===i||i.emit(new p(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data)),this.uploading=!1}}}handleNext(e){var t;e.stopPropagation(),this.uploading=!1,this.progressLabel="",this.progressPercent=0,null===(t=this.next)||void 0===t||t.emit({template:this.store.state})}async confirmDelete(){await f(this.endpoint,this.templateId,this.confirmDeleteDocument.id),this.store=await d(this.endpoint,this.templateId,!0),console.log("[ATTACHMENTS] New template",this.store.state),this.confirmDeleteDocument=null}async handleDelete(e){var t;(null===(t=this.store.state)||void 0===t?void 0:t.template_documents.length)>1?this.confirmDeleteDocument=e:this.showDeleteError=!0}getFileIcon(e){switch(e.mime){case"application/pdf":return w;case"image/jpeg":return y;case"image/png":return g;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return b}return k}render(){var e,t,o;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));const l=null===(e=this.store)||void 0===e?void 0:e.state;return l.isLoaded?this.endpoint.session&&l.profile_id?i(s,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},null===(t=this.store)||void 0===t?void 0:t.state.template_documents.map((e=>i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.page_numbers),i("div",{class:"pages-icon",innerHTML:S})),i("div",{class:"trash-icon",innerHTML:E,onClick:()=>this.handleDelete(e)}))))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(null===(o=this.store)||void 0===o?void 0:o.state.template_documents.length)||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=!1}),this.confirmDeleteDocument&&i("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:!0,onExit:()=>{this.confirmDeleteDocument=null}})):i(s,{class:"empty"}):i(s,{class:"loading"},i("verdocs-loader",null))}};L.style='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';const U=["attachments","roles","settings","fields","preview"],M=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.endpoint=o.getDefault(),this.templateId=null,this.step="preview",this.store=null}onStepChanged(){console.log("Step changed",this.step,this.templateId),this.loadTemplate().catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");if(!this.templateId)return void(this.step="preview");this.loadTemplate().catch((e=>console.log("[BUILD_TABS] Unable to load template",e)))}catch(s){console.log("[BUILD_TABS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new p(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}async loadTemplate(){this.templateId&&(this.store=await d(this.endpoint,this.templateId,!1))}setStep(e){var t;console.log("Selected step",e.detail.tab.id),e.stopPropagation(),e.preventDefault(),this.step=e.detail.tab.id,null===(t=this.stepChanged)||void 0===t||t.emit(e.detail.tab.id)}render(){var e,t,o,l,a,n,r,d,c;if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));let p=!1,h=!1,v=!1;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step),this.templateId&&this.store&&this.store.state&&(v=(null===(o=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.template_documents)||void 0===o?void 0:o.length)>0,h=v&&(null===(n=null===(a=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===a?void 0:a.roles)||void 0===n?void 0:n.length)>0,p=h&&(null===(c=null===(d=null===(r=this.store)||void 0===r?void 0:r.state)||void 0===d?void 0:d.fields)||void 0===c?void 0:c.length)>0);let m=Math.max(U.indexOf(this.step),0);return!p&&m>=4&&(m=3),!h&&m>=3&&(m=1),!v&&m>=1&&(m=0),console.log({selectedStepIndex:m,canPreview:p,canEditFields:h,canEditRoles:v}),i(s,null,i("verdocs-tabs",{onSelectTab:e=>this.setStep(e),selectedTab:m,tabs:[{id:"attachments",disabled:!1,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!v,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!p,label:"Preview/Send"}]}))}static get watchers(){return{step:["onStepChanged"]}}};M.style='verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';const N=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.templateCreated=t(this,"templateCreated",7),this.endpoint=o.getDefault(),this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,i,s,o,a;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await l(this.endpoint,{name:this.file.name,documents:[this.file]},(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created template",e),null===(t=this.templateCreated)||void 0===t||t.emit({endpoint:this.endpoint,template:e,templateId:e.id}),null===(i=this.next)||void 0===i||i.emit(e),this.creating=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[CREATE] Error creating template",e),null===(s=this.sdkError)||void 0===s||s.emit(new p(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.data)),this.creating=!1}}}render(){return i(s,null,this.endpoint.session?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):i("div",{class:"upload-box",onDrop:e=>{e.preventDefault(),e.target.classList.remove("drag-over"),this.file=e.dataTransfer.files[0]},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDragEnter:e=>e.target.classList.add("drag-over"),onDragLeave:e=>e.target.classList.remove("drag-over")},i("div",null,i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};N.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const R=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.name="",this.dirty=!1}async componentWillLoad(){var e,t,i,s,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await d(this.endpoint,this.templateId,!1),this.name=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.name,this.dirty=!1}catch(e){console.log("[TEMPLATE NAME] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new p(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t,i,s;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,console.log("Closing"),null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await a(this.endpoint,this.templateId,{name:this.name}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.name=this.name),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoading)?i(s,{class:"loading"},i("verdocs-loader",null)):i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("label",{htmlFor:"verdocs-template-name"},"Template Name"),i("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:e=>{var t,i;this.name=e.target.value,this.dirty=this.name!==(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name)}}),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};R.style="";const A=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.showPlanBlocker=!1,this.sendReminders=!1,this.firstReminderDays="1",this.reminderDays="1",this.dirty=!1}async componentWillLoad(){var e,t,i,s,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await d(this.endpoint,this.templateId,!0),this.sendReminders=!!(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.reminder_id),this.dirty=!1}catch(e){console.log("[TEMPLATE REMINDERS] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new p(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t,i,s;e.stopPropagation(),this.sendReminders=!!(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.reminder_id),this.dirty=!1,null===(s=this.close)||void 0===s||s.emit()}async handleSave(e){var t,i,s,o,l,a,n,r,c,h,v,m;e.stopPropagation();try{if(this.sendReminders){const e={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};(null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.reminder_id)?(await function(e,t,i,s){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),s).then((function(e){return e.data}))}(this.endpoint,this.templateId,null===(s=this.store)||void 0===s?void 0:s.state.reminder_id,e),this.store=await d(this.endpoint,this.templateId,!0)):(await function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))}(this.endpoint,this.templateId,e),this.store=await d(this.endpoint,this.templateId,!0))}else await(h=this.endpoint,v=this.templateId,m=null===(o=this.store)||void 0===o?void 0:o.state.reminder_id,h.api.delete("/templates/".concat(v,"/reminder/").concat(m)).then((function(e){return e.data}))),this.store=await d(this.endpoint,this.templateId,!0);null===(l=this.templateUpdated)||void 0===l||l.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"})}catch(e){console.log("[TEMPLATE REMINDERS] Unable to update reminders",e),z(e.message),null===(a=this.sdkError)||void 0===a||a.emit(new p(e.message,null===(n=e.response)||void 0===n?void 0:n.status,null===(r=e.response)||void 0===r?void 0:r.data))}this.dirty=!1,null===(c=this.close)||void 0===c||c.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Reminders"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),i("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:e=>{this.sendReminders=e.target.checked,this.dirty=!0}})),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),i("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:e=>{this.firstReminderDays=e.target.value,this.dirty=!0},disabled:!this.sendReminders})),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),i("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:e=>{this.reminderDays=e.target.value,this.dirty=!0},disabled:!this.sendReminders})),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))),this.showPlanBlocker&&i("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:()=>this.showPlanBlocker=!1})):i(s,{class:"empty"}):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};A.style='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';const D=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var e,t,i,s,o,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await d(this.endpoint,this.templateId,!1),this.personal=(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal)||!0,this.public=(null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.is_public)||!1,this.dirty=!1}catch(e){console.log("[TEMPLATE VISIBILITY] Error loading template",e),null===(o=this.sdkError)||void 0===o||o.emit(new p(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}handleCancel(e){var t,i,s,o,l;e.stopPropagation(),this.personal=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.is_personal,this.public=null===(o=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===o?void 0:o.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(e){var t,i,s;e.stopPropagation(),await a(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(t=this.store)||void 0===t?void 0:t.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"}),null===(s=this.close)||void 0===s||s.emit()}render(){var e,t;return this.endpoint.session?this.endpoint.session&&(null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.isLoaded)?i(s,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Visibility"),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-shared"},"Shared"),i("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:e=>{this.personal=!e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),i("div",{class:"input-row"},i("label",{htmlFor:"verdocs-is-public"},"Public"),i("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:e=>{this.public=e.target.checked,this.dirty=!0}})),i("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),i("div",{class:"buttons"},i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)})))):i(s,{class:"empty"}):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};D.style='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{C as verdocs_preview,I as verdocs_send,L as verdocs_template_attachments,M as verdocs_template_build_tabs,N as verdocs_template_create,R as verdocs_template_name,A as verdocs_template_reminders,D as verdocs_template_visibility}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as s,H as i}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as n}from"./p-035f6b38.js";import{a,c as r,b as o}from"./p-5e808a0b.js";import{V as l}from"./p-ed416acf.js";import{S as c}from"./p-7a1b2643.js";import{g as d,a as u,u as h}from"./p-3e607686.js";import{f as m}from"./p-c220af42.js";import{d as p}from"./p-02a71e03.js";import"./p-7d5dbd9a.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";var v=function(e,t){return e.api.get("/organizations/".concat(t,"/profiles")).then((function(e){return e.data}))};const f=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.keys=[],this.creatingKey=!1,this.createdKey=null,this.deletingKey=null,this.rotatingKey=null,this.newApiKeyName="",this.newApiKeyProfileId="",this.members=[]}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.newApiKeyProfileId=this.endpoint.session.profile_id,v(this.endpoint,this.endpoint.session.organization_id).then((e=>{this.members=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Error loading organization members",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})})),this.loadKeys()}loadKeys(){var e,t;(e=this.endpoint,t=this.endpoint.session.organization_id,e.api.get("/organizations/".concat(t,"/api_key")).then((function(e){return e.data}))).then((e=>{this.keys=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Unable to load API keys",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})}))}async handleDeleteKey(){var e,t,s;(e=this.endpoint,t=this.deletingKey.organization_id,s=this.deletingKey.client_id,e.api.delete("/organizations/".concat(t,"/api_key/").concat(s)).then((function(e){return e.data}))).then((()=>{this.deletingKey=null,l("API key deleted",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.deletingKey=null,console.log("[SETTINGS] Unable to delete API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to delete API key. Please try again later",{style:"error"})}))}async handleRotateKey(){var e,t,s;(e=this.endpoint,t=this.rotatingKey.organization_id,s=this.rotatingKey.client_id,e.api.put("/organizations/".concat(t,"/api_key/").concat(s,"/rotate")).then((function(e){return e.data}))).then((e=>{this.rotatingKey=null,l("API key rotated",{style:"success"}),this.loadKeys(),this.createdKey=e})).catch((e=>{var t,s,i;this.rotatingKey=null,console.log("[SETTINGS] Unable to rotate API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to rotate API key. Please try again later",{style:"error"})}))}async handleCreateKey(){var e,t,s;(e=this.endpoint,t=this.endpoint.session.organization_id,s={name:this.newApiKeyName,profile_id:this.newApiKeyProfileId},e.api.post("/organizations/".concat(t,"/api_key"),s).then((function(e){return e.data}))).then((e=>{this.creatingKey=!1,this.createdKey=e,l("API key created",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.creatingKey=!1,console.log("[SETTINGS] Unable to create API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to create API key. Please try again later",{style:"error"})}))}render(){var e,t,n,r;const o=this.members.map((e=>({label:a(e),value:e.id})));return this.endpoint.session?s(i,null,s("verdocs-table",{data:this.keys,columns:[{id:"name",header:"Name",renderCell:(e,t)=>s("div",null,s("div",null,t.name))},{id:"client_id",header:"Client ID",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>'}),s("div",null,t.client_id))},{id:"profile_id",header:"Acts as",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>'}),s("div",null,a(t.profile)))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>',onClick:()=>this.deletingKey=t}),s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>',onClick:()=>this.rotatingKey=t}))}]}),s("verdocs-button",{label:"Add API Key",size:"normal",onClick:()=>this.creatingKey=!0}),this.deletingKey&&s("verdocs-dialog",{onExit:()=>this.deletingKey=null},s("div",{slot:"title",class:"heading"},'Delete API key "',this.deletingKey.name,'"?'),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this key? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.deletingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleDeleteKey()})))),this.rotatingKey&&s("verdocs-dialog",{onExit:()=>this.rotatingKey=null},s("div",{slot:"title",class:"heading"},'Rotate API key "',this.rotatingKey.name,'"?'),s("div",{class:"content"},s("p",null,"Are you sure you want to rotate this key? A new client secret will be generated, and the old value will become unusable. This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.rotatingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleRotateKey()})))),this.creatingKey&&s("verdocs-dialog",{onExit:()=>this.creatingKey=!1},s("div",{slot:"title",class:"heading"},"Create API Key"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",placeholder:"API key name...",id:"verdocs-api-key-name",value:this.newApiKeyName,autocomplete:"off",required:!0,onInput:e=>this.newApiKeyName=e.target.value,onFocusout:e=>{this.newApiKeyName=e.target.value.trim()}}),s("p",null,'API keys must be associated with a profile. Actions performed via API calls using this key will "act as" this profile.'),s("verdocs-select-input",{options:o,label:"Act as Profile",onInput:e=>{this.newApiKeyProfileId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.creatingKey=!1}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleCreateKey()})))),this.createdKey&&s("verdocs-dialog",{onExit:()=>this.createdKey=null},s("div",{slot:"title",class:"heading"},"API Key Details"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",disabled:!0,value:null===(e=this.createdKey)||void 0===e?void 0:e.name}),s("verdocs-text-input",{label:"Profile",disabled:!0,value:a(null===(t=this.createdKey)||void 0===t?void 0:t.profile)}),s("p",null,"Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"),s("verdocs-text-input",{label:"Client ID",disabled:!0,value:null===(n=this.createdKey)||void 0===n?void 0:n.client_id,copyable:!0}),s("verdocs-text-input",{label:"Secret Key",disabled:!0,value:null===(r=this.createdKey)||void 0===r?void 0:r.client_secret,copyable:!0}),s("div",{class:"buttons"},s("verdocs-button",{size:"small",label:"Done",onClick:()=>this.createdKey=null}))))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};f.style='verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-api-keys .data-col svg{width:24px;height:24px}verdocs-settings-api-keys .col-name svg,verdocs-settings-api-keys .col-client_id svg,verdocs-settings-api-keys .col-profile_id svg{fill:#a1a1aa}verdocs-settings-api-keys .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-api-keys .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-api-keys .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .header-col.col-actions{text-align:center}verdocs-settings-api-keys verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-api-keys .col-client_id,verdocs-settings-api-keys .col-actions{display:none}}';const g='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>',y=e=>void 0!==e.find((e=>"owner"===e.name))?"Owner":void 0!==e.find((e=>"admin"===e.name))?"Admin":void 0!==e.find((e=>"member"===e.name))?"Member":void 0!==e.find((e=>"basic_user"===e.name))?"Basic User":void 0!==e.find((e=>"contact"===e.name))?"Contact":void 0,T=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.members=[],this.invited=[],this.roles=[],this.selectedTab=0,this.invitingMember=!1,this.newEmailAddress="",this.newRoleId="",this.submitting=!1,this.deletingInvitation=null,this.resendingInvitation=null,this.deletingMember=null}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.loadMembers().catch((e=>console.log("Unknown Error",e)))}async loadMembers(){var e,t,s,i,n,a;try{const[t,s,i]=await Promise.all([d(this.endpoint),v(this.endpoint,this.endpoint.session.organization_id),(n=this.endpoint,a=this.endpoint.session.organization_id,n.api.get("/organizations/".concat(a,"/invitation")).then((function(e){return e.data})))]);this.roles=t,this.members=s,this.invited=i,this.newRoleId=(null===(e=t.find((e=>"member"===e.name)))||void 0===e?void 0:e.id)||""}catch(e){null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load members. Please try again later")}}async handleInviteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.endpoint.session.organization_id,s={email:this.newEmailAddress,role_id:this.newRoleId,organization_id:this.endpoint.session.organization_id},e.api.post("/organizations/".concat(t,"/invitation"),s).then((function(e){return e.data}))).then((e=>{console.log("[SETTINGS] Invited member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Invitation sent!",{style:"success"}),this.loadMembers()})).catch((e=>{console.log("[SETTINGS] Unable to invite member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Unable to invite member. Please try again later",{style:"error"})}))}async handleDeleteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingMember.organization_id,s=this.deletingMember.email,e.api.delete("/organizations/".concat(t,"/profiles/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingMember=null,l("The member has been deleted.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingMember=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleDeleteInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingInvitation.organization_id,s=this.deletingInvitation.email,e.api.delete("/organizations/".concat(t,"/invitation/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingInvitation=null,l("The invitation has been cancelled.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingInvitation=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleResendInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.resendingInvitation.organization_id,s=this.resendingInvitation.email,e.api.post("/organizations/".concat(t,"/invitation/").concat(s,"/resend")).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.resendingInvitation=null,l("The invitation has been resent.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.resendingInvitation=null,console.log("REsend error",e),l("Unable to resend invitation. Please try again later",{style:"error"})}))}render(){if(!this.endpoint.session)return console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated");const e=this.roles.map((e=>({label:y([{name:e.name}]),value:e.id})));return s(i,null,s("verdocs-tabs",{tabs:[{label:`Members (${this.members.length})`},{label:`Pending Invitations (${this.invited.length})`}],onSelectTab:e=>this.selectedTab=e.detail.index}),0===this.selectedTab&&s("verdocs-table",{data:this.members,columns:[{id:"name",renderHeader:()=>"Member",renderCell:(e,t)=>{return s("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},s("div",{class:"role",style:{backgroundColor:(i=t.roles,void 0!==i.find((e=>"owner"===e.name))?"#9333ea":void 0!==i.find((e=>"admin"===e.name))?"#2563eb":void 0!==i.find((e=>"member"===e.name))?"#16a34a":void 0!==i.find((e=>"basic_user"===e.name))?"#ea580c":void 0!==i.find((e=>"contact"===e.name))?"#52525B":void 0)}},o(t)),s("span",null,a(t)));var i}},{id:"email",header:"E-mail Address"},{id:"phone",header:"Phone Number"},{id:"roles",header:"Role",renderCell:(e,t)=>`${y(t.roles)}`},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,t.id!==this.endpoint.session.profile_id&&s("div",{innerHTML:g,onClick:()=>this.deletingMember=t}))}]}),1===this.selectedTab&&s("verdocs-table",{data:this.invited,columns:[{id:"email",header:"E-mail Address"},{id:"generated_at",header:"Invited",renderCell:(e,t)=>s("div",null,m(new Date(t.generated_at),"MMM d, Y"))},{id:"role_id",header:"Role",renderCell:(e,t)=>{var i;return s("div",null,y([{name:null===(i=this.roles.find((e=>e.id===t.role_id)))||void 0===i?void 0:i.name}]))}},{id:"status",header:"Status",renderCell:(e,t)=>s("div",null,r(t.status))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:g,onClick:()=>this.deletingInvitation=t}),s("div",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>',onClick:()=>this.resendingInvitation=t}))}]}),s("verdocs-button",{label:"Invite New Member",size:"normal",disabled:this.submitting,onClick:()=>this.invitingMember=!0}),this.invitingMember&&s("verdocs-dialog",{onExit:()=>this.invitingMember=!1},s("div",{slot:"title",class:"heading"},"Invite New Member"),s("div",{class:"content"},s("verdocs-text-input",{label:"E-mail Address",placeholder:"Enter the user's email address...",id:"verdocs-invite-email",value:this.newEmailAddress,autocomplete:"off",required:!0,onInput:e=>this.newEmailAddress=e.target.value,onFocusout:e=>{this.newEmailAddress=e.target.value.trim()}}),s("div",{style:{marginBottom:"20px"}}),s("verdocs-select-input",{options:e,label:"Role",onInput:e=>{this.newRoleId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",disabled:this.submitting,onClick:()=>this.invitingMember=!1}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting||!this.newEmailAddress||!this.newRoleId,onClick:()=>this.handleInviteMember()})))),this.deletingMember&&s("verdocs-dialog",{onExit:()=>this.deletingMember=null},s("div",{slot:"title",class:"heading"},"Delete Member?"),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this member? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingMember=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteMember()})))),this.deletingInvitation&&s("verdocs-dialog",{onExit:()=>this.deletingInvitation=null},s("div",{slot:"title",class:"heading"},"Cancel Invitation?"),s("div",{class:"content"},s("p",null,"Are you sure you want to cancel this invitation? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteInvitation()})))),this.resendingInvitation&&s("verdocs-dialog",{onExit:()=>this.resendingInvitation=null},s("div",{slot:"title",class:"heading"},"Resend Invitation?"),s("div",{class:"content"},s("p",null,"The user will receive an email reminder to join your organization."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.resendingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleResendInvitation()})))))}};var b,M;T.style='verdocs-settings-members{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .role{font-size:12px;width:32px;height:32px;border-radius:32px;background:#777777;color:#ffffff;font-weight:700;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-members .data-col svg{width:24px;height:24px}verdocs-settings-members .col-name svg,verdocs-settings-members .col-client_id svg,verdocs-settings-members .col-profile_id svg{fill:#a1a1aa}verdocs-settings-members .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-members .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-members .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-members .header-col.col-actions{text-align:center}verdocs-settings-members verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-members .col-email,verdocs-settings-members .col-phone,verdocs-settings-members .col-actions{display:none}}',function(e){e.assertEqual=e=>e,e.assertIs=function(){},e.assertNever=function(){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of s)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(b||(b={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(M||(M={}));const x=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=e=>{switch(typeof e){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(e)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(e)?x.array:null===e?x.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?x.promise:"undefined"!=typeof Map&&e instanceof Map?x.map:"undefined"!=typeof Set&&e instanceof Set?x.set:"undefined"!=typeof Date&&e instanceof Date?x.date:x.object;default:return x.unknown}},w=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class k extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},s={_errors:[]},i=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)s._errors.push(t(n));else{let e=s,i=0;for(;i<n.path.length;){const s=n.path[i];i===n.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(n))):e[s]=e[s]||{_errors:[]},e=e[s],i++}}};return i(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},s=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}k.create=e=>new k(e);const I=(e,t)=>{let s;switch(e.code){case w.invalid_type:s=e.received===x.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,b.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:s=`Unrecognized key(s) in object: ${b.joinValues(e.keys,", ")}`;break;case w.invalid_union:s="Invalid input";break;case w.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${b.joinValues(e.options)}`;break;case w.invalid_enum_value:s=`Invalid enum value. Expected ${b.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:s="Invalid function arguments";break;case w.invalid_return_type:s="Invalid function return type";break;case w.invalid_date:s="Invalid date";break;case w.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:b.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case w.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case w.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case w.custom:s="Invalid input";break;case w.invalid_intersection_types:s="Intersection results could not be merged";break;case w.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:s="Number must be finite";break;default:s=t.defaultError,b.assertNever(e)}return{message:s}};let _=I;function N(){return _}const S=e=>{const{data:t,path:s,errorMaps:i,issueData:n}=e,a=[...s,...n.path||[]],r={...n,path:a};let o="";const l=i.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(r,{data:t,defaultError:o}).message;return{...n,path:a,message:n.message||o}};function E(e,t){const s=S({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,N(),I].filter((e=>!!e))});e.common.issues.push(s)}class C{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const i of t){if("aborted"===i.status)return A;"dirty"===i.status&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t)s.push({key:await e.key,value:await e.value});return C.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const i of t){const{key:t,value:n}=i;if("aborted"===t.status)return A;if("aborted"===n.status)return A;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!i.alwaysSet||(s[t.value]=n.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Z=e=>({status:"dirty",value:e}),P=e=>({status:"valid",value:e}),z=e=>"aborted"===e.status,j=e=>"dirty"===e.status,D=e=>"valid"===e.status,L=e=>"undefined"!=typeof Promise&&e instanceof Promise;var U;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(U||(U={}));class B{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $=(e,t)=>{if(D(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new k(e.common.issues);return this._error=t,this._error}}};function K(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:i,description:n}=e;if(t&&(s||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=i?i:t.defaultError}:{message:null!=s?s:t.defaultError},description:n}}class O{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return G(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(L(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const i={common:{issues:[],async:null!==(s=null==t?void 0:t.async)&&void 0!==s&&s,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:G(e)},n=this._parseSync({data:e,path:i.path,parent:i});return $(i,n)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:G(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(L(i)?i:Promise.resolve(i));return $(s,n)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const n=e(t),a=()=>i.addIssue({code:w.custom,...s(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(a(),!1))):!!n||(a(),!1)}))}refinement(e,t){return this._refinement(((s,i)=>!!e(s)||(i.addIssue("function"==typeof t?t(s,i):t),!1)))}_refinement(e){return new Ee({schema:this,typeName:Ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ce.create(this,this._def)}nullable(){return Ae.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this,this._def)}promise(){return Se.create(this,this._def)}or(e){return pe.create([this,e],this._def)}and(e){return ye.create(this,e,this._def)}transform(e){return new Ee({...K(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ze({...K(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new De({typeName:Ke.ZodBranded,type:this,...K(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...K(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Le.create(this,e)}readonly(){return Ue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R=/^c[^\s-]{8,}$/i,q=/^[a-z][a-z0-9]*$/,V=/^[0-9A-HJKMNP-TV-Z]{26}$/,F=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,H=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let W;const J=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Y=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class Q extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.string,received:t.parsedType}),A}const t=new C;let s;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const i=e.data.length>r.value,n=e.data.length<r.value;(i||n)&&(s=this._getOrReturnCtx(e,s),i?E(s,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&E(s,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)H.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"email",code:w.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)W||(W=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),W.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"emoji",code:w.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)F.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"uuid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)R.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)q.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid2",code:w.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)V.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ulid",code:w.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(i){s=this._getOrReturnCtx(e,s),E(s,{validation:"url",code:w.invalid_string,message:r.message}),t.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"regex",code:w.invalid_string,message:r.message}),t.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):"datetime"===r.kind?((a=r).precision?a.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${a.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${a.precision}}Z$`):0===a.precision?a.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):a.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:w.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"ip"===r.kind?(i=e.data,("v4"!==(n=r.version)&&n||!J.test(i))&&("v6"!==n&&n||!Y.test(i))&&(s=this._getOrReturnCtx(e,s),E(s,{validation:"ip",code:w.invalid_string,message:r.message}),t.dirty())):b.assertNever(r);var i,n,a;return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement((t=>e.test(t)),{validation:t,code:w.invalid_string,...U.errToObj(s)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}datetime(e){var t;return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,message:e}:{kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...U.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...U.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function X(e,t){const s=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=s>i?s:i;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}Q.create=e=>{var t;return new Q({checks:[],typeName:Ke.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...K(e)})};class ee extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.number,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"int"===i.kind?b.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"multipleOf"===i.kind?0!==X(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_finite,message:i.message}),s.dirty()):b.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&b.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ee.create=e=>new ee({checks:[],typeName:Ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...K(e)});class te extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.bigint,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),E(t,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):b.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}te.create=e=>{var t;return new te({checks:[],typeName:Ke.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...K(e)})};class se extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==x.boolean){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.boolean,received:t.parsedType}),A}return P(e.data)}}se.create=e=>new se({typeName:Ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...K(e)});class ie extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.date,received:t.parsedType}),A}if(isNaN(e.data.getTime()))return E(this._getOrReturnCtx(e),{code:w.invalid_date}),A;const t=new C;let s;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),t.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):b.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ie.create=e=>new ie({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ke.ZodDate,...K(e)});class ne extends O{_parse(e){if(this._getType(e)!==x.symbol){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.symbol,received:t.parsedType}),A}return P(e.data)}}ne.create=e=>new ne({typeName:Ke.ZodSymbol,...K(e)});class ae extends O{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.undefined,received:t.parsedType}),A}return P(e.data)}}ae.create=e=>new ae({typeName:Ke.ZodUndefined,...K(e)});class re extends O{_parse(e){if(this._getType(e)!==x.null){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.null,received:t.parsedType}),A}return P(e.data)}}re.create=e=>new re({typeName:Ke.ZodNull,...K(e)});class oe extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}}oe.create=e=>new oe({typeName:Ke.ZodAny,...K(e)});class le extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}}le.create=e=>new le({typeName:Ke.ZodUnknown,...K(e)});class ce extends O{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.never,received:t.parsedType}),A}}ce.create=e=>new ce({typeName:Ke.ZodNever,...K(e)});class de extends O{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.void,received:t.parsedType}),A}return P(e.data)}}de.create=e=>new de({typeName:Ke.ZodVoid,...K(e)});class ue extends O{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==x.array)return E(t,{code:w.invalid_type,expected:x.array,received:t.parsedType}),A;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,n=t.data.length<i.exactLength.value;(e||n)&&(E(t,{code:e?w.too_big:w.too_small,minimum:n?i.exactLength.value:void 0,maximum:e?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&(E(t,{code:w.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&(E(t,{code:w.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map(((e,s)=>i.type._parseAsync(new B(t,e,t.path,s))))).then((e=>C.mergeArray(s,e)));const n=[...t.data].map(((e,s)=>i.type._parseSync(new B(t,e,t.path,s))));return C.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}}function he(e){if(e instanceof me){const t={};for(const s in e.shape)t[s]=Ce.create(he(e.shape[s]));return new me({...e._def,shape:()=>t})}return e instanceof ue?new ue({...e._def,type:he(e.element)}):e instanceof Ce?Ce.create(he(e.unwrap())):e instanceof Ae?Ae.create(he(e.unwrap())):e instanceof Te?Te.create(e.items.map((e=>he(e)))):e}ue.create=(e,t)=>new ue({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...K(t)});class me extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=b.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),A}const{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),a=[];if(!(this._def.catchall instanceof ce&&"strip"===this._def.unknownKeys))for(const e in s.data)n.includes(e)||a.push(e);const r=[];for(const e of n)r.push({key:{status:"valid",value:e},value:i[e]._parse(new B(s,s.data[e],s.path,e)),alwaysSet:e in s.data});if(this._def.catchall instanceof ce){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)r.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)a.length>0&&(E(s,{code:w.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a)r.push({key:{status:"valid",value:t},value:e._parse(new B(s,s.data[t],s.path,t)),alwaysSet:t in s.data})}return s.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of r){const s=await t.key;e.push({key:s,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>C.mergeObjectSync(t,e))):C.mergeObjectSync(t,r)}get shape(){return this._def.shape()}strict(e){return new me({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var i,n,a,r;const o=null!==(a=null===(n=(i=this._def).errorMap)||void 0===n?void 0:n.call(i,t,s).message)&&void 0!==a?a:s.defaultError;return"unrecognized_keys"===t.code?{message:null!==(r=U.errToObj(e).message)&&void 0!==r?r:o}:{message:o}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const t={};return b.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new me({...this._def,shape:()=>t})}omit(e){const t={};return b.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new me({...this._def,shape:()=>t})}deepPartial(){return he(this)}partial(e){const t={};return b.objectKeys(this.shape).forEach((s=>{const i=this.shape[s];t[s]=e&&!e[s]?i:i.optional()})),new me({...this._def,shape:()=>t})}required(e){const t={};return b.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof Ce;)e=e._def.innerType;t[s]=e}})),new me({...this._def,shape:()=>t})}keyof(){return Ie(b.objectKeys(this.shape))}}me.create=(e,t)=>new me({shape:()=>e,unknownKeys:"strip",catchall:ce.create(),typeName:Ke.ZodObject,...K(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:"strict",catchall:ce.create(),typeName:Ke.ZodObject,...K(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:"strip",catchall:ce.create(),typeName:Ke.ZodObject,...K(t)});class pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map((e=>new k(e.ctx.common.issues)));return E(t,{code:w.invalid_union,unionErrors:s}),A}));{let e;const i=[];for(const n of s){const s={...t,common:{...t.common,issues:[]},parent:null},a=n._parseSync({data:t.data,path:t.path,parent:s});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:s}),s.common.issues.length&&i.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=i.map((e=>new k(e)));return E(t,{code:w.invalid_union,unionErrors:n}),A}}get options(){return this._def.options}}pe.create=(e,t)=>new pe({options:e,typeName:Ke.ZodUnion,...K(t)});const ve=e=>e instanceof we?ve(e.schema):e instanceof Ee?ve(e.innerType()):e instanceof ke?[e.value]:e instanceof _e?e.options:e instanceof Ne?Object.keys(e.enum):e instanceof Ze?ve(e._def.innerType):e instanceof ae?[void 0]:e instanceof re?[null]:null;class fe extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return E(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),A;const s=this.discriminator,i=this.optionsMap.get(t.data[s]);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const i=new Map;for(const s of t){const t=ve(s.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,s)}}return new fe({typeName:Ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...K(s)})}}function ge(e,t){const s=G(e),i=G(t);if(e===t)return{valid:!0,data:e};if(s===x.object&&i===x.object){const s=b.objectKeys(t),i=b.objectKeys(e).filter((e=>-1!==s.indexOf(e))),n={...e,...t};for(const s of i){const i=ge(e[s],t[s]);if(!i.valid)return{valid:!1};n[s]=i.data}return{valid:!0,data:n}}if(s===x.array&&i===x.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const n=ge(e[i],t[i]);if(!n.valid)return{valid:!1};s.push(n.data)}return{valid:!0,data:s}}return s===x.date&&i===x.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ye extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=(e,i)=>{if(z(e)||z(i))return A;const n=ge(e.value,i.value);return n.valid?((j(e)||j(i))&&t.dirty(),{status:t.value,value:n.data}):(E(s,{code:w.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ye.create=(e,t,s)=>new ye({left:e,right:t,typeName:Ke.ZodIntersection,...K(s)});class Te extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return E(s,{code:w.invalid_type,expected:x.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return E(s,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(E(s,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new B(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(i).then((e=>C.mergeArray(t,e))):C.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Te({...this._def,rest:e})}}Te.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Te({items:e,typeName:Ke.ZodTuple,rest:null,...K(t)})};class be extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.object)return E(s,{code:w.invalid_type,expected:x.object,received:s.parsedType}),A;const i=[],n=this._def.keyType,a=this._def.valueType;for(const e in s.data)i.push({key:n._parse(new B(s,e,s.path,e)),value:a._parse(new B(s,s.data[e],s.path,e))});return s.common.async?C.mergeObjectAsync(t,i):C.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return new be(t instanceof O?{keyType:e,valueType:t,typeName:Ke.ZodRecord,...K(s)}:{keyType:Q.create(),valueType:e,typeName:Ke.ZodRecord,...K(t)})}}class Me extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return E(s,{code:w.invalid_type,expected:x.map,received:s.parsedType}),A;const i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map((([e,t],a)=>({key:i._parse(new B(s,e,s.path,[a,"key"])),value:n._parse(new B(s,t,s.path,[a,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of a){const i=await s.key,n=await s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const s of a){const i=s.key,n=s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}Me.create=(e,t,s)=>new Me({valueType:t,keyType:e,typeName:Ke.ZodMap,...K(s)});class xe extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return E(s,{code:w.invalid_type,expected:x.set,received:s.parsedType}),A;const i=this._def;null!==i.minSize&&s.data.size<i.minSize.value&&(E(s,{code:w.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&s.data.size>i.maxSize.value&&(E(s,{code:w.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const n=this._def.valueType;function a(e){const s=new Set;for(const i of e){if("aborted"===i.status)return A;"dirty"===i.status&&t.dirty(),s.add(i.value)}return{status:t.value,value:s}}const r=[...s.data.values()].map(((e,t)=>n._parse(new B(s,e,s.path,t))));return s.common.async?Promise.all(r).then((e=>a(e))):a(r)}min(e,t){return new xe({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new xe({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}xe.create=(e,t)=>new xe({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...K(t)});class Ge extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return E(t,{code:w.invalid_type,expected:x.function,received:t.parsedType}),A;function s(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:w.invalid_arguments,argumentsError:s}})}function i(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:w.invalid_return_type,returnTypeError:s}})}const n={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Se){const e=this;return P((async function(...t){const r=new k([]),o=await e._def.args.parseAsync(t,n).catch((e=>{throw r.addIssue(s(t,e)),r})),l=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch((e=>{throw r.addIssue(i(l,e)),r}))}))}{const e=this;return P((function(...t){const r=e._def.args.safeParse(t,n);if(!r.success)throw new k([s(t,r.error)]);const o=Reflect.apply(a,this,r.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new k([i(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ge({...this._def,args:Te.create(e).rest(le.create())})}returns(e){return new Ge({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Ge({args:e||Te.create([]).rest(le.create()),returns:t||le.create(),typeName:Ke.ZodFunction,...K(s)})}}class we extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}we.create=(e,t)=>new we({getter:e,typeName:Ke.ZodLazy,...K(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new _e({values:e,typeName:Ke.ZodEnum,...K(t)})}ke.create=(e,t)=>new ke({value:e,typeName:Ke.ZodLiteral,...K(t)});class _e extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return E(t,{expected:b.joinValues(this._def.values),received:t.parsedType,code:w.invalid_type}),A}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:w.invalid_enum_value,options:this._def.values}),A}return P(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return _e.create(e)}exclude(e){return _e.create(this.options.filter((t=>!e.includes(t))))}}_e.create=Ie;class Ne extends O{_parse(e){const t=b.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const e=b.objectValues(t);return E(s,{expected:b.joinValues(e),received:s.parsedType,code:w.invalid_type}),A}if(-1===t.indexOf(e.data)){const e=b.objectValues(t);return E(s,{received:s.data,code:w.invalid_enum_value,options:e}),A}return P(e.data)}get enum(){return this._def.values}}Ne.create=(e,t)=>new Ne({values:e,typeName:Ke.ZodNativeEnum,...K(t)});class Se extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&!1===t.common.async)return E(t,{code:w.invalid_type,expected:x.promise,received:t.parsedType}),A;const s=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return P(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Se.create=(e,t)=>new Se({type:e,typeName:Ke.ZodPromise,...K(t)});class Ee extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{E(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const e=i.transform(s.data,n);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:s.path,parent:s}))):this._def.schema._parseSync({data:e,path:s.path,parent:s})}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,n);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===i.status?A:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?A:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===i.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(e))return e;const a=i.transform(e.value,n);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>D(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}b.assertNever(i)}}Ee.create=(e,t,s)=>new Ee({schema:e,typeName:Ke.ZodEffects,effect:t,...K(s)}),Ee.createWithPreprocess=(e,t,s)=>new Ee({schema:t,effect:{type:"preprocess",transform:e},typeName:Ke.ZodEffects,...K(s)});class Ce extends O{_parse(e){return this._getType(e)===x.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:Ke.ZodOptional,...K(t)});class Ae extends O{_parse(e){return this._getType(e)===x.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:Ke.ZodNullable,...K(t)});class Ze extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...K(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return L(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:Ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...K(t)});class ze extends O{_parse(e){if(this._getType(e)!==x.nan){const t=this._getOrReturnCtx(e);return E(t,{code:w.invalid_type,expected:x.nan,received:t.parsedType}),A}return{status:"valid",value:e.data}}}ze.create=e=>new ze({typeName:Ke.ZodNaN,...K(e)});const je=Symbol("zod_brand");class De extends O{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class Le extends O{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),Z(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new Le({in:e,out:t,typeName:Ke.ZodPipeline})}}class Ue extends O{_parse(e){const t=this._def.innerType._parse(e);return D(t)&&(t.value=Object.freeze(t.value)),t}}Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ke.ZodReadonly,...K(t)});const Be=(e,t={},s)=>e?oe.create().superRefine(((i,n)=>{var a,r;if(!e(i)){const e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,o=null===(r=null!==(a=e.fatal)&&void 0!==a?a:s)||void 0===r||r;n.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:o})}})):oe.create(),$e={object:me.lazycreate};var Ke;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ke||(Ke={}));const Oe=Q.create,Re=ee.create,qe=se.create,Ve=Ee.create,Fe={string:e=>Q.create({...e,coerce:!0}),number:e=>ee.create({...e,coerce:!0}),boolean:e=>se.create({...e,coerce:!0}),bigint:e=>te.create({...e,coerce:!0}),date:e=>ie.create({...e,coerce:!0})};var He=Object.freeze({__proto__:null,defaultErrorMap:I,setErrorMap:function(e){_=e},getErrorMap:N,makeIssue:S,EMPTY_PATH:[],addIssueToContext:E,ParseStatus:C,INVALID:A,DIRTY:Z,OK:P,isAborted:z,isDirty:j,isValid:D,isAsync:L,get util(){return b},get objectUtil(){return M},ZodParsedType:x,getParsedType:G,ZodType:O,ZodString:Q,ZodNumber:ee,ZodBigInt:te,ZodBoolean:se,ZodDate:ie,ZodSymbol:ne,ZodUndefined:ae,ZodNull:re,ZodAny:oe,ZodUnknown:le,ZodNever:ce,ZodVoid:de,ZodArray:ue,ZodObject:me,ZodUnion:pe,ZodDiscriminatedUnion:fe,ZodIntersection:ye,ZodTuple:Te,ZodRecord:be,ZodMap:Me,ZodSet:xe,ZodFunction:Ge,ZodLazy:we,ZodLiteral:ke,ZodEnum:_e,ZodNativeEnum:Ne,ZodPromise:Se,ZodEffects:Ee,ZodTransformer:Ee,ZodOptional:Ce,ZodNullable:Ae,ZodDefault:Ze,ZodCatch:Pe,ZodNaN:ze,BRAND:je,ZodBranded:De,ZodPipeline:Le,ZodReadonly:Ue,custom:Be,Schema:O,ZodSchema:O,late:$e,get ZodFirstPartyTypeKind(){return Ke},coerce:Fe,any:oe.create,array:ue.create,bigint:te.create,boolean:qe,date:ie.create,discriminatedUnion:fe.create,effect:Ve,enum:_e.create,function:Ge.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Be((t=>t instanceof e),t),intersection:ye.create,lazy:we.create,literal:ke.create,map:Me.create,nan:ze.create,nativeEnum:Ne.create,never:ce.create,null:re.create,nullable:Ae.create,number:Re,object:me.create,oboolean:()=>qe().optional(),onumber:()=>Re().optional(),optional:Ce.create,ostring:()=>Oe().optional(),pipeline:Le.create,preprocess:Ee.createWithPreprocess,promise:Se.create,record:be.create,set:xe.create,strictObject:me.strictCreate,string:Oe,symbol:ne.create,transformer:Ve,tuple:Te.create,undefined:ae.create,union:pe.create,unknown:le.create,void:de.create,NEVER:A,ZodIssueCode:w,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:k});const We=[["International Date Line West","GMT-11:00","(GMT-11:00) International Date Line West"],["Midway Island","GMT-11:00","(GMT-11:00) Midway Island"],["Samoa","GMT-11:00","(GMT-11:00) Samoa"],["Hawaii","GMT-10:00","(GMT-10:00) Hawaii"],["Alaska","GMT-09:00","(GMT-09:00) Alaska"],["Pacific Time (US & Canada)","GMT-08:00","(GMT-08:00) Pacific Time (US & Canada)"],["Tijuana","GMT-08:00","(GMT-08:00) Tijuana"],["Arizona","GMT-07:00","(GMT-07:00) Arizona"],["Chihuahua","GMT-07:00","(GMT-07:00) Chihuahua"],["Mazatlan","GMT-07:00","(GMT-07:00) Mazatlan"],["Mountain Time (US & Canada)","GMT-07:00","(GMT-07:00) Mountain Time (US & Canada)"],["Central America","GMT-06:00","(GMT-06:00) Central America"],["Central Time (US & Canada)","GMT-06:00","(GMT-06:00) Central Time (US & Canada)"],["Guadalajara","GMT-06:00","(GMT-06:00) Guadalajara"],["Mexico City","GMT-06:00","(GMT-06:00) Mexico City"],["Monterrey","GMT-06:00","(GMT-06:00) Monterrey"],["Saskatchewan","GMT-06:00","(GMT-06:00) Saskatchewan"],["Bogota","GMT-05:00","(GMT-05:00) Bogota"],["Eastern Time (US & Canada)","GMT-05:00","(GMT-05:00) Eastern Time (US & Canada)"],["Indiana (East)","GMT-05:00","(GMT-05:00) Indiana (East)"],["Lima","GMT-05:00","(GMT-05:00) Lima"],["Quito","GMT-05:00","(GMT-05:00) Quito"],["Caracas","GMT-04:30","(GMT-04:30) Caracas"],["Atlantic Time (Canada)","GMT-04:00","(GMT-04:00) Atlantic Time (Canada)"],["Georgetown","GMT-04:00","(GMT-04:00) Georgetown"],["La Paz","GMT-04:00","(GMT-04:00) La Paz"],["Santiago","GMT-04:00","(GMT-04:00) Santiago"],["Newfoundland","GMT-03:30","(GMT-03:30) Newfoundland"],["Brasilia","GMT-03:00","(GMT-03:00) Brasilia"],["Buenos Aires","GMT-03:00","(GMT-03:00) Buenos Aires"],["Greenland","GMT-03:00","(GMT-03:00) Greenland"],["Mid-Atlantic","GMT-02:00","(GMT-02:00) Mid-Atlantic"],["Azores","GMT-01:00","(GMT-01:00) Azores"],["Cape Verde Is.","GMT-01:00","(GMT-01:00) Cape Verde Is."],["Casablanca","GMT+00:00","(GMT+00:00) Casablanca"],["Dublin","GMT+00:00","(GMT+00:00) Dublin"],["Edinburgh","GMT+00:00","(GMT+00:00) Edinburgh"],["Lisbon","GMT+00:00","(GMT+00:00) Lisbon"],["London","GMT+00:00","(GMT+00:00) London"],["Monrovia","GMT+00:00","(GMT+00:00) Monrovia"],["UTC","GMT+00:00","(GMT+00:00) UTC"],["Amsterdam","GMT+01:00","(GMT+01:00) Amsterdam"],["Belgrade","GMT+01:00","(GMT+01:00) Belgrade"],["Berlin","GMT+01:00","(GMT+01:00) Berlin"],["Bern","GMT+01:00","(GMT+01:00) Bern"],["Bratislava","GMT+01:00","(GMT+01:00) Bratislava"],["Brussels","GMT+01:00","(GMT+01:00) Brussels"],["Budapest","GMT+01:00","(GMT+01:00) Budapest"],["Copenhagen","GMT+01:00","(GMT+01:00) Copenhagen"],["Ljubljana","GMT+01:00","(GMT+01:00) Ljubljana"],["Madrid","GMT+01:00","(GMT+01:00) Madrid"],["Paris","GMT+01:00","(GMT+01:00) Paris"],["Prague","GMT+01:00","(GMT+01:00) Prague"],["Rome","GMT+01:00","(GMT+01:00) Rome"],["Sarajevo","GMT+01:00","(GMT+01:00) Sarajevo"],["Skopje","GMT+01:00","(GMT+01:00) Skopje"],["Stockholm","GMT+01:00","(GMT+01:00) Stockholm"],["Vienna","GMT+01:00","(GMT+01:00) Vienna"],["Warsaw","GMT+01:00","(GMT+01:00) Warsaw"],["West Central Africa","(GMT+01:00","(GMT+01:00) West Central Africa"],["Zagreb","GMT+01:00","(GMT+01:00) Zagreb"],["Athens","GMT+02:00","(GMT+02:00) Athens"],["Bucharest","GMT+02:00","(GMT+02:00) Bucharest"],["Cairo","GMT+02:00","(GMT+02:00) Cairo"],["Harare","GMT+02:00","(GMT+02:00) Harare"],["Helsinki","GMT+02:00","(GMT+02:00) Helsinki"],["Istanbul","GMT+02:00","(GMT+02:00) Istanbul"],["Jerusalem","GMT+02:00","(GMT+02:00) Jerusalem"],["Kyiv","GMT+02:00","(GMT+02:00) Kyiv"],["Minsk","GMT+02:00","(GMT+02:00) Minsk"],["Pretoria","GMT+02:00","(GMT+02:00) Pretoria"],["Riga","GMT+02:00","(GMT+02:00) Riga"],["Sofia","GMT+02:00","(GMT+02:00) Sofia"],["Tallinn","GMT+02:00","(GMT+02:00) Tallinn"],["Vilnius","GMT+02:00","(GMT+02:00) Vilnius"],["Baghdad","GMT+03:00","(GMT+03:00) Baghdad"],["Kuwait","GMT+03:00","(GMT+03:00) Kuwait"],["Moscow","GMT+03:00","(GMT+03:00) Moscow"],["Nairobi","GMT+03:00","(GMT+03:00) Nairobi"],["Riyadh","GMT+03:00","(GMT+03:00) Riyadh"],["St. Petersburg","GMT+03:00","(GMT+03:00) St. Petersburg"],["Volgograd","GMT+03:00","(GMT+03:00) Volgograd"],["Tehran","GMT+03:30","(GMT+03:30) Tehran"],["Abu Dhabi","GMT+04:00","(GMT+04:00) Abu Dhabi"],["Baku","GMT+04:00","(GMT+04:00) Baku"],["Muscat","GMT+04:00","(GMT+04:00) Muscat"],["Tbilisi","GMT+04:00","(GMT+04:00) Tbilisi"],["Yerevan","GMT+04:00","(GMT+04:00) Yerevan"],["Kabul","GMT+04:30","(GMT+04:30) Kabul"],["Ekaterinburg","GMT+05:00","(GMT+05:00) Ekaterinburg"],["Islamabad","GMT+05:00","(GMT+05:00) Islamabad"],["Karachi","GMT+05:00","(GMT+05:00) Karachi"],["Tashkent","GMT+05:00","(GMT+05:00) Tashkent"],["Chennai","GMT+05:30","(GMT+05:30) Chennai"],["Kolkata","GMT+05:30","(GMT+05:30) Kolkata"],["Mumbai","GMT+05:30","(GMT+05:30) Mumbai"],["New Delhi","GMT+05:30","(GMT+05:30) New Delhi"],["Sri Jayawardenepura","GMT+05:30","(GMT+05:30) Sri Jayawardenepura"],["Kathmandu","GMT+05:45","(GMT+05:45) Kathmandu"],["Almaty","GMT+06:00","(GMT+06:00) Almaty"],["Astana","GMT+06:00","(GMT+06:00) Astana"],["Dhaka","GMT+06:00","(GMT+06:00) Dhaka"],["Novosibirsk","GMT+06:00","(GMT+06:00) Novosibirsk"],["Rangoon","GMT+06:30","(GMT+06:30) Rangoon"],["Bangkok","GMT+07:00","(GMT+07:00) Bangkok"],["Hanoi","GMT+07:00","(GMT+07:00) Hanoi"],["Jakarta","GMT+07:00","(GMT+07:00) Jakarta"],["Krasnoyarsk","GMT+07:00","(GMT+07:00) Krasnoyarsk"],["Beijing","GMT+08:00","(GMT+08:00) Beijing"],["Chongqing","GMT+08:00","(GMT+08:00) Chongqing"],["Hong Kong","GMT+08:00","(GMT+08:00) Hong Kong"],["Irkutsk","GMT+08:00","(GMT+08:00) Irkutsk"],["Kuala Lumpur","GMT+08:00","(GMT+08:00) Kuala Lumpur"],["Perth","GMT+08:00","(GMT+08:00) Perth"],["Singapore","GMT+08:00","(GMT+08:00) Singapore"],["Taipei","GMT+08:00","(GMT+08:00) Taipei"],["Ulaan Bataar","GMT+08:00","(GMT+08:00) Ulaan Bataar"],["Urumqi","GMT+08:00","(GMT+08:00) Urumqi"],["Osaka","GMT+09:00","(GMT+09:00) Osaka"],["Sapporo","GMT+09:00","(GMT+09:00) Sapporo"],["Seoul","GMT+09:00","(GMT+09:00) Seoul"],["Tokyo","GMT+09:00","(GMT+09:00) Tokyo"],["Yakutsk","GMT+09:00","(GMT+09:00) Yakutsk"],["Adelaide","GMT+09:30","(GMT+09:30) Adelaide"],["Darwin","GMT+09:30","(GMT+09:30) Darwin"],["Brisbane","GMT+10:00","(GMT+10:00) Brisbane"],["Canberra","GMT+10:00","(GMT+10:00) Canberra"],["Guam","GMT+10:00","(GMT+10:00) Guam"],["Hobart","GMT+10:00","(GMT+10:00) Hobart"],["Melbourne","GMT+10:00","(GMT+10:00) Melbourne"],["Port Moresby","GMT+10:00","(GMT+10:00) Port Moresby"],["Sydney","GMT+10:00","(GMT+10:00) Sydney"],["Vladivostok","GMT+10:00","(GMT+10:00) Vladivostok"],["Kamchatka","GMT+11:00","(GMT+11:00) Kamchatka"],["Magadan","GMT+11:00","(GMT+11:00) Magadan"],["New Caledonia","GMT+11:00","(GMT+11:00) New Caledonia"],["Solomon Is.","GMT+11:00","(GMT+11:00) Solomon Is."],["Auckland","GMT+12:00","(GMT+12:00) Auckland"],["Fiji","GMT+12:00","(GMT+12:00) Fiji"],["Marshall Is.","GMT+12:00","(GMT+12:00) Marshall Is."],["Wellington","GMT+12:00","(GMT+12:00) Wellington"],["Nuku'alofa","GMT+13:00","(GMT+13:00) Nuku'alofa"]].map((e=>({value:e[2],label:e[2]}))),Je=He.object({business_name:He.string().trim().max(30).optional(),contact_email:He.string().trim().email("Invalid email").optional().or(He.literal("")),phone:He.preprocess((e=>p(String(e).trim())),He.string().optional()),timezone:He.string().trim().optional(),url:He.string().trim().optional()}),Ye=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.organizationUpdated=t(this,"organizationUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.name="",this.business_name="",this.contact_email="",this.phone="",this.address="",this.address2="",this.timezone="",this.url=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await(t=this.endpoint,s=this.endpoint.session.organization_id,t.api.get("/organizations/".concat(s)).then((function(e){return e.data})));var t,s;console.log("[SETTINGS] Loaded organization",e),this.resetForm(e)}resetForm(e){this.name=e.name,this.business_name=e.business_name,this.contact_email=e.contact_email,this.phone=e.phone,this.address=e.address,this.address2=e.address2,this.timezone=e.timezone,this.url=e.url,this.dirty=!1,this.valid=!0}handleSubmit(e){var t,s,i;e.preventDefault(),e.stopPropagation(),(t=n.getDefault(),s=this.endpoint.session.organization_id,i={name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url},t.api.patch("/organizations/".concat(s),i).then((function(e){return e.data}))).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.organizationUpdated)||void 0===t||t.emit({endpoint:this.endpoint,organization:e}),this.resetForm(e)})).catch((e=>l(`Error updating organization: ${e.message}`,{style:"error"})))}processFields(){const e=Je.safeParse({name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url});console.log("[SETTINGS] Validation result",e),this.valid=e.success,this.dirty=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"Organization Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-name",value:this.name,autocomplete:"off",label:"Name",required:!1,disabled:!1,placeholder:"Enter your organization's name...",onInput:e=>this.name=e.target.value,onFocusout:e=>{this.name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-business-name",value:this.business_name,autocomplete:"off",label:"Display Name",placeholder:"The name to display on communications...",onInput:e=>this.business_name=e.target.value,onFocusout:e=>{this.business_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-url",value:this.url,autocomplete:"off",label:"Web URL",placeholder:"Enter your Web URL...",onInput:e=>this.url=e.target.value,onFocusout:e=>{this.url=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-phone",value:this.phone,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-email",value:this.contact_email,clearable:!0,autocomplete:"off",label:"Contact Email",placeholder:"Enter your contact email address...",onInput:e=>this.contact_email=e.target.value,onFocusout:e=>{this.contact_email=e.target.value.trim(),this.processFields()}}),s("verdocs-select-input",{options:We,value:this.timezone,label:"Time Zone"}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};Ye.style='verdocs-settings-organization{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-organization .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-organization .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-organization verdocs-text-input{margin:10px 0}verdocs-settings-organization verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-organization .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}';const Qe=He.object({first_name:He.string().trim().min(1,"First name is required").max(30),last_name:He.string().trim().min(1,"Last name is required").max(30),email:He.string().trim().email("Invalid email").min(1,"Email is required"),phone:He.preprocess((e=>p(String(e).trim())),He.string())}),Xe=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.profileUpdated=t(this,"profileUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.first_name="",this.last_name="",this.email="",this.phone=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await u(this.endpoint);console.log("[SETTINGS] Loaded profile",e),this.resetForm(e)}resetForm(e){this.first_name=e.first_name,this.last_name=e.last_name,this.email=e.email,this.phone=e.phone,this.dirty=!1,this.valid=!0}handleSubmit(e){e.preventDefault(),e.stopPropagation(),h(n.getDefault(),this.endpoint.session.profile_id,{first_name:this.first_name,last_name:this.last_name,phone:this.phone}).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.profileUpdated)||void 0===t||t.emit({endpoint:this.endpoint,profile:e}),this.resetForm(e)})).catch((e=>l(`Error updating profile: ${e.message}`,{style:"error"})))}processFields(){const e=Qe.safeParse({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone});console.log("[SETTINGS] Validation result",e),this.valid=e.success,this.dirty=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"My Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-first-name",value:this.first_name,autocomplete:"off",label:"First Name",required:!0,placeholder:"Enter your first name...",onInput:e=>this.first_name=e.target.value,onFocusout:e=>{this.first_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-last-name",value:this.last_name,autocomplete:"off",label:"Last Name",required:!0,placeholder:"Enter your last name...",onInput:e=>this.last_name=e.target.value,onFocusout:e=>{this.last_name=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-email",value:this.email,autocomplete:"off",label:"Email Address",required:!0,disabled:!0,placeholder:"Enter your email address...",onInput:e=>this.email=e.target.value,onFocusout:e=>{this.email=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-phone",value:this.phone,clearable:!0,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};Xe.style='verdocs-settings-profile{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-profile .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-profile .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-profile verdocs-text-input{margin:10px 0}verdocs-settings-profile verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-profile .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}';export{f as verdocs_settings_api_keys,T as verdocs_settings_members,Ye as verdocs_settings_organization,Xe as verdocs_settings_profile}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(l,a)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return s([e,t])}}function s(l){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;i=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){n.label=l[1];break}if(l[0]===6&&n.label<r[1]){n.label=r[1];r=l;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(l);break}if(r[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];i=0}finally{o=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-cbbf849f.system.js","./p-eb595245.system.js","./p-187b20b7.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,n,o,i,r,l,a,s,d;return{setters:[function(e){t=e.r;n=e.c;o=e.f;i=e.h;r=e.H;l=e.a},function(){},function(e){a=e.V},function(e){s=e.g},function(e){d=e.S},function(){}],execute:function(){var p='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';var c=e("verdocs_build",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.stepChanged=n(this,"stepChanged",7);this.send=n(this,"send",7);this.templateUpdated=n(this,"templateUpdated",7);this.templateCreated=n(this,"templateCreated",7);this.endpoint=a.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onTemplateIdChanged=function(e){console.log("Template ID changed",e);this.loadTemplate(e).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.onStepChanged=function(e){console.log("Step changed",e);this.loadTemplate(this.templateId).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.templateId){console.log("[BUILD] No template ID, activating upload mode");this.step="attachments";return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}this.loadTemplate(this.templateId).catch((function(e){return console.log("[BUILD] Unable to load template",e)}))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new d(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(n=o.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.loadTemplate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];console.log("Loading store",e);t=this;return[4,s(this.endpoint,e,true)];case 1:t.store=n.sent();o(this.el);n.label=2;case 2:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step="preview"};e.prototype.handleTemplateCreated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.loadTemplate(e)];case 1:n.sent();this.templateId=e;this.step="roles";(t=this.stepChanged)===null||t===void 0?void 0:t.emit("roles");return[2]}}))}))};e.prototype.handleTemplateUpdated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){console.log("tup");(t=this.templateUpdated)===null||t===void 0?void 0:t.emit(e.detail);return[2]}))}))};e.prototype.handleAttachmentsNext=function(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")};e.prototype.handleRolesNext=function(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")};e.prototype.handleStepChanged=function(e){var t;console.log("osc",e);this.step=e;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e)};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return i(r,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.store){console.log("[BUILD] No template ID, rendering created view");return i(r,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateCreated:function(t){return e.handleTemplateCreated(t.detail.templateId)}})))}console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step));return i(r,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),this.step==="attachments"&&i("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="roles"&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleRolesNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="settings"&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}})),this.step==="fields"&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="preview"&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:function(t){var n;return(n=e.send)===null||n===void 0?void 0:n.emit(t.detail)},style:{width:"100%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))};Object.defineProperty(e.prototype,"el",{get:function(){return l(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());c.style=p}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(l,a)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return s([e,t])}}function s(l){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;i=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){n.label=l[1];break}if(l[0]===6&&n.label<r[1]){n.label=r[1];r=l;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(l);break}if(r[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];i=0}finally{o=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-82b5e475.system.js","./p-187b20b7.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,n,o,i,r,l,a,s,d;return{setters:[function(e){t=e.r;n=e.c;o=e.f;i=e.h;r=e.H;l=e.a},function(){},function(e){a=e.V},function(e){s=e.g},function(e){d=e.S},function(){}],execute:function(){var p='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';var c=e("verdocs_build",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.stepChanged=n(this,"stepChanged",7);this.send=n(this,"send",7);this.templateUpdated=n(this,"templateUpdated",7);this.templateCreated=n(this,"templateCreated",7);this.endpoint=a.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onTemplateIdChanged=function(e){console.log("Template ID changed",e);this.loadTemplate(e).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.onStepChanged=function(e){console.log("Step changed",e);this.loadTemplate(this.templateId).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.templateId){console.log("[BUILD] No template ID, activating upload mode");this.step="attachments";return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}this.loadTemplate(this.templateId).catch((function(e){return console.log("[BUILD] Unable to load template",e)}))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new d(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(n=o.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.loadTemplate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];console.log("Loading store",e);t=this;return[4,s(this.endpoint,e,true)];case 1:t.store=n.sent();o(this.el);n.label=2;case 2:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step="preview"};e.prototype.handleTemplateCreated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.loadTemplate(e)];case 1:n.sent();this.templateId=e;this.step="roles";(t=this.stepChanged)===null||t===void 0?void 0:t.emit("roles");return[2]}}))}))};e.prototype.handleTemplateUpdated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){console.log("tup");(t=this.templateUpdated)===null||t===void 0?void 0:t.emit(e.detail);return[2]}))}))};e.prototype.handleAttachmentsNext=function(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")};e.prototype.handleRolesNext=function(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")};e.prototype.handleStepChanged=function(e){var t;console.log("osc",e);this.step=e;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e)};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return i(r,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.store){console.log("[BUILD] No template ID, rendering created view");return i(r,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateCreated:function(t){return e.handleTemplateCreated(t.detail.templateId)}})))}console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step));return i(r,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),this.step==="attachments"&&i("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="roles"&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleRolesNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="settings"&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}})),this.step==="fields"&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="preview"&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:function(t){var n;return(n=e.send)===null||n===void 0?void 0:n.emit(t.detail)},style:{width:"100%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))};Object.defineProperty(e.prototype,"el",{get:function(){return l(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());c.style=p}}}));