@verdocs/web-sdk 5.0.25 → 5.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) 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 +1 -1
  8. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-preview_6.cjs.entry.js +5 -2
  13. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  14. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  16. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +4 -1
  17. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  18. package/dist/components/{p-78de9e65.js → p-0e4ebc84.js} +3 -3
  19. package/dist/components/{p-78de9e65.js.map → p-0e4ebc84.js.map} +1 -1
  20. package/dist/components/{p-e4a97ad5.js → p-143a763f.js} +3 -3
  21. package/dist/components/{p-e4a97ad5.js.map → p-143a763f.js.map} +1 -1
  22. package/dist/components/{p-2d8b46e5.js → p-16b073b8.js} +2 -2
  23. package/dist/components/{p-2d8b46e5.js.map → p-16b073b8.js.map} +1 -1
  24. package/dist/components/{p-e9528d9f.js → p-1d4829fb.js} +3 -3
  25. package/dist/components/{p-e9528d9f.js.map → p-1d4829fb.js.map} +1 -1
  26. package/dist/components/{p-ca3e45f3.js → p-27a8eef0.js} +2 -2
  27. package/dist/components/{p-ca3e45f3.js.map → p-27a8eef0.js.map} +1 -1
  28. package/dist/components/{p-fcf13666.js → p-550377ba.js} +13 -13
  29. package/dist/components/{p-fcf13666.js.map → p-550377ba.js.map} +1 -1
  30. package/dist/components/{p-1ce18a42.js → p-619747d7.js} +2 -2
  31. package/dist/components/{p-1ce18a42.js.map → p-619747d7.js.map} +1 -1
  32. package/dist/components/{p-e95ded6b.js → p-631808d5.js} +18 -15
  33. package/dist/components/p-631808d5.js.map +1 -0
  34. package/dist/components/{p-e4799d51.js → p-7bd7baa6.js} +3 -3
  35. package/dist/components/{p-e4799d51.js.map → p-7bd7baa6.js.map} +1 -1
  36. package/dist/components/{p-1ab01232.js → p-813ed998.js} +3 -3
  37. package/dist/components/{p-1ab01232.js.map → p-813ed998.js.map} +1 -1
  38. package/dist/components/{p-a415ce22.js → p-8c965486.js} +3 -3
  39. package/dist/components/{p-a415ce22.js.map → p-8c965486.js.map} +1 -1
  40. package/dist/components/{p-681e7dd4.js → p-99128b47.js} +3 -3
  41. package/dist/components/{p-681e7dd4.js.map → p-99128b47.js.map} +1 -1
  42. package/dist/components/{p-53168eec.js → p-ac7694c0.js} +2 -2
  43. package/dist/components/{p-53168eec.js.map → p-ac7694c0.js.map} +1 -1
  44. package/dist/components/{p-ecfc85ae.js → p-b5e479db.js} +3 -3
  45. package/dist/components/{p-ecfc85ae.js.map → p-b5e479db.js.map} +1 -1
  46. package/dist/components/{p-f6156f7a.js → p-c422d9a0.js} +3 -3
  47. package/dist/components/{p-f6156f7a.js.map → p-c422d9a0.js.map} +1 -1
  48. package/dist/components/{p-c4c9feda.js → p-c4310332.js} +3 -3
  49. package/dist/components/{p-c4c9feda.js.map → p-c4310332.js.map} +1 -1
  50. package/dist/components/{p-91d65fde.js → p-c5045788.js} +3 -3
  51. package/dist/components/{p-91d65fde.js.map → p-c5045788.js.map} +1 -1
  52. package/dist/components/{p-3828cb31.js → p-d4be87ef.js} +29 -24
  53. package/dist/components/p-d4be87ef.js.map +1 -0
  54. package/dist/components/{p-28e3b2e3.js → p-d54466ed.js} +14 -14
  55. package/dist/components/{p-28e3b2e3.js.map → p-d54466ed.js.map} +1 -1
  56. package/dist/components/{p-eb2ad8d0.js → p-e39c327c.js} +2 -2
  57. package/dist/components/{p-eb2ad8d0.js.map → p-e39c327c.js.map} +1 -1
  58. package/dist/components/{p-eb12a71c.js → p-f238b25b.js} +2 -2
  59. package/dist/components/{p-eb12a71c.js.map → p-f238b25b.js.map} +1 -1
  60. package/dist/components/{p-bfed2f8d.js → p-f7cf2401.js} +2 -2
  61. package/dist/components/{p-bfed2f8d.js.map → p-f7cf2401.js.map} +1 -1
  62. package/dist/components/verdocs-build.js +20 -20
  63. package/dist/components/verdocs-envelope-recipient-link.js +1 -1
  64. package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
  65. package/dist/components/verdocs-envelope-sidebar.js +2 -2
  66. package/dist/components/verdocs-field-attachment.js +1 -1
  67. package/dist/components/verdocs-field-checkbox.js +1 -1
  68. package/dist/components/verdocs-field-date.js +1 -1
  69. package/dist/components/verdocs-field-dropdown.js +1 -1
  70. package/dist/components/verdocs-field-initial.js +1 -1
  71. package/dist/components/verdocs-field-payment.js +2 -2
  72. package/dist/components/verdocs-field-radio.js +1 -1
  73. package/dist/components/verdocs-field-signature.js +1 -1
  74. package/dist/components/verdocs-field-textarea.js +1 -1
  75. package/dist/components/verdocs-field-textbox.js +1 -1
  76. package/dist/components/verdocs-field-timestamp.js +1 -1
  77. package/dist/components/verdocs-preview.js +1 -1
  78. package/dist/components/verdocs-send.js +1 -1
  79. package/dist/components/verdocs-sign.js +2 -2
  80. package/dist/components/verdocs-template-attachments.js +1 -1
  81. package/dist/components/verdocs-template-build-tabs.js +1 -1
  82. package/dist/components/verdocs-template-document-page.js +1 -1
  83. package/dist/components/verdocs-template-field-properties.js +1 -1
  84. package/dist/components/verdocs-template-fields.js +1 -1
  85. package/dist/components/verdocs-template-role-properties.js +1 -1
  86. package/dist/components/verdocs-template-roles.js +1 -1
  87. package/dist/components/verdocs-view.js +1 -1
  88. package/dist/esm/{Datastore-3f924d94.js → Datastore-77cb8d9c.js} +29 -24
  89. package/dist/esm/Datastore-77cb8d9c.js.map +1 -0
  90. package/dist/esm/verdocs-build.entry.js +1 -1
  91. package/dist/esm/verdocs-checkbox_6.entry.js +1 -1
  92. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
  93. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
  94. package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
  95. package/dist/esm/verdocs-field-attachment_13.entry.js +1 -1
  96. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  97. package/dist/esm/verdocs-kba-dialog_2.entry.js +1 -1
  98. package/dist/esm/verdocs-menu-panel_2.entry.js +1 -1
  99. package/dist/esm/verdocs-preview_6.entry.js +5 -2
  100. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  101. package/dist/esm/verdocs-sign.entry.js +1 -1
  102. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  103. package/dist/esm-es5/Datastore-77cb8d9c.js +2 -0
  104. package/dist/esm-es5/Datastore-77cb8d9c.js.map +1 -0
  105. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-checkbox_6.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  116. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  118. package/dist/verdocs-web-sdk/{p-f6ed768d.entry.js → p-00063a35.entry.js} +2 -2
  119. package/dist/verdocs-web-sdk/{p-1902bf04.entry.js → p-104863b5.entry.js} +2 -2
  120. package/dist/verdocs-web-sdk/{p-9ab8bcaa.system.entry.js → p-1f2c019d.system.entry.js} +2 -2
  121. package/dist/verdocs-web-sdk/{p-fc29a754.entry.js → p-25aa3bd3.entry.js} +2 -2
  122. package/dist/verdocs-web-sdk/{p-b1a9dc79.entry.js → p-4e9a8e8e.entry.js} +2 -2
  123. package/dist/verdocs-web-sdk/p-4e9a8e8e.entry.js.map +1 -0
  124. package/dist/verdocs-web-sdk/p-52c3e8b0.system.js +2 -0
  125. package/dist/verdocs-web-sdk/p-52c3e8b0.system.js.map +1 -0
  126. package/dist/verdocs-web-sdk/{p-7975ec40.system.entry.js → p-578e65d4.system.entry.js} +2 -2
  127. package/dist/verdocs-web-sdk/{p-407c0725.system.entry.js → p-5bcf921b.system.entry.js} +2 -2
  128. package/dist/verdocs-web-sdk/{p-26106576.system.entry.js → p-5c065719.system.entry.js} +2 -2
  129. package/dist/verdocs-web-sdk/{p-7ffebea3.entry.js → p-5ebfe76c.entry.js} +2 -2
  130. package/dist/verdocs-web-sdk/{p-80952d72.system.entry.js → p-6e93814f.system.entry.js} +2 -2
  131. package/dist/verdocs-web-sdk/p-6e93814f.system.entry.js.map +1 -0
  132. package/dist/verdocs-web-sdk/{p-086ee7f1.system.entry.js → p-6eee289a.system.entry.js} +2 -2
  133. package/dist/verdocs-web-sdk/{p-cc230abf.entry.js → p-6f1e2f2f.entry.js} +2 -2
  134. package/dist/verdocs-web-sdk/{p-4e3790db.system.entry.js → p-70247599.system.entry.js} +2 -2
  135. package/dist/verdocs-web-sdk/{p-e84cf41e.entry.js → p-8369273d.entry.js} +2 -2
  136. package/dist/verdocs-web-sdk/{p-f84ba101.entry.js → p-a285560f.entry.js} +2 -2
  137. package/dist/verdocs-web-sdk/{p-75e53ae1.entry.js → p-b7799ec0.entry.js} +2 -2
  138. package/dist/verdocs-web-sdk/{p-a4d94e2e.entry.js → p-b8945173.entry.js} +2 -2
  139. package/dist/verdocs-web-sdk/{p-d4aff253.entry.js → p-b9fee1a7.entry.js} +2 -2
  140. package/dist/verdocs-web-sdk/{p-34c2298e.system.entry.js → p-cabfdb9d.system.entry.js} +2 -2
  141. package/dist/verdocs-web-sdk/{p-90690dde.system.entry.js → p-d1d95df4.system.entry.js} +2 -2
  142. package/dist/verdocs-web-sdk/{p-60da8e6b.entry.js → p-d3a8c6b8.entry.js} +2 -2
  143. package/dist/verdocs-web-sdk/p-d4be87ef.js +2 -0
  144. package/dist/verdocs-web-sdk/p-d4be87ef.js.map +1 -0
  145. package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
  146. package/dist/verdocs-web-sdk/{p-208a8b41.system.entry.js → p-e3efeb57.system.entry.js} +2 -2
  147. package/dist/verdocs-web-sdk/{p-dc5c275f.system.entry.js → p-e83d06d4.system.entry.js} +2 -2
  148. package/dist/verdocs-web-sdk/{p-32cf09f0.system.entry.js → p-ecfe8987.system.entry.js} +2 -2
  149. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  150. package/package.json +3 -3
  151. package/dist/cjs/Datastore-931fd77e.js.map +0 -1
  152. package/dist/components/p-3828cb31.js.map +0 -1
  153. package/dist/components/p-e95ded6b.js.map +0 -1
  154. package/dist/custom-elements.json +0 -2156
  155. package/dist/esm/Datastore-3f924d94.js.map +0 -1
  156. package/dist/esm-es5/Datastore-3f924d94.js +0 -2
  157. package/dist/esm-es5/Datastore-3f924d94.js.map +0 -1
  158. package/dist/verdocs-web-sdk/p-3828cb31.js +0 -2
  159. package/dist/verdocs-web-sdk/p-3828cb31.js.map +0 -1
  160. package/dist/verdocs-web-sdk/p-65be7617.system.js +0 -2
  161. package/dist/verdocs-web-sdk/p-65be7617.system.js.map +0 -1
  162. package/dist/verdocs-web-sdk/p-80952d72.system.entry.js.map +0 -1
  163. package/dist/verdocs-web-sdk/p-b1a9dc79.entry.js.map +0 -1
  164. /package/dist/verdocs-web-sdk/{p-f6ed768d.entry.js.map → p-00063a35.entry.js.map} +0 -0
  165. /package/dist/verdocs-web-sdk/{p-1902bf04.entry.js.map → p-104863b5.entry.js.map} +0 -0
  166. /package/dist/verdocs-web-sdk/{p-9ab8bcaa.system.entry.js.map → p-1f2c019d.system.entry.js.map} +0 -0
  167. /package/dist/verdocs-web-sdk/{p-fc29a754.entry.js.map → p-25aa3bd3.entry.js.map} +0 -0
  168. /package/dist/verdocs-web-sdk/{p-7975ec40.system.entry.js.map → p-578e65d4.system.entry.js.map} +0 -0
  169. /package/dist/verdocs-web-sdk/{p-407c0725.system.entry.js.map → p-5bcf921b.system.entry.js.map} +0 -0
  170. /package/dist/verdocs-web-sdk/{p-26106576.system.entry.js.map → p-5c065719.system.entry.js.map} +0 -0
  171. /package/dist/verdocs-web-sdk/{p-7ffebea3.entry.js.map → p-5ebfe76c.entry.js.map} +0 -0
  172. /package/dist/verdocs-web-sdk/{p-086ee7f1.system.entry.js.map → p-6eee289a.system.entry.js.map} +0 -0
  173. /package/dist/verdocs-web-sdk/{p-cc230abf.entry.js.map → p-6f1e2f2f.entry.js.map} +0 -0
  174. /package/dist/verdocs-web-sdk/{p-4e3790db.system.entry.js.map → p-70247599.system.entry.js.map} +0 -0
  175. /package/dist/verdocs-web-sdk/{p-e84cf41e.entry.js.map → p-8369273d.entry.js.map} +0 -0
  176. /package/dist/verdocs-web-sdk/{p-f84ba101.entry.js.map → p-a285560f.entry.js.map} +0 -0
  177. /package/dist/verdocs-web-sdk/{p-75e53ae1.entry.js.map → p-b7799ec0.entry.js.map} +0 -0
  178. /package/dist/verdocs-web-sdk/{p-a4d94e2e.entry.js.map → p-b8945173.entry.js.map} +0 -0
  179. /package/dist/verdocs-web-sdk/{p-d4aff253.entry.js.map → p-b9fee1a7.entry.js.map} +0 -0
  180. /package/dist/verdocs-web-sdk/{p-34c2298e.system.entry.js.map → p-cabfdb9d.system.entry.js.map} +0 -0
  181. /package/dist/verdocs-web-sdk/{p-90690dde.system.entry.js.map → p-d1d95df4.system.entry.js.map} +0 -0
  182. /package/dist/verdocs-web-sdk/{p-60da8e6b.entry.js.map → p-d3a8c6b8.entry.js.map} +0 -0
  183. /package/dist/verdocs-web-sdk/{p-208a8b41.system.entry.js.map → p-e3efeb57.system.entry.js.map} +0 -0
  184. /package/dist/verdocs-web-sdk/{p-dc5c275f.system.entry.js.map → p-e83d06d4.system.entry.js.map} +0 -0
  185. /package/dist/verdocs-web-sdk/{p-32cf09f0.system.entry.js.map → p-ecfe8987.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-272d51a4.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,sortFields,envelopeRecipientSubmit,getEnvelope,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,submitKbaPin,submitKbaIdentity,submitKbaChallengeResponse,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-bd656c37.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-3f924d94.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsSignCss='@-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:#4c56cb}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}';var VerdocsSignStyle0=verdocsSignCss;var inProgressMenuOptions=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var doneMenuOptions=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var VerdocsSign=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeLoaded=createEvent(this,"envelopeLoaded",7);this.envelopeUpdated=createEvent(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}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new VerdocsEndpoint({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,a,l,d,c;var h=this;return __generator(this,(function(u){switch(u.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}u.label=1;case 1:u.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,startSigningSession(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:a=u.sent(),l=a.envelope,d=a.recipient;console.log("[SIGN] Loaded signing session",l,d);this.recipient=d;this.envelope=l;Store.updateEnvelope(this.envelopeId,l);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==h.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. The sender has been notified."}else if(this.recipient.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){var t;console.log("[SIGN] KBA Step",e);h.kbaStep=e.kba_step;if(h.kbaStep==="failed"){h.fatalErrorHeader="Identity Verification Failed";h.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";h.isDone=true}else{h.kbaQuestions=((t=e.questions)===null||t===void 0?void 0:t.question)||[];h.kbaChoices=[]}})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:c=u.sent();console.log("[SIGN] Error with signing session",c);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(c.message,(r=c.response)===null||r===void 0?void 0:r.status,(o=c.response)===null||o===void 0?void 0:o.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,s;console.log("[SIGN] Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(s=t.response)===null||s===void 0?void 0:s.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,s,r,o,a,l;return __generator(this,(function(d){switch(d.label){case 0:o=e.detail.id;switch(o){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,envelopeRecipientDecline(this.endpoint,this.envelopeId,this.roleId)];case 4:a=d.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified.";return[3,7];case 5:window.print();(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){saveAttachment(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;updateDocumentFieldValue(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] saveFieldChange",e,t);updateEnvelopeField(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,s,r,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(n=e.response)===null||n===void 0?void 0:n.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.fatalErrorHeader="Signing Session Expired";i.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(r=i.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,s,r,o,a,l;var d=this;return __generator(this,(function(c){switch(c.label){case 0:i=t.target,n=i.value,s=i.checked;r=e.type;switch(r){case"textarea":return[3,1];case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}c.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}c.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 6:return[4,c.sent().blob()];case 7:o=c.sent();return[2,createInitials(this.endpoint,"initial",o).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.log("Error updating initials",e);d.showSpinner=false}))];case 8:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 9:return[4,c.sent().blob()];case 10:a=c.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e);d.showSpinner=false}))];case 11:l=t.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:s},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var t=e.value,i=t===void 0?"":t;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return isValidEmail(i);case"phone":return isValidPhone(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((function(t){return t.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));sortFields(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,a,l,d;var c=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.nextSubmits)return[3,5];h.label=1;case 1:h.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,envelopeRecipientSubmit(this.endpoint,this.envelopeId,this.roleId)];case 2:t=h.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){c.envelope=e;c.submitting=false})).catch((function(e){console.log("[SIGN] Error reloading envelope",e);c.submitting=false}));return[3,4];case 3:i=h.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:return[2];case 5:n=this.getSortedFillableFields().filter((function(e){return e.required&&!c.isFieldFilled(e)}));sortFields(n);s=n.findIndex((function(e){return e.name===c.focusedField}));r=s+1;if(r>=n.length){r=0}o=n[r];a=0;if(a<n.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){a++;r++;if(r>=n.length){r=0}o=n[r]}if(a>=n.length){o=null}if(o){l=getFieldId(o);d=document.getElementById(l);d===null||d===void 0?void 0:d.scrollIntoView({behavior:"smooth"});d===null||d===void 0?void 0:d.focusField();this.focusedField=o.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",t.map((function(e){return e.name})));this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(function(e){if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("deleted",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,deleteEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name)];case 2:n=o.sent();console.log("[SIGN] Deleted attachment",n);this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"&&t.type!=="attachment"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var s=formatFullName(this.recipient);i.setAttribute("initials",fullNameToInitials(s));i.setAttribute("name",s)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;var n=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,n);n.forEach((function(e,n){if(e.page!==i.pageNumber){return}var s=renderDocumentField("envelope",e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!s){return}if(Array.isArray(s)){s.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,s)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=renderDocumentField("envelope",e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:"Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.",buttonLabel:"OK",onNext:function(){window.location.reload()}}))}if(!this.envelope){return h(Host,null,h("verdocs-loader",null))}if(this.fatalErrorMessage){return h(Host,{class:{agreed:this.agreed}},h("div",{class:"fatal-error"},h("div",{class:"message"},h("div",{class:"header"},this.fatalErrorHeader),h("p",null,this.fatalErrorMessage))))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(t){t.preventDefault();t.stopPropagation();e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}if(!this.agreed){return h(Host,{class:"agreed"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"agree"},h("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:function(){return e.handleClickAgree()}}),h("ul",null,h("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",h("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),h("li",null,"Agree to Verdocs'"," ",h("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",h("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))}if(this.kbaStep==="pin"){return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){submitKbaPin(this.endpoint,this.envelopeId,this.roleId,t.detail).then((function(t){console.log("[SIGN] PIN code submission result",t);if(t.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var t,i;console.log("[SIGN] Error submitting PIN",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="identity"){return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e;var i=this;return __generator(this,(function(n){e=t.detail;submitKbaIdentity(this.endpoint,this.envelopeId,this.roleId,{firstName:e.first_name,lastName:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,ssnLast4:e.ssn_last_4}).then((function(e){console.log("[SIGN] Identity submission result",e);i.kbaStep=e.kba_step})).catch((function(e){var t,i;console.log("[SIGN] Error submitting identity",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify identity.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="challenge"){var t=this.kbaChoices.length;var i=this.kbaQuestions[t];return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?h("verdocs-spinner",null):h("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(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:t+1,steps:this.kbaQuestions.length,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,s,r,o,a;var l=this;return __generator(this,(function(d){switch(d.label){case 0:s=t.detail;this.kbaChoices=__spreadArray(__spreadArray([],this.kbaChoices,true),[s],false);if(!(this.kbaChoices.length>=this.kbaQuestions.length))return[3,4];r=this.kbaQuestions.map((function(e,t){return{type:e.type,answer:l.kbaChoices[t]}}));console.log("Submitting KBA responses",this.kbaChoices,r);d.label=1;case 1:d.trys.push([1,3,,4]);return[4,submitKbaChallengeResponse(this.endpoint,this.envelopeId,this.roleId,r)];case 2:o=d.sent();console.log("KBA challenge response",o);this.kbaStep=o.kba_step;if(this.kbaStep==="failed"){this.fatalErrorHeader="Identity Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{this.kbaQuestions=((e=o.questions)===null||e===void 0?void 0:e.question)||[];this.kbaChoices=[]}return[3,4];case 3:a=d.sent();console.log("Error submitting KBA challenge",a);this.kbaStep="";this.fatalErrorHeader="Unable to Verify Identity";this.fatalErrorMessage=((n=(i=a.response)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.error)||"Please try again later.";this.isDone=true;return[3,4];case 4:return[2]}}))}))}}))))}return h(Host,null,h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),!this.finishLater&&h("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(t){var i=integerSequence(1,t.pages);return h(Fragment,null,i.map((function(i){var n;var s=((n=t.page_sizes)===null||n===void 0?void 0:n[i])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:s.width,virtualHeight:s.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&h("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(){e.showDone=false;e.isDone=true}}),this.submitting||this.showSpinner&&h("verdocs-portal",null,h("div",{class:"spinner-overlay"},h("verdocs-spinner",null))))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-272d51a4.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,sortFields,envelopeRecipientSubmit,getEnvelope,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,submitKbaPin,submitKbaIdentity,submitKbaChallengeResponse,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-bd656c37.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-77cb8d9c.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsSignCss='@-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:#4c56cb}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}';var VerdocsSignStyle0=verdocsSignCss;var inProgressMenuOptions=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var doneMenuOptions=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var VerdocsSign=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeLoaded=createEvent(this,"envelopeLoaded",7);this.envelopeUpdated=createEvent(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}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new VerdocsEndpoint({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,a,l,d,c;var h=this;return __generator(this,(function(u){switch(u.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}u.label=1;case 1:u.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,startSigningSession(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:a=u.sent(),l=a.envelope,d=a.recipient;console.log("[SIGN] Loaded signing session",l,d);this.recipient=d;this.envelope=l;Store.updateEnvelope(this.envelopeId,l);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}));this.roleNames=this.sortedRecipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.roleNames.findIndex((function(e){return e==h.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. The sender has been notified."}else if(this.recipient.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){var t;console.log("[SIGN] KBA Step",e);h.kbaStep=e.kba_step;if(h.kbaStep==="failed"){h.fatalErrorHeader="Identity Verification Failed";h.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";h.isDone=true}else{h.kbaQuestions=((t=e.questions)===null||t===void 0?void 0:t.question)||[];h.kbaChoices=[]}})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:c=u.sent();console.log("[SIGN] Error with signing session",c);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(c.message,(r=c.response)===null||r===void 0?void 0:r.status,(o=c.response)===null||o===void 0?void 0:o.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,s;console.log("[SIGN] Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(s=t.response)===null||s===void 0?void 0:s.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,s,r,o,a,l;return __generator(this,(function(d){switch(d.label){case 0:o=e.detail.id;switch(o){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,envelopeRecipientDecline(this.endpoint,this.envelopeId,this.roleId)];case 4:a=d.sent();console.log("[SIGN] Decline result",a);(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified.";return[3,7];case 5:window.print();(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:{l=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(l){saveAttachment(this.endpoint,this.envelope,l.id).catch((function(e){console.log("[SIGN] Error downloading PDF",e)}));(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;updateDocumentFieldValue(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] saveFieldChange",e,t);updateEnvelopeField(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,s,r,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(n=e.response)===null||n===void 0?void 0:n.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.fatalErrorHeader="Signing Session Expired";i.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(r=i.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,s,r,o,a,l;var d=this;return __generator(this,(function(c){switch(c.label){case 0:i=t.target,n=i.value,s=i.checked;r=e.type;switch(r){case"textarea":return[3,1];case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:n})];case 2:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}c.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}c.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 6:return[4,c.sent().blob()];case 7:o=c.sent();return[2,createInitials(this.endpoint,"initial",o).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.log("Error updating initials",e);d.showSpinner=false}))];case 8:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 9:return[4,c.sent().blob()];case 10:a=c.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e);d.showSpinner=false}))];case 11:l=t.detail.formattedDate;if(l){return[2,this.saveFieldChange(e.name,{prepared:false,value:l})]}return[3,14];case 12:console.log("[SIGN] Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:s},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var t=e.value,i=t===void 0?"":t;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return isValidEmail(i);case"phone":return isValidPhone(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((function(t){return t.group===e.group})).some((function(e){return e.value==="true"}))}return e.value==="true";default:return false}};e.prototype.isFieldValid=function(e){return!e.required||this.isFieldFilled(e)};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));sortFields(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,a,l,d;var c=this;return __generator(this,(function(h){switch(h.label){case 0:if(!this.nextSubmits)return[3,5];h.label=1;case 1:h.trys.push([1,3,,4]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;return[4,envelopeRecipientSubmit(this.endpoint,this.envelopeId,this.roleId)];case 2:t=h.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){c.envelope=e;c.submitting=false})).catch((function(e){console.log("[SIGN] Error reloading envelope",e);c.submitting=false}));return[3,4];case 3:i=h.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:return[2];case 5:n=this.getSortedFillableFields().filter((function(e){return e.required&&!c.isFieldFilled(e)}));sortFields(n);s=n.findIndex((function(e){return e.name===c.focusedField}));r=s+1;if(r>=n.length){r=0}o=n[r];a=0;if(a<n.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){a++;r++;if(r>=n.length){r=0}o=n[r]}if(a>=n.length){o=null}if(o){l=getFieldId(o);d=document.getElementById(l);d===null||d===void 0?void 0:d.scrollIntoView({behavior:"smooth"});d===null||d===void 0?void 0:d.focusField();this.focusedField=o.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",t.map((function(e){return e.name})));this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(function(e){if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("deleted",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,deleteEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name)];case 2:n=o.sent();console.log("[SIGN] Deleted attachment",n);this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"&&t.type!=="attachment"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var s=formatFullName(this.recipient);i.setAttribute("initials",fullNameToInitials(s));i.setAttribute("name",s)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;var n=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,n);n.forEach((function(e,n){if(e.page!==i.pageNumber){return}var s=renderDocumentField("envelope",e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!s){return}if(Array.isArray(s)){s.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,s)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=renderDocumentField("envelope",e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:"Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.",buttonLabel:"OK",onNext:function(){window.location.reload()}}))}if(!this.envelope){return h(Host,null,h("verdocs-loader",null))}if(this.fatalErrorMessage){return h(Host,{class:{agreed:this.agreed}},h("div",{class:"fatal-error"},h("div",{class:"message"},h("div",{class:"header"},this.fatalErrorHeader),h("p",null,this.fatalErrorMessage))))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(t){t.preventDefault();t.stopPropagation();e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}if(!this.agreed){return h(Host,{class:"agreed"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"agree"},h("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:function(){return e.handleClickAgree()}}),h("ul",null,h("li",null,"Agree to use electronic records and signatures, and confirm you have read the"," ",h("a",{href:"https://verdocs.com/en/electronic-record-signature-disclosure/",target:"_blank"},"Electronic Record and Signatures Disclosure"),"."),h("li",null,"Agree to Verdocs'"," ",h("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",h("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))}if(this.kbaStep==="pin"){return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){submitKbaPin(this.endpoint,this.envelopeId,this.roleId,t.detail).then((function(t){console.log("[SIGN] PIN code submission result",t);if(t.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var t,i;console.log("[SIGN] Error submitting PIN",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="identity"){return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e;var i=this;return __generator(this,(function(n){e=t.detail;submitKbaIdentity(this.endpoint,this.envelopeId,this.roleId,{firstName:e.first_name,lastName:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,ssnLast4:e.ssn_last_4}).then((function(e){console.log("[SIGN] Identity submission result",e);i.kbaStep=e.kba_step})).catch((function(e){var t,i;console.log("[SIGN] Error submitting identity",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify identity.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="challenge"){var t=this.kbaChoices.length;var i=this.kbaQuestions[t];return h(Host,{class:"kba"},h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name))),h("div",{class:"document",style:{paddingTop:"15px"}},h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),h("div",{class:"cover"},h("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?h("verdocs-spinner",null):h("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(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:t+1,steps:this.kbaQuestions.length,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,s,r,o,a;var l=this;return __generator(this,(function(d){switch(d.label){case 0:s=t.detail;this.kbaChoices=__spreadArray(__spreadArray([],this.kbaChoices,true),[s],false);if(!(this.kbaChoices.length>=this.kbaQuestions.length))return[3,4];r=this.kbaQuestions.map((function(e,t){return{type:e.type,answer:l.kbaChoices[t]}}));console.log("Submitting KBA responses",this.kbaChoices,r);d.label=1;case 1:d.trys.push([1,3,,4]);return[4,submitKbaChallengeResponse(this.endpoint,this.envelopeId,this.roleId,r)];case 2:o=d.sent();console.log("KBA challenge response",o);this.kbaStep=o.kba_step;if(this.kbaStep==="failed"){this.fatalErrorHeader="Identity Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{this.kbaQuestions=((e=o.questions)===null||e===void 0?void 0:e.question)||[];this.kbaChoices=[]}return[3,4];case 3:a=d.sent();console.log("Error submitting KBA challenge",a);this.kbaStep="";this.fatalErrorHeader="Unable to Verify Identity";this.fatalErrorMessage=((n=(i=a.response)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.error)||"Please try again later.";this.isDone=true;return[3,4];case 4:return[2]}}))}))}}))))}return h(Host,null,h("div",{id:"verdocs-sign-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),!this.finishLater&&h("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(t){var i=integerSequence(1,t.pages);return h(Fragment,null,i.map((function(i){var n;var s=((n=t.page_sizes)===null||n===void 0?void 0:n[i])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:s.width,virtualHeight:s.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&h("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){return e.showFinishLater=false}}),this.showDone&&h("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(){e.showDone=false;e.isDone=true}}),this.submitting||this.showSpinner&&h("verdocs-portal",null,h("div",{class:"spinner-overlay"},h("verdocs-spinner",null))))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
2
2
  //# sourceMappingURL=verdocs-sign.entry.js.map
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function n(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):i(e.value).then(s,n)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(r=1,i&&(a=n[0]&2?i["return"]:n[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;if(i=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];i=0}finally{r=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-272d51a4.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,j as getControlStyles,g as getFieldId}from"./utils-bd656c37.js";import{S as Store}from"./Datastore-3f924d94.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsTemplateDocumentPageCss="@-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-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,r=t;o<r.length;o++){var i=r[o];var a=i.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var r;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,r;var i=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var c=e,l=c.xScale,d=c.yScale,u=c.templateId,p=c.editable,f=c.disabled,b=c.done,m=c.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"textarea":return h("verdocs-field-textarea",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"date":return h("verdocs-field-date",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"attachment":return h("verdocs-field-attachment",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"dropdown":return h("verdocs-field-dropdown",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"initial":return h("verdocs-field-initial",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"signature":return h("verdocs-field-signature",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"checkbox":return h("verdocs-field-checkbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"radio":return h("verdocs-field-radio",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-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-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"98b2f6b2a2711df2cf8e687e38684d495b6e7d50",class:{}},h("div",{key:"49500d4d3348e2ccd6c9cbe7867645756c6cf5ef","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"e64aa823a8a09b10a9166f96be633439d959d3ff",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"399156e882824870173ecf3e4bcc35f2ba720b8c","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function n(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):i(e.value).then(s,n)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(r=1,i&&(a=n[0]&2?i["return"]:n[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;if(i=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];i=0}finally{r=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-272d51a4.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,j as getControlStyles,g as getFieldId}from"./utils-bd656c37.js";import{S as Store}from"./Datastore-77cb8d9c.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsTemplateDocumentPageCss="@-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-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,r=t;o<r.length;o++){var i=r[o];var a=i.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var r;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,r;var i=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var c=e,l=c.xScale,d=c.yScale,u=c.templateId,p=c.editable,f=c.disabled,b=c.done,m=c.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"textarea":return h("verdocs-field-textarea",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"date":return h("verdocs-field-date",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"attachment":return h("verdocs-field-attachment",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"dropdown":return h("verdocs-field-dropdown",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"initial":return h("verdocs-field-initial",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"signature":return h("verdocs-field-signature",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"checkbox":return h("verdocs-field-checkbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"radio":return h("verdocs-field-radio",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-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-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"98b2f6b2a2711df2cf8e687e38684d495b6e7d50",class:{}},h("div",{key:"49500d4d3348e2ccd6c9cbe7867645756c6cf5ef","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"e64aa823a8a09b10a9166f96be633439d959d3ff",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"399156e882824870173ecf3e4bcc35f2ba720b8c","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
2
2
  //# sourceMappingURL=verdocs-template-document-page_2.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-b9654a5e.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,j as n,g as p}from"./p-0c45b79c.js";import{S as h}from"./p-3828cb31.js";import{c as b}from"./p-68a5aaff.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const u="@-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-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";const m=u;const f=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,null,r)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return a(this)}};f.style=m;const g='@-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-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';const v=g;const x=class{constructor(t){e(this,t);this.text="";this.icon="";this.placement="bottom";this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=b(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")}render(){return i(o,{key:"98b2f6b2a2711df2cf8e687e38684d495b6e7d50",class:{}},i("div",{key:"49500d4d3348e2ccd6c9cbe7867645756c6cf5ef","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:e=>this.iconEl=e}),i("div",{key:"e64aa823a8a09b10a9166f96be633439d959d3ff",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"399156e882824870173ecf3e4bcc35f2ba720b8c","data-popper-arrow":"true",class:"arrow"})))}};x.style=v;export{f as verdocs_template_document_page,x as verdocs_toolbar_icon};
2
- //# sourceMappingURL=p-f6ed768d.entry.js.map
1
+ import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-b9654a5e.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,j as n,g as p}from"./p-0c45b79c.js";import{S as h}from"./p-d4be87ef.js";import{c as b}from"./p-68a5aaff.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const u="@-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-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";const m=u;const f=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,null,r)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return a(this)}};f.style=m;const g='@-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-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';const v=g;const x=class{constructor(t){e(this,t);this.text="";this.icon="";this.placement="bottom";this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=b(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")}render(){return i(o,{key:"98b2f6b2a2711df2cf8e687e38684d495b6e7d50",class:{}},i("div",{key:"49500d4d3348e2ccd6c9cbe7867645756c6cf5ef","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:e=>this.iconEl=e}),i("div",{key:"e64aa823a8a09b10a9166f96be633439d959d3ff",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"399156e882824870173ecf3e4bcc35f2ba720b8c","data-popper-arrow":"true",class:"arrow"})))}};x.style=v;export{f as verdocs_template_document_page,x as verdocs_toolbar_icon};
2
+ //# sourceMappingURL=p-00063a35.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,h as s,F as i,H as o}from"./p-b9654a5e.js";import{getRGBA as n}from"@verdocs/js-sdk";import{S as a}from"./p-b0766439.js";import{S as r}from"./p-3828cb31.js";const d='@-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-field-payment{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-payment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-payment .settings-icon svg{fill:#707ae5}verdocs-field-payment .settings-icon:hover{opacity:1}@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)}}';const l=d;const c=class{constructor(s){e(this,s);this.settingsChanged=t(this,"settingsChanged",7);this.deleted=t(this,"deleted",7);this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.done=false;this.editable=false;this.moveable=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.focused=false;this.fields=undefined;this.pageNum=undefined;this.roleName=undefined;this.fieldId=undefined;this.recipients=undefined;this.selectedRoleName=undefined;this.pdfPages=undefined;this.currentSignature=undefined;this.currentSignatureId=undefined;this.currentInitial=undefined;this.currentInitialId=undefined;this.signed=false;this.preparedMessage=undefined;this.signatureUrl="";this.roleindex=0}componentWillLoad(){if(this.recipients&&this.recipients.length>0){const e=this.recipients.find((e=>e.type==="preparer"));console.log("Found preparer",e);if(e){this.preparedMessage=`Prepared by ${e["full_name"]}`}}}async focusField(){this.focused=true;setTimeout((()=>{this.focused=false}),500)}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.showPanel){e.showPanel()}}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.hidePanel){e.hidePanel()}}render(){const{source:e,sourceid:t,fieldname:d,editable:l=false,done:c=false,disabled:f=false,focused:p,xscale:h=1,yscale:g=1}=this;const{index:u,field:b}=r.getField(e,t,d,this.field);const m=n(u);if(!b){return s(i,null)}if(c){return s(o,{class:{done:c}},"$✓")}return s(o,{class:{focused:p,disabled:f},style:{backgroundColor:m}},s("button",{class:{hide:this.signed}},"$"),this.signed?s("div",{class:"frame"}):s("div",{style:{display:"none"}}),s("img",{width:"100%",height:"100%",src:this.signatureUrl,alt:"Payment Icon"}),l&&s(i,null,s("div",{id:`verdocs-settings-panel-trigger-${d}`,style:{transform:`scale(${Math.floor(1/h*1e3)/1e3}, ${Math.floor(1/g*1e3)/1e3})`},class:"settings-icon",innerHTML:a,onClick:e=>{e.stopPropagation();this.showingProperties=!this.showingProperties}}),this.showingProperties&&s("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${b.name}`,onClickAway:()=>this.showingProperties=false},s("verdocs-template-field-properties",{templateId:t,fieldName:b.name,onClose:()=>this.showingProperties=false,onDelete:()=>{var e;(e=this.deleted)===null||e===void 0?void 0:e.emit({fieldName:d});return this.hideSettingsPanel()},onSettingsChanged:e=>{var t;(t=this.settingsChanged)===null||t===void 0?void 0:t.emit(e.detail);return this.hideSettingsPanel()},helpText:"Check boxes allow the user to select one or more (non-exclusive) options."}))))}};c.style=l;export{c as verdocs_field_payment};
2
- //# sourceMappingURL=p-1902bf04.entry.js.map
1
+ import{r as e,c as t,h as s,F as i,H as o}from"./p-b9654a5e.js";import{getRGBA as n}from"@verdocs/js-sdk";import{S as a}from"./p-b0766439.js";import{S as r}from"./p-d4be87ef.js";const d='@-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-field-payment{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-payment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-payment .settings-icon svg{fill:#707ae5}verdocs-field-payment .settings-icon:hover{opacity:1}@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)}}';const l=d;const c=class{constructor(s){e(this,s);this.settingsChanged=t(this,"settingsChanged",7);this.deleted=t(this,"deleted",7);this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.done=false;this.editable=false;this.moveable=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.focused=false;this.fields=undefined;this.pageNum=undefined;this.roleName=undefined;this.fieldId=undefined;this.recipients=undefined;this.selectedRoleName=undefined;this.pdfPages=undefined;this.currentSignature=undefined;this.currentSignatureId=undefined;this.currentInitial=undefined;this.currentInitialId=undefined;this.signed=false;this.preparedMessage=undefined;this.signatureUrl="";this.roleindex=0}componentWillLoad(){if(this.recipients&&this.recipients.length>0){const e=this.recipients.find((e=>e.type==="preparer"));console.log("Found preparer",e);if(e){this.preparedMessage=`Prepared by ${e["full_name"]}`}}}async focusField(){this.focused=true;setTimeout((()=>{this.focused=false}),500)}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.showPanel){e.showPanel()}}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.hidePanel){e.hidePanel()}}render(){const{source:e,sourceid:t,fieldname:d,editable:l=false,done:c=false,disabled:f=false,focused:p,xscale:h=1,yscale:g=1}=this;const{index:u,field:b}=r.getField(e,t,d,this.field);const m=n(u);if(!b){return s(i,null)}if(c){return s(o,{class:{done:c}},"$✓")}return s(o,{class:{focused:p,disabled:f},style:{backgroundColor:m}},s("button",{class:{hide:this.signed}},"$"),this.signed?s("div",{class:"frame"}):s("div",{style:{display:"none"}}),s("img",{width:"100%",height:"100%",src:this.signatureUrl,alt:"Payment Icon"}),l&&s(i,null,s("div",{id:`verdocs-settings-panel-trigger-${d}`,style:{transform:`scale(${Math.floor(1/h*1e3)/1e3}, ${Math.floor(1/g*1e3)/1e3})`},class:"settings-icon",innerHTML:a,onClick:e=>{e.stopPropagation();this.showingProperties=!this.showingProperties}}),this.showingProperties&&s("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${b.name}`,onClickAway:()=>this.showingProperties=false},s("verdocs-template-field-properties",{templateId:t,fieldName:b.name,onClose:()=>this.showingProperties=false,onDelete:()=>{var e;(e=this.deleted)===null||e===void 0?void 0:e.emit({fieldName:d});return this.hideSettingsPanel()},onSettingsChanged:e=>{var t;(t=this.settingsChanged)===null||t===void 0?void 0:t.emit(e.detail);return this.hideSettingsPanel()},helpText:"Check boxes allow the user to select one or more (non-exclusive) options."}))))}};c.style=l;export{c as verdocs_field_payment};
2
+ //# sourceMappingURL=p-104863b5.entry.js.map
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,i,t,n){function s(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):s(e.value).then(r,a)}l((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(i){return l([e,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(t=0)),t)try{if(n=1,s&&(o=a[0]&2?s["return"]:a[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,a[1])).done)return o;if(s=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=i.call(e,t)}catch(e){a=[6,e];s=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-d738b5db.system.js","./p-9b26e4e0.system.js","./p-c8a15cb7.system.js","./p-65be7617.system.js","./p-2c5350ec.system.js"],(function(e){"use strict";var i,t,n,s,o,r,a,l,d,c,v,p,h,u,f,w,g,b;return{setters:[function(e){i=e.r;t=e.c;n=e.h;s=e.F;o=e.H},function(e){r=e.VerdocsEndpoint;a=e.getEnvelope;l=e.resendInvitation;d=e.cancelEnvelope;c=e.formatFullName;v=e.updateEnvelope;p=e.userIsEnvelopeOwner;h=e.capitalize},function(e){u=e.F},function(e){f=e.V},function(e){w=e.S},function(e){g=e.S},function(e){b=e.f}],execute:function(){var m='@-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-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;font-size:14px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:6px;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-name{-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:0 0 100px;flex:0 0 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}verdocs-envelope-sidebar .reminders{margin:15px 0 30px 0}verdocs-envelope-sidebar .reminders .form-row{margin:8px 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-sidebar .reminders .form-row .reminders-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row .form-label{-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row verdocs-text-input{margin:0;width:100px}';var x=m;var k=24*60*60*1e3;var C='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>';var y='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>';var z='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var M={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',idcard:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 10H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 14H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.16992 15.0001C6.37606 14.4141 6.75902 13.9065 7.26594 13.5475C7.77286 13.1884 8.37873 12.9956 8.99992 12.9956C9.62111 12.9956 10.227 13.1884 10.7339 13.5475C11.2408 13.9065 11.6238 14.4141 11.8299 15.0001" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 13C10.1046 13 11 12.1046 11 11C11 9.89543 10.1046 9 9 9C7.89543 9 7 9.89543 7 11C7 12.1046 7.89543 13 9 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 5H4C2.89543 5 2 5.89543 2 7V17C2 18.1046 2.89543 19 4 19H20C21.1046 19 22 18.1046 22 17V7C22 5.89543 21.1046 5 20 5Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',idcardslash:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 10H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 14H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.16992 15.0001C6.37606 14.4141 6.75902 13.9065 7.26594 13.5475C7.77286 13.1884 8.37873 12.9956 8.99992 12.9956C9.62111 12.9956 10.227 13.1884 10.7339 13.5475C11.2408 13.9065 11.6238 14.4141 11.8299 15.0001" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 13C10.1046 13 11 12.1046 11 11C11 9.89543 10.1046 9 9 9C7.89543 9 7 9.89543 7 11C7 12.1046 7.89543 13 9 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 5H4C2.89543 5 2 5.89543 2 7V17C2 18.1046 2.89543 19 4 19H20C21.1046 19 22 18.1046 22 17V7C22 5.89543 21.1046 5 20 5Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M2 2L22 22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',key:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.586 17.4139C2.2109 17.7889 2.00011 18.2975 2 18.8279V20.9999C2 21.2651 2.10536 21.5195 2.29289 21.707C2.48043 21.8946 2.73478 21.9999 3 21.9999H6C6.26522 21.9999 6.51957 21.8946 6.70711 21.707C6.89464 21.5195 7 21.2651 7 20.9999V19.9999C7 19.7347 7.10536 19.4803 7.29289 19.2928C7.48043 19.1053 7.73478 18.9999 8 18.9999H9C9.26522 18.9999 9.51957 18.8946 9.70711 18.707C9.89464 18.5195 10 18.2651 10 17.9999V16.9999C10 16.7347 10.1054 16.4803 10.2929 16.2928C10.4804 16.1053 10.7348 15.9999 11 15.9999H11.172C11.7024 15.9998 12.211 15.789 12.586 15.4139L13.4 14.5999C14.7898 15.0841 16.3028 15.0822 17.6915 14.5947C19.0801 14.1071 20.2622 13.1628 21.0444 11.916C21.8265 10.6693 22.1624 9.19409 21.9971 7.73165C21.8318 6.26922 21.1751 4.90617 20.1344 3.86549C19.0937 2.8248 17.7307 2.1681 16.2683 2.00281C14.8058 1.83751 13.3306 2.17341 12.0839 2.95556C10.8372 3.7377 9.89279 4.91979 9.40525 6.30844C8.91771 7.69708 8.91585 9.21008 9.4 10.5999L2.586 17.4139Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16.5 8C16.7761 8 17 7.77614 17 7.5C17 7.22386 16.7761 7 16.5 7C16.2239 7 16 7.22386 16 7.5C16 7.77614 16.2239 8 16.5 8Z" fill="black" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',keyslash:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.586 17.4139C2.2109 17.7889 2.00011 18.2975 2 18.8279V20.9999C2 21.2651 2.10536 21.5195 2.29289 21.707C2.48043 21.8946 2.73478 21.9999 3 21.9999H6C6.26522 21.9999 6.51957 21.8946 6.70711 21.707C6.89464 21.5195 7 21.2651 7 20.9999V19.9999C7 19.7347 7.10536 19.4803 7.29289 19.2928C7.48043 19.1053 7.73478 18.9999 8 18.9999H9C9.26522 18.9999 9.51957 18.8946 9.70711 18.707C9.89464 18.5195 10 18.2651 10 17.9999V16.9999C10 16.7347 10.1054 16.4803 10.2929 16.2928C10.4804 16.1053 10.7348 15.9999 11 15.9999H11.172C11.7024 15.9998 12.211 15.789 12.586 15.4139L13.4 14.5999C14.7898 15.0841 16.3028 15.0822 17.6915 14.5947C19.0801 14.1071 20.2622 13.1628 21.0444 11.916C21.8265 10.6693 22.1624 9.19409 21.9971 7.73165C21.8318 6.26922 21.1751 4.90617 20.1344 3.86549C19.0937 2.8248 17.7307 2.1681 16.2683 2.00281C14.8058 1.83751 13.3306 2.17341 12.0839 2.95556C10.8372 3.7377 9.89279 4.91979 9.40525 6.30844C8.91771 7.69708 8.91585 9.21008 9.4 10.5999L2.586 17.4139Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16.5 8C16.7761 8 17 7.77614 17 7.5C17 7.22386 16.7761 7 16.5 7C16.2239 7 16 7.22386 16 7.5C16 7.77614 16.2239 8 16.5 8Z" fill="black" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',pin:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 17V22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 10.76C8.9998 11.1321 8.89581 11.4967 8.69972 11.813C8.50363 12.1292 8.22321 12.3844 7.89 12.55L6.11 13.45C5.77679 13.6156 5.49637 13.8708 5.30028 14.187C5.10419 14.5033 5.0002 14.8679 5 15.24V16C5 16.2652 5.10536 16.5196 5.29289 16.7071C5.48043 16.8946 5.73478 17 6 17H18C18.2652 17 18.5196 16.8946 18.7071 16.7071C18.8946 16.5196 19 16.2652 19 16V15.24C18.9998 14.8679 18.8958 14.5033 18.6997 14.187C18.5036 13.8708 18.2232 13.6156 17.89 13.45L16.11 12.55C15.7768 12.3844 15.4964 12.1292 15.3003 11.813C15.1042 11.4967 15.0002 11.1321 15 10.76V7C15 6.73478 15.1054 6.48043 15.2929 6.29289C15.4804 6.10536 15.7348 6 16 6C16.5304 6 17.0391 5.78929 17.4142 5.41421C17.7893 5.03914 18 4.53043 18 4C18 3.46957 17.7893 2.96086 17.4142 2.58579C17.0391 2.21071 16.5304 2 16 2H8C7.46957 2 6.96086 2.21071 6.58579 2.58579C6.21071 2.96086 6 3.46957 6 4C6 4.53043 6.21071 5.03914 6.58579 5.41421C6.96086 5.78929 7.46957 6 8 6C8.26522 6 8.51957 6.10536 8.70711 6.29289C8.89464 6.48043 9 6.73478 9 7V10.76Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',pinslash:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 17V22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.0006 9.34V7C15.0006 6.73478 15.106 6.48043 15.2935 6.29289C15.4811 6.10536 15.7354 6 16.0006 6C16.5311 6 17.0398 5.78929 17.4148 5.41421C17.7899 5.03914 18.0006 4.53043 18.0006 4C18.0006 3.46957 17.7899 2.96086 17.4148 2.58579C17.0398 2.21071 16.5311 2 16.0006 2H7.89062" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M2 2L22 22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 9V10.76C8.9998 11.1321 8.89581 11.4967 8.69972 11.813C8.50363 12.1292 8.22321 12.3844 7.89 12.55L6.11 13.45C5.77679 13.6156 5.49637 13.8708 5.30028 14.187C5.10419 14.5033 5.0002 14.8679 5 15.24V16C5 16.2652 5.10536 16.5196 5.29289 16.7071C5.48043 16.8946 5.73478 17 6 17H17" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'};var D=e("verdocs_envelope_sidebar",function(){function e(e){i(this,e);this.sdkError=t(this,"sdkError",7);this.envelopeUpdated=t(this,"envelopeUpdated",7);this.toggle=t(this,"toggle",7);this.another=t(this,"another",7);this.envelopeListenerId=null;this.endpoint=r.getDefault();this.envelopeId="";this.activeTab=1;this.panelOpen=false;this.showRecipientDialog="";this.showCancelDialog=false;this.remindersEnabled=false;this.updatingReminders=false;this.initialReminder=null;this.followupReminders=null;this.loading=true;this.envelope=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t;return __generator(this,(function(n){try{this.endpoint.loadSession();if(!this.envelopeId){console.log("[SIDEBAR] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[SIDEBAR] Unable to start session, must be authenticated");return[2]}this.listenToEnvelope()}catch(n){console.log("[SIDEBAR] Error loading envelope",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new w(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(t=n.response)===null||t===void 0?void 0:t.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToEnvelope()};e.prototype.listenToEnvelope=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();g.subscribe("envelopes",this.envelopeId,(function(){return a(e.endpoint,e.envelopeId)}),false,(function(i){var t,n;e.envelope=i;e.loading=false;e.sortEnvelopeRecipients();e.initialReminder=(t=e.envelope)===null||t===void 0?void 0:t.initial_reminder;e.followupReminders=(n=e.envelope)===null||n===void 0?void 0:n.followup_reminders;e.remindersEnabled=!!e.initialReminder}));return[2]}))}))};e.prototype.unlistenToEnvelope=function(){if(this.envelopeListenerId){g.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}};e.prototype.sortEnvelopeRecipients=function(){var e;(((e=this.envelope)===null||e===void 0?void 0:e.recipients)||[]).sort((function(e,i){return e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence}))};e.prototype.setTab=function(e){var i;this.panelOpen=e!==this.activeTab||!this.panelOpen;(i=this.toggle)===null||i===void 0?void 0:i.emit({open:this.panelOpen});this.activeTab=e};e.prototype.canResendRecipient=function(e){var i;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes((i=this.envelope)===null||i===void 0?void 0:i.status)};e.prototype.handleRecipientAction=function(e,i){var t;console.log("[SIDEBAR] Recipient action",i,e);switch(i){case"reminder":l(this.endpoint,this.envelopeId,e.role_name).then((function(){f("Reminder Sent",{style:"success"})})).catch((function(e){console.log("[SIDEBAR] Error resending invitation",e);f("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":f("This feature will be enabled in a future release. Please try again later.",{style:"info"});break;case"details":f("This feature will be enabled in a future release. Please try again later.",{style:"info"});break}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:i})};e.prototype.handleCancelEnvelope=function(){var e=this;this.loading=true;d(this.endpoint,this.envelopeId).then((function(i){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){console.log("[SIDEBAR] Envelope canceled",i);f("Envelope canceled",{style:"success"});t=JSON.parse(JSON.stringify(this.envelope));t.status="canceled";g.updateEnvelope(this.envelopeId,t);this.loading=false;this.panelOpen=false;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:t,event:"canceled"});return[2]}))}))})).catch((function(i){console.log("[SIDEBAR] Error canceling envelope",i);e.loading=false;f("Error canceling envelope: "+i.message,{style:"error"})}))};e.prototype.prepareHistoryEntries=function(){var e=this;var i,t,n,s,o,r;var a=[];var l=((i=this.envelope)===null||i===void 0?void 0:i.history_entries)||[];a.push({icon:"pencil",message:"Envelope created.",date:new Date((t=this.envelope)===null||t===void 0?void 0:t.created_at)});if(((n=this.envelope)===null||n===void 0?void 0:n.status)==="complete"){a.push({icon:"pencil",message:"Envelope completed.",date:new Date((s=this.envelope)===null||s===void 0?void 0:s.updated_at)})}var d=l.some((function(e){return e.event==="owner:canceled"}));if(((o=this.envelope)===null||o===void 0?void 0:o.status)==="canceled"&&!d){a.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date((r=this.envelope)===null||r===void 0?void 0:r.canceled_at)})}l.forEach((function(i){var t;var n=(((t=e.envelope)===null||t===void 0?void 0:t.recipients)||[]).find((function(e){return e.role_name===i.role_name}));var s=c(n);switch(i.event.toLowerCase()){case"recipient:kba_verified":a.push({icon:"key",message:"KBA verification completed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:kba_failed":a.push({icon:"keyslash",message:"KBA verification failed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:id_verified":a.push({icon:"idcard",message:"ID verification completed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:id_failed":a.push({icon:"idcardslash",message:"ID verification failed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:pin_verified":a.push({icon:"pin",message:"PIN verification completed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:pin_failed":a.push({icon:"pinslash",message:"PIN verification failed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:signed":a.push({icon:"gesture",message:"Signed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:declined":a.push({icon:"clear",message:"Declined by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:opened":switch(i.event_detail){case"email":case"mail":a.push({icon:"visibility",message:"Opened by ".concat(s,", via email."),date:new Date(i.created_at)});break;case"sms":a.push({icon:"visibility",message:"Opened by ".concat(s,", via SMS."),date:new Date(i.created_at)});break;case"in_person_link":a.push({icon:"visibility",message:"Opened by ".concat(s,", via In-person link."),date:new Date(i.created_at)});break;case"in_app":a.push({icon:"visibility",message:"Opened by ".concat(s,", via dashboard."),date:new Date(i.created_at)});break;default:a.push({icon:"visibility",message:"Opened by ".concat(s,"."),date:new Date(i.created_at)})}break;case"recipient:submitted":switch(i.event_detail){case"approver":a.push({icon:"check_circle",message:"Approved by ".concat(s,"."),date:new Date(i.created_at)});break;default:a.push({icon:"send",message:"Submitted by ".concat(s,"."),date:new Date(i.created_at)});break}break;case"recipient:prepared":a.push({icon:"send",message:"Prepared by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:claimed":if(i.event_detail==="guest"){a.push({icon:"account_circle",message:"".concat(s," claimed the Envelope as a guest."),date:new Date(i.created_at)})}else if(i.event_detail==="profile"){a.push({icon:"verified_user",message:"".concat(s," claimed the Envelope as a verified user."),date:new Date(i.created_at)})}break;case"recipient:agreed":a.push({icon:"done",message:"".concat(s," agreed to use electronic records and signatures."),date:new Date(i.created_at)});break;case"recipient:invited":if(i.event_detail==="sms"){a.push({icon:"textsms",message:"".concat(s," has been invited via SMS."),date:new Date(i.created_at)})}else{a.push({icon:"mail",message:"".concat(s," has been invited via email."),date:new Date(i.created_at)})}break;case"recipient:reminder":if(i.event_detail==="sms"){a.push({icon:"textsms",message:"".concat(s," sent a reminder via SMS."),date:new Date(i.created_at)})}else{a.push({icon:"mail",message:"".concat(s," sent a reminder via email."),date:new Date(i.created_at)})}break;case"invitation:resent":a.push({icon:"mail",message:"Invitation was resent to ".concat(s).concat(i.event_detail==="reminder"?" by reminder":"","."),date:new Date(i.created_at)});break;case"envelope:cc":a.push({icon:"contact_mail",message:"A copy has been sent to ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:delegated":a.push({icon:"people",message:i.event_detail,date:new Date(i.created_at)});break;case"recipient:updated_info":a.push({icon:"perm_identity",message:i.event_detail,date:new Date(i.created_at)});break;case"owner:updated_recipient_info":a.push({icon:"perm_identity",message:i.event_detail,date:new Date(i.created_at)});break;case"created":a.push({icon:"create",message:"Envelope was created.",date:new Date(i.created_at)});break;case"completed":a.push({icon:"done_all",message:"Envelope was completed.",date:new Date(i.created_at)});break;case"envelope:canceled":case"envelope_canceled":case"canceled":case"owner:canceled":a.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(i.created_at)});break;case"owner:get_in_person_link":a.push({icon:"link",message:"Owner accessed the In-person link for ".concat(n,"."),date:new Date(i.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",i);break}}));a.sort((function(e,i){return i.date.getTime()-e.date.getTime()}));return a};e.prototype.handleToggleReminders=function(){if(this.remindersEnabled){return this.handleSetReminders(null,null)}else{return this.handleSetReminders(k,3*k)}};e.prototype.handleSetReminders=function(e,i){var t=this;console.log("Updating reminders...");this.updatingReminders=true;v(this.endpoint,this.envelopeId,{initial_reminder:e,followup_reminders:i}).then((function(e){console.log("Updated",e);g.updateEnvelope(t.envelopeId,e);t.initialReminder=e.initial_reminder;t.followupReminders=e.followup_reminders;t.remindersEnabled=!!e.initial_reminder;t.updatingReminders=false})).catch((function(e){var i,n,s;console.log("Error updating envelope",e);t.initialReminder=(i=t.envelope)===null||i===void 0?void 0:i.initial_reminder;t.followupReminders=(n=t.envelope)===null||n===void 0?void 0:n.followup_reminders;t.remindersEnabled=!!((s=t.envelope)===null||s===void 0?void 0:s.initial_reminder);t.updatingReminders=false;alert(e.response.data.error)}))};e.prototype.render=function(){var e=this;var i,t,r,a,l,d,v,f,w,g,m,x;if(this.loading){return n(o,null)}var D=p(this.endpoint.profile,this.envelope);var _=this.prepareHistoryEntries();var H=((i=this.envelope)===null||i===void 0?void 0:i.status)!=="pending"&&((t=this.envelope)===null||t===void 0?void 0:t.status)!=="in progress";return n(o,{class:this.panelOpen?"open":""},n("div",{class:"side-buttons"},n("button",{class:this.activeTab===1?"active":"",onClick:function(){return e.setTab(1)},innerHTML:C}),n("button",{class:this.activeTab===2?"active":"",onClick:function(){return e.setTab(2)},innerHTML:y}),n("button",{class:this.activeTab===3?"active":"",onClick:function(){return e.setTab(3)},innerHTML:z})),this.activeTab===1&&n("div",{class:"content"},n("div",{class:"title"},"Details"),n("div",{class:"label"},"Envelope ID"),n("div",{class:"value"},(r=this.envelope)===null||r===void 0?void 0:r.id),n("div",{class:"label"},"Date Created"),n("div",{class:"value"},b(new Date((a=this.envelope)===null||a===void 0?void 0:a.created_at),u)),n("div",{class:"label"},"Last Modified"),n("div",{class:"value"},b(new Date((l=this.envelope)===null||l===void 0?void 0:l.updated_at),u)),n("div",{class:"label"},"Status"),n("div",{class:"value"},h((d=this.envelope)===null||d===void 0?void 0:d.status)),n("div",{class:"label"},"Owner ID"),n("div",{class:"value"},(v=this.envelope)===null||v===void 0?void 0:v.profile_id),n("div",{class:"label"},"Owner Name"),n("div",{class:"value"},c((f=this.envelope)===null||f===void 0?void 0:f.profile)),n("div",{class:"label"},"Owner Email"),n("div",{class:"value"},(g=(w=this.envelope)===null||w===void 0?void 0:w.profile)===null||g===void 0?void 0:g.email)),this.activeTab===2&&n("div",{class:"content"},n("div",{class:"title"},"Recipients"),(m=this.envelope)===null||m===void 0?void 0:m.recipients.map((function(i,t){var s;var o=i.status!=="submitted"&&i.status!=="canceled"&&i.status!=="declined";var r=e.canResendRecipient(i);var a=c(i);return n("div",{class:"recipient-detail"},n("div",{class:"recipient-header"},n("div",{class:"recipient-number"},t+1),n("div",{class:"recipient-name"},i.role_name),n("div",{class:(s={"recipient-status":true},s[i.status]=true,s)},i.status),D&&!H&&n("verdocs-dropdown",{onOptionSelected:function(t){return e.handleRecipientAction(i,t.detail.id)},options:[{id:"reminder",label:"Send Reminder",disabled:!r},{id:"inperson",label:"Get In-Person Link",disabled:!o}]})),n("dic",{class:"recipient-content"},n("div",{class:"recipient-name"},a),n("div",{class:"recipient-name"},i.email),n("div",{class:"recipient-name"},i.phone)))})),D&&n("div",{class:"reminders"},n("div",{class:"form-row"},n("div",{class:"reminders-label"},"Reminders"),n("verdocs-switch",{disabled:H||this.updatingReminders,checked:this.remindersEnabled,onCheckedChange:function(){return e.handleToggleReminders()}})),this.remindersEnabled&&n(s,null,n("div",{class:"form-row"},"NOTE: Reminders will only be sent for up to 14 days."),n("div",{class:"form-row"},n("div",{class:"form-label"},"Initial Reminder (days):"),n("verdocs-text-input",{placeholder:"In hours...",disabled:H||this.updatingReminders,value:String(Math.floor(this.initialReminder/k)),onBlur:function(i){e.initialReminder=Number(i.target.value)*k;e.handleSetReminders(e.initialReminder,e.followupReminders)}})),n("div",{class:"form-row"},n("div",{class:"form-label"},"Follow-up Reminders:"),n("verdocs-text-input",{placeholder:"In hours...",disabled:H||this.updatingReminders,value:String(Math.floor(this.followupReminders/k)),onBlur:function(i){e.followupReminders=Number(i.target.value)*k;e.handleSetReminders(e.initialReminder,e.followupReminders)}})),n("div",{class:"form-row"},n("div",{class:"form-label"},"Next Reminder:"),n("div",{style:{color:"#dddddd"}},b(new Date((x=this.envelope)===null||x===void 0?void 0:x.next_reminder),"P p"))))),D&&n("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Envelope",onClick:function(){return e.showCancelDialog=!H},disabled:H})),this.activeTab===3&&n("div",{class:"content"},n("div",{class:"title"},"History"),_.map((function(e){return n("div",{class:"history-entry"},n("div",{class:"activity-icon",innerHTML:M[e.icon]||e.icon}),n("div",{class:"activity-details"},n("div",{class:"activity-text"},e.message),n("div",{class:"activity-date"},b(e.date,u))))}))),this.showRecipientDialog&&n("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:function(){return e.showRecipientDialog=""}}),this.showCancelDialog&&n("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:function(){e.showCancelDialog=false;e.handleCancelEnvelope()}}))};return e}());D.style=x}}}));
2
- //# sourceMappingURL=p-9ab8bcaa.system.entry.js.map
1
+ var __awaiter=this&&this.__awaiter||function(e,i,t,n){function s(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):s(e.value).then(r,a)}l((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(i){return l([e,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(t=0)),t)try{if(n=1,s&&(o=a[0]&2?s["return"]:a[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,a[1])).done)return o;if(s=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=i.call(e,t)}catch(e){a=[6,e];s=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-d738b5db.system.js","./p-9b26e4e0.system.js","./p-c8a15cb7.system.js","./p-52c3e8b0.system.js","./p-2c5350ec.system.js"],(function(e){"use strict";var i,t,n,s,o,r,a,l,d,c,v,p,h,u,f,w,g,b;return{setters:[function(e){i=e.r;t=e.c;n=e.h;s=e.F;o=e.H},function(e){r=e.VerdocsEndpoint;a=e.getEnvelope;l=e.resendInvitation;d=e.cancelEnvelope;c=e.formatFullName;v=e.updateEnvelope;p=e.userIsEnvelopeOwner;h=e.capitalize},function(e){u=e.F},function(e){f=e.V},function(e){w=e.S},function(e){g=e.S},function(e){b=e.f}],execute:function(){var m='@-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-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;font-size:14px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;gap:6px;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-name{-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:0 0 100px;flex:0 0 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}verdocs-envelope-sidebar .reminders{margin:15px 0 30px 0}verdocs-envelope-sidebar .reminders .form-row{margin:8px 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-sidebar .reminders .form-row .reminders-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row .form-label{-ms-flex:1;flex:1}verdocs-envelope-sidebar .reminders .form-row verdocs-text-input{margin:0;width:100px}';var x=m;var k=24*60*60*1e3;var C='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>';var y='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>';var z='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var M={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',idcard:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 10H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 14H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.16992 15.0001C6.37606 14.4141 6.75902 13.9065 7.26594 13.5475C7.77286 13.1884 8.37873 12.9956 8.99992 12.9956C9.62111 12.9956 10.227 13.1884 10.7339 13.5475C11.2408 13.9065 11.6238 14.4141 11.8299 15.0001" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 13C10.1046 13 11 12.1046 11 11C11 9.89543 10.1046 9 9 9C7.89543 9 7 9.89543 7 11C7 12.1046 7.89543 13 9 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 5H4C2.89543 5 2 5.89543 2 7V17C2 18.1046 2.89543 19 4 19H20C21.1046 19 22 18.1046 22 17V7C22 5.89543 21.1046 5 20 5Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',idcardslash:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 10H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 14H18" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.16992 15.0001C6.37606 14.4141 6.75902 13.9065 7.26594 13.5475C7.77286 13.1884 8.37873 12.9956 8.99992 12.9956C9.62111 12.9956 10.227 13.1884 10.7339 13.5475C11.2408 13.9065 11.6238 14.4141 11.8299 15.0001" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 13C10.1046 13 11 12.1046 11 11C11 9.89543 10.1046 9 9 9C7.89543 9 7 9.89543 7 11C7 12.1046 7.89543 13 9 13Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M20 5H4C2.89543 5 2 5.89543 2 7V17C2 18.1046 2.89543 19 4 19H20C21.1046 19 22 18.1046 22 17V7C22 5.89543 21.1046 5 20 5Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M2 2L22 22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',key:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.586 17.4139C2.2109 17.7889 2.00011 18.2975 2 18.8279V20.9999C2 21.2651 2.10536 21.5195 2.29289 21.707C2.48043 21.8946 2.73478 21.9999 3 21.9999H6C6.26522 21.9999 6.51957 21.8946 6.70711 21.707C6.89464 21.5195 7 21.2651 7 20.9999V19.9999C7 19.7347 7.10536 19.4803 7.29289 19.2928C7.48043 19.1053 7.73478 18.9999 8 18.9999H9C9.26522 18.9999 9.51957 18.8946 9.70711 18.707C9.89464 18.5195 10 18.2651 10 17.9999V16.9999C10 16.7347 10.1054 16.4803 10.2929 16.2928C10.4804 16.1053 10.7348 15.9999 11 15.9999H11.172C11.7024 15.9998 12.211 15.789 12.586 15.4139L13.4 14.5999C14.7898 15.0841 16.3028 15.0822 17.6915 14.5947C19.0801 14.1071 20.2622 13.1628 21.0444 11.916C21.8265 10.6693 22.1624 9.19409 21.9971 7.73165C21.8318 6.26922 21.1751 4.90617 20.1344 3.86549C19.0937 2.8248 17.7307 2.1681 16.2683 2.00281C14.8058 1.83751 13.3306 2.17341 12.0839 2.95556C10.8372 3.7377 9.89279 4.91979 9.40525 6.30844C8.91771 7.69708 8.91585 9.21008 9.4 10.5999L2.586 17.4139Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16.5 8C16.7761 8 17 7.77614 17 7.5C17 7.22386 16.7761 7 16.5 7C16.2239 7 16 7.22386 16 7.5C16 7.77614 16.2239 8 16.5 8Z" fill="black" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',keyslash:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.586 17.4139C2.2109 17.7889 2.00011 18.2975 2 18.8279V20.9999C2 21.2651 2.10536 21.5195 2.29289 21.707C2.48043 21.8946 2.73478 21.9999 3 21.9999H6C6.26522 21.9999 6.51957 21.8946 6.70711 21.707C6.89464 21.5195 7 21.2651 7 20.9999V19.9999C7 19.7347 7.10536 19.4803 7.29289 19.2928C7.48043 19.1053 7.73478 18.9999 8 18.9999H9C9.26522 18.9999 9.51957 18.8946 9.70711 18.707C9.89464 18.5195 10 18.2651 10 17.9999V16.9999C10 16.7347 10.1054 16.4803 10.2929 16.2928C10.4804 16.1053 10.7348 15.9999 11 15.9999H11.172C11.7024 15.9998 12.211 15.789 12.586 15.4139L13.4 14.5999C14.7898 15.0841 16.3028 15.0822 17.6915 14.5947C19.0801 14.1071 20.2622 13.1628 21.0444 11.916C21.8265 10.6693 22.1624 9.19409 21.9971 7.73165C21.8318 6.26922 21.1751 4.90617 20.1344 3.86549C19.0937 2.8248 17.7307 2.1681 16.2683 2.00281C14.8058 1.83751 13.3306 2.17341 12.0839 2.95556C10.8372 3.7377 9.89279 4.91979 9.40525 6.30844C8.91771 7.69708 8.91585 9.21008 9.4 10.5999L2.586 17.4139Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16.5 8C16.7761 8 17 7.77614 17 7.5C17 7.22386 16.7761 7 16.5 7C16.2239 7 16 7.22386 16 7.5C16 7.77614 16.2239 8 16.5 8Z" fill="black" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',pin:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 17V22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 10.76C8.9998 11.1321 8.89581 11.4967 8.69972 11.813C8.50363 12.1292 8.22321 12.3844 7.89 12.55L6.11 13.45C5.77679 13.6156 5.49637 13.8708 5.30028 14.187C5.10419 14.5033 5.0002 14.8679 5 15.24V16C5 16.2652 5.10536 16.5196 5.29289 16.7071C5.48043 16.8946 5.73478 17 6 17H18C18.2652 17 18.5196 16.8946 18.7071 16.7071C18.8946 16.5196 19 16.2652 19 16V15.24C18.9998 14.8679 18.8958 14.5033 18.6997 14.187C18.5036 13.8708 18.2232 13.6156 17.89 13.45L16.11 12.55C15.7768 12.3844 15.4964 12.1292 15.3003 11.813C15.1042 11.4967 15.0002 11.1321 15 10.76V7C15 6.73478 15.1054 6.48043 15.2929 6.29289C15.4804 6.10536 15.7348 6 16 6C16.5304 6 17.0391 5.78929 17.4142 5.41421C17.7893 5.03914 18 4.53043 18 4C18 3.46957 17.7893 2.96086 17.4142 2.58579C17.0391 2.21071 16.5304 2 16 2H8C7.46957 2 6.96086 2.21071 6.58579 2.58579C6.21071 2.96086 6 3.46957 6 4C6 4.53043 6.21071 5.03914 6.58579 5.41421C6.96086 5.78929 7.46957 6 8 6C8.26522 6 8.51957 6.10536 8.70711 6.29289C8.89464 6.48043 9 6.73478 9 7V10.76Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',pinslash:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 17V22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.0006 9.34V7C15.0006 6.73478 15.106 6.48043 15.2935 6.29289C15.4811 6.10536 15.7354 6 16.0006 6C16.5311 6 17.0398 5.78929 17.4148 5.41421C17.7899 5.03914 18.0006 4.53043 18.0006 4C18.0006 3.46957 17.7899 2.96086 17.4148 2.58579C17.0398 2.21071 16.5311 2 16.0006 2H7.89062" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M2 2L22 22" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 9V10.76C8.9998 11.1321 8.89581 11.4967 8.69972 11.813C8.50363 12.1292 8.22321 12.3844 7.89 12.55L6.11 13.45C5.77679 13.6156 5.49637 13.8708 5.30028 14.187C5.10419 14.5033 5.0002 14.8679 5 15.24V16C5 16.2652 5.10536 16.5196 5.29289 16.7071C5.48043 16.8946 5.73478 17 6 17H17" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'};var D=e("verdocs_envelope_sidebar",function(){function e(e){i(this,e);this.sdkError=t(this,"sdkError",7);this.envelopeUpdated=t(this,"envelopeUpdated",7);this.toggle=t(this,"toggle",7);this.another=t(this,"another",7);this.envelopeListenerId=null;this.endpoint=r.getDefault();this.envelopeId="";this.activeTab=1;this.panelOpen=false;this.showRecipientDialog="";this.showCancelDialog=false;this.remindersEnabled=false;this.updatingReminders=false;this.initialReminder=null;this.followupReminders=null;this.loading=true;this.envelope=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t;return __generator(this,(function(n){try{this.endpoint.loadSession();if(!this.envelopeId){console.log("[SIDEBAR] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[SIDEBAR] Unable to start session, must be authenticated");return[2]}this.listenToEnvelope()}catch(n){console.log("[SIDEBAR] Error loading envelope",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new w(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(t=n.response)===null||t===void 0?void 0:t.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToEnvelope()};e.prototype.listenToEnvelope=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();g.subscribe("envelopes",this.envelopeId,(function(){return a(e.endpoint,e.envelopeId)}),false,(function(i){var t,n;e.envelope=i;e.loading=false;e.sortEnvelopeRecipients();e.initialReminder=(t=e.envelope)===null||t===void 0?void 0:t.initial_reminder;e.followupReminders=(n=e.envelope)===null||n===void 0?void 0:n.followup_reminders;e.remindersEnabled=!!e.initialReminder}));return[2]}))}))};e.prototype.unlistenToEnvelope=function(){if(this.envelopeListenerId){g.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}};e.prototype.sortEnvelopeRecipients=function(){var e;(((e=this.envelope)===null||e===void 0?void 0:e.recipients)||[]).sort((function(e,i){return e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence}))};e.prototype.setTab=function(e){var i;this.panelOpen=e!==this.activeTab||!this.panelOpen;(i=this.toggle)===null||i===void 0?void 0:i.emit({open:this.panelOpen});this.activeTab=e};e.prototype.canResendRecipient=function(e){var i;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes((i=this.envelope)===null||i===void 0?void 0:i.status)};e.prototype.handleRecipientAction=function(e,i){var t;console.log("[SIDEBAR] Recipient action",i,e);switch(i){case"reminder":l(this.endpoint,this.envelopeId,e.role_name).then((function(){f("Reminder Sent",{style:"success"})})).catch((function(e){console.log("[SIDEBAR] Error resending invitation",e);f("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":f("This feature will be enabled in a future release. Please try again later.",{style:"info"});break;case"details":f("This feature will be enabled in a future release. Please try again later.",{style:"info"});break}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:i})};e.prototype.handleCancelEnvelope=function(){var e=this;this.loading=true;d(this.endpoint,this.envelopeId).then((function(i){return __awaiter(e,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){console.log("[SIDEBAR] Envelope canceled",i);f("Envelope canceled",{style:"success"});t=JSON.parse(JSON.stringify(this.envelope));t.status="canceled";g.updateEnvelope(this.envelopeId,t);this.loading=false;this.panelOpen=false;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:t,event:"canceled"});return[2]}))}))})).catch((function(i){console.log("[SIDEBAR] Error canceling envelope",i);e.loading=false;f("Error canceling envelope: "+i.message,{style:"error"})}))};e.prototype.prepareHistoryEntries=function(){var e=this;var i,t,n,s,o,r;var a=[];var l=((i=this.envelope)===null||i===void 0?void 0:i.history_entries)||[];a.push({icon:"pencil",message:"Envelope created.",date:new Date((t=this.envelope)===null||t===void 0?void 0:t.created_at)});if(((n=this.envelope)===null||n===void 0?void 0:n.status)==="complete"){a.push({icon:"pencil",message:"Envelope completed.",date:new Date((s=this.envelope)===null||s===void 0?void 0:s.updated_at)})}var d=l.some((function(e){return e.event==="owner:canceled"}));if(((o=this.envelope)===null||o===void 0?void 0:o.status)==="canceled"&&!d){a.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date((r=this.envelope)===null||r===void 0?void 0:r.canceled_at)})}l.forEach((function(i){var t;var n=(((t=e.envelope)===null||t===void 0?void 0:t.recipients)||[]).find((function(e){return e.role_name===i.role_name}));var s=c(n);switch(i.event.toLowerCase()){case"recipient:kba_verified":a.push({icon:"key",message:"KBA verification completed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:kba_failed":a.push({icon:"keyslash",message:"KBA verification failed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:id_verified":a.push({icon:"idcard",message:"ID verification completed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:id_failed":a.push({icon:"idcardslash",message:"ID verification failed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:pin_verified":a.push({icon:"pin",message:"PIN verification completed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:pin_failed":a.push({icon:"pinslash",message:"PIN verification failed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:signed":a.push({icon:"gesture",message:"Signed by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:declined":a.push({icon:"clear",message:"Declined by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:opened":switch(i.event_detail){case"email":case"mail":a.push({icon:"visibility",message:"Opened by ".concat(s,", via email."),date:new Date(i.created_at)});break;case"sms":a.push({icon:"visibility",message:"Opened by ".concat(s,", via SMS."),date:new Date(i.created_at)});break;case"in_person_link":a.push({icon:"visibility",message:"Opened by ".concat(s,", via In-person link."),date:new Date(i.created_at)});break;case"in_app":a.push({icon:"visibility",message:"Opened by ".concat(s,", via dashboard."),date:new Date(i.created_at)});break;default:a.push({icon:"visibility",message:"Opened by ".concat(s,"."),date:new Date(i.created_at)})}break;case"recipient:submitted":switch(i.event_detail){case"approver":a.push({icon:"check_circle",message:"Approved by ".concat(s,"."),date:new Date(i.created_at)});break;default:a.push({icon:"send",message:"Submitted by ".concat(s,"."),date:new Date(i.created_at)});break}break;case"recipient:prepared":a.push({icon:"send",message:"Prepared by ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:claimed":if(i.event_detail==="guest"){a.push({icon:"account_circle",message:"".concat(s," claimed the Envelope as a guest."),date:new Date(i.created_at)})}else if(i.event_detail==="profile"){a.push({icon:"verified_user",message:"".concat(s," claimed the Envelope as a verified user."),date:new Date(i.created_at)})}break;case"recipient:agreed":a.push({icon:"done",message:"".concat(s," agreed to use electronic records and signatures."),date:new Date(i.created_at)});break;case"recipient:invited":if(i.event_detail==="sms"){a.push({icon:"textsms",message:"".concat(s," has been invited via SMS."),date:new Date(i.created_at)})}else{a.push({icon:"mail",message:"".concat(s," has been invited via email."),date:new Date(i.created_at)})}break;case"recipient:reminder":if(i.event_detail==="sms"){a.push({icon:"textsms",message:"".concat(s," sent a reminder via SMS."),date:new Date(i.created_at)})}else{a.push({icon:"mail",message:"".concat(s," sent a reminder via email."),date:new Date(i.created_at)})}break;case"invitation:resent":a.push({icon:"mail",message:"Invitation was resent to ".concat(s).concat(i.event_detail==="reminder"?" by reminder":"","."),date:new Date(i.created_at)});break;case"envelope:cc":a.push({icon:"contact_mail",message:"A copy has been sent to ".concat(s,"."),date:new Date(i.created_at)});break;case"recipient:delegated":a.push({icon:"people",message:i.event_detail,date:new Date(i.created_at)});break;case"recipient:updated_info":a.push({icon:"perm_identity",message:i.event_detail,date:new Date(i.created_at)});break;case"owner:updated_recipient_info":a.push({icon:"perm_identity",message:i.event_detail,date:new Date(i.created_at)});break;case"created":a.push({icon:"create",message:"Envelope was created.",date:new Date(i.created_at)});break;case"completed":a.push({icon:"done_all",message:"Envelope was completed.",date:new Date(i.created_at)});break;case"envelope:canceled":case"envelope_canceled":case"canceled":case"owner:canceled":a.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(i.created_at)});break;case"owner:get_in_person_link":a.push({icon:"link",message:"Owner accessed the In-person link for ".concat(n,"."),date:new Date(i.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",i);break}}));a.sort((function(e,i){return i.date.getTime()-e.date.getTime()}));return a};e.prototype.handleToggleReminders=function(){if(this.remindersEnabled){return this.handleSetReminders(null,null)}else{return this.handleSetReminders(k,3*k)}};e.prototype.handleSetReminders=function(e,i){var t=this;console.log("Updating reminders...");this.updatingReminders=true;v(this.endpoint,this.envelopeId,{initial_reminder:e,followup_reminders:i}).then((function(e){console.log("Updated",e);g.updateEnvelope(t.envelopeId,e);t.initialReminder=e.initial_reminder;t.followupReminders=e.followup_reminders;t.remindersEnabled=!!e.initial_reminder;t.updatingReminders=false})).catch((function(e){var i,n,s;console.log("Error updating envelope",e);t.initialReminder=(i=t.envelope)===null||i===void 0?void 0:i.initial_reminder;t.followupReminders=(n=t.envelope)===null||n===void 0?void 0:n.followup_reminders;t.remindersEnabled=!!((s=t.envelope)===null||s===void 0?void 0:s.initial_reminder);t.updatingReminders=false;alert(e.response.data.error)}))};e.prototype.render=function(){var e=this;var i,t,r,a,l,d,v,f,w,g,m,x;if(this.loading){return n(o,null)}var D=p(this.endpoint.profile,this.envelope);var _=this.prepareHistoryEntries();var H=((i=this.envelope)===null||i===void 0?void 0:i.status)!=="pending"&&((t=this.envelope)===null||t===void 0?void 0:t.status)!=="in progress";return n(o,{class:this.panelOpen?"open":""},n("div",{class:"side-buttons"},n("button",{class:this.activeTab===1?"active":"",onClick:function(){return e.setTab(1)},innerHTML:C}),n("button",{class:this.activeTab===2?"active":"",onClick:function(){return e.setTab(2)},innerHTML:y}),n("button",{class:this.activeTab===3?"active":"",onClick:function(){return e.setTab(3)},innerHTML:z})),this.activeTab===1&&n("div",{class:"content"},n("div",{class:"title"},"Details"),n("div",{class:"label"},"Envelope ID"),n("div",{class:"value"},(r=this.envelope)===null||r===void 0?void 0:r.id),n("div",{class:"label"},"Date Created"),n("div",{class:"value"},b(new Date((a=this.envelope)===null||a===void 0?void 0:a.created_at),u)),n("div",{class:"label"},"Last Modified"),n("div",{class:"value"},b(new Date((l=this.envelope)===null||l===void 0?void 0:l.updated_at),u)),n("div",{class:"label"},"Status"),n("div",{class:"value"},h((d=this.envelope)===null||d===void 0?void 0:d.status)),n("div",{class:"label"},"Owner ID"),n("div",{class:"value"},(v=this.envelope)===null||v===void 0?void 0:v.profile_id),n("div",{class:"label"},"Owner Name"),n("div",{class:"value"},c((f=this.envelope)===null||f===void 0?void 0:f.profile)),n("div",{class:"label"},"Owner Email"),n("div",{class:"value"},(g=(w=this.envelope)===null||w===void 0?void 0:w.profile)===null||g===void 0?void 0:g.email)),this.activeTab===2&&n("div",{class:"content"},n("div",{class:"title"},"Recipients"),(m=this.envelope)===null||m===void 0?void 0:m.recipients.map((function(i,t){var s;var o=i.status!=="submitted"&&i.status!=="canceled"&&i.status!=="declined";var r=e.canResendRecipient(i);var a=c(i);return n("div",{class:"recipient-detail"},n("div",{class:"recipient-header"},n("div",{class:"recipient-number"},t+1),n("div",{class:"recipient-name"},i.role_name),n("div",{class:(s={"recipient-status":true},s[i.status]=true,s)},i.status),D&&!H&&n("verdocs-dropdown",{onOptionSelected:function(t){return e.handleRecipientAction(i,t.detail.id)},options:[{id:"reminder",label:"Send Reminder",disabled:!r},{id:"inperson",label:"Get In-Person Link",disabled:!o}]})),n("dic",{class:"recipient-content"},n("div",{class:"recipient-name"},a),n("div",{class:"recipient-name"},i.email),n("div",{class:"recipient-name"},i.phone)))})),D&&n("div",{class:"reminders"},n("div",{class:"form-row"},n("div",{class:"reminders-label"},"Reminders"),n("verdocs-switch",{disabled:H||this.updatingReminders,checked:this.remindersEnabled,onCheckedChange:function(){return e.handleToggleReminders()}})),this.remindersEnabled&&n(s,null,n("div",{class:"form-row"},"NOTE: Reminders will only be sent for up to 14 days."),n("div",{class:"form-row"},n("div",{class:"form-label"},"Initial Reminder (days):"),n("verdocs-text-input",{placeholder:"In hours...",disabled:H||this.updatingReminders,value:String(Math.floor(this.initialReminder/k)),onBlur:function(i){e.initialReminder=Number(i.target.value)*k;e.handleSetReminders(e.initialReminder,e.followupReminders)}})),n("div",{class:"form-row"},n("div",{class:"form-label"},"Follow-up Reminders:"),n("verdocs-text-input",{placeholder:"In hours...",disabled:H||this.updatingReminders,value:String(Math.floor(this.followupReminders/k)),onBlur:function(i){e.followupReminders=Number(i.target.value)*k;e.handleSetReminders(e.initialReminder,e.followupReminders)}})),n("div",{class:"form-row"},n("div",{class:"form-label"},"Next Reminder:"),n("div",{style:{color:"#dddddd"}},b(new Date((x=this.envelope)===null||x===void 0?void 0:x.next_reminder),"P p"))))),D&&n("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Envelope",onClick:function(){return e.showCancelDialog=!H},disabled:H})),this.activeTab===3&&n("div",{class:"content"},n("div",{class:"title"},"History"),_.map((function(e){return n("div",{class:"history-entry"},n("div",{class:"activity-icon",innerHTML:M[e.icon]||e.icon}),n("div",{class:"activity-details"},n("div",{class:"activity-text"},e.message),n("div",{class:"activity-date"},b(e.date,u))))}))),this.showRecipientDialog&&n("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:function(){return e.showRecipientDialog=""}}),this.showCancelDialog&&n("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:function(){e.showCancelDialog=false;e.handleCancelEnvelope()}}))};return e}());D.style=x}}}));
2
+ //# sourceMappingURL=p-1f2c019d.system.entry.js.map