@verdocs/web-sdk 5.0.24 → 5.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/dist/cjs/{Datastore-931fd77e.js → Datastore-e39f8315.js} +29 -24
  2. package/dist/cjs/Datastore-e39f8315.js.map +1 -0
  3. package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-checkbox_6.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +25 -1
  8. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js.map +1 -1
  9. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-preview_6.cjs.entry.js +5 -2
  14. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  15. package/dist/cjs/verdocs-sign.cjs.entry.js +7 -7
  16. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  17. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  18. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +1 -1
  19. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +5 -5
  20. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  21. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +24 -0
  22. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js.map +1 -1
  23. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +4 -1
  24. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  25. package/dist/components/{p-78de9e65.js → p-0e4ebc84.js} +3 -3
  26. package/dist/components/{p-78de9e65.js.map → p-0e4ebc84.js.map} +1 -1
  27. package/dist/components/{p-e4a97ad5.js → p-143a763f.js} +3 -3
  28. package/dist/components/{p-e4a97ad5.js.map → p-143a763f.js.map} +1 -1
  29. package/dist/components/{p-2d8b46e5.js → p-16b073b8.js} +2 -2
  30. package/dist/components/{p-2d8b46e5.js.map → p-16b073b8.js.map} +1 -1
  31. package/dist/components/{p-e9528d9f.js → p-1d4829fb.js} +3 -3
  32. package/dist/components/{p-e9528d9f.js.map → p-1d4829fb.js.map} +1 -1
  33. package/dist/components/{p-ca3e45f3.js → p-27a8eef0.js} +2 -2
  34. package/dist/components/{p-ca3e45f3.js.map → p-27a8eef0.js.map} +1 -1
  35. package/dist/components/{p-fcf13666.js → p-550377ba.js} +13 -13
  36. package/dist/components/{p-fcf13666.js.map → p-550377ba.js.map} +1 -1
  37. package/dist/components/{p-1ce18a42.js → p-619747d7.js} +2 -2
  38. package/dist/components/{p-1ce18a42.js.map → p-619747d7.js.map} +1 -1
  39. package/dist/components/{p-e95ded6b.js → p-631808d5.js} +18 -15
  40. package/dist/components/p-631808d5.js.map +1 -0
  41. package/dist/components/{p-e4799d51.js → p-7bd7baa6.js} +3 -3
  42. package/dist/components/{p-e4799d51.js.map → p-7bd7baa6.js.map} +1 -1
  43. package/dist/components/{p-1ab01232.js → p-813ed998.js} +3 -3
  44. package/dist/components/{p-1ab01232.js.map → p-813ed998.js.map} +1 -1
  45. package/dist/components/{p-a415ce22.js → p-8c965486.js} +3 -3
  46. package/dist/components/{p-a415ce22.js.map → p-8c965486.js.map} +1 -1
  47. package/dist/components/{p-681e7dd4.js → p-99128b47.js} +3 -3
  48. package/dist/components/{p-681e7dd4.js.map → p-99128b47.js.map} +1 -1
  49. package/dist/components/{p-53168eec.js → p-ac7694c0.js} +2 -2
  50. package/dist/components/{p-53168eec.js.map → p-ac7694c0.js.map} +1 -1
  51. package/dist/components/{p-ecfc85ae.js → p-b5e479db.js} +3 -3
  52. package/dist/components/{p-ecfc85ae.js.map → p-b5e479db.js.map} +1 -1
  53. package/dist/components/{p-f6156f7a.js → p-c422d9a0.js} +3 -3
  54. package/dist/components/{p-f6156f7a.js.map → p-c422d9a0.js.map} +1 -1
  55. package/dist/components/{p-c4c9feda.js → p-c4310332.js} +3 -3
  56. package/dist/components/{p-c4c9feda.js.map → p-c4310332.js.map} +1 -1
  57. package/dist/components/{p-91d65fde.js → p-c5045788.js} +3 -3
  58. package/dist/components/{p-91d65fde.js.map → p-c5045788.js.map} +1 -1
  59. package/dist/components/{p-3828cb31.js → p-d4be87ef.js} +29 -24
  60. package/dist/components/p-d4be87ef.js.map +1 -0
  61. package/dist/components/{p-28e3b2e3.js → p-d54466ed.js} +14 -14
  62. package/dist/components/{p-28e3b2e3.js.map → p-d54466ed.js.map} +1 -1
  63. package/dist/components/{p-eb2ad8d0.js → p-e39c327c.js} +2 -2
  64. package/dist/components/{p-eb2ad8d0.js.map → p-e39c327c.js.map} +1 -1
  65. package/dist/components/{p-eb12a71c.js → p-f238b25b.js} +2 -2
  66. package/dist/components/{p-eb12a71c.js.map → p-f238b25b.js.map} +1 -1
  67. package/dist/components/{p-bfed2f8d.js → p-f7cf2401.js} +2 -2
  68. package/dist/components/{p-bfed2f8d.js.map → p-f7cf2401.js.map} +1 -1
  69. package/dist/components/verdocs-build.js +20 -20
  70. package/dist/components/verdocs-envelope-recipient-link.js +1 -1
  71. package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
  72. package/dist/components/verdocs-envelope-sidebar.js +26 -2
  73. package/dist/components/verdocs-envelope-sidebar.js.map +1 -1
  74. package/dist/components/verdocs-field-attachment.js +1 -1
  75. package/dist/components/verdocs-field-checkbox.js +1 -1
  76. package/dist/components/verdocs-field-date.js +1 -1
  77. package/dist/components/verdocs-field-dropdown.js +1 -1
  78. package/dist/components/verdocs-field-initial.js +1 -1
  79. package/dist/components/verdocs-field-payment.js +2 -2
  80. package/dist/components/verdocs-field-radio.js +1 -1
  81. package/dist/components/verdocs-field-signature.js +1 -1
  82. package/dist/components/verdocs-field-textarea.js +1 -1
  83. package/dist/components/verdocs-field-textbox.js +1 -1
  84. package/dist/components/verdocs-field-timestamp.js +1 -1
  85. package/dist/components/verdocs-preview.js +1 -1
  86. package/dist/components/verdocs-send.js +1 -1
  87. package/dist/components/verdocs-sign.js +8 -8
  88. package/dist/components/verdocs-sign.js.map +1 -1
  89. package/dist/components/verdocs-template-attachments.js +1 -1
  90. package/dist/components/verdocs-template-build-tabs.js +1 -1
  91. package/dist/components/verdocs-template-document-page.js +1 -1
  92. package/dist/components/verdocs-template-field-properties.js +1 -1
  93. package/dist/components/verdocs-template-fields.js +1 -1
  94. package/dist/components/verdocs-template-role-properties.js +1 -1
  95. package/dist/components/verdocs-template-roles.js +1 -1
  96. package/dist/components/verdocs-view.js +1 -1
  97. package/dist/esm/{Datastore-3f924d94.js → Datastore-77cb8d9c.js} +29 -24
  98. package/dist/esm/Datastore-77cb8d9c.js.map +1 -0
  99. package/dist/esm/verdocs-build.entry.js +1 -1
  100. package/dist/esm/verdocs-checkbox_6.entry.js +1 -1
  101. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
  102. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
  103. package/dist/esm/verdocs-envelope-sidebar.entry.js +25 -1
  104. package/dist/esm/verdocs-envelope-sidebar.entry.js.map +1 -1
  105. package/dist/esm/verdocs-field-attachment_13.entry.js +1 -1
  106. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  107. package/dist/esm/verdocs-kba-dialog_2.entry.js +1 -1
  108. package/dist/esm/verdocs-menu-panel_2.entry.js +1 -1
  109. package/dist/esm/verdocs-preview_6.entry.js +5 -2
  110. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  111. package/dist/esm/verdocs-sign.entry.js +7 -7
  112. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  113. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  114. package/dist/esm-es5/Datastore-77cb8d9c.js +2 -0
  115. package/dist/esm-es5/Datastore-77cb8d9c.js.map +1 -0
  116. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-checkbox_6.entry.js +1 -1
  118. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  119. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  120. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  121. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js.map +1 -1
  122. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  123. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  124. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
  125. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
  126. package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
  127. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  128. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  129. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  130. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  131. package/dist/verdocs-web-sdk/{p-f6ed768d.entry.js → p-00063a35.entry.js} +2 -2
  132. package/dist/verdocs-web-sdk/{p-1902bf04.entry.js → p-104863b5.entry.js} +2 -2
  133. package/dist/verdocs-web-sdk/p-1f2c019d.system.entry.js +2 -0
  134. package/dist/verdocs-web-sdk/p-1f2c019d.system.entry.js.map +1 -0
  135. package/dist/verdocs-web-sdk/{p-fc29a754.entry.js → p-25aa3bd3.entry.js} +2 -2
  136. package/dist/verdocs-web-sdk/{p-b1a9dc79.entry.js → p-4e9a8e8e.entry.js} +2 -2
  137. package/dist/verdocs-web-sdk/p-4e9a8e8e.entry.js.map +1 -0
  138. package/dist/verdocs-web-sdk/p-52c3e8b0.system.js +2 -0
  139. package/dist/verdocs-web-sdk/p-52c3e8b0.system.js.map +1 -0
  140. package/dist/verdocs-web-sdk/{p-7975ec40.system.entry.js → p-578e65d4.system.entry.js} +2 -2
  141. package/dist/verdocs-web-sdk/{p-407c0725.system.entry.js → p-5bcf921b.system.entry.js} +2 -2
  142. package/dist/verdocs-web-sdk/{p-26106576.system.entry.js → p-5c065719.system.entry.js} +2 -2
  143. package/dist/verdocs-web-sdk/{p-7ffebea3.entry.js → p-5ebfe76c.entry.js} +2 -2
  144. package/dist/verdocs-web-sdk/{p-80952d72.system.entry.js → p-6e93814f.system.entry.js} +2 -2
  145. package/dist/verdocs-web-sdk/p-6e93814f.system.entry.js.map +1 -0
  146. package/dist/verdocs-web-sdk/{p-086ee7f1.system.entry.js → p-6eee289a.system.entry.js} +2 -2
  147. package/dist/verdocs-web-sdk/{p-cc230abf.entry.js → p-6f1e2f2f.entry.js} +2 -2
  148. package/dist/verdocs-web-sdk/p-70247599.system.entry.js +2 -0
  149. package/dist/verdocs-web-sdk/p-70247599.system.entry.js.map +1 -0
  150. package/dist/verdocs-web-sdk/{p-e84cf41e.entry.js → p-8369273d.entry.js} +2 -2
  151. package/dist/verdocs-web-sdk/p-a285560f.entry.js +2 -0
  152. package/dist/verdocs-web-sdk/p-a285560f.entry.js.map +1 -0
  153. package/dist/verdocs-web-sdk/p-b7799ec0.entry.js +2 -0
  154. package/dist/verdocs-web-sdk/p-b7799ec0.entry.js.map +1 -0
  155. package/dist/verdocs-web-sdk/{p-a4d94e2e.entry.js → p-b8945173.entry.js} +2 -2
  156. package/dist/verdocs-web-sdk/{p-d4aff253.entry.js → p-b9fee1a7.entry.js} +2 -2
  157. package/dist/verdocs-web-sdk/{p-34c2298e.system.entry.js → p-cabfdb9d.system.entry.js} +2 -2
  158. package/dist/verdocs-web-sdk/{p-90690dde.system.entry.js → p-d1d95df4.system.entry.js} +2 -2
  159. package/dist/verdocs-web-sdk/{p-60da8e6b.entry.js → p-d3a8c6b8.entry.js} +2 -2
  160. package/dist/verdocs-web-sdk/p-d4be87ef.js +2 -0
  161. package/dist/verdocs-web-sdk/p-d4be87ef.js.map +1 -0
  162. package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
  163. package/dist/verdocs-web-sdk/{p-208a8b41.system.entry.js → p-e3efeb57.system.entry.js} +2 -2
  164. package/dist/verdocs-web-sdk/{p-dc5c275f.system.entry.js → p-e83d06d4.system.entry.js} +2 -2
  165. package/dist/verdocs-web-sdk/{p-32cf09f0.system.entry.js → p-ecfe8987.system.entry.js} +2 -2
  166. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  167. package/package.json +3 -3
  168. package/dist/cjs/Datastore-931fd77e.js.map +0 -1
  169. package/dist/components/p-3828cb31.js.map +0 -1
  170. package/dist/components/p-e95ded6b.js.map +0 -1
  171. package/dist/esm/Datastore-3f924d94.js.map +0 -1
  172. package/dist/esm-es5/Datastore-3f924d94.js +0 -2
  173. package/dist/esm-es5/Datastore-3f924d94.js.map +0 -1
  174. package/dist/verdocs-web-sdk/p-2175c81a.system.entry.js +0 -2
  175. package/dist/verdocs-web-sdk/p-2175c81a.system.entry.js.map +0 -1
  176. package/dist/verdocs-web-sdk/p-23d6f064.entry.js +0 -2
  177. package/dist/verdocs-web-sdk/p-23d6f064.entry.js.map +0 -1
  178. package/dist/verdocs-web-sdk/p-3828cb31.js +0 -2
  179. package/dist/verdocs-web-sdk/p-3828cb31.js.map +0 -1
  180. package/dist/verdocs-web-sdk/p-65be7617.system.js +0 -2
  181. package/dist/verdocs-web-sdk/p-65be7617.system.js.map +0 -1
  182. package/dist/verdocs-web-sdk/p-80952d72.system.entry.js.map +0 -1
  183. package/dist/verdocs-web-sdk/p-b1a9dc79.entry.js.map +0 -1
  184. package/dist/verdocs-web-sdk/p-c4a10e58.system.entry.js +0 -2
  185. package/dist/verdocs-web-sdk/p-c4a10e58.system.entry.js.map +0 -1
  186. package/dist/verdocs-web-sdk/p-db1faf41.entry.js +0 -2
  187. package/dist/verdocs-web-sdk/p-db1faf41.entry.js.map +0 -1
  188. /package/dist/verdocs-web-sdk/{p-f6ed768d.entry.js.map → p-00063a35.entry.js.map} +0 -0
  189. /package/dist/verdocs-web-sdk/{p-1902bf04.entry.js.map → p-104863b5.entry.js.map} +0 -0
  190. /package/dist/verdocs-web-sdk/{p-fc29a754.entry.js.map → p-25aa3bd3.entry.js.map} +0 -0
  191. /package/dist/verdocs-web-sdk/{p-7975ec40.system.entry.js.map → p-578e65d4.system.entry.js.map} +0 -0
  192. /package/dist/verdocs-web-sdk/{p-407c0725.system.entry.js.map → p-5bcf921b.system.entry.js.map} +0 -0
  193. /package/dist/verdocs-web-sdk/{p-26106576.system.entry.js.map → p-5c065719.system.entry.js.map} +0 -0
  194. /package/dist/verdocs-web-sdk/{p-7ffebea3.entry.js.map → p-5ebfe76c.entry.js.map} +0 -0
  195. /package/dist/verdocs-web-sdk/{p-086ee7f1.system.entry.js.map → p-6eee289a.system.entry.js.map} +0 -0
  196. /package/dist/verdocs-web-sdk/{p-cc230abf.entry.js.map → p-6f1e2f2f.entry.js.map} +0 -0
  197. /package/dist/verdocs-web-sdk/{p-e84cf41e.entry.js.map → p-8369273d.entry.js.map} +0 -0
  198. /package/dist/verdocs-web-sdk/{p-a4d94e2e.entry.js.map → p-b8945173.entry.js.map} +0 -0
  199. /package/dist/verdocs-web-sdk/{p-d4aff253.entry.js.map → p-b9fee1a7.entry.js.map} +0 -0
  200. /package/dist/verdocs-web-sdk/{p-34c2298e.system.entry.js.map → p-cabfdb9d.system.entry.js.map} +0 -0
  201. /package/dist/verdocs-web-sdk/{p-90690dde.system.entry.js.map → p-d1d95df4.system.entry.js.map} +0 -0
  202. /package/dist/verdocs-web-sdk/{p-60da8e6b.entry.js.map → p-d3a8c6b8.entry.js.map} +0 -0
  203. /package/dist/verdocs-web-sdk/{p-208a8b41.system.entry.js.map → p-e3efeb57.system.entry.js.map} +0 -0
  204. /package/dist/verdocs-web-sdk/{p-dc5c275f.system.entry.js.map → p-e83d06d4.system.entry.js.map} +0 -0
  205. /package/dist/verdocs-web-sdk/{p-32cf09f0.system.entry.js.map → p-ecfe8987.system.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"names":["verdocsEnvelopeSidebarCss","VerdocsEnvelopeSidebarStyle0","MS_PER_DAY","InformationCircle","Users","ClipboardDocuments","ActivityIcons","visibility","pencil","mail","contact_mail","done","send","gesture","clear","check_circle","link","cancel","done_all","create","perm_identity","people","contact_email","textsms","verified_user","account_circle","VerdocsEnvelopeSidebar","exports","this","envelopeListenerId","VerdocsEndpoint","getDefault","class_1","prototype","componentWillLoad","endpoint","loadSession","envelopeId","console","log","concat","session","listenToEnvelope","e","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","disconnectedCallback","unlistenToEnvelope","Store","subscribe","getEnvelope","_this","envelope","loading","sortEnvelopeRecipients","initialReminder","initial_reminder","followupReminders","followup_reminders","remindersEnabled","store","delListener","recipients","sort","a","b","sequence","order","setTab","tab","panelOpen","activeTab","toggle","open","canResendRecipient","recipient","includes","handleRecipientAction","id","resendInvitation","role_name","then","VerdocsToast","style","catch","showRecipientDialog","envelopeUpdated","event","handleCancelEnvelope","cancelEnvelope","r","__awaiter","newEnvelope","JSON","parse","stringify","updateEnvelope","prepareHistoryEntries","entries","histories","history_entries","push","icon","date","Date","created_at","_d","updated_at","ownerCanceled","some","history","_e","_f","canceled_at","forEach","find","fullName","formatFullName","toLowerCase","event_detail","getTime","handleToggleReminders","handleSetReminders","updatingReminders","alert","error","render","h","Host","isEnvelopeOwner","userIsEnvelopeOwner","profile","historyEntries","functionsDisabled","class","onClick","innerHTML","format","FORMAT_TIMESTAMP","capitalize","_g","profile_id","_h","_k","_j","email","_l","map","index","canGetInPersonLink","canSendReminder","_o","onOptionSelected","item","detail","options","label","disabled","phone","checked","onCheckedChange","Fragment","placeholder","value","String","Math","floor","onBlur","Number","target","color","_m","next_reminder","variant","showCancelDialog","entry","roleName","onNext","heading"],"sources":["src/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.scss?tag=verdocs-envelope-sidebar","src/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-envelope-sidebar {\n font-family: $verdocs-primary-font;\n flex-direction: row;\n display: flex;\n flex: 0 0 56px;\n width: 56px;\n min-height: 400px;\n height: 100%;\n background: #41435e;\n transition: 0.5s cubic-bezier(0.35, 0, 0.25, 1);\n\n &.open {\n flex: 0 0 400px;\n max-width: 100%;\n width: 400px;\n\n @media screen and (max-width: 500px) {\n flex: 0 0 300px;\n width: 300px;\n }\n }\n\n .side-buttons {\n flex-direction: column;\n flex: 0 0 56px;\n display: flex;\n\n button {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 50px;\n outline: none;\n border: none;\n border-left: 2px solid transparent;\n background: none;\n width: 100%;\n\n &.active {\n border-left: 2px solid #50bd80;\n }\n\n svg {\n color: white;\n width: 24px;\n height: 24px;\n }\n }\n }\n\n .content {\n flex: 1;\n display: none;\n color: white;\n flex-direction: column;\n padding: 12px 16px 16px;\n }\n\n &.open .content {\n display: flex;\n overflow-y: scroll;\n }\n\n verdocs-ok-dialog .content {\n color: black;\n }\n\n .title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 12px;\n font-size: 16px;\n line-height: 24px;\n font-weight: 400;\n //flex: 0;\n }\n\n .label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 12px;\n line-height: 16px;\n color: rgba(255, 255, 255, 0.54);\n //flex: 0;\n }\n\n .value {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 14px;\n font-size: 14px;\n font-weight: 500;\n line-height: 16px;\n color: #fff;\n //flex: 0;\n }\n\n .manage-recipients-button {\n align-self: center;\n white-space: nowrap;\n width: 100%;\n margin: 0 0 10px 0;\n\n .label {\n color: #ffffff;\n font-size: 14px;\n }\n\n button {\n width: 100%;\n }\n }\n\n .recipient-detail {\n flex: 0;\n padding: 8px;\n font-size: 14px;\n position: relative;\n flex-direction: column;\n border: solid 1px #979797;\n margin-bottom: 16px;\n }\n\n .recipient-header {\n flex-direction: row;\n box-sizing: border-box;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-bottom: 4px;\n }\n\n .recipient-number {\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 24px;\n font-size: 14px;\n font-weight: 500;\n border: solid 1px #979797;\n }\n\n .recipient-name {\n flex: 1;\n box-sizing: border-box;\n text-transform: capitalize;\n }\n\n .recipient-status {\n flex: 0 0 100px;\n border-radius: 5px;\n text-align: center;\n box-sizing: border-box;\n max-width: 100px;\n min-width: 100px;\n background-color: #616161; // Default\n text-transform: capitalize;\n font-size: 14px;\n padding: 3px 0;\n\n &.invited {\n background-color: #ff8f00;\n }\n &.opened {\n background-color: #616161;\n }\n &.signed,\n &.submitted {\n background-color: #2e7d32;\n }\n &.pending {\n background-color: #0277bd;\n }\n &.canceled,\n &.declined {\n background-color: #c62828;\n }\n\n @media screen and (max-width: 500px) {\n flex: 1 1 60px;\n max-width: 60px;\n min-width: 60px;\n }\n }\n\n .recipient-content {\n flex-direction: column;\n }\n\n .recipient-name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .history-entry {\n display: flex;\n align-items: center;\n flex-direction: row;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid #dddddd;\n\n .activity-icon {\n margin-right: 14px;\n\n svg {\n width: 24px;\n height: 24px;\n fill: #ffffff;\n }\n }\n\n .activity-details {\n }\n\n .activity-text {\n font-size: 14px;\n line-height: 16px;\n margin-bottom: 4px;\n }\n\n .activity-date {\n font-size: 12px;\n line-height: 16px;\n color: rgba(255, 255, 255, 0.54);\n }\n }\n\n .content .history-entry:first-of-type {\n border-top: none;\n }\n\n .reminders {\n margin: 15px 0 30px 0;\n\n .form-row {\n margin: 8px 0 0;\n display: flex;\n flex-direction: row;\n\n .reminders-label {\n display: flex;\n flex: 1;\n }\n\n .form-label {\n flex: 1;\n }\n\n verdocs-text-input {\n margin: 0;\n width: 100px;\n }\n }\n }\n}\n","import {format} from 'date-fns';\nimport type {IEnvelope, IRecipient} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Fragment, Host, Prop, State} from '@stencil/core';\nimport {cancelEnvelope, capitalize, formatFullName, getEnvelope, resendInvitation, updateEnvelope, userIsEnvelopeOwner, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {FORMAT_TIMESTAMP} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\nconst InformationCircle = `<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>`;\n\nconst Users = `<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>`;\n\nconst ClipboardDocuments = `<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>`;\n\n// https://materialui.co/icon/verified-user and https://heroicons.com/\nconst ActivityIcons = {\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n 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>`,\n};\n\ninterface IHistoryEntry {\n icon: string;\n message: string;\n date: Date;\n}\n\n/**\n * Displays a file upload mechanism suitable for the first step of creating a template.\n * This is typically the first step in a template creation workflow.\n */\n@Component({\n tag: 'verdocs-envelope-sidebar',\n styleUrl: 'verdocs-envelope-sidebar.scss',\n shadow: false,\n})\nexport class VerdocsEnvelopeSidebar {\n private envelopeListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n /**\n * Event fired when the sidebar is opened or closed.\n */\n @Event({composed: true}) toggle: EventEmitter<{open: boolean}>;\n\n /**\n * Event fired when the user clicks Send Another in the Manage Recipients dialog. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) another: EventEmitter<{envelope: IEnvelope}>;\n\n // @State() envelope: IEnvelope | null = null;\n // @State() sortedRecipients: IRecipient[] = [];\n // @State() roleNames: string[] = [];\n @State() activeTab: number = 1;\n @State() panelOpen = false;\n @State() showRecipientDialog = '';\n @State() showCancelDialog = false;\n\n @State() remindersEnabled = false;\n @State() updatingReminders = false;\n @State() initialReminder: number | null = null;\n @State() followupReminders: number | null = null;\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.envelopeId) {\n console.log(`[SIDEBAR] Missing required envelope ID ${this.envelopeId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[SIDEBAR] Unable to start session, must be authenticated');\n return;\n }\n\n this.listenToEnvelope();\n } catch (e) {\n console.log('[SIDEBAR] Error loading envelope', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n disconnectedCallback() {\n this.unlistenToEnvelope();\n }\n\n async listenToEnvelope() {\n console.log('[SIDEBAR] Loading envelope', this.envelopeId);\n this.unlistenToEnvelope();\n Store.subscribe(\n 'envelopes',\n this.envelopeId,\n () => getEnvelope(this.endpoint, this.envelopeId),\n false,\n (envelope: IEnvelope) => {\n this.envelope = envelope;\n this.loading = false;\n\n this.sortEnvelopeRecipients();\n this.initialReminder = this.envelope?.initial_reminder;\n this.followupReminders = this.envelope?.followup_reminders;\n this.remindersEnabled = !!this.initialReminder;\n },\n );\n }\n\n unlistenToEnvelope() {\n if (this.envelopeListenerId) {\n Store.store.delListener(this.envelopeListenerId);\n this.envelopeListenerId = null;\n }\n }\n\n sortEnvelopeRecipients() {\n (this.envelope?.recipients || []).sort((a, b) => {\n return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;\n });\n }\n\n setTab(tab: number) {\n this.panelOpen = tab !== this.activeTab || !this.panelOpen;\n this.toggle?.emit({open: this.panelOpen});\n this.activeTab = tab;\n }\n\n // TODO: Refactor to a common library?\n canResendRecipient(recipient: IRecipient) {\n return (\n !['pending', 'declined', 'submitted', 'canceled'].includes(recipient.status) && //\n !['complete', 'declined', 'canceled'].includes(this.envelope?.status)\n );\n }\n\n handleRecipientAction(recipient: IRecipient, id: string) {\n console.log('[SIDEBAR] Recipient action', id, recipient);\n switch (id) {\n case 'reminder':\n resendInvitation(this.endpoint, this.envelopeId, recipient.role_name)\n .then(() => {\n VerdocsToast('Reminder Sent', {style: 'success'});\n })\n .catch(e => {\n console.log('[SIDEBAR] Error resending invitation', e);\n VerdocsToast('Error resending invitation: ' + e.message, {style: 'error'});\n });\n break;\n\n case 'inperson':\n this.showRecipientDialog = recipient.role_name;\n break;\n\n case 'modify':\n VerdocsToast('This feature will be enabled in a future release. Please try again later.', {style: 'info'});\n break;\n\n case 'details':\n VerdocsToast('This feature will be enabled in a future release. Please try again later.', {style: 'info'});\n break;\n }\n\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: id});\n }\n\n handleCancelEnvelope() {\n this.loading = true;\n cancelEnvelope(this.endpoint, this.envelopeId)\n .then(async r => {\n console.log('[SIDEBAR] Envelope canceled', r);\n VerdocsToast('Envelope canceled', {style: 'success'});\n\n // TODO: Use returned value instead?\n const newEnvelope = JSON.parse(JSON.stringify(this.envelope));\n newEnvelope.status = 'canceled';\n Store.updateEnvelope(this.envelopeId, newEnvelope);\n\n this.loading = false;\n this.panelOpen = false;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: newEnvelope, event: 'canceled'});\n })\n .catch(e => {\n console.log('[SIDEBAR] Error canceling envelope', e);\n this.loading = false;\n VerdocsToast('Error canceling envelope: ' + e.message, {style: 'error'});\n });\n }\n\n prepareHistoryEntries() {\n const entries: IHistoryEntry[] = [];\n const histories = this.envelope?.history_entries || [];\n\n entries.push({icon: 'pencil', message: 'Envelope created.', date: new Date(this.envelope?.created_at)});\n\n if (this.envelope?.status === 'complete') {\n entries.push({icon: 'pencil', message: 'Envelope completed.', date: new Date(this.envelope?.updated_at)});\n }\n\n // TODO: Shift back to server-side generating these events? We'll still need\n // to tolerate both cases here for a while.\n const ownerCanceled = histories.some(history => (history.event as any) === 'owner:canceled');\n if (this.envelope?.status === 'canceled' && !ownerCanceled) {\n entries.push({icon: 'pencil', message: 'Envelope Cancelled.', date: new Date(this.envelope?.canceled_at)});\n }\n\n histories.forEach(history => {\n const recipient = (this.envelope?.recipients || []).find(recipient => recipient.role_name === history.role_name);\n const fullName = formatFullName(recipient);\n\n switch (history.event.toLowerCase()) {\n case 'recipient:signed':\n entries.push({icon: 'gesture', message: `Signed by ${fullName}.`, date: new Date(history.created_at)});\n break;\n case 'recipient:declined':\n entries.push({icon: 'clear', message: `Declined by ${fullName}.`, date: new Date(history.created_at)});\n break;\n case 'recipient:opened':\n switch (history.event_detail) {\n // TODO: Sync these up with reality\n case 'email':\n case 'mail':\n entries.push({icon: 'visibility', message: `Opened by ${fullName}, via email.`, date: new Date(history.created_at)});\n break;\n case 'sms':\n entries.push({icon: 'visibility', message: `Opened by ${fullName}, via SMS.`, date: new Date(history.created_at)});\n break;\n case 'in_person_link':\n entries.push({icon: 'visibility', message: `Opened by ${fullName}, via In-person link.`, date: new Date(history.created_at)});\n break;\n case 'in_app':\n entries.push({icon: 'visibility', message: `Opened by ${fullName}, via dashboard.`, date: new Date(history.created_at)});\n break;\n default:\n entries.push({icon: 'visibility', message: `Opened by ${fullName}.`, date: new Date(history.created_at)});\n }\n break;\n case 'recipient:submitted':\n switch (history.event_detail) {\n // TODO: Sync up\n case 'approver':\n entries.push({icon: 'check_circle', message: `Approved by ${fullName}.`, date: new Date(history.created_at)});\n break;\n default:\n entries.push({icon: 'send', message: `Submitted by ${fullName}.`, date: new Date(history.created_at)});\n break;\n }\n break;\n case 'recipient:prepared':\n entries.push({icon: 'send', message: `Prepared by ${fullName}.`, date: new Date(history.created_at)});\n break;\n case 'recipient:claimed':\n if (history.event_detail === 'guest') {\n entries.push({icon: 'account_circle', message: `${fullName} claimed the Envelope as a guest.`, date: new Date(history.created_at)});\n } else if (history.event_detail === 'profile') {\n entries.push({icon: 'verified_user', message: `${fullName} claimed the Envelope as a verified user.`, date: new Date(history.created_at)});\n }\n break;\n case 'recipient:agreed':\n entries.push({icon: 'done', message: `${fullName} agreed to use electronic records and signatures.`, date: new Date(history.created_at)});\n break;\n case 'recipient:invited':\n if (history.event_detail === 'sms') {\n entries.push({icon: 'textsms', message: `${fullName} has been invited via SMS.`, date: new Date(history.created_at)});\n } else {\n entries.push({icon: 'mail', message: `${fullName} has been invited via email.`, date: new Date(history.created_at)});\n }\n break;\n case 'recipient:reminder':\n if (history.event_detail === 'sms') {\n entries.push({icon: 'textsms', message: `${fullName} sent a reminder via SMS.`, date: new Date(history.created_at)});\n } else {\n entries.push({icon: 'mail', message: `${fullName} sent a reminder via email.`, date: new Date(history.created_at)});\n }\n break;\n case 'invitation:resent':\n entries.push({\n icon: 'mail',\n message: `Invitation was resent to ${fullName}${history.event_detail === 'reminder' ? ' by reminder' : ''}.`,\n date: new Date(history.created_at),\n });\n break;\n case 'envelope:cc':\n entries.push({icon: 'contact_mail', message: `A copy has been sent to ${fullName}.`, date: new Date(history.created_at)});\n break;\n case 'recipient:delegated':\n entries.push({icon: 'people', message: history.event_detail, date: new Date(history.created_at)});\n break;\n case 'recipient:updated_info':\n entries.push({icon: 'perm_identity', message: history.event_detail, date: new Date(history.created_at)});\n break;\n case 'owner:updated_recipient_info':\n entries.push({icon: 'perm_identity', message: history.event_detail, date: new Date(history.created_at)});\n break;\n case 'created':\n entries.push({icon: 'create', message: `Envelope was created.`, date: new Date(history.created_at)});\n break;\n case 'completed':\n entries.push({icon: 'done_all', message: `Envelope was completed.`, date: new Date(history.created_at)});\n break;\n // TODO: Final answer?\n case 'envelope:canceled':\n case 'envelope_canceled':\n case 'canceled':\n case 'owner:canceled':\n entries.push({icon: 'cancel', message: `Envelope was canceled by the creator.`, date: new Date(history.created_at)});\n break;\n case 'owner:get_in_person_link':\n entries.push({icon: 'link', message: `Owner accessed the In-person link for ${recipient}.`, date: new Date(history.created_at)});\n break;\n default:\n console.log('[SIDEBAR] Unknown history type', history);\n break;\n }\n });\n\n entries.sort((a, b) => b.date.getTime() - a.date.getTime());\n return entries;\n }\n\n // canModify(recipient: IRecipient) {\n // const invalidRecipientStatus = ['declined', 'signed', 'submitted', 'canceled'];\n // const invalidEnvelopeStatus = ['complete', 'declined', 'canceled'];\n // return recipient.claimed !== true && invalidRecipientStatus.indexOf(recipient.status) === -1 && invalidEnvelopeStatus.indexOf(this.envelope?.status) === -1;\n // }\n\n handleToggleReminders() {\n if (this.remindersEnabled) {\n return this.handleSetReminders(null, null);\n } else {\n return this.handleSetReminders(MS_PER_DAY, 3 * MS_PER_DAY);\n }\n }\n\n handleSetReminders(initial_reminder: number | null, followup_reminders: number | null) {\n console.log('Updating reminders...');\n this.updatingReminders = true;\n\n updateEnvelope(this.endpoint, this.envelopeId, {initial_reminder, followup_reminders})\n .then(envelope => {\n console.log('Updated', envelope);\n Store.updateEnvelope(this.envelopeId, envelope);\n this.initialReminder = envelope.initial_reminder;\n this.followupReminders = envelope.followup_reminders;\n this.remindersEnabled = !!envelope.initial_reminder;\n this.updatingReminders = false;\n })\n .catch(e => {\n console.log('Error updating envelope', e);\n this.initialReminder = this.envelope?.initial_reminder;\n this.followupReminders = this.envelope?.followup_reminders;\n this.remindersEnabled = !!this.envelope?.initial_reminder;\n this.updatingReminders = false;\n alert(e.response.data.error);\n });\n }\n\n render() {\n if (this.loading) {\n // We don't show a loading indicator for the sidebar, to avoid FOUS\n return <Host />;\n }\n\n const isEnvelopeOwner = userIsEnvelopeOwner(this.endpoint.profile, this.envelope);\n const historyEntries = this.prepareHistoryEntries();\n const functionsDisabled = this.envelope?.status !== 'pending' && this.envelope?.status !== 'in progress';\n\n return (\n <Host class={this.panelOpen ? 'open' : ''}>\n <div class=\"side-buttons\">\n <button class={this.activeTab === 1 ? 'active' : ''} onClick={() => this.setTab(1)} innerHTML={InformationCircle} />\n <button class={this.activeTab === 2 ? 'active' : ''} onClick={() => this.setTab(2)} innerHTML={Users} />\n <button class={this.activeTab === 3 ? 'active' : ''} onClick={() => this.setTab(3)} innerHTML={ClipboardDocuments} />\n </div>\n\n {this.activeTab === 1 && (\n <div class=\"content\">\n <div class=\"title\">Details</div>\n\n <div class=\"label\">Envelope ID</div>\n <div class=\"value\">{this.envelope?.id}</div>\n\n <div class=\"label\">Date Created</div>\n <div class=\"value\">{format(new Date(this.envelope?.created_at), FORMAT_TIMESTAMP)}</div>\n\n <div class=\"label\">Last Modified</div>\n <div class=\"value\">{format(new Date(this.envelope?.updated_at), FORMAT_TIMESTAMP)}</div>\n\n <div class=\"label\">Status</div>\n <div class=\"value\">{capitalize(this.envelope?.status)}</div>\n\n <div class=\"label\">Owner ID</div>\n <div class=\"value\">{this.envelope?.profile_id}</div>\n\n <div class=\"label\">Owner Name</div>\n <div class=\"value\">{formatFullName(this.envelope?.profile)}</div>\n\n <div class=\"label\">Owner Email</div>\n <div class=\"value\">{this.envelope?.profile?.email}</div>\n </div>\n )}\n\n {this.activeTab === 2 && (\n <div class=\"content\">\n <div class=\"title\">Recipients</div>\n {this.envelope?.recipients.map((recipient, index) => {\n const canGetInPersonLink = recipient.status !== 'submitted' && recipient.status !== 'canceled' && recipient.status !== 'declined';\n const canSendReminder = this.canResendRecipient(recipient);\n const fullName = formatFullName(recipient);\n\n return (\n <div class=\"recipient-detail\">\n <div class=\"recipient-header\">\n <div class=\"recipient-number\">{index + 1}</div>\n <div class=\"recipient-name\">{recipient.role_name}</div>\n <div class={{'recipient-status': true, [recipient.status]: true}}>{recipient.status}</div>\n {isEnvelopeOwner && !functionsDisabled && (\n <verdocs-dropdown\n onOptionSelected={item => this.handleRecipientAction(recipient, item.detail.id)}\n options={[\n {id: 'reminder', label: 'Send Reminder', disabled: !canSendReminder},\n {id: 'inperson', label: 'Get In-Person Link', disabled: !canGetInPersonLink},\n // {id: 'modify', label: 'Modify Recipient', disabled: !this.canModifyRecipient(recipient)},\n // TODO: Details dialog\n // {id:'details',label: 'View Details'},\n ]}\n />\n )}\n </div>\n\n <dic class=\"recipient-content\">\n <div class=\"recipient-name\">{fullName}</div>\n <div class=\"recipient-name\">{recipient.email}</div>\n <div class=\"recipient-name\">{recipient.phone}</div>\n </dic>\n </div>\n );\n })}\n\n {isEnvelopeOwner && (\n <div class=\"reminders\">\n <div class=\"form-row\">\n <div class=\"reminders-label\">Reminders</div>\n <verdocs-switch disabled={functionsDisabled || this.updatingReminders} checked={this.remindersEnabled} onCheckedChange={() => this.handleToggleReminders()} />\n </div>\n\n {this.remindersEnabled && (\n <Fragment>\n <div class=\"form-row\">NOTE: Reminders will only be sent for up to 14 days.</div>\n <div class=\"form-row\">\n <div class=\"form-label\">Initial Reminder (days):</div>\n <verdocs-text-input\n placeholder=\"In hours...\"\n disabled={functionsDisabled || this.updatingReminders}\n value={String(Math.floor(this.initialReminder / MS_PER_DAY))}\n onBlur={(e: any) => {\n this.initialReminder = Number(e.target.value) * MS_PER_DAY;\n this.handleSetReminders(this.initialReminder, this.followupReminders);\n }}\n />\n </div>\n <div class=\"form-row\">\n <div class=\"form-label\">Follow-up Reminders:</div>\n <verdocs-text-input\n placeholder=\"In hours...\"\n disabled={functionsDisabled || this.updatingReminders}\n value={String(Math.floor(this.followupReminders / MS_PER_DAY))}\n onBlur={(e: any) => {\n this.followupReminders = Number(e.target.value) * MS_PER_DAY;\n this.handleSetReminders(this.initialReminder, this.followupReminders);\n }}\n />\n </div>\n <div class=\"form-row\">\n <div class=\"form-label\">Next Reminder:</div>\n <div style={{color: '#dddddd'}}>{format(new Date(this.envelope?.next_reminder), 'P p')}</div>\n </div>\n </Fragment>\n )}\n </div>\n )}\n {/* <verdocs-button*/}\n {/* class=\"manage-recipients-button\"*/}\n {/* variant=\"standard\"*/}\n {/* label=\"Turn On Reminders\"*/}\n {/* onClick={() => (this.showManageDialog = !functionsDisabled)}*/}\n {/* disabled={functionsDisabled}*/}\n {/* />*/}\n\n {isEnvelopeOwner && (\n <verdocs-button\n class=\"manage-recipients-button\"\n variant=\"standard\"\n label=\"Cancel Envelope\"\n onClick={() => (this.showCancelDialog = !functionsDisabled)}\n disabled={functionsDisabled}\n />\n )}\n </div>\n )}\n\n {this.activeTab === 3 && (\n <div class=\"content\">\n <div class=\"title\">History</div>\n\n {historyEntries.map(entry => (\n <div class=\"history-entry\">\n <div class=\"activity-icon\" innerHTML={ActivityIcons[entry.icon] || entry.icon} />\n <div class=\"activity-details\">\n <div class=\"activity-text\">{entry.message}</div>\n {/* 'MMMM Do YYYY, h:mm:ss a' */}\n <div class=\"activity-date\">{format(entry.date, FORMAT_TIMESTAMP)}</div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {this.showRecipientDialog && (\n <verdocs-envelope-recipient-link envelopeId={this.envelopeId} roleName={this.showRecipientDialog} onNext={() => (this.showRecipientDialog = '')} />\n )}\n\n {this.showCancelDialog && (\n <verdocs-ok-dialog\n heading=\"Cancel Envelope?\"\n message={'Are you sure you want to cancel this Envelope? This action cannot be undone.'}\n onNext={() => {\n this.showCancelDialog = false;\n this.handleCancelEnvelope();\n }}\n />\n )}\n </Host>\n );\n }\n}\n"],"mappings":"8hEAAA,IAAMA,EAA4B,6gLAClC,IAAAC,EAAeD,ECQf,IAAME,EAAa,GAAK,GAAK,GAAK,IAElC,IAAMC,EAAoB,mUAE1B,IAAMC,EAAQ,2hBAEd,IAAMC,EAAqB,6vBAG3B,IAAMC,EAAgB,CACpBC,WAAY,4aACZC,OAAQ,iVACRC,KAAM,qNACNC,aAAc,qNACdC,KAAM,kRACNC,KAAM,6IACNC,QAAS,qvBACTC,MAAO,6MACPC,aAAc,6NACdC,KAAM,2TACNC,OAAQ,uRACRC,SAAU,iQACVC,OAAQ,6PACRC,cAAe,6PACfC,OAAQ,yYACRC,cAAe,sUACfC,QAAS,2NACTC,cAAe,qiBACfC,eAAgB,4U,IAkBLC,EAAsBC,EAAA,sC,4KACzBC,KAAAC,mBAAqB,K,cAKOC,EAAgBC,a,gBAKvB,G,eA2BA,E,eACR,M,yBACU,G,sBACH,M,sBAEA,M,uBACC,M,qBACa,K,uBACE,K,aAEzB,K,cACmB,I,CAEhCC,EAAAC,UAAAC,kBAAN,W,+FACE,IACEN,KAAKO,SAASC,cAEd,IAAKR,KAAKS,WAAY,CACpBC,QAAQC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AuH,SAAA,SAAAA,EAAEC,eAAgB,WAczF3C,GACCF,EAAA,kBACEO,MAAM,2BACNuC,QAAQ,WACRjB,MAAM,kBACNrB,QAAS,kBAAOpF,EAAK2H,kBAAoBzC,CAAhC,EACTwB,SAAUxB,KAMjBjH,KAAKmD,YAAc,GAClBwD,EAAA,OAAKO,MAAM,WACTP,EAAA,OAAKO,MAAM,SAAO,WAEjBF,EAAee,KAAI,SAAA4B,GAAK,OACvBhD,EAAA,OAAKO,MAAM,iBACTP,EAAA,OAAKO,MAAM,gBAAgBE,UAAW1I,EAAciL,EAAMzE,OAASyE,EAAMzE,OACzEyB,EAAA,OAAKO,MAAM,oBACTP,EAAA,OAAKO,MAAM,iBAAiByC,EAAMvI,SAElCuF,EAAA,OAAKO,MAAM,iBAAiBG,EAAOsC,EAAMxE,KAAMmC,KAN5B,KAa5BtH,KAAKiE,qBACJ0C,EAAA,mCAAiClG,WAAYT,KAAKS,WAAYmJ,SAAU5J,KAAKiE,oBAAqB4F,OAAQ,kBAAO9H,EAAKkC,oBAAsB,EAAlC,IAG3GjE,KAAK0J,kBACJ/C,EAAA,qBACEmD,QAAQ,mBACR1I,QAAS,+EACTyI,OAAQ,WACN9H,EAAK2H,iBAAmB,MACxB3H,EAAKqC,sB,eAngBgB,I","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as i,h as t,H as s,F as o}from"./p-b9654a5e.js";import{VerdocsEndpoint as n,startSigningSession as a,getKbaStep as l,envelopeRecipientAgree as r,envelopeRecipientDecline as d,updateEnvelopeField as c,createSignature as h,updateEnvelopeFieldSignature as p,createInitials as g,updateEnvelopeFieldInitials as u,isValidPhone as v,isValidEmail as f,sortFields as m,envelopeRecipientSubmit as x,getEnvelope as b,uploadEnvelopeFieldAttachment as y,deleteEnvelopeFieldAttachment as w,formatFullName as k,fullNameToInitials as S,submitKbaPin as N,submitKbaIdentity as I,submitKbaChallengeResponse as G,integerSequence as P}from"@verdocs/js-sdk";import{a as z,u as F,r as E,g as D}from"./p-0c45b79c.js";import{V as A}from"./p-04c07b7b.js";import{S as L}from"./p-fd97809c.js";import{S as U}from"./p-3828cb31.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const V='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign .agree{-ms-flex:0;flex:0;width:600px;display:-ms-flexbox;display:flex;max-width:90%;padding:30px 15px;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign .agree li{margin:0.5em 0}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:50%;width:50%;font-size:16px;background:white;border-radius:5px;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#654dcb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';const T=V;const j=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const R=[{id:"print",label:"Print"},{id:"download",label:"Download"}];const C=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.recipientIndex=-1;this.endpoint=null;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.kbaStep="";this.kbaQuestions=[];this.showSpinner=false;this.kbaChoices=[];this.loading=true;this.envelope=null}componentWillLoad(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new n({sessionType:"signing"})}}async componentDidLoad(){var e,i,t,s,o,n,r;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new L("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new L("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new L("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{envelope:e,recipient:i}=await a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);console.log(`[SIGN] Loaded signing session`,e,i);this.recipient=i;this.envelope=e;U.updateEnvelope(this.envelopeId,e);this.sortedRecipients=[...this.envelope.recipients];this.sortedRecipients.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence));this.roleNames=this.sortedRecipients.map((e=>e.role_name));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((e=>e==this.roleId));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.submitted=this.recipient.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. Please contact its sender for more information."}else if(this.recipient.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){l(this.endpoint,this.envelopeId,this.roleId).then((e=>{var i;console.log("[SIGN] KBA Step",e);this.kbaStep=e.kba_step;if(this.kbaStep==="failed"){this.fatalErrorHeader="Identity Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. Please contact the document's sender.";this.isDone=true}else{this.kbaQuestions=((i=e.questions)===null||i===void 0?void 0:i.question)||[];this.kbaChoices=[]}})).catch((e=>console.log("Error getting KBA step",e)))}}catch(e){console.log("[SIGN] Error with signing session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new L(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(r=e.response)===null||r===void 0?void 0:r.data));this.showLoadError=true}}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}}handleClickAgree(){this.submitting=true;r(this.endpoint,this.envelopeId,this.roleId,true).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Update failure",e);this.submitting=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(new L(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,o,n;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":A("This feature will be available in an upcoming release.");(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=true;const e=await d(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Decline result",e);(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this envelope."}break;case"print":window.print();(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>e.type==="attachment"));if(e){z(this.endpoint,this.envelope,e.id).catch((e=>{console.log("[SIGN] Error downloading PDF",e)}));(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}break}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e,i);this.getRecipientFields().forEach((t=>{if(t.name===e){t.value=i.value;t.settings=i.settings;F(t);this.checkRecipientFields()}}))}saveFieldChange(e,i){console.log("[SIGN] saveFieldChange",e,i);c(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new L(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"radio":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"dropdown":console.log("Saving dropdown",e.name,i.detail);return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":if(!i.detail){return}this.showSpinner=true;const o=await(await fetch(i.detail)).blob();return g(this.endpoint,"initial",o).then((async i=>{const t=await u(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);this.showSpinner=false}));case"signature":if(!i.detail){return}this.showSpinner=true;const n=await(await fetch(i.detail)).blob();return h(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await p(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);this.showSpinner=false}));case"date":const{formattedDate:a}=i.detail;if(a){return this.saveFieldChange(e.name,{prepared:false,value:a})}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e);break}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return f(i);case"phone":return v(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>e.value==="true"))}return e.value==="true";default:return false}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));m(e);return e}async handleNext(){var e;if(this.nextSubmits){try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const i=await x(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");b(this.endpoint,this.envelopeId).then((e=>{this.envelope=e;this.submitting=false})).catch((e=>{console.log("[SIGN] Error reloading envelope",e);this.submitting=false}))}catch(e){console.log("[SIGN] Error submitting",e)}return}const i=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldFilled(e)));m(i);const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let o=i[s];let n=0;if(n<i.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){n++;s++;if(s>=i.length){s=0}o=i[s]}if(n>=i.length){o=null}if(o){const e=D(o);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth"});i===null||i===void 0?void 0:i.focusField();this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",e.map((e=>e.name)));this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t){if(t.getAttribute("attached")==="1"){return}t.setAttribute("attached","1");t.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));t.addEventListener("attached",(async t=>{console.log("[SIGN] onAttached",t.detail,t.target.value);this.showSpinner=true;try{const s=await y(this.endpoint,this.envelopeId,i.name,t.detail);this.updateRecipientFieldValue(i.name,s);this.checkRecipientFields();const o=E("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,o);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);A("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("deleted",(async t=>{console.log("[SIGN] onDeleted",t.detail,t.target.value);this.showSpinner=true;try{const t=await w(this.endpoint,this.envelopeId,i.name);console.log("[SIGN] Deleted attachment",t);this.updateRecipientFieldValue(i.name,t);this.checkRecipientFields();const s=E("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,s);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);A("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("focusout",(e=>{if(i.type!=="dropdown"&&i.type!=="attachment"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}}));t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);const s=k(this.recipient);t.setAttribute("initials",S(s));t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail;const t=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,t);t.forEach(((e,t)=>{if(e.page!==i.pageNumber){return}const s=E("envelope",e,i,{disabled:false,editable:false,draggable:false,done:this.isDone},t);if(!s){return}if(Array.isArray(s)){s.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,s)}}));this.sortedRecipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=E("envelope",e,i,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!t){return}if(Array.isArray(t)){t.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,t)}}))}));this.checkRecipientFields()}render(){if(this.showLoadError){return t(s,null,t("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`,buttonLabel:"OK",onNext:()=>{window.location.reload()}}))}if(!this.envelope){return t(s,null,t("verdocs-loader",null))}if(this.fatalErrorMessage){return t(s,{class:{agreed:this.agreed}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},this.fatalErrorHeader),t("p",null,this.fatalErrorMessage))))}if(this.isDone){return t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:e=>{e.preventDefault();e.stopPropagation();this.showDone=false;this.isDone=true}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)))}if(!this.agreed){return t(s,{class:"agreed"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:()=>this.handleClickAgree()}),t("ul",null,t("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",t("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),t("li",null,"Agree to Verdocs'"," ",t("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",t("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))}if(this.kbaStep==="pin"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:async e=>{N(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{console.log("[SIGN] PIN code submission result",e);if(e.kba_step==="complete"){this.kbaStep=""}})).catch((e=>{var i,t;console.log("[SIGN] Error submitting PIN",e);A(((t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}))}}))))}if(this.kbaStep==="identity"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const i=e.detail;I(this.endpoint,this.envelopeId,this.roleId,{firstName:i.first_name,lastName:i.last_name,address:i.address,city:i.city,state:i.state,zip:i.zip,ssnLast4:i.ssn_last_4}).then((e=>{console.log("[SIGN] Identity submission result",e);this.kbaStep=e.kba_step})).catch((e=>{var i,t;console.log("[SIGN] Error submitting identity",e);A(((t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)||"Unable to verify identity.",{style:"error"})}))}}))))}if(this.kbaStep==="challenge"){const e=this.kbaChoices.length;const i=this.kbaQuestions[e];return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?t("verdocs-spinner",null):t("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{var i,t,s;const o=e.detail;this.kbaChoices=[...this.kbaChoices,o];if(this.kbaChoices.length>=this.kbaQuestions.length){const o=this.kbaQuestions.map(((e,i)=>({type:e.type,answer:this.kbaChoices[i]})));console.log("Submitting KBA responses",this.kbaChoices,o);try{const e=await G(this.endpoint,this.envelopeId,this.roleId,o);console.log("KBA challenge response",e);this.kbaStep=e.kba_step;if(this.kbaStep==="failed"){this.fatalErrorHeader="Identity Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. Please contact the document's sender.";this.isDone=true}else{this.kbaQuestions=((i=e.questions)===null||i===void 0?void 0:i.question)||[];this.kbaChoices=[]}}catch(e){console.log("Error submitting KBA challenge",e);this.kbaStep="";this.fatalErrorHeader="Unable to Verify Identity";this.fatalErrorMessage=((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)||"Please try again later.";this.isDone=true}}}}))))}return t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?j:R,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=P(1,e.pages);return t(o,null,i.map((i=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=false}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=false;this.isDone=true}}),this.submitting||this.showSpinner&&t("verdocs-portal",null,t("div",{class:"spinner-overlay"},t("verdocs-spinner",null))))}};C.style=T;export{C as verdocs_sign};
2
- //# sourceMappingURL=p-23d6f064.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["verdocsSignCss","VerdocsSignStyle0","inProgressMenuOptions","id","label","doneMenuOptions","VerdocsSign","this","recipientIndex","componentWillLoad","endpoint","console","log","VerdocsEndpoint","sessionType","componentDidLoad","envelopeId","_a","sdkError","emit","SDKError","roleId","_b","inviteCode","_c","envelope","recipient","startSigningSession","Store","updateEnvelope","sortedRecipients","recipients","sort","a","b","sequence","order","roleNames","map","r","role_name","documents","length","documentsSingularPlural","findIndex","roleName","agreed","warn","submitted","status","isDone","showDone","fatalErrorHeader","fatalErrorMessage","nextButtonLabel","checkRecipientFields","_d","envelopeLoaded","getKbaStep","then","kbaStep","kba_step","kbaQuestions","questions","question","kbaChoices","catch","e","_e","message","_f","response","_g","data","showLoadError","componentDidRender","headerTarget","headerTargetId","document","getElementById","headerEl","remove","append","handleClickAgree","submitting","envelopeRecipientAgree","envelopeUpdated","event","handleOptionSelected","detail","finishLater","showFinishLater","VerdocsToast","declineResult","envelopeRecipientDecline","window","print","firstDoc","find","doc","type","saveAttachment","updateRecipientFieldValue","fieldName","updateResult","getRecipientFields","forEach","oldField","name","value","settings","updateDocumentFieldValue","saveFieldChange","fields","updateEnvelopeField","error","handleFieldChange","field","checked","target","prepared","String","showSpinner","initialsBlob","fetch","blob","createInitials","async","newInitials","updateEnvelopeFieldInitials","signatureBlob","createSignature","newSignature","updateEnvelopeFieldSignature","formattedDate","ts","getAttribute","isFieldFilled","validator","isValidEmail","isValidPhone","trim","group","filter","f","some","isFieldValid","required","getSortedFillableFields","recipientFields","sortFields","handleNext","nextSubmits","result","envelopeRecipientSubmit","getEnvelope","emptyFields","focusedIndex","focusedField","nextFocusedIndex","nextRequiredField","skips","includes","getFieldId","el","scrollIntoView","behavior","focusField","invalidFields","attachFieldAttributes","pageInfo","setAttribute","addEventListener","finally","uploadEnvelopeFieldAttachment","newEl","renderDocumentField","disabled","editable","draggable","done","style","deleteEnvelopeFieldAttachment","template_id","pageNumber","xScale","yScale","fullName","formatFullName","fullNameToInitials","handlePageRendered","tabIndex","page","Array","isArray","render","h","Host","heading","buttonLabel","onNext","location","reload","class","onSdkError","preventDefault","stopPropagation","src","alt","paddingTop","width","height","boxShadow","marginTop","onInput","href","mode","step","steps","helptitle","helptext","submitKbaPin","recipDetails","submitKbaIdentity","firstName","first_name","lastName","last_name","address","city","state","zip","ssnLast4","ssn_last_4","questionNumber","kbaQuestion","prompt","choices","answer","responses","q","i","submitKbaChallengeResponse","flex","size","onClick","marginLeft","options","onOptionSelected","envelopeDocument","pageNumbers","integerSequence","pages","Fragment","pageSize","page_sizes","documentId","virtualWidth","virtualHeight","onPageRendered","layers"],"sources":["src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n //.intro {\n // width: 100%;\n // display: flex;\n // flex: 0 0 60px;\n // color: #111111;\n // font-size: 18px;\n // font-weight: 500;\n // line-height: 28px;\n // flex-direction: row;\n // background: #ffffff;\n //\n // .inner {\n // width: 100%;\n // display: flex;\n // margin: 0 auto;\n // padding: 0 20px;\n // max-width: 1200px;\n // flex-direction: row;\n // align-items: center;\n // }\n //}\n\n > .document {\n flex: 1;\n width: 100%;\n height: 100%;\n align-self: center;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n max-width: 1200px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n //justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 5000;\n position: absolute;\n padding-top: 100px;\n align-items: center;\n flex-direction: column;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .agree {\n flex: 0;\n width: 600px;\n display: flex;\n max-width: 90%;\n padding: 30px 15px;\n flex-direction: column;\n background-color: #ffffff;\n\n .header {\n flex: 0 0 56px;\n }\n\n li {\n margin: 0.5em 0;\n }\n }\n\n verdocs-ok-dialog .background-overlay {\n align-items: flex-start;\n padding-top: 100px;\n }\n\n .loading-indicator {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 10000;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.7);\n }\n\n .fatal-error {\n position: absolute;\n z-index: 100;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #4a4a4a;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .placeholder {\n position: absolute;\n opacity: 0.1;\n z-index: -1;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n margin-top: 15px;\n }\n\n .message {\n max-width: 50%;\n width: 50%;\n font-size: 16px;\n background: white;\n border-radius: 5px;\n box-shadow: 3px 3px 9px -1px #0000003f;\n }\n\n .header {\n color: white;\n font-size: 18px;\n font-weight: 500;\n padding: 5px 10px;\n margin: 0 0 10px 0;\n background: $verdocs-purple;\n }\n\n p {\n margin: 1rem;\n font-size: 14px;\n font-weight: 400;\n padding: 0 10px;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n\n#verdocs-sign-header {\n color: #fff;\n width: 100%;\n display: flex;\n z-index: 1000;\n flex: 0 0 46px;\n font-size: 12px;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow:\n 0 4px 4px 0 rgb(0 0 0 / 24%),\n 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n display: flex;\n margin: 0 auto;\n padding: 0 12px;\n max-width: 1200px;\n align-items: center;\n flex-direction: row;\n }\n\n .logo {\n width: 80px;\n display: none;\n margin: -6px 0 0 0;\n }\n\n .title {\n font-size: 18px;\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n padding: 0 10px 0 0;\n text-overflow: ellipsis;\n }\n}\n\n.spinner-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n background: #0000007f;\n justify-content: center;\n}\n","import type {IEnvelope, IEnvelopeField, IRecipient} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {updateEnvelopeField, sortFields, submitKbaIdentity, submitKbaChallengeResponse} from '@verdocs/js-sdk';\nimport {fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment, getKbaStep} from '@verdocs/js-sdk';\nimport {getEnvelope, integerSequence, isValidEmail, isValidPhone, submitKbaPin, updateEnvelopeFieldInitials} from '@verdocs/js-sdk';\nimport {createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, formatFullName} from '@verdocs/js-sdk';\nimport {getFieldId, renderDocumentField, saveAttachment, updateDocumentFieldValue} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst inProgressMenuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing'},\n {id: 'download', label: 'Download'},\n];\n\nconst doneMenuOptions = [\n {id: 'print', label: 'Print'},\n {id: 'download', label: 'Download'},\n];\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop({mutable: true}) endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop({reflect: true}) envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop({reflect: true}) roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop({reflect: true}) inviteCode: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the header will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects (e.g. \"fixed\").\n *\n * The movement of the header to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the header's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() headerTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() roleNames: string[] = [];\n @State() sortedRecipients: IRecipient[] = [];\n @State() recipient: IRecipient | null = null;\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() fatalErrorHeader = '';\n @State() fatalErrorMessage = '';\n @State() focusedField = '';\n @State() submitting = false;\n @State() submitted = false;\n @State() isDone = false;\n @State() showDone = false;\n @State() showLoadError = false;\n @State() finishLater = false;\n @State() showFinishLater = false;\n @State() agreed = false;\n @State() documentsSingularPlural = 'document';\n @State() kbaStep = '';\n @State() kbaQuestions: any[] = [];\n @State() showSpinner = false;\n @State() kbaChoices = [];\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n recipientIndex: number = -1;\n\n componentWillLoad() {\n if (!this.endpoint) {\n console.log('[SIGN] Creating signing endpoint');\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n\n // NOTE: We don't listen to the store here because we are often an independent\n // session and might have a different \"view\" of the envelope.\n const {envelope, recipient} = await startSigningSession(this.endpoint, this.envelopeId, this.roleId, this.inviteCode);\n console.log(`[SIGN] Loaded signing session`, envelope, recipient);\n this.recipient = recipient;\n this.envelope = envelope;\n\n Store.updateEnvelope(this.envelopeId, envelope);\n\n // TODO: Can be cleaned up shortly.\n this.sortedRecipients = [...this.envelope.recipients];\n this.sortedRecipients.sort((a, b) => {\n return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;\n });\n\n this.roleNames = this.sortedRecipients.map(r => r.role_name);\n\n if (this.envelope.documents.length > 0) {\n this.documentsSingularPlural = 'document(s)';\n }\n\n this.recipientIndex = this.roleNames.findIndex(roleName => roleName == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = this.sortedRecipients[this.recipientIndex];\n this.agreed = this.recipient.agreed;\n } else {\n console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);\n }\n\n // TODO: Envelope \"complete\" | \"declined\" | \"canceled\"\n // TODO: Recipient \"canceled\"\n this.submitted = this.recipient.status === 'submitted';\n this.isDone = this.submitted;\n this.showDone = this.submitted;\n\n if (this.envelope.status === 'canceled') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'This envelope has been canceled. Please contact its sender for more information.';\n } else if (this.recipient.status === 'declined') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'You have declined to sign this envelope.';\n } else if (this.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n this.checkRecipientFields();\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: this.envelope});\n\n if (!this.isDone) {\n getKbaStep(this.endpoint, this.envelopeId, this.roleId)\n .then(r => {\n console.log('[SIGN] KBA Step', r);\n this.kbaStep = r.kba_step;\n if (this.kbaStep === 'failed') {\n this.fatalErrorHeader = 'Identity Verification Failed';\n this.fatalErrorMessage = \"We were unable to verify your identity. Please contact the document's sender.\";\n this.isDone = true;\n } else {\n this.kbaQuestions = (r as any).questions?.question || [];\n this.kbaChoices = [];\n }\n })\n .catch(e => console.log('Error getting KBA step', e));\n }\n } catch (e) {\n console.log('[SIGN] Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n this.showLoadError = true;\n }\n }\n\n componentDidRender() {\n const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;\n const headerEl = document.getElementById('verdocs-sign-header');\n if (headerTarget && headerEl) {\n console.log('[SIGN] Moving header');\n headerEl.remove();\n headerTarget.append(headerEl);\n }\n }\n\n handleClickAgree() {\n this.submitting = true;\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(() => {\n this.nextButtonLabel = 'Next';\n this.recipient.agreed = true;\n this.submitting = false;\n this.agreed = true; // The server returns a recipient object but it's not \"deep\" so we track this locally\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('[SIGN] Update failure', e);\n this.submitting = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e: any) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'later'});\n break;\n\n case 'claim':\n VerdocsToast('This feature will be available in an upcoming release.');\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'claimed'});\n break;\n\n case 'decline':\n {\n this.submitting = true;\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Decline result', declineResult);\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'declined'});\n this.submitting = false;\n this.fatalErrorHeader = 'Declined';\n this.fatalErrorMessage = 'You have declined to sign this envelope.';\n }\n break;\n\n case 'print':\n window.print();\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'printed'});\n break;\n\n case 'download':\n {\n const firstDoc = this.envelope.documents.find(doc => doc.type === 'attachment');\n if (firstDoc) {\n saveAttachment(this.endpoint, this.envelope, firstDoc.id).catch(e => {\n console.log('[SIGN] Error downloading PDF', e);\n });\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n }\n }\n break;\n }\n }\n\n updateRecipientFieldValue(fieldName: string, updateResult: any) {\n console.log('[SIGN] updateRecipientFieldValue', fieldName, updateResult);\n this.getRecipientFields().forEach(oldField => {\n if (oldField.name === fieldName) {\n oldField.value = updateResult.value;\n // TODO: Keeping this while attachments still rely on it\n oldField.settings = updateResult.settings;\n updateDocumentFieldValue(oldField);\n this.checkRecipientFields();\n }\n });\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n console.log('[SIGN] saveFieldChange', fieldName, fields);\n updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .then(updateResult => this.updateRecipientFieldValue(fieldName, updateResult))\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n console.log('[SIGN] Signing session expired');\n this.fatalErrorHeader = 'Signing Session Expired';\n this.fatalErrorMessage = 'Please reload your browser to continue.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IEnvelopeField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type as any) {\n // TODO: Remove legacy type when no longer needed\n case 'textarea':\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'radio': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'dropdown':\n // TODO: Set prepared to false server-side.\n console.log('Saving dropdown', field.name, e.detail);\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(async newInitials => {\n const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.log('Error updating initials', e);\n this.showSpinner = false;\n });\n\n case 'signature':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(async newSignature => {\n console.log('Signature update result', newSignature);\n const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.warn('[SIGN] Error updating signature', e);\n this.showSpinner = false;\n });\n\n case 'date':\n const {formattedDate} = e.detail;\n if (formattedDate) {\n return this.saveFieldChange(field.name, {prepared: false, value: formattedDate});\n }\n break;\n\n case 'timestamp':\n console.log('[SIGN] Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('[SIGN] Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldFilled(field: IEnvelopeField) {\n const {value = ''} = field;\n switch (field.type as any) {\n case 'textarea':\n case 'textbox':\n switch (field.validator || '') {\n case 'email':\n return isValidEmail(value);\n case 'phone':\n return isValidPhone(value);\n default:\n return (value || '').trim() !== '';\n }\n\n case 'signature':\n return value === 'signed';\n\n case 'initial':\n return value === 'initialed';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'date':\n return !!value;\n\n case 'attachment':\n return value === 'attached';\n\n case 'dropdown':\n return value !== '';\n\n case 'checkbox':\n return value === 'true';\n\n case 'radio':\n if (!!field.group) {\n return this.getRecipientFields()\n .filter(f => f.group === field.group)\n .some(field => field.value === 'true');\n }\n\n return field.value === 'true';\n\n default:\n return false;\n }\n }\n\n isFieldValid(field: IEnvelopeField) {\n return !field.required || this.isFieldFilled(field);\n }\n\n getSortedFillableFields() {\n const recipientFields = this.getRecipientFields().filter(field => field.type !== 'timestamp');\n sortFields(recipientFields);\n return recipientFields;\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n // Patches the date picker to be forcibly removed if still showing during submission\n document.getElementById('air-datepicker-global-container')?.remove();\n\n this.submitting = true;\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.recipient.status = 'submitted';\n this.showDone = true;\n console.log('[SIGN] Reloading envelope');\n getEnvelope(this.endpoint, this.envelopeId)\n .then(envelope => {\n this.envelope = envelope;\n // The show-done dialog does this\n // this.isDone = true;\n this.submitting = false;\n })\n .catch(e => {\n // this.isDone = true;\n console.log('[SIGN] Error reloading envelope', e);\n this.submitting = false;\n });\n } catch (e) {\n console.log('[SIGN] Error submitting', e);\n }\n\n return;\n }\n\n // Find and focus the next incomplete field (that is fillable)\n const emptyFields = this.getSortedFillableFields().filter(field => field.required && !this.isFieldFilled(field));\n sortFields(emptyFields);\n\n const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = emptyFields[nextFocusedIndex];\n // console.log('Next field', nextRequiredField, emptyFields);\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ['initialed', 'signed'].includes(nextRequiredField.value)) {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = emptyFields[nextFocusedIndex];\n }\n\n if (skips >= emptyFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.scrollIntoView({behavior: 'smooth'});\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n getRecipientFields() {\n return this.envelope.fields.filter(field => field.role_name === this.recipient.role_name);\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.getRecipientFields().filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n if (!this.nextSubmits) {\n this.nextSubmits = true;\n }\n } else {\n console.log(\n '[SIGN] Invalid fields remaining',\n invalidFields.map(field => field.name),\n );\n this.nextButtonLabel = 'Next';\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, el) {\n // We can get called multiple times as rendering completes and it's hard to avoid that\n // because it's a ton of work for the callers to know it's been done already. But we\n // don't want to attach multiple event listeners or we get dupe event handling, like\n // calling the server twice on every field update. Since JS has no removeAllEventListeners()\n // option, using removeEventListener() isn't reliable the way Stencil binds local function\n // contexts, and cloneNode messes up the rest of the rendering, we just track it with a flag.\n if (el.getAttribute('attached') === '1') {\n return;\n }\n el.setAttribute('attached', '1');\n\n el.addEventListener('input', (e: any) => {\n // console.log('[SIGN] onfieldInput', e.detail, e.target.value);\n // These field types don't emit fieldChange. Should we standardize on that? We don't tap \"input\" for fields like\n // text boxes because we'd be updating the field on every keystroke. We do those on blur which fires fieldChange.\n if (e.target.type === 'radio' || e.target.type === 'checkbox') {\n // if (e.target.type === 'radio' || e.target.name.includes('date') || e.target.name.includes('checkbox')) {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n } else {\n this.checkRecipientFields();\n }\n });\n el.addEventListener('attached', async (e: any) => {\n console.log('[SIGN] onAttached', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await uploadEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name, e.detail);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('deleted', async (e: any) => {\n console.log('[SIGN] onDeleted', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await deleteEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name);\n console.log('[SIGN] Deleted attachment', updateResult);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('focusout', e => {\n // These field types trigger focusout as they're used, even without a value change\n if (field.type !== 'dropdown' && field.type !== 'attachment') {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n }\n });\n el.addEventListener('fieldChange', e => {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n });\n\n el.setAttribute('templateid', this.envelope.template_id);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('page', pageInfo.pageNumber);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n\n const fullName = formatFullName(this.recipient);\n el.setAttribute('initials', fullNameToInitials(fullName));\n el.setAttribute('name', fullName);\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n\n // NOTE: We don't filter on pageNumber here because we need the position in the\n // entire list to set the tabIndex.\n const recipientFields = this.getSortedFillableFields();\n console.log('[SIGN] Rendering fields for page', pageInfo.pageNumber, recipientFields);\n\n // First render the fields for the signer\n recipientFields.forEach((field, tabIndex) => {\n if (field.page !== pageInfo.pageNumber) {\n return;\n }\n\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone}, tabIndex);\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n\n // Now render the fields for other signers who have yet to act\n this.sortedRecipients\n .filter(r => r.role_name !== this.recipient.role_name && (r.status === 'invited' || r.status === 'opened' || r.status === 'pending'))\n .forEach(() => {\n this.getRecipientFields()\n .filter(field => field.page === pageInfo.pageNumber)\n .forEach(field => {\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (this.showLoadError) {\n return (\n <Host>\n <verdocs-ok-dialog\n heading=\"Unable to Start Signing\"\n message={`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`}\n buttonLabel=\"OK\"\n onNext={() => {\n window.location.reload();\n }}\n />\n </Host>\n );\n }\n\n if (!this.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (this.fatalErrorMessage) {\n return (\n <Host class={{agreed: this.agreed}}>\n <div class=\"fatal-error\">\n <div class=\"message\">\n <div class=\"header\">{this.fatalErrorHeader}</div>\n <p>{this.fatalErrorMessage}</p>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.isDone) {\n return (\n <Host class={{agreed: this.agreed}}>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={(e: any) => {\n e.preventDefault();\n e.stopPropagation();\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting && (\n <div class=\"loading-indicator\">\n <verdocs-loader />\n </div>\n )}\n </Host>\n );\n }\n\n if (!this.agreed) {\n return (\n <Host class=\"agreed\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"By checking this box, you:\" onInput={() => this.handleClickAgree()} />\n <ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the{' '}\n <a href=\"https://verdocs.com/en/electronic-record-signature-disclosure/\" target=\"_blank\">\n Electronic Record and Signatures Disclosure\n </a>\n .\n </li>\n <li>\n Agree to Verdocs'{' '}\n <a href=\"https://verdocs.com/en/eula\" target=\"_blank\">\n End User License Agreement\n </a>{' '}\n and confirm you have read Verdocs'{' '}\n <a href=\"https://verdocs.com/en/privacy-policy/\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </li>\n </ul>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'pin') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"text\"\n step={1}\n steps={1}\n helptitle=\"Document is protected by a PIN code\"\n helptext=\"Please enter your PIN code to proceed. If you do not have one, please contact the sender.\"\n label=\"PIN Code\"\n onNext={async e => {\n submitKbaPin(this.endpoint, this.envelopeId, this.roleId, e.detail as string)\n .then(r => {\n console.log('[SIGN] PIN code submission result', r);\n if (r.kba_step === 'complete') {\n this.kbaStep = '';\n }\n })\n .catch(e => {\n console.log('[SIGN] Error submitting PIN', e);\n VerdocsToast(e.response?.data?.error || 'Unable to verify PIN code. Please try again.', {style: 'error'});\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'identity') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"identity\"\n helptitle=\"Document requires identity verification\"\n helptext=\"Please complete your contact details to proceed.\"\n recipient={this.recipient}\n onNext={async e => {\n const recipDetails = e.detail as IRecipient;\n submitKbaIdentity(this.endpoint, this.envelopeId, this.roleId, {\n firstName: recipDetails.first_name,\n lastName: recipDetails.last_name,\n address: recipDetails.address,\n city: recipDetails.city,\n state: recipDetails.state,\n zip: recipDetails.zip,\n ssnLast4: recipDetails.ssn_last_4,\n })\n .then(r => {\n console.log('[SIGN] Identity submission result', r);\n this.kbaStep = r.kba_step;\n })\n .catch(e => {\n console.log('[SIGN] Error submitting identity', e);\n VerdocsToast(e.response?.data?.error || 'Unable to verify identity.', {style: 'error'});\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'challenge') {\n const questionNumber = this.kbaChoices.length;\n const kbaQuestion = this.kbaQuestions[questionNumber];\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n {this.kbaChoices.length >= this.kbaQuestions.length ? (\n <verdocs-spinner />\n ) : (\n <verdocs-kba-dialog\n mode=\"choice\"\n helptitle=\"Your identity requires additional verification\"\n helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}\n choices={kbaQuestion?.answer || ['Skip Question']}\n step={questionNumber + 1}\n steps={this.kbaQuestions.length}\n onNext={async (e: any) => {\n const answer = e.detail as string;\n this.kbaChoices = [...this.kbaChoices, answer];\n if (this.kbaChoices.length >= this.kbaQuestions.length) {\n const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));\n console.log('Submitting KBA responses', this.kbaChoices, responses);\n try {\n const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);\n console.log('KBA challenge response', response);\n this.kbaStep = response.kba_step;\n if (this.kbaStep === 'failed') {\n this.fatalErrorHeader = 'Identity Verification Failed';\n this.fatalErrorMessage = \"We were unable to verify your identity. Please contact the document's sender.\";\n this.isDone = true;\n } else {\n this.kbaQuestions = (response as any).questions?.question || [];\n this.kbaChoices = [];\n }\n } catch (e) {\n console.log('Error submitting KBA challenge', e);\n this.kbaStep = '';\n this.fatalErrorHeader = 'Unable to Verify Identity';\n this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';\n this.isDone = true;\n }\n }\n }}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n <div style={{flex: '1'}} />\n\n {!this.finishLater && <verdocs-button size=\"xsmall\" label={this.nextButtonLabel} disabled={!this.agreed} onClick={() => this.handleNext()} />}\n\n <div style={{marginLeft: '10px'}} />\n <verdocs-dropdown options={!this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n {(this.envelope.documents || []).map(envelopeDocument => {\n const pageNumbers = integerSequence(1, envelopeDocument.pages);\n\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = envelopeDocument.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n // In signing mode we show the original template page with all the recipient fields so we can show source formatting and\n // where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or\n // future signers still need to act. Once we're \"done\" we flip to showing the envelope's documents which have the final\n // field vales (so far) stamped into them.\n // TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure\n // we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.\n // console.log('tp', templatePage, page);\n return (\n <verdocs-envelope-document-page\n envelopeId={this.envelopeId}\n documentId={envelopeDocument.id}\n endpoint={this.endpoint}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n pageNumber={pageNumber}\n onPageRendered={e => this.handlePageRendered(e)}\n type=\"filled\"\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message={`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`}\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={() => {\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting ||\n (this.showSpinner && (\n <verdocs-portal>\n <div class=\"spinner-overlay\">\n <verdocs-spinner />\n </div>\n </verdocs-portal>\n ))}\n </Host>\n );\n }\n}\n"],"mappings":"y3BAAA,MAAMA,EAAiB,sgIACvB,MAAAC,EAAeD,ECYf,MAAME,EAAwB,CAC5B,CAACC,GAAI,QAASC,MAAO,gBAErB,CAACD,GAAI,UAAWC,MAAO,mBACvB,CAACD,GAAI,QAASC,MAAO,yBACrB,CAACD,GAAI,WAAYC,MAAO,aAG1B,MAAMC,EAAkB,CACtB,CAACF,GAAI,QAASC,MAAO,SACrB,CAACD,GAAI,WAAYC,MAAO,a,MAyBbE,EAAW,M,4JA0EtBC,KAAAC,gBAA0B,E,cAtEyB,K,gBAKA,K,YAKJ,K,gBAKI,K,oBAWX,K,eAkBT,G,sBACW,G,eACF,K,kBAChB,M,qBACG,Q,iBACJ,M,sBACK,G,uBACC,G,kBACL,G,gBAC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,cAAU,MAAA9O,SAAA,SAAAA,EAAGuK,KAAe,CAAC0B,MAAO,IAAKC,OAAQ,KASnF,OACEf,EAAA,kCACEpL,WAAYT,KAAKS,WACjBgP,WAAYP,EAAiBtP,GAC7BO,SAAUH,KAAKG,SACfuP,aAAcH,EAAS5C,MACvBgD,cAAeJ,EAAS3C,OACxB3B,WAAYA,EACZ2E,eAAgBhM,GAAK5D,KAAKuL,mBAAmB3H,GAC7CiC,KAAK,SACLgK,OAAQ,CACN,CAACxJ,KAAM,OAAQR,KAAM,UACrB,CAACQ,KAAM,WAAYR,KAAM,SAE3B,IAGG,KAKhB7F,KAAKoF,iBACJyG,EAAA,qBACEE,QAAQ,8CACRjI,QAAS,mBAAmB9D,KAAKoC,2HACjC6J,OAAQ,IAAOjM,KAAKoF,gBAAkB,QAIzCpF,KAAK4C,UACJiJ,EAAA,qBACEE,QAAQ,eACRjI,QAAS,sBAAsB9D,KAAKoC,sOACpC6J,OAAQ,KACNjM,KAAK4C,SAAW,MAChB5C,KAAK2C,OAAS,IAAI,IAKvB3C,KAAK6E,YACH7E,KAAKmH,aACJ0E,EAAA,sBACEA,EAAA,OAAKO,MAAM,mBACTP,EAAA,0B","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{getTemplate as t}from"@verdocs/js-sdk";const s=t=>typeof t;const n="";const o=s(n);const c=s(true);const e=s(0);const l=s(s);const r="type";const a="default";const i="Listener";const u="add";const f="Has";const d="Ids";const h="Table";const b=h+"s";const g=h+d;const T="Row";const _=T+"Count";const p=T+d;const v="Cell";const S=v+d;const w="Value";const m=w+"s";const C=w+d;const V=t=>n+t;const I=isFinite;const y=(t,s)=>t instanceof s;const R=t=>t==void 0;const J=(t,s,n)=>R(t)?n?.():s(t);const L=t=>t==o||t==c;const E=t=>s(t)==l;const O=t=>Array.isArray(t);const j=(t,s,n)=>t.slice(s,n);const N=t=>t.length;const F=(t,s)=>t.test(s);const M=(t,s)=>t.includes(s);const $=(t,s)=>t.every(s);const x=(t,s)=>N(t)===N(s)&&$(t,((t,n)=>s[n]===t));const A=(t,s)=>t.sort(s);const D=(t,s)=>t.forEach(s);const P=(t,s)=>t.map(s);const k=(t,s,n)=>t.reduce(s,n);const z=(t,...s)=>t.push(...s);const H=t=>t.shift();const W=Object;const q=t=>W.getPrototypeOf(t);const B=W.entries;const G=W.isFrozen;const K=t=>!R(t)&&J(q(t),(t=>t==W.prototype||R(q(t))),(()=>true));const Q=W.keys;const U=W.freeze;const X=(t,s)=>s in t;const Y=(t,s)=>{delete t[s];return t};const Z=(t,s)=>P(B(t),(([t,n])=>s(n,t)));const tt=t=>N(Q(t));const st=t=>K(t)&&tt(t)==0;const nt=(t,s,n,o=0)=>{if(R(t)||!K(t)||!o&&st(t)||G(t)){n?.();return false}Z(t,((n,o)=>{if(!s(n,o)){Y(t,o)}}));return o?true:!st(t)};const ot=t=>s=>k(ut(s),((s,n)=>s+t(n)),0);const ct=t=>t?.size??0;const et=ot(ct);const lt=ot(et);const rt=ot(lt);const at=(t,s)=>t?.has(s)??false;const it=t=>R(t)||ct(t)==0;const ut=t=>[...t?.values()??[]];const ft=t=>t.clear();const dt=(t,s)=>t?.forEach(s);const ht=(t,s)=>t?.delete(s);const bt=t=>new Map(t);const gt=t=>[...t?.keys()??[]];const Tt=(t,s)=>t?.get(s);const _t=(t,s)=>dt(t,((t,n)=>s(n,t)));const pt=(t,s)=>P([...t?.entries()??[]],(([t,n])=>s(n,t)));const vt=(t,s,n)=>R(n)?(ht(t,s),t):t?.set(s,n);const St=(t,s,n,o)=>{if(!at(t,s)){vt(t,s,n())}else{o?.(Tt(t,s))}return Tt(t,s)};const wt=(t,s,n,o=vt)=>{Z(s,((s,o)=>n(t,o,s)));_t(t,(n=>X(s,n)?0:o(t,n)));return t};const mt=(t,s,n,o)=>{const c={};dt(t,((t,e)=>{if(!n?.(t,e)){const n=s?s(t,e):t;if(!o?.(n)){c[e]=n}}}));return c};const Ct=(t,s,n)=>mt(t,(t=>mt(t,s,n)),it,st);const Vt=(t,s,n)=>mt(t,(t=>Ct(t,s,n)),it,st);const It=(t,s)=>{const n=bt();dt(t,((t,o)=>n.set(o,s?.(t)??t)));return n};const yt=t=>It(t,It);const Rt=t=>It(t,yt);const Jt=(t,s,n,o,c=0)=>J((n?St:Tt)(t,s[c],c>N(s)-2?n:bt),(e=>{if(c>N(s)-2){if(o?.(e)){vt(t,s[c])}return e}const l=Jt(e,s,n,o,c+1);if(it(e)){vt(t,s[c])}return l}));const Lt=t=>{const n=s(t);return L(n)||n==e&&I(t)?n:void 0};const Et=(t,s,n,o,c)=>R(c)?t.delCell(s,n,o,true):t.setCell(s,n,o,c);const Ot=(t,s,n)=>R(n)?t.delValue(s):t.setValue(s,n);const jt=t=>new Set(O(t)||R(t)?t:[t]);const Nt=(t,s)=>t?.add(s);const Ft=/^\d+$/;const Mt=()=>{const t=[];let s=0;return[o=>(o?H(t):null)??n+s++,s=>{if(F(Ft,s)&&N(t)<1e3){z(t,s)}}]};const $t=(t,s=[n])=>{const o=[];const c=(t,n)=>n==N(s)?z(o,t):s[n]===null?dt(t,(t=>c(t,n+1))):D([s[n],null],(s=>c(Tt(t,s),n+1)));c(t,0);return o};const xt=t=>{let s;const[o,c]=Mt();const e=bt();const l=(c,l,r,a=[],i=(()=>[]))=>{s??=t();const u=o(1);vt(e,u,[c,l,r,a,i]);Nt(Jt(l,r??[n],jt),u);return u};const r=(t,n,...o)=>D($t(t,n),(t=>dt(t,(t=>Tt(e,t)[0](s,...n??[],...o)))));const a=t=>J(Tt(e,t),(([,s,o])=>{Jt(s,o??[n],void 0,(s=>{ht(s,t);return it(s)?1:0}));vt(e,t);c(t);return o}));const i=t=>J(Tt(e,t),(([t,,n=[],o,c])=>{const e=(...l)=>{const r=N(l);if(r==N(n)){t(s,...l,...c(l))}else if(R(n[r])){D(o[r]?.(...l)??[],(t=>e(...l,t)))}else{e(...l,n[r])}};e()}));return[l,r,a,i]};const At=(t,s)=>(t??0)<(s??0)?-1:1;const Dt=t=>[t,t];const Pt=(t,s=et)=>s(t[0])+s(t[1]);const kt=()=>[bt(),bt()];const zt=t=>[...t];const Ht=([t,s])=>t===s;const Wt=JSON.stringify;const qt=JSON.parse;const Bt=t=>Wt(t,((t,s)=>y(s,Map)?W.fromEntries([...s]):s));const Gt=(t,s,n)=>vt(t,s,Tt(t,s)==-n?void 0:n);const Kt=()=>{let t;let s;let n=false;let o=false;let c=0;let l=[];const d=bt();const I=bt();const y=bt();const N=bt();const F=bt();const $=bt();const k=bt();const H=bt();const W=bt();const q=bt();const B=bt();const G=bt();const K=bt();const Q=bt();const tt=jt();const ot=bt();const ut=bt();const Jt=bt();const Ft=bt();const $t=kt();const Wt=kt();const Qt=kt();const Ut=kt();const Xt=kt();const Yt=kt();const Zt=kt();const ts=kt();const ss=kt();const ns=kt();const os=kt();const cs=kt();const es=kt();const ls=kt();const rs=kt();const as=kt();const is=kt();const us=kt();const fs=kt();const ds=kt();const hs=kt();const bs=kt();const gs=bt();const Ts=kt();const[_s,ps,vs,Ss]=xt((()=>jo));const ws=t=>nt(t,(t=>nt(t,Cs)));const ms=t=>nt(t,Cs);const Cs=t=>{if(!nt(t,((t,s)=>M([r,a],s)))){return false}const s=t[r];if(!L(s)&&s!=e){return false}if(Lt(t[a])!=s){Y(t,a)}return true};const Vs=O;const Is=t=>nt(t,ys,on);const ys=(s,n)=>(!t||at(B,n)||on(n))&&nt(s,((t,s)=>Rs(n,s,t)),(()=>on(n)));const Rs=(t,s,n,o)=>nt(o?n:Os(n,t,s),((o,c)=>J(Js(t,s,c,o),(t=>{n[c]=t;return true}),(()=>false))),(()=>on(t,s)));const Js=(s,n,o,c)=>t?J(Tt(Tt(B,s),o),(t=>Lt(c)!=t[r]?on(s,n,o,c,t[a]):c),(()=>on(s,n,o,c))):R(Lt(c))?on(s,n,o,c):c;const Ls=(t,s)=>nt(s?t:js(t),((s,n)=>J(Es(n,s),(s=>{t[n]=s;return true}),(()=>false))),(()=>cn()));const Es=(t,n)=>s?J(Tt(K,t),(s=>Lt(n)!=s[r]?cn(t,n,s[a]):n),(()=>cn(t,n))):R(Lt(n))?cn(t,n):n;const Os=(t,s,n)=>{J(Tt(G,s),(([o,c])=>{dt(o,((s,n)=>{if(!X(t,n)){t[n]=s}}));dt(c,(o=>{if(!X(t,o)){on(s,n,o)}}))}));return t};const js=t=>{if(s){dt(Q,((s,n)=>{if(!X(t,n)){t[n]=s}}));dt(tt,(s=>{if(!X(t,s)){cn(s)}}))}return t};const Ns=t=>wt(B,t,((t,s,n)=>{const o=bt();const c=jt();wt(St(B,s,bt),n,((t,s,n)=>{vt(t,s,n);J(n[a],(t=>vt(o,s,t)),(()=>Nt(c,s)))}));vt(G,s,[o,c])}),((t,s)=>{vt(B,s);vt(G,s)}));const Fs=t=>wt(K,t,((t,s,n)=>{vt(K,s,n);J(n[a],(t=>vt(Q,s,t)),(()=>Nt(tt,s)))}),((t,s)=>{vt(K,s);vt(Q,s);ht(tt,s)}));const Ms=t=>st(t)?co():zn(t);const $s=([t,s])=>{(st(t)?co:zn)(t);(st(s)?ao:Kn)(s)};const xs=t=>wt(Jt,t,((t,s,n)=>As(s,n)),((t,s)=>Gs(s)));const As=(t,s)=>wt(St(Jt,t,(()=>{Xs(t,1);vt(ot,t,Mt());vt(ut,t,bt());return bt()})),s,((s,n,o)=>Ds(t,s,n,o)),((s,n)=>Ks(t,s,n)));const Ds=(t,s,n,o,c)=>wt(St(s,n,(()=>{Ys(t,n,1);return bt()})),o,((s,o,c)=>Ps(t,n,s,o,c)),((o,e)=>Qs(t,s,n,o,e,c)));const Ps=(t,s,n,o,c)=>{if(!at(n,o)){Zs(t,s,o,1)}const e=Tt(n,o);if(c!==e){tn(t,s,o,e,c);vt(n,o,c)}};const ks=(t,s,n,o,c)=>J(Tt(s,n),(s=>Ps(t,n,s,o,c)),(()=>Ds(t,s,n,Os({[o]:c},t,n))));const zs=t=>st(t)?ao():Kn(t);const Hs=t=>wt(Ft,t,((t,s,n)=>Ws(s,n)),((t,s)=>Us(s)));const Ws=(t,s)=>{if(!at(Ft,t)){sn(t,1)}const n=Tt(Ft,t);if(s!==n){nn(t,n,s);vt(Ft,t,s)}};const qs=(t,s)=>{const[n]=Tt(ot,t);let o;do{o=n(s)}while(at(Tt(Jt,t),o));return o};const Bs=t=>Tt(Jt,t)??As(t,{});const Gs=t=>As(t,{});const Ks=(t,s,n)=>{const[,o]=Tt(ot,t);o(n);Ds(t,s,n,{},true)};const Qs=(t,s,n,o,c,e)=>{const l=Tt(Tt(G,t)?.[0],c);if(!R(l)&&!e){return Ps(t,n,o,c,l)}const r=s=>{tn(t,n,s,Tt(o,s));Zs(t,n,s,-1);vt(o,s)};if(R(l)){r(c)}else{_t(o,r)}if(it(o)){Ys(t,n,-1);if(it(vt(s,n))){Xs(t,-1);vt(Jt,t);vt(ot,t);vt(ut,t)}}};const Us=t=>{const s=Tt(Q,t);if(!R(s)){return Ws(t,s)}nn(t,Tt(Ft,t));sn(t,-1);vt(Ft,t)};const Xs=(t,s)=>Gt(d,t,s);const Ys=(t,s,n)=>Gt(St(N,t,bt),s,n)&&vt(y,t,St(y,t,(()=>0))+n);const Zs=(t,s,n,o)=>{const c=Tt(ut,t);const e=Tt(c,n)??0;if(e==0&&o==1||e==1&&o==-1){Gt(St(I,t,bt),n,o)}vt(c,n,e!=-o?e+o:null);Gt(St(St(F,t,bt),s,bt),n,o)};const tn=(t,s,n,o,c)=>{St(St(St($,t,bt),s,bt),n,(()=>[o,0]))[1]=c;l[3]?.(t,s,n,c)};const sn=(t,s)=>Gt(k,t,s);const nn=(t,s,n)=>{St(H,t,(()=>[s,0]))[1]=n;l[4]?.(t,n)};const on=(t,s,n,o,c)=>{z(St(St(St(W,t,bt),s,bt),n,(()=>[])),o);return c};const cn=(t,s,n)=>{z(St(q,t,(()=>[])),s);return n};const en=(t,s,n)=>J(Tt(Tt(Tt($,t),s),n),(([t,s])=>[true,t,s]),(()=>[false,...Dt(Vn(t,s,n))]));const ln=t=>J(Tt(H,t),(([t,s])=>[true,t,s]),(()=>[false,...Dt(Rn(t))]));const rn=t=>!it(W)&&!it(as[t])?dt(t?Rt(W):W,((s,n)=>dt(s,((s,o)=>dt(s,((s,c)=>ps(as[t],[n,o,c],s))))))):0;const an=t=>!it(q)&&!it(is[t])?dt(t?It(q):q,((s,n)=>ps(is[t],[n],s))):0;const un=(t,s,n,o)=>{if(!it(t)){ps(s,o,(()=>mt(t)));_t(t,((t,s)=>ps(n,[...o??[],t],s==1)));return 1}};const fn=t=>{const s=Jn();if(s!=n){ps($t[t],void 0,s)}const o=it(ns[t]);const c=it(es[t])&&it(ls[t])&&it(ss[t])&&it(os[t])&&it(Yt[t])&&it(Zt[t])&&it(ts[t])&&o&&it(Qt[t])&&it(Ut[t]);const e=it(rs[t])&&it(cs[t])&&it(Xt[t])&&it(Wt[t]);if(!c||!e){const s=t?[It(d),yt(I),It(y),yt(N),Rt(F),Rt($)]:[d,I,y,N,F,$];if(!c){un(s[0],Qt[t],Ut[t]);dt(s[1],((s,n)=>un(s,Yt[t],Zt[t],[n])));dt(s[2],((s,n)=>{if(s!=0){ps(ts[t],[n],vn(n))}}));const n=jt();dt(s[3],((s,c)=>{if(un(s,ss[t],os[t],[c])&&!o){ps(ns[t],[c,null]);Nt(n,c)}}));if(!o){dt(s[5],((s,o)=>{if(!at(n,o)){const n=jt();dt(s,(t=>dt(t,(([s,o],c)=>o!==s?Nt(n,c):ht(t,c)))));dt(n,(s=>ps(ns[t],[o,s])))}}))}dt(s[4],((s,n)=>dt(s,((s,o)=>un(s,es[t],ls[t],[n,o])))))}if(!e){let n;dt(s[5],((s,o)=>{let c;dt(s,((s,e)=>{let l;dt(s,(([s,r],a)=>{if(r!==s){ps(rs[t],[o,e,a],r,s,en);n=c=l=1}}));if(l){ps(cs[t],[o,e],en)}}));if(c){ps(Xt[t],[o],en)}}));if(n){ps(Wt[t],void 0,en)}}}};const dn=t=>{const s=Nn();if(s!=o){ps(us[t],void 0,s)}const n=it(ds[t])&&it(hs[t]);const c=it(bs[t])&&it(fs[t]);if(!n||!c){const s=t?[It(k),It(H)]:[k,H];if(!n){un(s[0],ds[t],hs[t])}if(!c){let n;dt(s[1],(([s,o],c)=>{if(o!==s){ps(bs[t],[c],o,s,ln);n=1}}));if(n){ps(fs[t],void 0,ln)}}}};const hn=(t,...s)=>{bo((()=>t(...P(s,V))));return jo};const bn=()=>[gn(),In()];const gn=()=>Vt(Jt);const Tn=()=>gt(Jt);const _n=t=>Ct(Tt(Jt,V(t)));const pn=t=>gt(Tt(ut,V(t)));const vn=t=>ct(Tt(Jt,V(t)));const Sn=t=>gt(Tt(Jt,V(t)));const wn=(t,s,n,o=0,c)=>P(j(A(pt(Tt(Jt,V(t)),((t,n)=>[R(s)?n:Tt(t,V(s)),n])),(([t],[s])=>At(t,s)*(n?-1:1))),o,R(c)?c:o+c),(([,t])=>t));const mn=(t,s)=>mt(Tt(Tt(Jt,V(t)),V(s)));const Cn=(t,s)=>gt(Tt(Tt(Jt,V(t)),V(s)));const Vn=(t,s,n)=>Tt(Tt(Tt(Jt,V(t)),V(s)),V(n));const In=()=>mt(Ft);const yn=()=>gt(Ft);const Rn=t=>Tt(Ft,V(t));const Jn=()=>!it(Jt);const Ln=t=>at(Jt,V(t));const En=(t,s)=>at(Tt(ut,V(t)),V(s));const On=(t,s)=>at(Tt(Jt,V(t)),V(s));const jn=(t,s,n)=>at(Tt(Tt(Jt,V(t)),V(s)),V(n));const Nn=()=>!it(Ft);const Fn=t=>at(Ft,V(t));const Mn=()=>Bt(Jt);const $n=()=>Bt(Ft);const xn=()=>Bt([Jt,Ft]);const An=()=>Bt(B);const Dn=()=>Bt(K);const Pn=()=>Bt([B,K]);const kn=t=>hn((()=>{const s=E(t)?t():t;if(Vs(s)){$s(s)}}));const zn=t=>hn((()=>Is(t)?xs(t):0));const Hn=(t,s)=>hn((t=>ys(s,t)?As(t,s):0),t);const Wn=(t,s,n)=>hn(((t,s)=>Rs(t,s,n)?Ds(t,Bs(t),s,n):0),t,s);const qn=(t,s,n=true)=>bo((()=>{let o=void 0;if(Rs(t,o,s)){t=V(t);Ds(t,Bs(t),o=qs(t,n?1:0),s)}return o}));const Bn=(t,s,n)=>hn(((t,s)=>{if(Rs(t,s,n,1)){const o=Bs(t);Z(n,((n,c)=>ks(t,o,s,c,n)))}}),t,s);const Gn=(t,s,n,o)=>hn(((t,s,n)=>J(Js(t,s,n,E(o)?o(Vn(t,s,n)):o),(o=>ks(t,Bs(t),s,n,o)))),t,s,n);const Kn=t=>hn((()=>Ls(t)?Hs(t):0));const Qn=t=>hn((()=>Ls(t,1)?Z(t,((t,s)=>Ws(s,t))):0));const Un=(t,s)=>hn((t=>J(Es(t,E(s)?s(Rn(t)):s),(s=>Ws(t,s)))),t);const Xn=t=>hn((()=>{Z(t[0],((t,s)=>R(t)?eo(s):Z(t,((t,n)=>R(t)?lo(s,n):Z(t,((t,o)=>Et(jo,s,n,o,t)))))));Z(t[1],((t,s)=>Ot(jo,s,t)))}));const Yn=t=>{try{Ms(qt(t))}catch{}return jo};const Zn=t=>{try{zs(qt(t))}catch{}return jo};const to=t=>hn((()=>{try{const[s,n]=qt(t);Ms(s);zs(n)}catch{Yn(t)}}));const so=s=>hn((()=>{if(t=ws(s)){Ns(s);if(!it(Jt)){const t=gn();co();zn(t)}}}));const no=t=>hn((()=>{if(s=ms(t)){const n=In();fo();ao();s=true;Fs(t);Kn(n)}}));const oo=(t,s)=>hn((()=>{so(t);no(s)}));const co=()=>hn((()=>xs({})));const eo=t=>hn((t=>at(Jt,t)?Gs(t):0),t);const lo=(t,s)=>hn(((t,s)=>J(Tt(Jt,t),(n=>at(n,s)?Ks(t,n,s):0))),t,s);const ro=(t,s,n,o)=>hn(((t,s,n)=>J(Tt(Jt,t),(c=>J(Tt(c,s),(e=>at(e,n)?Qs(t,c,s,e,n,o):0))))),t,s,n);const ao=()=>hn((()=>Hs({})));const io=t=>hn((t=>at(Ft,t)?Us(t):0),t);const uo=()=>hn((()=>{Ns({});t=false}));const fo=()=>hn((()=>{Fs({});s=false}));const ho=()=>hn((()=>{uo();fo()}));const bo=(t,s)=>{if(c!=-1){go();const n=t();po(s);return n}};const go=()=>{if(c!=-1){c++}if(c==1){l[0]?.();ps(gs)}return jo};const To=()=>[mt($,((t,s)=>Tt(d,s)===-1?void 0:mt(t,((t,n)=>Tt(Tt(N,s),n)===-1?void 0:mt(t,(([,t])=>t),(t=>Ht(t)))),it,st)),it,st),mt(H,(([,t])=>t),(t=>Ht(t))),1];const _o=()=>[!it($),!it(H),Vt($,zt,Ht),Vt(W),mt(H,zt,Ht),mt(q),mt(d),Ct(N),Vt(F),mt(k)];const po=t=>{if(c>0){c--;if(c==0){c=1;rn(1);if(!it($)){fn(1)}an(1);if(!it(H)){dn(1)}if(t?.(jo)){dt($,((t,s)=>dt(t,((t,n)=>dt(t,(([t],o)=>Et(jo,s,n,o,t)))))));ft($);dt(H,(([t],s)=>Ot(jo,s,t)));ft(H)}ps(Ts[0],void 0);c=-1;rn(0);if(!it($)){fn(0)}an(0);if(!it(H)){dn(0)}l[1]?.();ps(Ts[1],void 0);l[2]?.();c=0;n=Jn();o=Nn();D([d,I,y,N,F,$,W,k,H,q],ft)}}return jo};const vo=t=>dt(Jt,((s,n)=>t(n,(t=>dt(s,((s,n)=>t(n,(t=>_t(s,t)))))))));const So=(t,s)=>_t(Tt(ut,V(t)),s);const wo=(t,s)=>dt(Tt(Jt,V(t)),((t,n)=>s(n,(s=>_t(t,s)))));const mo=(t,s,n)=>_t(Tt(Tt(Jt,V(t)),V(s)),n);const Co=t=>_t(Ft,t);const Vo=(t,s,n,o,c,e,l)=>{let r=wn(t,s,n,o,c);return _s((()=>{const l=wn(t,s,n,o,c);if(!x(l,r)){r=l;e(jo,t,s,n,o,c,r)}}),ns[l?1:0],[t,s],[Tn])};const Io=t=>_s(t,gs);const yo=t=>_s(t,Ts[0]);const Ro=t=>_s(t,Ts[1]);const Jo=t=>{Ss(t);return jo};const Lo=t=>{vs(t);return jo};const Eo=()=>({hasTables:Pt($t),tables:Pt(Wt),tableIds:Pt(Qt),hasTable:Pt(Ut),table:Pt(Xt),tableCellIds:Pt(Yt),hasTableCell:Pt(Zt,lt),rowCount:Pt(ts),rowIds:Pt(ss),sortedRowIds:Pt(ns),hasRow:Pt(os,lt),row:Pt(cs,lt),cellIds:Pt(es,lt),hasCell:Pt(ls,rt),cell:Pt(rs,rt),invalidCell:Pt(as,rt),hasValues:Pt(us),values:Pt(fs),valueIds:Pt(ds),hasValue:Pt(hs),value:Pt(bs),invalidValue:Pt(is),transaction:et(gs)+Pt(Ts)});const Oo=(t,s,n,o,c)=>l=[t,s,n,o,c];const jo={getContent:bn,getTables:gn,getTableIds:Tn,getTable:_n,getTableCellIds:pn,getRowCount:vn,getRowIds:Sn,getSortedRowIds:wn,getRow:mn,getCellIds:Cn,getCell:Vn,getValues:In,getValueIds:yn,getValue:Rn,hasTables:Jn,hasTable:Ln,hasTableCell:En,hasRow:On,hasCell:jn,hasValues:Nn,hasValue:Fn,getTablesJson:Mn,getValuesJson:$n,getJson:xn,getTablesSchemaJson:An,getValuesSchemaJson:Dn,getSchemaJson:Pn,hasTablesSchema:()=>t,hasValuesSchema:()=>s,setContent:kn,setTables:zn,setTable:Hn,setRow:Wn,addRow:qn,setPartialRow:Bn,setCell:Gn,setValues:Kn,setPartialValues:Qn,setValue:Un,applyChanges:Xn,setTablesJson:Yn,setValuesJson:Zn,setJson:to,setTablesSchema:so,setValuesSchema:no,setSchema:oo,delTables:co,delTable:eo,delRow:lo,delCell:ro,delValues:ao,delValue:io,delTablesSchema:uo,delValuesSchema:fo,delSchema:ho,transaction:bo,startTransaction:go,getTransactionChanges:To,getTransactionLog:_o,finishTransaction:po,forEachTable:vo,forEachTableCell:So,forEachRow:wo,forEachCell:mo,forEachValue:Co,addSortedRowIdsListener:Vo,addStartTransactionListener:Io,addWillFinishTransactionListener:yo,addDidFinishTransactionListener:Ro,callListener:Jo,delListener:Lo,getListenerStats:Eo,isMergeable:()=>false,createStore:Kt,addListener:_s,callListeners:ps,setInternalListeners:Oo};Z({[f+b]:[0,$t,[],()=>[Jn()]],[b]:[0,Wt],[g]:[0,Qt],[f+h]:[1,Ut,[Tn],t=>[Ln(...t)]],[h]:[1,Xt,[Tn]],[h+S]:[1,Yt,[Tn]],[f+h+v]:[2,Zt,[Tn,pn],t=>[En(...t)]],[_]:[1,ts,[Tn]],[p]:[1,ss,[Tn]],[f+T]:[2,os,[Tn,Sn],t=>[On(...t)]],[T]:[2,cs,[Tn,Sn]],[S]:[2,es,[Tn,Sn]],[f+v]:[3,ls,[Tn,Sn,Cn],t=>[jn(...t)]],[v]:[3,rs,[Tn,Sn,Cn],t=>Dt(Vn(...t))],InvalidCell:[3,as],[f+m]:[0,us,[],()=>[Nn()]],[m]:[0,fs],[C]:[0,ds],[f+w]:[1,hs,[yn],t=>[Fn(...t)]],[w]:[1,bs,[yn],t=>Dt(Rn(t[0]))],InvalidValue:[1,is]},(([t,s,n,o],c)=>{jo[u+c+i]=(...c)=>_s(c[t],s[c[t+1]?1:0],t>0?j(c,0,t):void 0,n,o)}));return U(jo)};const Qt=Kt();Qt.delTables();Qt.delValues();console.log("[STORE] Data store initialized.");const Ut=(t,s)=>{try{return JSON.parse(t)}catch(t){return s||null}};const Xt=t=>{const s={};for(let n in t){if(typeof t[n]==="string"||typeof t[n]==="number"||typeof t[n]==="boolean"){s[n]=t[n]}else if(t[n]===null){s[`__null__${n}`]=""}else if(Array.isArray(t[n])){s[`__array__${n}`]=JSON.stringify(t[n])}else if(typeof t[n]==="object"){s[`__object__${n}`]=JSON.stringify(t[n])}}return s};const Yt=t=>{const s={};for(let n in t){if(n.startsWith("__null__")){s[n.replace("__null__","")]=null}else if(typeof t[n]==="string"&&n.startsWith("__array__")){s[n.replace("__array__","")]=Ut(t[n])}else if(typeof t[n]==="string"&&n.startsWith("__object__")){s[n.replace("__object__","")]=Ut(t[n])}else{s[n]=t[n]}}return s};const Zt={store:Qt,subscribe(t,s,n,o,c){if(Qt.hasRow(t,s)){c(Yt(Qt.getRow(t,s)))}const e=Qt.addRowListener(t,s,(()=>{const n=Qt.getRow(t,s);c(Yt(n))}));if(!Qt.hasRow(t,s)||o){console.log("[STORE] Loading/reloading",{tableId:t,rowId:s});n().then((n=>{Qt.setRow(t,s,Xt(n))})).catch((n=>{console.error("[STORE] Error getting row",{tableId:t,rowId:s,forceReload:o},n)}))}return e},unsubscribe(t){Qt.delListener(t)},async getTemplate(s,n,o=false){if(!o){if(!Qt.hasRow("templates",n)){return null}const t=Qt.getRow("templates",n);return Yt(t)}const c=await t(s,n);console.log("[STORE] Reloading template",c);Qt.setRow("templates",n,Xt(c));return c},updateTemplate(t,s){Qt.setRow("templates",t,Xt(s));return s},async getEnvelope(s,n,o=false){if(!o){if(!Qt.hasRow("envelopes",n)){return null}const t=Qt.getRow("envelopes",n);return Yt(t)}const c=await t(s,n);Qt.setRow("envelopes",n,Xt(c));return c},updateEnvelope(t,s){Qt.setRow("envelopes",t,Xt(s));return s},getField(t,s,n,o){if(t==="template"){const t=Qt.getRow("templates",s);const c=Yt(t);const e=(c.fields||[]).find((t=>t.name===n));const l=(c.roles||[]).map((t=>t.name));const r=l.findIndex((t=>t===e.role_name));return{index:Math.max(r,0),field:o||e}}else{const t=Qt.getRow("envelopes",s);const c=Yt(t);const e=(c.fields||[]).find((t=>t.name===n));const l=(c.recipients||[]).map((t=>t.role_name));const r=l.findIndex((t=>t===e.role_name));return{index:r,field:o||e}}}};export{Zt as S};
2
- //# sourceMappingURL=p-3828cb31.js.map