@verdocs/web-sdk 2.0.17 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/cjs/{EnvelopeStore-2c06f2bd.js → EnvelopeStore-b60a1bd3.js} +1 -1
  2. package/dist/cjs/{Envelopes-dba86ae4.js → Envelopes-01c2e7e4.js} +21 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{utils-01940b1a.js → utils-65c99e57.js} +2 -2
  5. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +2 -2
  7. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +2 -2
  9. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -2
  10. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +40 -15
  12. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
  16. package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-field-signature.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +2 -3
  21. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -2
  22. package/dist/cjs/verdocs-pagination_3.cjs.entry.js +2 -2
  23. package/dist/cjs/verdocs-preview.cjs.entry.js +2 -2
  24. package/dist/cjs/verdocs-send.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-sign.cjs.entry.js +12 -3
  26. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
  27. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -2
  28. package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-view.cjs.entry.js +2 -2
  30. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  31. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +16 -14
  32. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +11 -2
  33. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.css +20 -0
  34. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +154 -18
  35. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +0 -1
  36. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.stories.js +1 -1
  37. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +1 -1
  38. package/dist/collection/components/templates/verdocs-template-reminders/verdocs-template-reminders.stories.js +1 -1
  39. package/dist/collection/components/templates/verdocs-template-sender/verdocs-template-sender.stories.js +1 -2
  40. package/dist/collection/utils/utils.js +1 -1
  41. package/dist/components/EnvelopeStore.js +1 -1
  42. package/dist/components/Envelopes.js +21 -1
  43. package/dist/components/utils.js +2 -2
  44. package/dist/components/verdocs-envelope-document-page2.js +1 -1
  45. package/dist/components/verdocs-field-attachment.js +84 -18
  46. package/dist/components/verdocs-field-textbox.js +0 -1
  47. package/dist/components/verdocs-sign.js +11 -2
  48. package/dist/components/verdocs-upload-dialog2.js +1 -1
  49. package/dist/custom-elements.json +1939 -0
  50. package/dist/docs.json +131 -6
  51. package/dist/esm/{EnvelopeStore-ab955cb5.js → EnvelopeStore-26315437.js} +1 -1
  52. package/dist/esm/{Envelopes-290f96cc.js → Envelopes-9ccae245.js} +21 -1
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/esm/{utils-f77d3ea6.js → utils-a3504472.js} +2 -2
  55. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  56. package/dist/esm/verdocs-contact-picker.entry.js +2 -2
  57. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  58. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +2 -2
  59. package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -2
  60. package/dist/esm/verdocs-envelopes-list.entry.js +2 -2
  61. package/dist/esm/verdocs-field-attachment.entry.js +40 -15
  62. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  63. package/dist/esm/verdocs-field-date.entry.js +2 -2
  64. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  65. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  66. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  67. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  68. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  69. package/dist/esm/verdocs-field-textarea.entry.js +2 -2
  70. package/dist/esm/verdocs-field-textbox.entry.js +2 -3
  71. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  72. package/dist/esm/verdocs-pagination_3.entry.js +2 -2
  73. package/dist/esm/verdocs-preview.entry.js +2 -2
  74. package/dist/esm/verdocs-send.entry.js +2 -2
  75. package/dist/esm/verdocs-sign.entry.js +12 -3
  76. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  77. package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
  78. package/dist/esm/verdocs-upload-dialog.entry.js +1 -1
  79. package/dist/esm/verdocs-view.entry.js +2 -2
  80. package/dist/esm/verdocs-web-sdk.js +1 -1
  81. package/dist/esm-es5/{EnvelopeStore-ab955cb5.js → EnvelopeStore-26315437.js} +1 -1
  82. package/dist/esm-es5/{Envelopes-290f96cc.js → Envelopes-9ccae245.js} +1 -1
  83. package/dist/esm-es5/loader.js +1 -1
  84. package/dist/esm-es5/{utils-f77d3ea6.js → utils-a3504472.js} +2 -2
  85. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  111. package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +40 -4
  112. package/dist/types/components.d.ts +50 -2
  113. package/dist/verdocs-web-sdk/{p-56536ba4.system.entry.js → p-00229e30.system.entry.js} +1 -1
  114. package/dist/verdocs-web-sdk/{p-e0806eca.system.entry.js → p-00b90b95.system.entry.js} +1 -1
  115. package/dist/verdocs-web-sdk/p-00dcb2d7.entry.js +1 -0
  116. package/dist/verdocs-web-sdk/{p-40fe601a.entry.js → p-0100e5cd.entry.js} +1 -1
  117. package/dist/verdocs-web-sdk/{p-e52e9076.system.js → p-02bda176.system.js} +1 -1
  118. package/dist/verdocs-web-sdk/p-08c75409.system.entry.js +1 -0
  119. package/dist/verdocs-web-sdk/p-0b0a2fbd.system.js +1 -0
  120. package/dist/verdocs-web-sdk/{p-be05b066.system.entry.js → p-0ec94d1b.system.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-63d12640.system.entry.js → p-10a58bc0.system.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-1aa0ddfd.system.entry.js → p-13da9776.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-1dc1c4ac.entry.js → p-1708f25d.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-636adf80.system.entry.js → p-29f70720.system.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-4edec688.system.entry.js → p-32d173cf.system.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/{p-351d9421.entry.js → p-369ea745.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/{p-42565a9f.system.entry.js → p-3ff21704.system.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-d94464f5.entry.js → p-43d78f20.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-421b0a64.system.entry.js → p-466ae9b3.system.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/{p-258bc811.entry.js → p-4e60b427.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-df3c31be.system.entry.js → p-53447ca3.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-070f734a.system.entry.js → p-543d12af.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-8df9800b.system.entry.js → p-5464c8f3.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-ecf9aa75.entry.js → p-5e3559ff.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  136. package/dist/verdocs-web-sdk/{p-7297edd7.system.entry.js → p-6785d5ea.system.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-662d8dac.system.entry.js → p-67a4588a.system.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-87e90c64.entry.js → p-6ce6c81f.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-bfafa7c4.system.entry.js → p-704b515e.system.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-4e8503ad.system.entry.js → p-70ca15f7.system.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-6e21282e.entry.js → p-71cce1d5.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-5b2f535e.entry.js → p-761cd04f.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-84361fd5.js → p-86433cb0.js} +2 -2
  144. package/dist/verdocs-web-sdk/{p-c56597a0.system.entry.js → p-890cd7fd.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-3fd755ce.system.entry.js → p-8dbb3599.system.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-943d774d.system.entry.js → p-94f811f6.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-62c24af3.entry.js → p-a5239b05.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-26fe07cf.js → p-aa637390.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-90c7fc43.system.entry.js → p-b288f867.system.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/p-b5591ddc.js +1 -0
  151. package/dist/verdocs-web-sdk/{p-15efc789.entry.js → p-b8ba7838.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/p-bbdb47e7.entry.js +1 -0
  153. package/dist/verdocs-web-sdk/{p-3f36465e.entry.js → p-bd287aad.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-b765d51a.entry.js → p-c3c0376a.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-643042c0.entry.js → p-c98dc1dc.entry.js} +1 -1
  156. package/dist/verdocs-web-sdk/p-c9fe8bad.system.entry.js +1 -0
  157. package/dist/verdocs-web-sdk/{p-ba9d70ce.entry.js → p-cbefbfda.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/{p-3b3d21cb.entry.js → p-d08dde38.entry.js} +1 -1
  159. package/dist/verdocs-web-sdk/{p-9077a801.system.js → p-d1020e11.system.js} +2 -2
  160. package/dist/verdocs-web-sdk/{p-96a6f76f.system.entry.js → p-d339db07.system.entry.js} +1 -1
  161. package/dist/verdocs-web-sdk/p-dfa2cada.system.entry.js +1 -0
  162. package/dist/verdocs-web-sdk/{p-3f08a2e3.entry.js → p-e16eedbd.entry.js} +1 -1
  163. package/dist/verdocs-web-sdk/{p-b3bb3dbd.entry.js → p-e23b9c03.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-58be5261.entry.js → p-e2ef1a46.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-d20e83c7.entry.js → p-e36f0402.entry.js} +1 -1
  166. package/dist/verdocs-web-sdk/{p-f755bc0b.entry.js → p-e6616a5e.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/{p-0d005d4f.entry.js → p-e749e4b8.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-36c79c81.entry.js → p-e8d9c730.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-8fc9f797.system.entry.js → p-f26a6d84.system.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  171. package/package.json +2 -2
  172. package/dist/verdocs-web-sdk/p-194b2dd7.system.entry.js +0 -1
  173. package/dist/verdocs-web-sdk/p-4cb3fa5f.system.js +0 -1
  174. package/dist/verdocs-web-sdk/p-72c63106.js +0 -1
  175. package/dist/verdocs-web-sdk/p-8a43a64d.system.entry.js +0 -1
  176. package/dist/verdocs-web-sdk/p-a59bad4d.entry.js +0 -1
  177. package/dist/verdocs-web-sdk/p-b399a6e5.entry.js +0 -1
  178. package/dist/verdocs-web-sdk/p-f01a4c71.system.entry.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/web-sdk",
3
- "version": "2.0.17",
3
+ "version": "2.0.20",
4
4
  "private": false,
5
5
  "description": "Verdocs Web SDK",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "@stencil/core": "2.20.0",
34
34
  "@stencil/store": "^2.0.4",
35
35
  "@svgdotjs/svg.js": "^3.2.0",
36
- "@verdocs/js-sdk": "^3.8.1",
36
+ "@verdocs/js-sdk": "^3.8.4",
37
37
  "choices.js": "^10.2.0",
38
38
  "date-fns": "^2.30.0",
39
39
  "flatpickr": "^4.6.13",
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function l(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,l)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(t){return s([e,t])}}function s(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++){if(o||!(r in t)){if(!o)o=Array.prototype.slice.call(t,0,r);o[r]=t[r]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-2dbc05c6.system.js","./p-327858f0.system.js"],(function(e){"use strict";var t,n,r,i,o;return{setters:[function(e){t=e.r;n=e.c;r=e.h;i=e.H},function(e){o=e.f}],execute:function(){var a='verdocs-upload-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-upload-dialog .dialog{width:300px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-upload-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-upload-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-upload-dialog .buttons verdocs-button{margin-left:16px}verdocs-upload-dialog .drop-target{padding:30px 15px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5f5;border:2px dashed #979797;min-height:260px;text-align:center;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:rgba(0, 0, 0, 0.54);opacity:1;margin:20px 0}verdocs-upload-dialog .drop-target p{margin:12px 0}verdocs-upload-dialog .drop-target.dragging-over{border:5px solid #4c56cb}verdocs-upload-dialog .drop-target>verdocs-button{margin:12px 0;display:inline-block}verdocs-upload-dialog .attachments{height:56px;font-size:0;margin:20px 0;padding:0 16px;line-height:56px;white-space:normal;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-upload-dialog .attachments .attachment{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-upload-dialog .attachments .attachment .icon{width:18px;height:18px;line-height:18px}verdocs-upload-dialog .attachments .attachment .icon.trash{cursor:pointer}verdocs-upload-dialog .attachments .attachment .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;padding:0 8px;font-size:14px;font-weight:400}';var l='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>';var s='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>';var d=e("verdocs_upload_dialog",function(){function e(e){t(this,e);this.exit=n(this,"exit",7);this.next=n(this,"next",7);this.draggingOver=false;this.decodedFiles=[]}e.prototype.handleCancel=function(){this.exit.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleCancel()}};e.prototype.handleDone=function(){this.next.emit(this.decodedFiles)};e.prototype.handleDragOver=function(e){e.preventDefault();this.draggingOver=true};e.prototype.handleDragLeave=function(e){e.preventDefault();this.draggingOver=false};e.prototype.handleDrop=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,i;return __generator(this,(function(a){switch(a.label){case 0:e.preventDefault();this.draggingOver=false;t=[];if(e.dataTransfer.items){for(n=0;n<e.dataTransfer.items.length;n++){if(e.dataTransfer.items[n].kind==="file"){r=e.dataTransfer.items[n].getAsFile();t.push(r)}}}else{t=e.dataTransfer.files}i=this;return[4,Promise.all(t.map(o))];case 1:i.decodedFiles=a.sent();return[2]}}))}))};e.prototype.handleRemoveAttachment=function(e){var t=__spreadArray([],this.decodedFiles,true);t.splice(e,1);this.decodedFiles=t};e.prototype.handleSelectFile=function(){var e;(e=this.fileInput)===null||e===void 0?void 0:e.click()};e.prototype.handleFileChange=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i;return __generator(this,(function(a){switch(a.label){case 0:n=[];for(r=0;r<((e=this.fileInput)===null||e===void 0?void 0:e.files.length);r++){n.push((t=this.fileInput)===null||t===void 0?void 0:t.files[r])}i=this;return[4,Promise.all(n.map(o))];case 1:i.decodedFiles=a.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;return r(i,null,r("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},r("div",{class:"dialog"},r("div",{class:"heading"},"Upload attachment"),this.decodedFiles.length<1?r("div",{class:{"drop-target":true,"dragging-over":this.draggingOver},onDragOver:function(t){return e.handleDragOver(t)},onDragLeave:function(t){return e.handleDragLeave(t)},onDrop:function(t){return e.handleDrop(t)}},r("p",null,"Drag and drop a file here..."),r("p",null,"- or -"),r("verdocs-button",{label:"Select a file...",onClick:function(){return e.handleSelectFile()}}),r("input",{type:"file",ref:function(t){return e.fileInput=t},style:{display:"none"},onChange:function(){return e.handleFileChange()}})):r("div",{class:"attachments"},this.decodedFiles.map((function(t,n){return r("div",{class:"attachment"},r("div",{class:"icon",innerHTML:s}),r("div",{class:"name"},t.name),r("div",{class:"icon trash",innerHTML:l,onClick:function(){return e.handleRemoveAttachment(n)}}))}))),r("div",{class:"buttons"},r("verdocs-button",{label:"Cancel",variant:"outline",onClick:function(){return e.handleCancel()}}),r("verdocs-button",{label:"Done",onClick:function(){return e.handleDone()},disabled:this.decodedFiles.length<1})))))};return e}());d.style=a}}}));
@@ -1 +0,0 @@
1
- System.register(["./p-54498887.system.js"],(function(n){"use strict";var t;return{setters:[function(n){t=n.d}],execute:function(){var e=undefined&&undefined.__awaiter||function(n,t,e,o){function r(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,i){function u(n){try{a(o.next(n))}catch(n){i(n)}}function c(n){try{a(o["throw"](n))}catch(n){i(n)}}function a(n){n.done?e(n.value):r(n.value).then(u,c)}a((o=o.apply(n,t||[])).next())}))};var o=undefined&&undefined.__generator||function(n,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(n){return function(t){return a([n,t])}}function a(c){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(o=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;r=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1];i=c;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(c);break}if(i[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];r=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var r=n("g",(function(n,t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.post("/envelopes/summary",{page:t}).then((function(n){return n.data}))]}))}))}));var i=n("s",(function(n,t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.post("/envelopes/search",t).then((function(n){return n.data}))]}))}))}));var u=n("e",(function(n,r){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.get("/envelopes/".concat(r.envelopeId,"/recipients/").concat(encodeURIComponent(r.roleId),"/invitation/").concat(r.inviteCode)).then((function(e){var o;var r=((o=e.headers)===null||o===void 0?void 0:o.signer_token)||"";var i=t(r);n.setToken(r);return{recipient:e.data,session:i,signerToken:r}}))]}))}))}));var c=n("a",(function(n,t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.get("/envelopes/".concat(t)).then((function(n){return n.data}))]}))}))}));var a=n("c",(function(n,t){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.put("/envelopes/".concat(t),{action:"cancel"}).then((function(n){return n.data}))]}))}))}));var f=n("b",(function(n,t,r){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.get("/envelopes/".concat(t,"/envelope_documents/").concat(r,"?file=true"),{responseType:"blob"}).then((function(n){return n.data}))]}))}))}));var d=n("u",(function(n,t,r,i){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.put("/envelopes/".concat(t,"/fields/").concat(r),i).then((function(n){return n.data}))]}))}))}));var v=n("f",(function(n,t,r,i){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.put("/envelopes/".concat(t,"/fields/").concat(r,"/signature/").concat(i)).then((function(n){return n.data}))]}))}))}));var s=n("h",(function(n,t,r,i){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.put("/envelopes/".concat(t,"/fields/").concat(r,"/initial/").concat(i)).then((function(n){return n.data}))]}))}))}));var l=n("d",(function(n,t,r){return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.get("/envelopes/".concat(t,"/fields/").concat(r,"/document"),{responseType:"blob"}).then((function(n){return n.data}))]}))}))}));var p=n("i",(function(n,t,r,i,u){if(u===void 0){u="original"}return e(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,n.api.get("/envelopes/".concat(t,"/envelope_documents/").concat(r,"/pages/").concat(i,"/image?type=").concat(u),{timeout:2e4,"axios-retry":{retries:5}}).then((function(n){return n.data}))]}))}))}));var h={};var y=n("t",(function(n,t){if(h[t]&&h[t].loaded+2e3<(new Date).getTime()){return h[t].envelope}return c(n,t).then((function(n){h[t]={loaded:(new Date).getTime(),envelope:n};return n}))}))}}}));
@@ -1 +0,0 @@
1
- import{d as n}from"./p-05788c2b.js";var e=function(n,e,t,i){return new(t||(t=Promise))((function(r,o){function u(n){try{f(i.next(n))}catch(n){o(n)}}function c(n){try{f(i.throw(n))}catch(n){o(n)}}function f(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(u,c)}f((i=i.apply(n,e||[])).next())}))},t=function(n,e){var t,i,r,o,u={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(f){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(u=0)),u;)try{if(t=1,i&&(r=2&c[0]?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,i=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!((r=(r=u.trys).length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){u.label=c[1];break}if(6===c[0]&&u.label<r[1]){u.label=r[1],r=c;break}if(r&&u.label<r[2]){u.label=r[2],u.ops.push(c);break}r[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(n,u)}catch(n){c=[6,n],i=0}finally{t=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,f])}}},i=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.post("/envelopes/summary",{page:i}).then((function(n){return n.data}))]}))}))},r=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.post("/envelopes/search",i).then((function(n){return n.data}))]}))}))},o=function(i,r){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,i.api.get("/envelopes/".concat(r.envelopeId,"/recipients/").concat(encodeURIComponent(r.roleId),"/invitation/").concat(r.inviteCode)).then((function(e){var t,r=(null===(t=e.headers)||void 0===t?void 0:t.signer_token)||"",o=n(r);return i.setToken(r),{recipient:e.data,session:o,signerToken:r}}))]}))}))},u=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.get("/envelopes/".concat(i)).then((function(n){return n.data}))]}))}))},c=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.put("/envelopes/".concat(i),{action:"cancel"}).then((function(n){return n.data}))]}))}))},f=function(n,i,r){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.get("/envelopes/".concat(i,"/envelope_documents/").concat(r,"?file=true"),{responseType:"blob"}).then((function(n){return n.data}))]}))}))},s=function(n,i,r,o){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.put("/envelopes/".concat(i,"/fields/").concat(r),o).then((function(n){return n.data}))]}))}))},v=function(n,i,r,o){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.put("/envelopes/".concat(i,"/fields/").concat(r,"/signature/").concat(o)).then((function(n){return n.data}))]}))}))},a=function(n,i,r,o){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.put("/envelopes/".concat(i,"/fields/").concat(r,"/initial/").concat(o)).then((function(n){return n.data}))]}))}))},d=function(n,i,r){return e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.get("/envelopes/".concat(i,"/fields/").concat(r,"/document"),{responseType:"blob"}).then((function(n){return n.data}))]}))}))},l=function(n,i,r,o,u){return void 0===u&&(u="original"),e(void 0,void 0,void 0,(function(){return t(this,(function(){return[2,n.api.get("/envelopes/".concat(i,"/envelope_documents/").concat(r,"/pages/").concat(o,"/image?type=").concat(u),{timeout:2e4,"axios-retry":{retries:5}}).then((function(n){return n.data}))]}))}))},p={},h=function(n,e){return p[e]&&p[e].loaded+2e3<(new Date).getTime()?p[e].envelope:u(n,e).then((function(n){return p[e]={loaded:(new Date).getTime(),envelope:n},n}))};export{u as a,f as b,c,d,o as e,v as f,i as g,a as h,l as i,r as s,h as t,s as u}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-05eb4fed.system.js"],(function(e){"use strict";var t,n,i,r,o;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H},function(e){o=e.g}],execute:function(){var s='verdocs-field-attachment{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:24px;height:24px;display:block;font-size:11px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-attachment.disabled{opacity:0.5}verdocs-field-attachment.disabled span{cursor:inherit}verdocs-field-attachment span{cursor:inherit;width:20px}verdocs-field-attachment.required span{border:1px solid #cc0000}verdocs-field-attachment.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';var a='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>';var l=e("verdocs_field_attachment",function(){function e(e){t(this,e);this.settingsChanged=n(this,"settingsChanged",7);this.templateid="";this.field=null;this.disabled=false;this.roleIndex=0;this.rerender=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.handleShow();return[2]}))}))};e.prototype.handleShow=function(){var e=this;this.dialog=document.createElement("verdocs-upload-dialog");this.dialog.open=true;this.dialog.addEventListener("exit",(function(){var t;return(t=e.dialog)===null||t===void 0?void 0:t.remove()}));document.addEventListener("done",(function(){var t;return(t=e.dialog)===null||t===void 0?void 0:t.remove()}));document.body.append(this.dialog)};e.prototype.showSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.showPanel){e.showPanel()}return[2]}))}))};e.prototype.hideSettingsPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.getElementById("verdocs-settings-panel-".concat(this.field.name));if(e&&e.hidePanel){e.hidePanel()}return[2]}))}))};e.prototype.render=function(){var e=this;var t,n,s,l;var d={x:0,y:0};if("settings"in this.field&&((t=this.field)===null||t===void 0?void 0:t.settings)){d=this.field.settings}else if("setting"in this.field&&((n=this.field)===null||n===void 0?void 0:n.setting)){d=this.field.setting}var u=(l=(s=this.disabled)!==null&&s!==void 0?s:d.disabled)!==null&&l!==void 0?l:false;var c=this.field["rgba"]||o(this.roleIndex);return i(r,{class:{required:d.required,disabled:u},style:{backgroundColor:c}},i("span",{innerHTML:a,onClick:function(){return!u&&e.handleShow()}}))};return e}());l.style=s}}}));
@@ -1 +0,0 @@
1
- import{r as e,c as i,h as t,H as s,F as o}from"./p-6d3e0994.js";import{e as n,t as l,u as a,f as r,h as d}from"./p-72c63106.js";import{R as h}from"./p-05788c2b.js";import{e as c,a as p,b as u}from"./p-3cd894ff.js";import{V as v}from"./p-af048fad.js";import{a as g,i as m}from"./p-e662f81b.js";import{f as x,i as f}from"./p-7291906c.js";import{b,u as w,a as y,r as k,c as S}from"./p-84361fd5.js";import{a as I}from"./p-de60d3a8.js";import{S as N}from"./p-7a1b2643.js";import{V as G}from"./p-ed416acf.js";import{f as F}from"./p-c220af42.js";import"./p-eab67c09.js";import"./p-aa124212.js";const j=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],z=[{id:"print",label:"Print"},{id:"download",label:"Download"}],R=class{constructor(t){e(this,t),this.sdkError=i(this,"sdkError",7),this.envelopeLoaded=i(this,"envelopeLoaded",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.endpoint=null,this.recipientIndex=-1,this.envelopeId=null,this.roleId=null,this.inviteCode=null,this.headerTargetId=null,this.envelope=null,this.roleNames=[],this.sortedRecipients=[],this.recipient=null,this.signerToken=null,this.hasSignature=!1,this.nextButtonLabel="Start",this.nextSubmits=!1,this.showSubmitDialog=!1,this.errorMessage="",this.focusedField="",this.submitting=!1,this.isDone=!1,this.showDone=!1,this.finishLater=!1,this.showFinishLater=!1,this.agreed=!1,this.documentsSingularPlural="document"}componentWillLoad(){this.endpoint=new v({sessionType:"signing"})}async componentWillRender(){var e,i,t,s,o,a,r;if(this.envelopeId)if(this.roleId)if(this.inviteCode)try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{session:e,recipient:i,signerToken:t}=await n(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode});console.log(`[SIGN] Loaded signing session ${e.email} / ${e.profile_id}`),this.recipient=i,console.log("[SIGN] We are recipient",this.recipient),this.signerToken=t,this.endpoint.setToken(t),this.agreed&&(this.nextButtonLabel="Next"),this.envelope=await l(this.endpoint,this.envelopeId),this.sortedRecipients=[...this.envelope.recipients],this.sortedRecipients.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence)),this.roleNames=this.sortedRecipients.map((e=>e.role_name)),this.envelope.documents.length>0&&(this.documentsSingularPlural="document(s)"),this.recipientIndex=this.roleNames.findIndex((e=>e==this.roleId)),this.recipientIndex>-1?(this.recipient=this.sortedRecipients[this.recipientIndex],this.agreed=this.recipient.agreed,console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)):console.log("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients),this.isDone=["submitted","canceled","declined"].includes(this.recipient.status),this.checkRecipientFields(),null===(s=this.envelopeLoaded)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope})}catch(e){console.log("Error with signing session",e),null===(o=this.sdkError)||void 0===o||o.emit(new N(e.message,null===(a=e.response)||void 0===a?void 0:a.status,null===(r=e.response)||void 0===r?void 0:r.data))}else null===(t=this.sdkError)||void 0===t||t.emit(new N("[SIGN] Missing required inviteCode",500,""));else null===(i=this.sdkError)||void 0===i||i.emit(new N("[SIGN] Missing required roleId",500,""));else null===(e=this.sdkError)||void 0===e||e.emit(new N("[SIGN] Missing required envelopId",500,""))}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-sign-header");e&&i&&(console.log("[SIGN] Moving header"),i.remove(),e.append(i))}handleClickAgree(){this.submitting=!0,c(this.endpoint,this.envelopeId,this.roleId,!0).then((()=>{var e;this.nextButtonLabel="Next",this.recipient.agreed=!0,this.submitting=!1,this.agreed=!0,null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("Update failure",e),this.submitting=!1,null===(i=this.sdkError)||void 0===i||i.emit(new N(e.message,null===(t=e.response)||void 0===t?void 0:t.status,null===(s=e.response)||void 0===s?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,o,n;switch(e.detail.id){case"later":this.finishLater=!0,this.showFinishLater=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":G("This feature will be available in an upcoming release."),null===(t=this.envelopeUpdated)||void 0===t||t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=!0;const e=await p(this.endpoint,this.envelopeId,this.roleId);console.log("Decline result",e),null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"}),this.submitting=!1,this.isDone=!0}break;case"print":window.print(),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":b(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((e=>{console.log("Error downloading PDF",e)})),null===(n=this.envelopeUpdated)||void 0===n||n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e),this.recipient.fields.forEach((t=>{t.name===e&&(t.settings=i.settings,w(t),this.checkRecipientFields())}))}saveFieldChange(e,i){console.log("[SIGN] updateRecipientFieldValue",e),a(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,l;401===(null===(i=e.response)||void 0===i?void 0:i.status)&&"jwt expired"===(null===(s=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===s?void 0:s.error)?(console.log("[SIGN] Signing session expired"),this.errorMessage="Signing session expired. Please reload your browser to continue."):console.log("[SIGN] Server error",e),null===(o=this.sdkError)||void 0===o||o.emit(new N(e.message,null===(n=e.response)||void 0===n?void 0:n.status,null===(l=e.response)||void 0===l?void 0:l.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textbox":return this.saveFieldChange(e.name,{prepared:!1,value:t});case"checkbox_group":{const t=e.settings.options.map((e=>({id:e.id,checked:i.target.checked})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"radio_button_group":{const t=e.settings.options.map((e=>({id:e.id,selected:i.target.value===e.id})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"dropdown":return this.saveFieldChange(e.name,{prepared:!1,value:i.detail});case"initial":const a=await(await fetch(i.detail)).blob();return(o=this.endpoint,"initial",n=a,l=new FormData,l.append("initial",n,"initial"),o.api.post("/initials",l).then((function(e){return e.data}))).then((async i=>{const t=await d(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"signature":const h=await(await fetch(i.detail)).blob();return function(e,i,t){var s=new FormData;return s.append("signature",t,"signature"),e.api.post("/signatures",s).then((function(e){return e.data}))}(this.endpoint,0,h).then((async i=>{const t=await r(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"date":const c=i.target.getAttribute("iso");console.log("Formatting date for save",c);const p=F(new Date(c),I);return console.log("Formatted",p),this.saveFieldChange(e.name,{prepared:!1,value:p});case"timestamp":console.log("Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("Unhandled field update",{value:t,checked:s},e)}var o,n,l}isFieldValid(e){var i,t,s,o,n,l,a;const{required:r=!1}=e,{result:d="",value:h="",base64:c=""}=e.settings||{};switch(e.type){case"textbox":switch((null===(i=e.settings)||void 0===i?void 0:i.validator)||""){case"email":return m(d);case"phone":return g(d);default:return!r||""!==d}case"signature":case"initial":return!r||""!==c;case"timestamp":return!0;case"textarea":case"date":case"attachment":return!r||""!==d;case"dropdown":return!r||""!==h;case"checkbox_group":const p=((null===(s=null===(t=e.settings)||void 0===t?void 0:t.options)||void 0===s?void 0:s.filter((e=>e.checked)))||[]).length;return!r||p>=((null===(o=e.settings)||void 0===o?void 0:o.minimum_checked)||0)&&p<=((null===(n=e.settings)||void 0===n?void 0:n.maximum_checked)||999);case"radio_button_group":return!r||((null===(a=null===(l=e.settings)||void 0===l?void 0:l.options)||void 0===a?void 0:a.filter((e=>e.selected)))||[]).length>0;default:return!1}}async handleNext(){var e;if(this.nextSubmits){try{this.submitting=!0;const e=await u(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",e),this.recipient.status="submitted",this.showDone=!0,this.isDone=!0,setTimeout((()=>{console.log("[SIGN] Reloading"),window.location.reload()}),1e3)}catch(e){console.log("[SIGN] Error submitting",e)}return void(this.submitting=!1)}const i=this.recipient.fields.filter((e=>e.required));let t=i.findIndex((e=>e.name===this.focusedField))+1;t>=i.length&&(t=0);let s=i[t],o=0;if(o<i.length&&["signature","initial"].includes(s.type)&&"signed"===(null===(e=s.settings)||void 0===e?void 0:e.result)&&(o++,t++,t>=i.length&&(t=0),s=i[t]),o>=i.length&&(s=null),s){const e=S(s),i=document.getElementById(e);null==i||i.focusField(),this.focusedField=s.name}}checkRecipientFields(){const e=this.recipient.fields.filter((e=>!this.isFieldValid(e)));e.length<1?(this.nextButtonLabel="Finish",this.nextSubmits||(this.showSubmitDialog=!0,this.nextSubmits=!0)):(console.log("[SIGN] Remaining invalid fields",e),this.nextButtonLabel="Next",this.nextSubmits=!1)}attachFieldAttributes(e,i,t,s){var o;s.addEventListener("input",(e=>{console.log("[SIGN] onfieldInput",e.detail,e.target.value),e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")?(console.log("CB",e.target),this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))):this.checkRecipientFields()})),s.addEventListener("focusout",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),s.addEventListener("fieldChange",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),s.setAttribute("page",e.pageNumber),s.setAttribute("roleindex",t),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("initials",this.recipient?x(this.recipient.full_name):""),s.setAttribute("name",(null===(o=this.recipient)||void 0===o?void 0:o.full_name)||"")}handlePageRendered(e){const i=e.detail,t=y(this.roleNames,this.recipient.role_name),s=this.recipient.fields.filter((e=>e.page===i.pageNumber));console.log("[SIGN] Page rendered, updating fields",{pageInfo:i,roleIndex:t,recipientFields:s}),s.filter((e=>e.page===i.pageNumber)).forEach((e=>{const s=k(e,i,t,{disabled:!1,editable:!1,draggable:!1,done:this.isDone});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(i,e,t,s))):this.attachFieldAttributes(i,e,t,s))})),this.sortedRecipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status===h.INVITED||e.status===h.OPENED||e.status===h.PENDING))).forEach((e=>{const t=y(this.roleNames,e.role_name);e.fields.filter((e=>e.page===i.pageNumber)).forEach((e=>{const s=k(e,i,t,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(i,e,t,s))):this.attachFieldAttributes(i,e,t,s))}))})),this.checkRecipientFields()}render(){return this.envelope?this.isDone?t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return null===(i=this.sdkError)||void 0===i?void 0:i.emit(e.detail)}}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,{class:{agreed:this.agreed}},!this.agreed&&!this.finishLater&&t("div",{class:"intro"},t("div",{class:"inner"},"Please review and act on these documents.")),t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},this.agreed?t(o,null,t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}})):t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:()=>this.handleClickAgree()})),!this.finishLater&&t("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:this.isDone||this.finishLater?z:j,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",this.agreed?{style:{display:"none"}}:{class:"cover"}),t("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((e=>{const i=f(1,e.page_numbers);return t(o,null,i.map((i=>t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=!1}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.showSubmitDialog&&t("verdocs-ok-dialog",{heading:"Ready to Submit?",message:"All required fields have been completed.<br />Are you ready to submit this document?",showCancel:!0,onExit:()=>{this.showSubmitDialog=!1},onNext:()=>(this.showSubmitDialog=!1,this.handleNext())}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,null,t("verdocs-loader",null))}};R.style='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 .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff}verdocs-sign .intro .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}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 .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}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)}@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 56px;flex:0 0 56px;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 20px;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}';export{R as verdocs_sign}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as e,H as i}from"./p-6d3e0994.js";import{g as o}from"./p-6de76553.js";const n=class{constructor(e){t(this,e),this.settingsChanged=s(this,"settingsChanged",7),this.templateid="",this.field=null,this.disabled=!1,this.roleIndex=0,this.rerender=0}async focusField(){this.handleShow()}handleShow(){this.dialog=document.createElement("verdocs-upload-dialog"),this.dialog.open=!0,this.dialog.addEventListener("exit",(()=>{var t;return null===(t=this.dialog)||void 0===t?void 0:t.remove()})),document.addEventListener("done",(()=>{var t;return null===(t=this.dialog)||void 0===t?void 0:t.remove()})),document.body.append(this.dialog)}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel()}render(){var t,s,n,r;let d={x:0,y:0};"settings"in this.field&&(null===(t=this.field)||void 0===t?void 0:t.settings)?d=this.field.settings:"setting"in this.field&&(null===(s=this.field)||void 0===s?void 0:s.setting)&&(d=this.field.setting);const a=null!==(r=null!==(n=this.disabled)&&void 0!==n?n:d.disabled)&&void 0!==r&&r,l=this.field.rgba||o(this.roleIndex);return e(i,{class:{required:d.required,disabled:a},style:{backgroundColor:l}},e("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>',onClick:()=>!a&&this.handleShow()}))}};n.style='verdocs-field-attachment{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:24px;height:24px;display:block;font-size:11px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-attachment.disabled{opacity:0.5}verdocs-field-attachment.disabled span{cursor:inherit}verdocs-field-attachment span{cursor:inherit;width:20px}verdocs-field-attachment.required span{border:1px solid #cc0000}verdocs-field-attachment.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';export{n as verdocs_field_attachment}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):r(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(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,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(o){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;r=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(o[0]===6&&i.label<s[1]){i.label=s[1];s=o;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(o);break}if(s[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];r=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++){if(s||!(n in t)){if(!s)s=Array.prototype.slice.call(t,0,n);s[n]=t[n]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-2dbc05c6.system.js","./p-4cb3fa5f.system.js","./p-54498887.system.js","./p-eaf0b189.system.js","./p-4422958b.system.js","./p-7efdefa3.system.js","./p-d50523fd.system.js","./p-9077a801.system.js","./p-7fd7152d.system.js","./p-187b20b7.system.js","./p-ca13070e.system.js","./p-dc9c4361.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js"],(function(e){"use strict";var t,i,n,r,s,o,a,l,d,c,u,h,p,f,g,v,m,b,x,w,y,I,k,_,S,F,N,D;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.F},function(e){o=e.e;a=e.t;l=e.u;d=e.f;c=e.h},function(e){u=e.R},function(e){h=e.e;p=e.a;f=e.b},function(e){g=e.V},function(e){v=e.a;m=e.i},function(e){b=e.f;x=e.i},function(e){w=e.b;y=e.u;I=e.a;k=e.r;_=e.c},function(e){S=e.a},function(e){F=e.S},function(e){N=e.V},function(e){D=e.f},function(){},function(){}],execute:function(){var E=function(e,t,i){var n=new FormData;n.append("signature",i,t);return e.api.post("/signatures",n).then((function(e){return e.data}))};var R=function(e,t,i){var n=new FormData;n.append("initial",i,t);return e.api.post("/initials",n).then((function(e){return e.data}))};var A='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 .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff}verdocs-sign .intro .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}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 .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}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)}@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 56px;flex:0 0 56px;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 20px;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}';var L=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var C=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var G=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.showSubmitDialog=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){this.endpoint=new g({sessionType:"signing"})};e.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,s,l,d,c,u,h,p,f;var g=this;return __generator(this,(function(v){switch(v.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new F("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new F("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new F("[SIGN] Missing required inviteCode",500,""));return[2]}v.label=1;case 1:v.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,o(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:d=v.sent(),c=d.session,u=d.recipient,h=d.signerToken;console.log("[SIGN] Loaded signing session ".concat(c.email," / ").concat(c.profile_id));this.recipient=u;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=h;this.endpoint.setToken(h);if(this.agreed){this.nextButtonLabel="Next"}p=this;return[4,a(this.endpoint,this.envelopeId)];case 3:p.envelope=v.sent();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==g.roleId}));if(this.recipientIndex>-1){this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});return[3,5];case 4:f=v.sent();console.log("Error with signing session",f);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new F(f.message,(s=f.response)===null||s===void 0?void 0:s.status,(l=f.response)===null||l===void 0?void 0:l.data));return[3,5];case 5: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;h(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,r;console.log("Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new F(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,s,o,a;return __generator(this,(function(l){switch(l.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:N("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,p(this.endpoint,this.envelopeId,this.roleId)];case 4:a=l.sent();console.log("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.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:w(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((function(e){console.log("Error downloading PDF",e)}));(s=this.envelopeUpdated)===null||s===void 0?void 0:s.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);this.recipient.fields.forEach((function(n){if(n.name===e){n.settings=t.settings;y(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e);l(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,r,s,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(s=i.sdkError)===null||s===void 0?void 0:s.emit(new F(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,r,s,o,o,a,l,u,h;var p=this;return __generator(this,(function(f){switch(f.label){case 0:i=t.target,n=i.value,r=i.checked;s=e.type;switch(s){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":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:{o=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:o}})]}f.label=3;case 3:{o=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:o}})]}f.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:return[4,fetch(t.detail)];case 6:return[4,f.sent().blob()];case 7:a=f.sent();return[2,R(this.endpoint,"initial",a).then((function(t){return __awaiter(p,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,c(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))}))];case 8:return[4,fetch(t.detail)];case 9:return[4,f.sent().blob()];case 10:l=f.sent();return[2,E(this.endpoint,"signature",l).then((function(t){return __awaiter(p,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,d(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);return[2]}}))}))}))];case 11:u=t.target.getAttribute("iso");console.log("Formatting date for save",u);h=D(new Date(u),S);console.log("Formatted",h);return[2,this.saveFieldChange(e.name,{prepared:false,value:h})];case 12:console.log("Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:n,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,i,n,r,s,o,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},u=c.result,h=u===void 0?"":u,p=c.value,f=p===void 0?"":p,g=c.base64,b=g===void 0?"":g;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return m(h);case"phone":return v(h);default:return!d||h!==""}case"signature":case"initial":return!d||b!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!d||h!=="";case"dropdown":return!d||f!=="";case"checkbox_group":var x=(((n=(i=e.settings)===null||i===void 0?void 0:i.options)===null||n===void 0?void 0:n.filter((function(e){return e.checked})))||[]).length;return!d||x>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&x<=(((s=e.settings)===null||s===void 0?void 0:s.maximum_checked)||999);case"radio_button_group":return!d||(((a=(o=e.settings)===null||o===void 0?void 0:o.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,s,o,a,l,d;var c=this;return __generator(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);this.submitting=true;return[4,f(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;this.isDone=true;setTimeout((function(){console.log("[SIGN] Reloading");window.location.reload()}),1e3);return[3,4];case 3:i=u.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:this.submitting=false;return[2];case 5:n=this.recipient.fields.filter((function(e){return e.required}));r=n.findIndex((function(e){return e.name===c.focusedField}));s=r+1;if(s>=n.length){s=0}o=n[s];a=0;if(a<n.length&&["signature","initial"].includes(o.type)&&((e=o.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;s++;if(s>=n.length){s=0}o=n[s]}if(a>=n.length){o=null}if(o){l=_(o);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=o.name}return[2]}}))}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.recipient.fields.filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.showSubmitDialog=true;this.nextSubmits=true}}else{console.log("[SIGN] Remaining invalid fields",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i,n){var r=this;var s;n.addEventListener("input",(function(e){console.log("[SIGN] onfieldInput",e.detail,e.target.value);if(e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")){console.log("CB",e.target);r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}else{r.checkRecipientFields()}}));n.addEventListener("focusout",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));n.addEventListener("fieldChange",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));n.setAttribute("page",e.pageNumber);n.setAttribute("roleindex",i);n.setAttribute("xScale",e.xScale);n.setAttribute("yScale",e.yScale);n.setAttribute("initials",this.recipient?b(this.recipient.full_name):"");n.setAttribute("name",((s=this.recipient)===null||s===void 0?void 0:s.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;var n=I(this.roleNames,this.recipient.role_name);var r=this.recipient.fields.filter((function(e){return e.page===i.pageNumber}));console.log("[SIGN] Page rendered, updating fields",{pageInfo:i,roleIndex:n,recipientFields:r});r.filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var r=k(e,i,n,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(i,e,n,r)}))}else{t.attachFieldAttributes(i,e,n,r)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status===u.INVITED||e.status===u.OPENED||e.status===u.PENDING)})).forEach((function(e){var n=I(t.roleNames,e.role_name);e.fields.filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var r=k(e,i,n,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(i,e,n,r)}))}else{t.attachFieldAttributes(i,e,n,r)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(!this.envelope){return n(r,null,n("verdocs-loader",null))}if(this.isDone){return n(r,{class:{agreed:this.agreed}},n("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.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("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&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}return n(r,{class:{agreed:this.agreed}},!this.agreed&&!this.finishLater&&n("div",{class:"intro"},n("div",{class:"inner"},"Please review and act on these documents.")),n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},!this.agreed?n("div",{class:"agree"},n("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:function(){return e.handleClickAgree()}})):n(s,null,n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name),n("div",{style:{flex:"1"}})),!this.finishLater&&n("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),n("div",{style:{marginLeft:"10px"}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?L:C,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),!this.agreed?n("div",{class:"cover"}):n("div",{style:{display:"none"}}),n("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((function(t){var i=x(1,t.page_numbers);return n(s,null,i.map((function(i){return n("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("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.errorMessage&&n("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&n("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.showSubmitDialog&&n("verdocs-ok-dialog",{heading:"Ready to Submit?",message:"All required fields have been completed.<br />Are you ready to submit this document?",showCancel:true,onExit:function(){e.showSubmitDialog=false},onNext:function(){e.showSubmitDialog=false;return e.handleNext()}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))};return e}());G.style=A}}}));