@verdocs/web-sdk 1.16.5 → 2.0.0

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 (200) hide show
  1. package/dist/cjs/{TemplateStore-50096591.js → TemplateStore-cd05c035.js} +1 -1
  2. package/dist/cjs/{VerdocsEndpoint-9aec53cd.js → VerdocsEndpoint-2ff96f90.js} +25 -0
  3. package/dist/cjs/ipc-test.cjs.entry.js +2 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{popper-9def2535.js → popper-d7adcfc6.js} +6 -12
  6. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-auth.cjs.entry.js +71 -15
  8. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  9. package/dist/cjs/{verdocs-button-panel_3.cjs.entry.js → verdocs-button-panel_2.cjs.entry.js} +3 -20
  10. package/dist/cjs/{verdocs-checkbox_4.cjs.entry.js → verdocs-checkbox_5.cjs.entry.js} +21 -3
  11. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-pagination_3.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-preview.cjs.entry.js +2 -2
  22. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-send.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  26. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +89 -82
  27. package/dist/cjs/verdocs-template-attachments_2.cjs.entry.js +2 -2
  28. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
  29. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -2
  30. package/dist/cjs/verdocs-template-name.cjs.entry.js +2 -2
  31. package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -2
  32. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  33. package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
  34. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  35. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  36. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  37. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +5 -0
  38. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +20 -1
  39. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +62 -14
  40. package/dist/components/VerdocsEndpoint.js +25 -0
  41. package/dist/components/popper.js +6 -12
  42. package/dist/components/verdocs-auth.js +79 -17
  43. package/dist/components/verdocs-status-indicator2.js +88 -81
  44. package/dist/components/verdocs-text-input2.js +5 -3
  45. package/dist/custom-elements.json +1894 -0
  46. package/dist/docs.json +24 -13
  47. package/dist/esm/{TemplateStore-bc248c04.js → TemplateStore-dcfb68c3.js} +1 -1
  48. package/dist/esm/{VerdocsEndpoint-f65843b9.js → VerdocsEndpoint-e447b318.js} +25 -0
  49. package/dist/esm/ipc-test.entry.js +2 -2
  50. package/dist/esm/loader.js +1 -1
  51. package/dist/esm/{popper-bfa25c7f.js → popper-15e448b4.js} +6 -12
  52. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  53. package/dist/esm/verdocs-auth.entry.js +71 -15
  54. package/dist/esm/verdocs-build.entry.js +2 -2
  55. package/dist/esm/{verdocs-button-panel_3.entry.js → verdocs-button-panel_2.entry.js} +4 -20
  56. package/dist/esm/{verdocs-checkbox_4.entry.js → verdocs-checkbox_5.entry.js} +21 -4
  57. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  58. package/dist/esm/verdocs-dropdown.entry.js +1 -1
  59. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  60. package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
  61. package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
  62. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  63. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  64. package/dist/esm/verdocs-field-textbox.entry.js +1 -1
  65. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  66. package/dist/esm/verdocs-pagination_3.entry.js +1 -1
  67. package/dist/esm/verdocs-preview.entry.js +2 -2
  68. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  69. package/dist/esm/verdocs-search.entry.js +1 -1
  70. package/dist/esm/verdocs-send.entry.js +2 -2
  71. package/dist/esm/verdocs-sign.entry.js +1 -1
  72. package/dist/esm/verdocs-status-indicator.entry.js +89 -82
  73. package/dist/esm/verdocs-template-attachments_2.entry.js +2 -2
  74. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  75. package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
  76. package/dist/esm/verdocs-template-name.entry.js +2 -2
  77. package/dist/esm/verdocs-template-reminders.entry.js +2 -2
  78. package/dist/esm/verdocs-template-star.entry.js +1 -1
  79. package/dist/esm/verdocs-template-visibility.entry.js +2 -2
  80. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  81. package/dist/esm/verdocs-view.entry.js +1 -1
  82. package/dist/esm/verdocs-web-sdk.js +1 -1
  83. package/dist/esm-es5/{TemplateStore-bc248c04.js → TemplateStore-dcfb68c3.js} +1 -1
  84. package/dist/esm-es5/{VerdocsEndpoint-f65843b9.js → VerdocsEndpoint-e447b318.js} +1 -1
  85. package/dist/esm-es5/ipc-test.entry.js +1 -1
  86. package/dist/esm-es5/loader.js +1 -1
  87. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -0
  91. package/dist/esm-es5/{verdocs-checkbox_4.entry.js → verdocs-checkbox_5.entry.js} +1 -1
  92. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-template-attachments_2.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  114. package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
  115. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  116. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  117. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  118. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +4 -0
  119. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +7 -1
  120. package/dist/types/components.d.ts +8 -0
  121. package/dist/verdocs-web-sdk/{p-0dec6856.entry.js → p-006dd4da.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-1ea3fe3d.entry.js → p-0378a336.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-93a1f0c7.entry.js → p-0527ab90.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-7f78860a.system.entry.js → p-065babe0.system.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-004ec0ae.entry.js → p-0df85bd4.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/{p-3ad53326.system.entry.js → p-118a14fe.system.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/p-189606f5.entry.js +1 -0
  128. package/dist/verdocs-web-sdk/{p-592f4249.entry.js → p-1ade993c.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-2f20c091.entry.js → p-1f592fb0.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/p-223e5517.entry.js +1 -0
  131. package/dist/verdocs-web-sdk/{p-3add7514.system.entry.js → p-25fdc669.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-8c8e0f2b.system.entry.js → p-26417803.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-3422705a.entry.js → p-268fe01c.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-4cc14862.entry.js → p-2a130b90.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-f03d1e3b.entry.js → p-2b404e29.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-3443e511.system.entry.js → p-2b7b500b.system.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/p-36d42438.entry.js +1 -0
  138. package/dist/verdocs-web-sdk/{p-80149a45.entry.js → p-3e9c4c8a.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-ad4d8802.system.entry.js → p-434dd9d9.system.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/p-52300880.system.entry.js +1 -0
  141. package/dist/verdocs-web-sdk/{p-98bd4b4f.entry.js → p-5255e6f7.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-70812806.system.entry.js → p-57e55966.system.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-9a582e91.entry.js → p-59e55e05.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-92a36e56.system.entry.js → p-5fd70b07.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  146. package/dist/verdocs-web-sdk/{p-c1c252b5.system.entry.js → p-6995a8d8.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-e54ac802.system.entry.js → p-6a67a872.system.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-2985bb3e.system.entry.js → p-6c60927e.system.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-df1b0ed6.system.entry.js → p-787289cc.system.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/{p-84ed9bf2.system.entry.js → p-78b7499c.system.entry.js} +1 -1
  151. package/dist/verdocs-web-sdk/{p-1d2c9b8a.system.entry.js → p-80ead6ca.system.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/{p-282e1d70.entry.js → p-81bfb9ee.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-a3698582.system.entry.js → p-87232ec1.system.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-f2dfb0c4.entry.js → p-899f9d42.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-45cda07e.entry.js → p-9044fd88.entry.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-0bc0e0e1.system.entry.js → p-90565aa6.system.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-3c889a0a.entry.js → p-90a11750.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/{p-7589ac5e.system.entry.js → p-9488e048.system.entry.js} +1 -1
  159. package/dist/verdocs-web-sdk/{p-b78a0d6a.system.entry.js → p-9c25c1d4.system.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/{p-d8f1b3af.system.js → p-a4129b09.system.js} +1 -1
  161. package/dist/verdocs-web-sdk/p-a8cf70dd.entry.js +1 -0
  162. package/dist/verdocs-web-sdk/{p-d0910a5d.entry.js → p-a8eb011c.entry.js} +1 -1
  163. package/dist/verdocs-web-sdk/{p-818941f3.system.entry.js → p-abfb25bc.system.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-fd40e5ab.system.entry.js → p-ac58a89b.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-ce0362cd.system.entry.js → p-b42c686d.system.entry.js} +1 -1
  166. package/dist/verdocs-web-sdk/{p-6d442326.system.entry.js → p-b49887e6.system.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/{p-79ddf1a7.entry.js → p-b7b48889.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-5fcd1f65.system.entry.js → p-b8036fd4.system.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-e72313cc.entry.js → p-bdea2ff9.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/{p-b0ec1235.entry.js → p-be8ff081.entry.js} +1 -1
  171. package/dist/verdocs-web-sdk/{p-23046e75.system.entry.js → p-c0e4c58b.system.entry.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-86652c3f.system.entry.js → p-c212eac2.system.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-2a1f413b.system.entry.js → p-c2eb64ad.system.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-8ff6e046.entry.js → p-c7cebd38.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-004e9c9b.entry.js → p-c893c9e3.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-e591fe98.entry.js → p-c8a1de2c.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/{p-d240bf31.entry.js → p-d278b481.entry.js} +1 -1
  178. package/dist/verdocs-web-sdk/{p-50b62a6f.entry.js → p-d3f3c09a.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/{p-9a8d5562.entry.js → p-d583e91b.entry.js} +1 -1
  180. package/dist/verdocs-web-sdk/{p-3fa63a12.system.js → p-d808a494.system.js} +1 -1
  181. package/dist/verdocs-web-sdk/{p-69462ccd.js → p-e06d9588.js} +1 -1
  182. package/dist/verdocs-web-sdk/p-e4b3e134.system.entry.js +1 -0
  183. package/dist/verdocs-web-sdk/{p-1071b04a.system.entry.js → p-e63f1a46.system.entry.js} +1 -1
  184. package/dist/verdocs-web-sdk/{p-7f8a8798.system.entry.js → p-e9c00342.system.entry.js} +1 -1
  185. package/dist/verdocs-web-sdk/{p-130f3a72.entry.js → p-ea5cec2d.entry.js} +1 -1
  186. package/dist/verdocs-web-sdk/p-eddc727f.system.entry.js +1 -0
  187. package/dist/verdocs-web-sdk/{p-2526d836.js → p-ee6f2dd3.js} +1 -1
  188. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  189. package/package.json +8 -8
  190. package/dist/esm-es5/verdocs-button-panel_3.entry.js +0 -1
  191. package/dist/verdocs-web-sdk/p-32eed336.entry.js +0 -1
  192. package/dist/verdocs-web-sdk/p-4ab54e29.entry.js +0 -1
  193. package/dist/verdocs-web-sdk/p-4ed347fe.system.entry.js +0 -1
  194. package/dist/verdocs-web-sdk/p-6d6b57c4.system.entry.js +0 -1
  195. package/dist/verdocs-web-sdk/p-d5c75638.system.entry.js +0 -1
  196. package/dist/verdocs-web-sdk/p-e0005281.entry.js +0 -1
  197. package/dist/verdocs-web-sdk/p-fcf2a8ed.entry.js +0 -1
  198. /package/dist/esm-es5/{popper-bfa25c7f.js → popper-15e448b4.js} +0 -0
  199. /package/dist/verdocs-web-sdk/{p-9d707f6e.js → p-7c0dcd00.js} +0 -0
  200. /package/dist/verdocs-web-sdk/{p-5e0c6e7c.system.js → p-9a5ff58c.system.js} +0 -0
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function l(e){try{a(i.next(e))}catch(e){s(e)}}function r(e){try{a(i["throw"](e))}catch(e){s(e)}}function a(e){e.done?n(e.value):o(e.value).then(l,r)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(e){return function(t){return a([e,t])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,o&&(s=l[0]&2?o["return"]:l[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;if(o=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1];s=l;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(l);break}if(s[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-3fa63a12.system.js","./p-7efdefa3.system.js","./p-05eb4fed.system.js","./p-d8f1b3af.system.js","./p-62aaeefd.system.js","./p-187b20b7.system.js","./p-2c95d99b.system.js","./p-11de0d75.system.js","./p-bbee73c8.system.js","./p-4cb3fa5f.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js"],(function(e){"use strict";var t,n,i,o,s,l,r,a,d,c,p;return{setters:[function(e){t=e.r;n=e.c;i=e.h;o=e.H},function(){},function(e){s=e.V},function(e){l=e.i;r=e.a},function(e){a=e.g},function(e){d=e.g},function(e){c=e.a},function(e){p=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var u='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var f='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var v='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var h='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var m='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var x=e("verdocs_send",function(){function e(e){t(this,e);this.send=n(this,"send",7);this.exit=n(this,"exit",7);this.sdkError=n(this,"sdkError",7);this.searchContacts=n(this,"searchContacts",7);this.levels=[];this.store=null;this.endpoint=s.getDefault();this.templateId=null;this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i,o,s,l,r,a,c,u,f,v,h;return __generator(this,(function(m){switch(m.label){case 0:m.trys.push([0,2,,3]);u=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}f=this;return[4,d(this.endpoint,this.templateId,true)];case 1:f.store=m.sent();if(!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if((i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.roles){v={};this.rolesCompleted={};(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.roles.forEach((function(e){var t=e.sequence-1;v[t]||(v[t]=[]);var n="r-".concat(t,"-").concat(v[t].length);v[t].push(__assign(__assign({},e),{id:n}))}));this.rolesAtLevel=v;this.levels=Object.keys(v).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((l=u===null||u===void 0?void 0:u.session)===null||l===void 0?void 0:l.profile){this.sessionContacts.push({id:u.session.profile.id,name:"".concat(u.session.profile.first_name," ").concat(u.session.profile.last_name),email:u.session.profile.email,phone:u.session.profile.phone})}return[3,3];case 2:h=m.sent();console.log("[SEND] Error with preview session",h);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new p(h.message,(a=h.response)===null||a===void 0?void 0:a.status,(c=h.response)===null||c===void 0?void 0:c.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return i("div",{class:"level-icon",innerHTML:v})}else if(e>=this.levels.length){return i("div",{class:"level-icon",innerHTML:m})}else{return i("div",{class:"level-icon",innerHTML:h})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t,n,i;e.stopPropagation();(t=this.send)===null||t===void 0?void 0:t.emit({roles:Object.values(this.rolesCompleted),name:(i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.name,template_id:this.templateId})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,n,s,d;var p=(((n=(t=this.store)===null||t===void 0?void 0:t.state)===null||n===void 0?void 0:n.roles)||[]).map((function(e){return e.name}))||[];var u=Object.values(this.rolesCompleted).filter((function(e){return l(e.email)||r(e.phone)}));var v=u.length>=p.length;return i(o,{class:{sendable:(d=(s=this.store)===null||s===void 0?void 0:s.state)===null||d===void 0?void 0:d.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return i("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var n,o,s,l,r,d;var u=!t.email;return u?i("div",{class:"recipient",style:{backgroundColor:a(c(p,t.name))},onClick:function(n){return e.handleClickRole(n,t)}},(o=(n=e.rolesCompleted[t.id])===null||n===void 0?void 0:n.full_name)!==null&&o!==void 0?o:t.name,i("div",{class:"icon",innerHTML:f}),e.showPickerForId===t.id&&i("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.rolesCompleted[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}})):i("div",{class:"recipient",style:{borderColor:a(c(p,t.name))},onClick:function(n){return e.handleClickRole(n,t)}},(r=(l=e.rolesCompleted[t.id])===null||l===void 0?void 0:l.full_name)!==null&&r!==void 0?r:t.full_name,i("div",{class:"icon",innerHTML:f}),e.showPickerForId===t.id&&i("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(d=e.rolesCompleted[t.id])!==null&&d!==void 0?d:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}}))})))})),i("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{label:"Send",size:"small",disabled:!v,onClick:function(t){return e.handleSend(t)}})))};return e}());x.style=u}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function l(e){try{a(i.next(e))}catch(e){s(e)}}function r(e){try{a(i["throw"](e))}catch(e){s(e)}}function a(e){e.done?n(e.value):o(e.value).then(l,r)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(e){return function(t){return a([e,t])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,o&&(s=l[0]&2?o["return"]:l[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;if(o=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1];s=l;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(l);break}if(s[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-d808a494.system.js","./p-7efdefa3.system.js","./p-05eb4fed.system.js","./p-a4129b09.system.js","./p-62aaeefd.system.js","./p-187b20b7.system.js","./p-2c95d99b.system.js","./p-11de0d75.system.js","./p-bbee73c8.system.js","./p-4cb3fa5f.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js"],(function(e){"use strict";var t,n,i,o,s,l,r,a,d,c,p;return{setters:[function(e){t=e.r;n=e.c;i=e.h;o=e.H},function(){},function(e){s=e.V},function(e){l=e.i;r=e.a},function(e){a=e.g},function(e){d=e.g},function(e){c=e.a},function(e){p=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var u='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var f='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var v='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var h='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var m='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var x=e("verdocs_send",function(){function e(e){t(this,e);this.send=n(this,"send",7);this.exit=n(this,"exit",7);this.sdkError=n(this,"sdkError",7);this.searchContacts=n(this,"searchContacts",7);this.levels=[];this.store=null;this.endpoint=s.getDefault();this.templateId=null;this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i,o,s,l,r,a,c,u,f,v,h;return __generator(this,(function(m){switch(m.label){case 0:m.trys.push([0,2,,3]);u=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}f=this;return[4,d(this.endpoint,this.templateId,true)];case 1:f.store=m.sent();if(!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if((i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.roles){v={};this.rolesCompleted={};(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.roles.forEach((function(e){var t=e.sequence-1;v[t]||(v[t]=[]);var n="r-".concat(t,"-").concat(v[t].length);v[t].push(__assign(__assign({},e),{id:n}))}));this.rolesAtLevel=v;this.levels=Object.keys(v).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((l=u===null||u===void 0?void 0:u.session)===null||l===void 0?void 0:l.profile){this.sessionContacts.push({id:u.session.profile.id,name:"".concat(u.session.profile.first_name," ").concat(u.session.profile.last_name),email:u.session.profile.email,phone:u.session.profile.phone})}return[3,3];case 2:h=m.sent();console.log("[SEND] Error with preview session",h);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new p(h.message,(a=h.response)===null||a===void 0?void 0:a.status,(c=h.response)===null||c===void 0?void 0:c.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return i("div",{class:"level-icon",innerHTML:v})}else if(e>=this.levels.length){return i("div",{class:"level-icon",innerHTML:m})}else{return i("div",{class:"level-icon",innerHTML:h})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t,n,i;e.stopPropagation();(t=this.send)===null||t===void 0?void 0:t.emit({roles:Object.values(this.rolesCompleted),name:(i=(n=this.store)===null||n===void 0?void 0:n.state)===null||i===void 0?void 0:i.name,template_id:this.templateId})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,n,s,d;var p=(((n=(t=this.store)===null||t===void 0?void 0:t.state)===null||n===void 0?void 0:n.roles)||[]).map((function(e){return e.name}))||[];var u=Object.values(this.rolesCompleted).filter((function(e){return l(e.email)||r(e.phone)}));var v=u.length>=p.length;return i(o,{class:{sendable:(d=(s=this.store)===null||s===void 0?void 0:s.state)===null||d===void 0?void 0:d.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:"level level-start"},this.getLevelIcon(-1),i("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return i("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var n,o,s,l,r,d;var u=!t.email;return u?i("div",{class:"recipient",style:{backgroundColor:a(c(p,t.name))},onClick:function(n){return e.handleClickRole(n,t)}},(o=(n=e.rolesCompleted[t.id])===null||n===void 0?void 0:n.full_name)!==null&&o!==void 0?o:t.name,i("div",{class:"icon",innerHTML:f}),e.showPickerForId===t.id&&i("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.rolesCompleted[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}})):i("div",{class:"recipient",style:{borderColor:a(c(p,t.name))},onClick:function(n){return e.handleClickRole(n,t)}},(r=(l=e.rolesCompleted[t.id])===null||l===void 0?void 0:l.full_name)!==null&&r!==void 0?r:t.full_name,i("div",{class:"icon",innerHTML:f}),e.showPickerForId===t.id&&i("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(d=e.rolesCompleted[t.id])!==null&&d!==void 0?d:t,onSearchContacts:function(t){var n;return(n=e.searchContacts)===null||n===void 0?void 0:n.emit(t.detail)}}))})))})),i("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{label:"Send",size:"small",disabled:!v,onClick:function(t){return e.handleSend(t)}})))};return e}());x.style=u}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,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(r)try{if(n=1,s&&(i=o[0]&2?s["return"]:o[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;if(s=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;s=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-3fa63a12.system.js","./p-d8f1b3af.system.js","./p-187b20b7.system.js","./p-ca13070e.system.js","./p-2c95d99b.system.js","./p-11de0d75.system.js"],(function(e){"use strict";var t,r,n,s,i,o,a,l;return{setters:[function(e){t=e.r;r=e.c;n=e.h;s=e.H},function(){},function(e){i=e.V},function(e){o=e.g},function(e){a=e.S},function(e){l=e.V},function(){},function(){}],execute:function(){var d=function(e,t,r){return e.api.post("/templates/".concat(t,"/reminder/"),r).then((function(e){return e.data}))};var c=function(e,t,r,n){return e.api.put("/templates/".concat(t,"/reminder/").concat(r),n).then((function(e){return e.data}))};var u=function(e,t,r){return e.api.delete("/templates/".concat(t,"/reminder/").concat(r)).then((function(e){return e.data}))};var p='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var m=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.sdkError=r(this,"sdkError",7);this.store=null;this.endpoint=i.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,s,i,l;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}i=this;return[4,o(this.endpoint,this.templateId,true)];case 1:i.store=d.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:l=d.sent();console.log("[TEMPLATE REMINDERS] Error loading template",l);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new a(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(s=l.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,r,n;e.stopPropagation();this.sendReminders=!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id);this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,s,i,p,m,f,h,v,y,b,x;return __generator(this,(function(g){switch(g.label){case 0:e.stopPropagation();g.label=1;case 1:g.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];h={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id))return[3,4];return[4,d(this.endpoint,this.templateId,h)];case 2:g.sent();v=this;return[4,o(this.endpoint,this.templateId,true)];case 3:v.store=g.sent();return[3,7];case 4:return[4,c(this.endpoint,this.templateId,(n=this.store)===null||n===void 0?void 0:n.state.reminder_id,h)];case 5:g.sent();y=this;return[4,o(this.endpoint,this.templateId,true)];case 6:y.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,u(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id)];case 9:g.sent();b=this;return[4,o(this.endpoint,this.templateId,true)];case 10:b.store=g.sent();g.label=11;case 11:return[3,13];case 12:x=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",x);l(x.message);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new a(x.message,(p=x.response)===null||p===void 0?void 0:p.status,(m=x.response)===null||m===void 0?void 0:m.data));return[3,13];case 13:this.dirty=false;(f=this.close)===null||f===void 0?void 0:f.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,r;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.isLoaded)){return n(s,{class:"empty"})}return n(s,null,n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("h5",null,"Reminders"),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),n("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),n("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),n("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),n("div",{class:"buttons"},n("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&n("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());m.style=p}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,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(r)try{if(n=1,s&&(i=o[0]&2?s["return"]:o[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;if(s=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;s=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-d808a494.system.js","./p-a4129b09.system.js","./p-187b20b7.system.js","./p-ca13070e.system.js","./p-2c95d99b.system.js","./p-11de0d75.system.js"],(function(e){"use strict";var t,r,n,s,i,o,a,l;return{setters:[function(e){t=e.r;r=e.c;n=e.h;s=e.H},function(){},function(e){i=e.V},function(e){o=e.g},function(e){a=e.S},function(e){l=e.V},function(){},function(){}],execute:function(){var d=function(e,t,r){return e.api.post("/templates/".concat(t,"/reminder/"),r).then((function(e){return e.data}))};var c=function(e,t,r,n){return e.api.put("/templates/".concat(t,"/reminder/").concat(r),n).then((function(e){return e.data}))};var u=function(e,t,r){return e.api.delete("/templates/".concat(t,"/reminder/").concat(r)).then((function(e){return e.data}))};var p='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var m=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.sdkError=r(this,"sdkError",7);this.store=null;this.endpoint=i.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,s,i,l;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}i=this;return[4,o(this.endpoint,this.templateId,true)];case 1:i.store=d.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:l=d.sent();console.log("[TEMPLATE REMINDERS] Error loading template",l);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new a(l.message,(n=l.response)===null||n===void 0?void 0:n.status,(s=l.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,r,n;e.stopPropagation();this.sendReminders=!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id);this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,s,i,p,m,f,h,v,y,b,x;return __generator(this,(function(g){switch(g.label){case 0:e.stopPropagation();g.label=1;case 1:g.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];h={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.reminder_id))return[3,4];return[4,d(this.endpoint,this.templateId,h)];case 2:g.sent();v=this;return[4,o(this.endpoint,this.templateId,true)];case 3:v.store=g.sent();return[3,7];case 4:return[4,c(this.endpoint,this.templateId,(n=this.store)===null||n===void 0?void 0:n.state.reminder_id,h)];case 5:g.sent();y=this;return[4,o(this.endpoint,this.templateId,true)];case 6:y.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,u(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id)];case 9:g.sent();b=this;return[4,o(this.endpoint,this.templateId,true)];case 10:b.store=g.sent();g.label=11;case 11:return[3,13];case 12:x=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",x);l(x.message);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new a(x.message,(p=x.response)===null||p===void 0?void 0:p.status,(m=x.response)===null||m===void 0?void 0:m.data));return[3,13];case 13:this.dirty=false;(f=this.close)===null||f===void 0?void 0:f.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,r;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((r=(t=this.store)===null||t===void 0?void 0:t.state)===null||r===void 0?void 0:r.isLoaded)){return n(s,{class:"empty"})}return n(s,null,n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("h5",null,"Reminders"),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),n("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),n("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),n("div",{class:"input-row"},n("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),n("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),n("div",{class:"buttons"},n("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&n("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());m.style=p}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,n){function s(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function i(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):s(e.value).then(a,i)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o)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:o.label++;return{value:a[1],done:false};case 5:o.label++;s=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(a[0]===6&&o.label<r[1]){o.label=r[1];r=a;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(a);break}if(r[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}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}}};System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-3fa63a12.system.js","./p-6e9af353.system.js","./p-455d16dc.system.js","./p-d8f1b3af.system.js","./p-187b20b7.system.js","./p-11de0d75.system.js","./p-2c95d99b.system.js"],(function(e){"use strict";var t,o,n,s,r,a,i,l,c,p,d,u,h,f,m,g,v;return{setters:[function(e){t=e.r;o=e.c;n=e.h;s=e.H},function(){},function(e){r=e.V},function(e){a=e.c;i=e.d},function(e){l=e.D;c=e.P;p=e.J;d=e.a;u=e.F;h=e.b;f=e.T},function(e){m=e.g},function(e){g=e.S},function(e){v=e.c},function(){}],execute:function(){var x='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var b=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.templateUpdate=o(this,"templateUpdate",7);this.sdkError=o(this,"sdkError",7);this.endpoint=r.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,s;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,m(this.endpoint,this.templateId,false)];case 1:n.store=r.sent();return[3,3];case 2:s=r.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new g(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(o=s.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,s,r,i,l;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();s=e.detail.file;if(!s){return[2]}console.log("[ATTACHMENTS] Uploading...",s);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,a(this.endpoint,this.templateId,s,this.handleUploadProgress.bind(this))];case 2:r=c.sent();console.log("[ATTACHMENTS] Created attachment",r);i=this;return[4,m(this.endpoint,this.templateId,true)];case 3:i.store=c.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:l=c.sent();console.log("[ATTACHMENTS] Error creating template",l);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new g(l.message,(o=l.response)===null||o===void 0?void 0:o.status,(n=l.response)===null||n===void 0?void 0:n.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,i(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,m(this.endpoint,this.templateId,true)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return d;case"image/jpeg":return p;case"image/png":return c;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return l}return u};e.prototype.render=function(){var e=this;var t,o,r;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var a=(t=this.store)===null||t===void 0?void 0:t.state;if(!a.isLoaded){return n(s,{class:"loading"},n("verdocs-loader",null))}if(!this.endpoint.session||!a.profile_id){return n(s,{class:"empty"})}return n(s,null,n("h5",null,"Existing Attachments"),n("div",{class:"attachments"},(o=this.store)===null||o===void 0?void 0:o.state.template_documents.map((function(t){return n("div",{class:"attachment"},n("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),n("div",{class:"filename",title:t.name},t.name),n("div",{class:"pages"},n("div",{class:"count"},t.page_numbers),n("div",{class:"pages-icon",innerHTML:h})),n("div",{class:"trash-icon",innerHTML:f,onClick:function(){return e.handleDelete(t)}}))}))),n("h5",null,"Attach a New Document"),this.uploading?n("div",{class:"loader-wrapper"},n("verdocs-loader",null),this.progressLabel&&n("div",{class:"progress-wrapper"},n("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):n("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),n("div",{class:"buttons"},n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),n("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((r=this.store)===null||r===void 0?void 0:r.state.template_documents.length)||this.uploading})),this.showDeleteError&&n("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&n("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());b.style=x;var y='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var w=" ";var k='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var _=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.sdkError=o(this,"sdkError",7);this.endpoint=r.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,s,r,a;var i=this;return __generator(this,(function(l){switch(l.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";l.label=1;case 1:l.trys.push([1,3,,4]);return[4,v(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){i.progressLabel="Processing...";i.progressPercent=100}else{i.progressPercent=e}}))];case 2:r=l.sent();console.log("[CREATE] Created template",r);(t=this.next)===null||t===void 0?void 0:t.emit(r);this.creating=false;this.progressLabel="";this.progressPercent=0;return[3,4];case 3:a=l.sent();console.log("[CREATE] Error creating template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new g(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(s=a.response)===null||s===void 0?void 0:s.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return n(s,null,n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?n("div",{class:"loader-wrapper"},n("verdocs-loader",null),this.progressLabel&&n("div",{class:"progress-wrapper"},n("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):n("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},n("div",null,n("span",{innerHTML:k})),n("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),n("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?w:"Or, if you prefer..."),n("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),n("div",{class:"buttons"},n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),n("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());_.style=y}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,n){function s(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function i(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):s(e.value).then(a,i)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o)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:o.label++;return{value:a[1],done:false};case 5:o.label++;s=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(a[0]===6&&o.label<r[1]){o.label=r[1];r=a;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(a);break}if(r[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}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}}};System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-d808a494.system.js","./p-6e9af353.system.js","./p-455d16dc.system.js","./p-a4129b09.system.js","./p-187b20b7.system.js","./p-11de0d75.system.js","./p-2c95d99b.system.js"],(function(e){"use strict";var t,o,n,s,r,a,i,l,c,p,d,u,h,f,m,g,v;return{setters:[function(e){t=e.r;o=e.c;n=e.h;s=e.H},function(){},function(e){r=e.V},function(e){a=e.c;i=e.d},function(e){l=e.D;c=e.P;p=e.J;d=e.a;u=e.F;h=e.b;f=e.T},function(e){m=e.g},function(e){g=e.S},function(e){v=e.c},function(){}],execute:function(){var x='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var b=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.templateUpdate=o(this,"templateUpdate",7);this.sdkError=o(this,"sdkError",7);this.endpoint=r.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,n,s;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,m(this.endpoint,this.templateId,false)];case 1:n.store=r.sent();return[3,3];case 2:s=r.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new g(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(o=s.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,s,r,i,l;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();s=e.detail.file;if(!s){return[2]}console.log("[ATTACHMENTS] Uploading...",s);this.uploading=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,4,,5]);return[4,a(this.endpoint,this.templateId,s,this.handleUploadProgress.bind(this))];case 2:r=c.sent();console.log("[ATTACHMENTS] Created attachment",r);i=this;return[4,m(this.endpoint,this.templateId,true)];case 3:i.store=c.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:l=c.sent();console.log("[ATTACHMENTS] Error creating template",l);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new g(l.message,(o=l.response)===null||o===void 0?void 0:o.status,(n=l.response)===null||n===void 0?void 0:n.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,i(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,m(this.endpoint,this.templateId,true)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return d;case"image/jpeg":return p;case"image/png":return c;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return l}return u};e.prototype.render=function(){var e=this;var t,o,r;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var a=(t=this.store)===null||t===void 0?void 0:t.state;if(!a.isLoaded){return n(s,{class:"loading"},n("verdocs-loader",null))}if(!this.endpoint.session||!a.profile_id){return n(s,{class:"empty"})}return n(s,null,n("h5",null,"Existing Attachments"),n("div",{class:"attachments"},(o=this.store)===null||o===void 0?void 0:o.state.template_documents.map((function(t){return n("div",{class:"attachment"},n("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),n("div",{class:"filename",title:t.name},t.name),n("div",{class:"pages"},n("div",{class:"count"},t.page_numbers),n("div",{class:"pages-icon",innerHTML:h})),n("div",{class:"trash-icon",innerHTML:f,onClick:function(){return e.handleDelete(t)}}))}))),n("h5",null,"Attach a New Document"),this.uploading?n("div",{class:"loader-wrapper"},n("verdocs-loader",null),this.progressLabel&&n("div",{class:"progress-wrapper"},n("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):n("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),n("div",{class:"buttons"},n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),n("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((r=this.store)===null||r===void 0?void 0:r.state.template_documents.length)||this.uploading})),this.showDeleteError&&n("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&n("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());b.style=x;var y='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var w=" ";var k='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var _=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.sdkError=o(this,"sdkError",7);this.endpoint=r.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,n,s,r,a;var i=this;return __generator(this,(function(l){switch(l.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";l.label=1;case 1:l.trys.push([1,3,,4]);return[4,v(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){i.progressLabel="Processing...";i.progressPercent=100}else{i.progressPercent=e}}))];case 2:r=l.sent();console.log("[CREATE] Created template",r);(t=this.next)===null||t===void 0?void 0:t.emit(r);this.creating=false;this.progressLabel="";this.progressPercent=0;return[3,4];case 3:a=l.sent();console.log("[CREATE] Error creating template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new g(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(s=a.response)===null||s===void 0?void 0:s.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return n(s,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return n(s,null,n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?n("div",{class:"loader-wrapper"},n("verdocs-loader",null),this.progressLabel&&n("div",{class:"progress-wrapper"},n("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):n("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},n("div",null,n("span",{innerHTML:k})),n("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),n("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?w:"Or, if you prefer..."),n("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),n("div",{class:"buttons"},n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),n("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());_.style=y}}}));
@@ -1 +1 @@
1
- System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-3fa63a12.system.js"],(function(e){"use strict";var s,r,t;return{setters:[function(e){s=e.r;r=e.h},function(){},function(e){t=e.V}],execute:function(){var c='verdocs-search{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}';var i=e("verdocs_search",function(){function e(e){s(this,e);this.endpoint=t.getDefault()}e.prototype.render=function(){return r("div",{class:"container"},r("verdocs-search-box",{endpoint:this.endpoint}),r("div",{class:"boxes"},r("verdocs-search-activity",{type:"recent",endpoint:this.endpoint}),r("verdocs-search-activity",{type:"saved",endpoint:this.endpoint}),r("verdocs-search-activity",{type:"starred",endpoint:this.endpoint}),r("verdocs-quick-functions",{endpoint:this.endpoint})))};return e}());i.style=c}}}));
1
+ System.register(["./p-2dbc05c6.system.js","./p-54498887.system.js","./p-d808a494.system.js"],(function(e){"use strict";var s,r,t;return{setters:[function(e){s=e.r;r=e.h},function(){},function(e){t=e.V}],execute:function(){var c='verdocs-search{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}';var i=e("verdocs_search",function(){function e(e){s(this,e);this.endpoint=t.getDefault()}e.prototype.render=function(){return r("div",{class:"container"},r("verdocs-search-box",{endpoint:this.endpoint}),r("div",{class:"boxes"},r("verdocs-search-activity",{type:"recent",endpoint:this.endpoint}),r("verdocs-search-activity",{type:"saved",endpoint:this.endpoint}),r("verdocs-search-activity",{type:"starred",endpoint:this.endpoint}),r("verdocs-quick-functions",{endpoint:this.endpoint})))};return e}());i.style=c}}}));
@@ -1 +1 @@
1
- import{r as i,c as e,h as t,H as s}from"./p-6d3e0994.js";import"./p-05788c2b.js";import{V as o}from"./p-69462ccd.js";import{u as l}from"./p-6570268f.js";import{g as a}from"./p-2526d836.js";import{S as r}from"./p-7a1b2643.js";import"./p-21615f18.js";const n=class{constructor(t){i(this,t),this.close=e(this,"close",7),this.sdkError=e(this,"sdkError",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var i,e,t,s,o,l,n;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await a(this.endpoint,this.templateId,!1),this.personal=(null===(e=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===e?void 0:e.is_personal)||!0,this.public=(null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.is_public)||!1,this.dirty=!1}catch(i){console.log("[TEMPLATE VISIBILITY] Error loading template",i),null===(o=this.sdkError)||void 0===o||o.emit(new r(i.message,null===(l=i.response)||void 0===l?void 0:l.status,null===(n=i.response)||void 0===n?void 0:n.data))}}handleCancel(i){var e,t,s,o,l;i.stopPropagation(),this.personal=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal,this.public=null===(o=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===o?void 0:o.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(i){var e,t;i.stopPropagation(),await l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(e=this.store)||void 0===e?void 0:e.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(t=this.close)||void 0===t||t.emit()}render(){var i,e;return this.endpoint.session?this.endpoint.session&&(null===(e=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===e?void 0:e.isLoaded)?t(s,null,t("form",{onSubmit:i=>i.preventDefault(),onClick:i=>i.stopPropagation(),autocomplete:"off"},t("h5",null,"Visibility"),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-shared"},"Shared"),t("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:i=>{this.personal=!i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-public"},"Public"),t("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:i=>{this.public=i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),t("div",{class:"buttons"},t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:i=>this.handleCancel(i)}),t("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:i=>this.handleSave(i)})))):t(s,{class:"empty"}):t(s,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};n.style='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{n as verdocs_template_visibility}
1
+ import{r as i,c as e,h as t,H as s}from"./p-6d3e0994.js";import"./p-05788c2b.js";import{V as o}from"./p-e06d9588.js";import{u as l}from"./p-6570268f.js";import{g as a}from"./p-ee6f2dd3.js";import{S as r}from"./p-7a1b2643.js";import"./p-21615f18.js";const n=class{constructor(t){i(this,t),this.close=e(this,"close",7),this.sdkError=e(this,"sdkError",7),this.store=null,this.endpoint=o.getDefault(),this.templateId="",this.dirty=!1,this.personal=!1,this.public=!1}async componentWillLoad(){var i,e,t,s,o,l,n;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[VISIBILITY] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[VISIBILITY] Unable to start builder session, must be authenticated");this.store=await a(this.endpoint,this.templateId,!1),this.personal=(null===(e=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===e?void 0:e.is_personal)||!0,this.public=(null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.is_public)||!1,this.dirty=!1}catch(i){console.log("[TEMPLATE VISIBILITY] Error loading template",i),null===(o=this.sdkError)||void 0===o||o.emit(new r(i.message,null===(l=i.response)||void 0===l?void 0:l.status,null===(n=i.response)||void 0===n?void 0:n.data))}}handleCancel(i){var e,t,s,o,l;i.stopPropagation(),this.personal=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.is_personal,this.public=null===(o=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===o?void 0:o.is_public,this.dirty=!1,null===(l=this.close)||void 0===l||l.emit()}async handleSave(i){var e,t;i.stopPropagation(),await l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),(null===(e=this.store)||void 0===e?void 0:e.state)&&(this.store.state.is_personal=this.personal,this.store.state.is_public=this.public),this.dirty=!1,null===(t=this.close)||void 0===t||t.emit()}render(){var i,e;return this.endpoint.session?this.endpoint.session&&(null===(e=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===e?void 0:e.isLoaded)?t(s,null,t("form",{onSubmit:i=>i.preventDefault(),onClick:i=>i.stopPropagation(),autocomplete:"off"},t("h5",null,"Visibility"),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-shared"},"Shared"),t("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:i=>{this.personal=!i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-public"},"Public"),t("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:i=>{this.public=i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),t("div",{class:"buttons"},t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:i=>this.handleCancel(i)}),t("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:i=>this.handleSave(i)})))):t(s,{class:"empty"}):t(s,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};n.style='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{n as verdocs_template_visibility}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):r(t.value).then(o,s)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return c([t,e])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=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(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];r=0}finally{n=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-4cb3fa5f.system.js","./p-54498887.system.js","./p-3fa63a12.system.js","./p-62aaeefd.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js"],(function(t){"use strict";var e,i,n,r,a,o,s,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;a=t.a},function(t){o=t.i},function(){},function(t){s=t.V},function(t){c=t.t},function(){},function(){},function(){},function(){},function(){}],execute:function(){var h="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var d=t("verdocs_envelope_document_page",function(){function t(t){e(this,t);this.pageRendered=i(this,"pageRendered",7);this.endpoint=s.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".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="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,o(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(c((function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];var a=r.contentRect.width;t.renderedWidth=a;t.renderedHeight=t.virtualHeight*(a/t.virtualWidth)}t.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};t.prototype.disconnectedCallback=function(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};t.prototype.render=function(){var t=this;var e="".concat(this.renderedHeight,"px");return n(r,{id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?n("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?n("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(t.containerId,"-").concat(i.name),src:t.pageDisplayUri,alt:"Page ".concat(t.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(e){t.naturalWidth=e.target.naturalWidth;t.naturalHeight=e.target.naturalHeight;t.aspectRatio=t.naturalWidth/t.naturalHeight;t.virtualHeight=t.virtualWidth/t.aspectRatio;t.renderedHeight=e.target.offsetWidth/t.aspectRatio}}):n("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());d.style=h}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(n.next(t))}catch(t){a(t)}}function s(t){try{c(n["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):r(t.value).then(o,s)}c((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return c([t,e])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=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(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=e.call(t,i)}catch(t){o=[6,t];r=0}finally{n=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-2dbc05c6.system.js","./p-4cb3fa5f.system.js","./p-54498887.system.js","./p-d808a494.system.js","./p-62aaeefd.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js"],(function(t){"use strict";var e,i,n,r,a,o,s,c;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;a=t.a},function(t){o=t.i},function(){},function(t){s=t.V},function(t){c=t.t},function(){},function(){},function(){},function(){},function(){}],execute:function(){var h="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var d=t("verdocs_envelope_document_page",function(){function t(t){e(this,t);this.pageRendered=i(this,"pageRendered",7);this.endpoint=s.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".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="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=this;return[4,o(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)];case 1:t.pageDisplayUri=e.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;this.resizeObserver=new ResizeObserver(c((function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];var a=r.contentRect.width;t.renderedWidth=a;t.renderedHeight=t.virtualHeight*(a/t.virtualWidth)}t.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};t.prototype.disconnectedCallback=function(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};t.prototype.render=function(){var t=this;var e="".concat(this.renderedHeight,"px");return n(r,{id:"".concat(this.containerId),style:{height:e,flex:"0 0 ".concat(e)}},this.layers.map((function(i){return i.type==="div"?n("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(t.containerId,"-").concat(i.name),style:{height:e}}):t.pageDisplayUri?n("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(t.containerId,"-").concat(i.name),src:t.pageDisplayUri,alt:"Page ".concat(t.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(e){t.naturalWidth=e.target.naturalWidth;t.naturalHeight=e.target.naturalHeight;t.aspectRatio=t.naturalWidth/t.naturalHeight;t.virtualHeight=t.virtualWidth/t.aspectRatio;t.renderedHeight=e.target.offsetWidth/t.aspectRatio}}):n("div",null)})))};Object.defineProperty(t.prototype,"container",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());d.style=h}}}));
@@ -1 +1 @@
1
- import{r as t,h as s,H as e}from"./p-6d3e0994.js";import"./p-05788c2b.js";import{V as i}from"./p-69462ccd.js";import{g as l}from"./p-2526d836.js";import"./p-21615f18.js";import"./p-6570268f.js";const o=class{constructor(s){t(this,s),this.store=null,this.endpoint=i.getDefault(),this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}async componentWillLoad(){try{this.endpoint.loadSession(),this.store=await l(this.endpoint,this.templateId,!1)}catch(t){console.log("[TEMPLATE VISIBILITY] Error loading template",t)}}render(){return console.log("[IPC] Rendering"),s(e,null,s("div",null,s("pre",null,s("code",null,JSON.stringify(this.store.state,null,2)))),s("verdocs-template-roles",{templateId:this.templateId}),s("verdocs-template-fields",{templateId:this.templateId}))}};o.style="ipc-test{max-width:800px;display:block}";export{o as ipc_test}
1
+ import{r as t,h as s,H as e}from"./p-6d3e0994.js";import"./p-05788c2b.js";import{V as i}from"./p-e06d9588.js";import{g as l}from"./p-ee6f2dd3.js";import"./p-21615f18.js";import"./p-6570268f.js";const o=class{constructor(s){t(this,s),this.store=null,this.endpoint=i.getDefault(),this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}async componentWillLoad(){try{this.endpoint.loadSession(),this.store=await l(this.endpoint,this.templateId,!1)}catch(t){console.log("[TEMPLATE VISIBILITY] Error loading template",t)}}render(){return console.log("[IPC] Rendering"),s(e,null,s("div",null,s("pre",null,s("code",null,JSON.stringify(this.store.state,null,2)))),s("verdocs-template-roles",{templateId:this.templateId}),s("verdocs-template-fields",{templateId:this.templateId}))}};o.style="ipc-test{max-width:800px;display:block}";export{o as ipc_test}
@@ -1 +1 @@
1
- import{r as e,c as t,h as s,H as i}from"./p-6d3e0994.js";import"./p-05788c2b.js";import{V as a,c as r}from"./p-69462ccd.js";import{a as l,d as n}from"./p-6570268f.js";import{V as o}from"./p-ed416acf.js";import{S as d}from"./p-7a1b2643.js";import{r as p,t as h,a as c,l as u,g as m}from"./p-4fe4e161.js";function v(e,t){p(2,arguments);var s=h(e),i=h(t),a=s.getTime()-i.getTime();return a<0?-1:a>0?1:a}function x(e,t){p(2,arguments);var s=h(e),i=h(t),a=s.getFullYear()-i.getFullYear(),r=s.getMonth()-i.getMonth();return 12*a+r}function f(e,t){return p(2,arguments),h(e).getTime()-h(t).getTime()}var g={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function w(e){return e?g[e]:g.trunc}function b(e){p(1,arguments);var t=h(e);return t.setHours(23,59,59,999),t}function k(e){p(1,arguments);var t=h(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}function M(e){p(1,arguments);var t=h(e);return b(t).getTime()===k(t).getTime()}function y(e,t){p(2,arguments);var s,i=h(e),a=h(t),r=v(i,a),l=Math.abs(x(i,a));if(l<1)s=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-r*l);var n=v(i,a)===-r;M(h(e))&&1===l&&1===v(e,a)&&(n=!1),s=r*(l-Number(n))}return 0===s?0:s}function S(e,t,s){p(2,arguments);var i=f(e,t)/1e3;return w(null==s?void 0:s.roundingMethod)(i)}function T(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}function A(e){return T({},e)}const E=[{value:"all",label:"All"},{value:"personal",label:"Personal"},{value:"shared",label:"Shared"},{value:"public",label:"Public"}],L=[{value:"all",label:"All"},{value:"starred",label:"Starred"},{value:"unstarred",label:"Not Starred"}],H=[{value:"name",label:"Name"},{value:"created_at",label:"Created"},{value:"updated_at",label:"Last Updated"},{value:"last_used_at",label:"Last Used"},{value:"counter",label:"Most Used"},{value:"star_counter",label:"Most Starred"}],j=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.viewTemplate=t(this,"viewTemplate",7),this.editTemplate=t(this,"editTemplate",7),this.templateDeleted=t(this,"templateDeleted",7),this.handleOptionSelected=(e,t)=>{var s,i;"send"===e?null===(s=this.viewTemplate)||void 0===s||s.emit({endpoint:this.endpoint,template:t}):"createlink"===e||"signnow"===e||"submitted"===e||"link"===e?o("This feature is coming soon!"):"edit"===e?null===(i=this.editTemplate)||void 0===i||i.emit({endpoint:this.endpoint,template:t}):"delete"===e&&(this.confirmDelete=t)},this.endpoint=a.getDefault(),this.sharing="all",this.starred="all",this.sort="updated_at",this.name="",this.allowedActions=["send","createlink","signnow","submitted","link","edit","delete"],this.selectedPage=0,this.count=0,this.loading=!0,this.confirmDelete=null,this.templates=[]}handleSharingUpdated(){return this.queryTemplates()}handleStarredUpdated(){return this.queryTemplates()}handleSortUpdated(){return this.queryTemplates()}handleNameUpdated(){return this.queryTemplates()}async componentWillLoad(){if(this.endpoint.loadSession(),this.endpoint.session)return this.queryTemplates();console.log("[TEMPLATES] Must be authenticated")}async queryTemplates(){var e,t,s;try{let e={page:this.selectedPage,ascending:"name"===this.sort||"star_counter"===this.sort,sort_by:this.sort};"all"!==this.sharing&&(e.is_personal="personal"===this.sharing,e.is_public="public"===this.sharing),"all"!==this.starred&&(e.is_starred="starred"===this.starred),""!==this.name.trim()&&(e.name=this.name.trim());const t=await l(this.endpoint,e);this.templates=t.result,this.count=t.total,this.loading=!1}catch(i){console.log("[TEMPLATES] Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new d(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}canDelete(e){return r(this.endpoint.session,"delete",e)}canEdit(e){return r(this.endpoint.session,"write",e)}canPreview(e){return r(this.endpoint.session,"read",e)}deleteTemplate(e){this.confirmDelete=null,n(this.endpoint,e.id).then((()=>{var t;return console.log("[TEMPLATES] Deleted template",e),null===(t=this.templateDeleted)||void 0===t||t.emit({endpoint:this.endpoint,template:e}),this.queryTemplates()})).catch((t=>{var s,i,a;console.log("[TEMPLATES] Error deleting template",e),null===(s=this.sdkError)||void 0===s||s.emit(new d(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(a=t.response)||void 0===a?void 0:a.data))}))}render(){return s(i,null,s("div",{class:"header"},s("div",{class:"filter"},s("verdocs-text-input",{id:"verdocs-filter-name",value:this.name,autocomplete:"off",placeholder:"Filter by Name...",onFocusout:e=>(this.name=e.target.value,this.queryTemplates())})),s("verdocs-quick-filter",{label:"Sharing",value:this.sharing,options:E,onOptionSelected:e=>(this.sharing=e.detail.value,this.queryTemplates())}),s("verdocs-quick-filter",{label:"Starred",value:this.starred,options:L,onOptionSelected:e=>(this.starred=e.detail.value,this.queryTemplates())}),s("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:H,onOptionSelected:e=>(this.sort=e.detail.value,this.queryTemplates())}),this.loading&&s("verdocs-spinner",{mode:"dark",size:24}),s("div",{style:{display:"flex",flex:"1"}})),this.templates.map((e=>{const t=[];return this.allowedActions.includes("send")&&t.push({label:"Send",id:"send",disabled:!this.canPreview(e)}),this.allowedActions.includes("createlink")&&t.push({label:"Create Link",id:"createlink",disabled:!0}),this.allowedActions.includes("createlink")&&t.push({label:"Sign Now",id:"signnow",disabled:!0}),this.allowedActions.includes("submitted")&&(t.push({label:""}),t.push({label:"Submissions",id:"submitted"})),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&(t.push({label:""}),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&t.push({label:"Get Preview Link",id:"link",disabled:!this.canPreview(e)}),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&t.push({label:"Edit",id:"edit",disabled:!this.canEdit(e)}),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&t.push({label:"Delete",id:"delete",disabled:!this.canDelete(e)})),s("div",{class:"template",onClick:()=>{var t;null===(t=this.viewTemplate)||void 0===t||t.emit({endpoint:this.endpoint,template:e})}},s("div",{class:"inner"},s("verdocs-template-star",{template:e,endpoint:this.endpoint}),s("div",{class:"spacer icon-spacer"}),s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>'}),s("div",{class:"name"},e.name),s("div",{class:"spacer usage-spacer"}),s("div",{class:"usage"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /></svg>'}),e.counter||"--"),s("div",{class:"spacer last-used-spacer"}),s("div",{class:"last-used"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" /></svg>'}),s("span",{style:{marginRight:"5px"}},"Last Used:"),e.last_used_at?function(e,t,s){var i,a;p(2,arguments);var r=m(),l=null!==(i=null!==(a=null==s?void 0:s.locale)&&void 0!==a?a:r.locale)&&void 0!==i?i:u;if(!l.formatDistance)throw new RangeError("locale must contain formatDistance property");var n=v(e,t);if(isNaN(n))throw new RangeError("Invalid time value");var o,d,x=T(A(s),{addSuffix:Boolean(null==s?void 0:s.addSuffix),comparison:n});n>0?(o=h(t),d=h(e)):(o=h(e),d=h(t));var f,g=S(d,o),w=(c(d)-c(o))/1e3,b=Math.round((g-w)/60);if(b<2)return null!=s&&s.includeSeconds?g<5?l.formatDistance("lessThanXSeconds",5,x):g<10?l.formatDistance("lessThanXSeconds",10,x):g<20?l.formatDistance("lessThanXSeconds",20,x):g<40?l.formatDistance("halfAMinute",0,x):l.formatDistance(g<60?"lessThanXMinutes":"xMinutes",1,x):0===b?l.formatDistance("lessThanXMinutes",1,x):l.formatDistance("xMinutes",b,x);if(b<45)return l.formatDistance("xMinutes",b,x);if(b<90)return l.formatDistance("aboutXHours",1,x);if(b<1440){var k=Math.round(b/60);return l.formatDistance("aboutXHours",k,x)}if(b<2520)return l.formatDistance("xDays",1,x);if(b<43200){var M=Math.round(b/1440);return l.formatDistance("xDays",M,x)}if(b<86400)return f=Math.round(b/43200),l.formatDistance("aboutXMonths",f,x);if((f=y(d,o))<12){var E=Math.round(b/43200);return l.formatDistance("xMonths",E,x)}var L=f%12,H=Math.floor(f/12);return L<3?l.formatDistance("aboutXYears",H,x):L<9?l.formatDistance("overXYears",H,x):l.formatDistance("almostXYears",H+1,x)}(new Date(e.last_used_at),new Date):"Never"),s("div",{class:"spacer ownership-spacer"}),e.is_public&&s("div",{class:"ownership"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>'})," Public"),!e.is_public&&!e.is_personal&&s("div",{class:"ownership"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" /></svg>'})," Private"),!e.is_public&&e.is_personal&&s("div",{class:"ownership"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21" /></svg>'})," Shared"),s("verdocs-dropdown",{options:t,onOptionSelected:t=>this.handleOptionSelected(t.detail.id,e)})))})),this.templates.length?s("div",{style:{marginTop:"10px"}},s("verdocs-pagination",{selectedPage:this.selectedPage,perPage:10,itemCount:this.count,onSelectPage:e=>(this.selectedPage=e.detail.selectedPage,this.queryTemplates())})):s("div",{class:"empty-text"},"No matching templates found. Please adjust your filters and try again."),this.confirmDelete&&s("verdocs-ok-dialog",{heading:"Delete this Template?",message:"This operation cannot be undone.",onNext:()=>this.deleteTemplate(this.confirmDelete),onExit:()=>this.confirmDelete=null,showCancel:!0}))}static get watchers(){return{sharing:["handleSharingUpdated"],starred:["handleStarredUpdated"],sort:["handleSortUpdated"],name:["handleNameUpdated"]}}};j.style='verdocs-templates-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-templates-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .header .filter{width:150px}verdocs-templates-list .header verdocs-text-input{margin:0}verdocs-templates-list .header verdocs-text-input input{height:32px}verdocs-templates-list .filter{-ms-flex-align:center;align-items:center}verdocs-templates-list .template{width:100%;margin:3px 0;background:#ffffff}verdocs-templates-list .template:hover{cursor:pointer;background:#f5f5fa}verdocs-templates-list .template .inner{gap:10px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-templates-list .template .inner svg{width:24px;height:24px}verdocs-templates-list .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:black;font-size:18px;margin-left:10px}@media screen and (max-width: 1300px){verdocs-templates-list .name{font-size:16px}}verdocs-templates-list .spacer{margin:0;height:30px;-ms-flex:0 0 1px;flex:0 0 1px;display:-ms-flexbox;display:flex;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-templates-list .spacer{margin:12px 0;border-top:1px solid #dad8dd;border-right:none}}verdocs-templates-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-templates-list .ownership{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 100px;flex:0 0 100px;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .ownership svg{width:24px;height:24px;margin-right:8px}verdocs-templates-list .last-used{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 280px;flex:0 0 280px;font-size:16px;margin:0 0 0 10px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-templates-list .last-used svg{width:24px;height:24px;margin-right:8px}verdocs-templates-list .usage{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .usage svg{width:24px;height:24px;margin-right:8px}';export{j as verdocs_templates_list}
1
+ import{r as e,c as t,h as s,H as i}from"./p-6d3e0994.js";import"./p-05788c2b.js";import{V as a,c as r}from"./p-e06d9588.js";import{a as l,d as n}from"./p-6570268f.js";import{V as o}from"./p-ed416acf.js";import{S as d}from"./p-7a1b2643.js";import{r as p,t as h,a as c,l as u,g as m}from"./p-4fe4e161.js";function v(e,t){p(2,arguments);var s=h(e),i=h(t),a=s.getTime()-i.getTime();return a<0?-1:a>0?1:a}function x(e,t){p(2,arguments);var s=h(e),i=h(t),a=s.getFullYear()-i.getFullYear(),r=s.getMonth()-i.getMonth();return 12*a+r}function f(e,t){return p(2,arguments),h(e).getTime()-h(t).getTime()}var g={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function w(e){return e?g[e]:g.trunc}function b(e){p(1,arguments);var t=h(e);return t.setHours(23,59,59,999),t}function k(e){p(1,arguments);var t=h(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}function M(e){p(1,arguments);var t=h(e);return b(t).getTime()===k(t).getTime()}function y(e,t){p(2,arguments);var s,i=h(e),a=h(t),r=v(i,a),l=Math.abs(x(i,a));if(l<1)s=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-r*l);var n=v(i,a)===-r;M(h(e))&&1===l&&1===v(e,a)&&(n=!1),s=r*(l-Number(n))}return 0===s?0:s}function S(e,t,s){p(2,arguments);var i=f(e,t)/1e3;return w(null==s?void 0:s.roundingMethod)(i)}function T(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}function A(e){return T({},e)}const E=[{value:"all",label:"All"},{value:"personal",label:"Personal"},{value:"shared",label:"Shared"},{value:"public",label:"Public"}],L=[{value:"all",label:"All"},{value:"starred",label:"Starred"},{value:"unstarred",label:"Not Starred"}],H=[{value:"name",label:"Name"},{value:"created_at",label:"Created"},{value:"updated_at",label:"Last Updated"},{value:"last_used_at",label:"Last Used"},{value:"counter",label:"Most Used"},{value:"star_counter",label:"Most Starred"}],j=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.viewTemplate=t(this,"viewTemplate",7),this.editTemplate=t(this,"editTemplate",7),this.templateDeleted=t(this,"templateDeleted",7),this.handleOptionSelected=(e,t)=>{var s,i;"send"===e?null===(s=this.viewTemplate)||void 0===s||s.emit({endpoint:this.endpoint,template:t}):"createlink"===e||"signnow"===e||"submitted"===e||"link"===e?o("This feature is coming soon!"):"edit"===e?null===(i=this.editTemplate)||void 0===i||i.emit({endpoint:this.endpoint,template:t}):"delete"===e&&(this.confirmDelete=t)},this.endpoint=a.getDefault(),this.sharing="all",this.starred="all",this.sort="updated_at",this.name="",this.allowedActions=["send","createlink","signnow","submitted","link","edit","delete"],this.selectedPage=0,this.count=0,this.loading=!0,this.confirmDelete=null,this.templates=[]}handleSharingUpdated(){return this.queryTemplates()}handleStarredUpdated(){return this.queryTemplates()}handleSortUpdated(){return this.queryTemplates()}handleNameUpdated(){return this.queryTemplates()}async componentWillLoad(){if(this.endpoint.loadSession(),this.endpoint.session)return this.queryTemplates();console.log("[TEMPLATES] Must be authenticated")}async queryTemplates(){var e,t,s;try{let e={page:this.selectedPage,ascending:"name"===this.sort||"star_counter"===this.sort,sort_by:this.sort};"all"!==this.sharing&&(e.is_personal="personal"===this.sharing,e.is_public="public"===this.sharing),"all"!==this.starred&&(e.is_starred="starred"===this.starred),""!==this.name.trim()&&(e.name=this.name.trim());const t=await l(this.endpoint,e);this.templates=t.result,this.count=t.total,this.loading=!1}catch(i){console.log("[TEMPLATES] Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new d(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}canDelete(e){return r(this.endpoint.session,"delete",e)}canEdit(e){return r(this.endpoint.session,"write",e)}canPreview(e){return r(this.endpoint.session,"read",e)}deleteTemplate(e){this.confirmDelete=null,n(this.endpoint,e.id).then((()=>{var t;return console.log("[TEMPLATES] Deleted template",e),null===(t=this.templateDeleted)||void 0===t||t.emit({endpoint:this.endpoint,template:e}),this.queryTemplates()})).catch((t=>{var s,i,a;console.log("[TEMPLATES] Error deleting template",e),null===(s=this.sdkError)||void 0===s||s.emit(new d(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(a=t.response)||void 0===a?void 0:a.data))}))}render(){return s(i,null,s("div",{class:"header"},s("div",{class:"filter"},s("verdocs-text-input",{id:"verdocs-filter-name",value:this.name,autocomplete:"off",placeholder:"Filter by Name...",onFocusout:e=>(this.name=e.target.value,this.queryTemplates())})),s("verdocs-quick-filter",{label:"Sharing",value:this.sharing,options:E,onOptionSelected:e=>(this.sharing=e.detail.value,this.queryTemplates())}),s("verdocs-quick-filter",{label:"Starred",value:this.starred,options:L,onOptionSelected:e=>(this.starred=e.detail.value,this.queryTemplates())}),s("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:H,onOptionSelected:e=>(this.sort=e.detail.value,this.queryTemplates())}),this.loading&&s("verdocs-spinner",{mode:"dark",size:24}),s("div",{style:{display:"flex",flex:"1"}})),this.templates.map((e=>{const t=[];return this.allowedActions.includes("send")&&t.push({label:"Send",id:"send",disabled:!this.canPreview(e)}),this.allowedActions.includes("createlink")&&t.push({label:"Create Link",id:"createlink",disabled:!0}),this.allowedActions.includes("createlink")&&t.push({label:"Sign Now",id:"signnow",disabled:!0}),this.allowedActions.includes("submitted")&&(t.push({label:""}),t.push({label:"Submissions",id:"submitted"})),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&(t.push({label:""}),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&t.push({label:"Get Preview Link",id:"link",disabled:!this.canPreview(e)}),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&t.push({label:"Edit",id:"edit",disabled:!this.canEdit(e)}),(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete"))&&t.push({label:"Delete",id:"delete",disabled:!this.canDelete(e)})),s("div",{class:"template",onClick:()=>{var t;null===(t=this.viewTemplate)||void 0===t||t.emit({endpoint:this.endpoint,template:e})}},s("div",{class:"inner"},s("verdocs-template-star",{template:e,endpoint:this.endpoint}),s("div",{class:"spacer icon-spacer"}),s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>'}),s("div",{class:"name"},e.name),s("div",{class:"spacer usage-spacer"}),s("div",{class:"usage"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /></svg>'}),e.counter||"--"),s("div",{class:"spacer last-used-spacer"}),s("div",{class:"last-used"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" /></svg>'}),s("span",{style:{marginRight:"5px"}},"Last Used:"),e.last_used_at?function(e,t,s){var i,a;p(2,arguments);var r=m(),l=null!==(i=null!==(a=null==s?void 0:s.locale)&&void 0!==a?a:r.locale)&&void 0!==i?i:u;if(!l.formatDistance)throw new RangeError("locale must contain formatDistance property");var n=v(e,t);if(isNaN(n))throw new RangeError("Invalid time value");var o,d,x=T(A(s),{addSuffix:Boolean(null==s?void 0:s.addSuffix),comparison:n});n>0?(o=h(t),d=h(e)):(o=h(e),d=h(t));var f,g=S(d,o),w=(c(d)-c(o))/1e3,b=Math.round((g-w)/60);if(b<2)return null!=s&&s.includeSeconds?g<5?l.formatDistance("lessThanXSeconds",5,x):g<10?l.formatDistance("lessThanXSeconds",10,x):g<20?l.formatDistance("lessThanXSeconds",20,x):g<40?l.formatDistance("halfAMinute",0,x):l.formatDistance(g<60?"lessThanXMinutes":"xMinutes",1,x):0===b?l.formatDistance("lessThanXMinutes",1,x):l.formatDistance("xMinutes",b,x);if(b<45)return l.formatDistance("xMinutes",b,x);if(b<90)return l.formatDistance("aboutXHours",1,x);if(b<1440){var k=Math.round(b/60);return l.formatDistance("aboutXHours",k,x)}if(b<2520)return l.formatDistance("xDays",1,x);if(b<43200){var M=Math.round(b/1440);return l.formatDistance("xDays",M,x)}if(b<86400)return f=Math.round(b/43200),l.formatDistance("aboutXMonths",f,x);if((f=y(d,o))<12){var E=Math.round(b/43200);return l.formatDistance("xMonths",E,x)}var L=f%12,H=Math.floor(f/12);return L<3?l.formatDistance("aboutXYears",H,x):L<9?l.formatDistance("overXYears",H,x):l.formatDistance("almostXYears",H+1,x)}(new Date(e.last_used_at),new Date):"Never"),s("div",{class:"spacer ownership-spacer"}),e.is_public&&s("div",{class:"ownership"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>'})," Public"),!e.is_public&&!e.is_personal&&s("div",{class:"ownership"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" /></svg>'})," Private"),!e.is_public&&e.is_personal&&s("div",{class:"ownership"},s("span",{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21" /></svg>'})," Shared"),s("verdocs-dropdown",{options:t,onOptionSelected:t=>this.handleOptionSelected(t.detail.id,e)})))})),this.templates.length?s("div",{style:{marginTop:"10px"}},s("verdocs-pagination",{selectedPage:this.selectedPage,perPage:10,itemCount:this.count,onSelectPage:e=>(this.selectedPage=e.detail.selectedPage,this.queryTemplates())})):s("div",{class:"empty-text"},"No matching templates found. Please adjust your filters and try again."),this.confirmDelete&&s("verdocs-ok-dialog",{heading:"Delete this Template?",message:"This operation cannot be undone.",onNext:()=>this.deleteTemplate(this.confirmDelete),onExit:()=>this.confirmDelete=null,showCancel:!0}))}static get watchers(){return{sharing:["handleSharingUpdated"],starred:["handleStarredUpdated"],sort:["handleSortUpdated"],name:["handleNameUpdated"]}}};j.style='verdocs-templates-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-templates-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .header .filter{width:150px}verdocs-templates-list .header verdocs-text-input{margin:0}verdocs-templates-list .header verdocs-text-input input{height:32px}verdocs-templates-list .filter{-ms-flex-align:center;align-items:center}verdocs-templates-list .template{width:100%;margin:3px 0;background:#ffffff}verdocs-templates-list .template:hover{cursor:pointer;background:#f5f5fa}verdocs-templates-list .template .inner{gap:10px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-templates-list .template .inner svg{width:24px;height:24px}verdocs-templates-list .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:black;font-size:18px;margin-left:10px}@media screen and (max-width: 1300px){verdocs-templates-list .name{font-size:16px}}verdocs-templates-list .spacer{margin:0;height:30px;-ms-flex:0 0 1px;flex:0 0 1px;display:-ms-flexbox;display:flex;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-templates-list .spacer{margin:12px 0;border-top:1px solid #dad8dd;border-right:none}}verdocs-templates-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-templates-list .ownership{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 100px;flex:0 0 100px;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .ownership svg{width:24px;height:24px;margin-right:8px}verdocs-templates-list .last-used{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 280px;flex:0 0 280px;font-size:16px;margin:0 0 0 10px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-templates-list .last-used svg{width:24px;height:24px;margin-right:8px}verdocs-templates-list .usage{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .usage svg{width:24px;height:24px;margin-right:8px}';export{j as verdocs_templates_list}
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[s]=t[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,i){function s(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function l(e){try{r(i.next(e))}catch(e){o(e)}}function a(e){try{r(i["throw"](e))}catch(e){o(e)}}function r(e){e.done?n(e.value):s(e.value).then(l,a)}r((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,s,o,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return r([e,t])}}function r(l){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,s&&(o=l[0]&2?s["return"]:l[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;if(s=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;s=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1];o=l;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(l);break}if(o[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];s=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,o;i<s;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-2dbc05c6.system.js","./p-4cb3fa5f.system.js","./p-65e7b32a.system.js","./p-54498887.system.js","./p-3fa63a12.system.js","./p-62aaeefd.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js"],(function(e){"use strict";var t,n,i,s,o,l,a,r,d,c,p,u,v;return{setters:[function(e){t=e.r;n=e.c;i=e.h;s=e.H},function(e){o=e.s;l=e.c},function(e){a=e.g;r=e.a;d=e.b},function(){},function(e){c=e.V},function(e){p=e.s},function(e){u=e.V},function(e){v=e.S},function(){},function(){},function(){},function(){},function(){}],execute:function(){var f='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:150px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:14px;display:-ms-flexbox;display:flex;padding:8px 20px;border-radius:6px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;font-size:16px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;font-size:18px;overflow:hidden;line-height:28px;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}';var h='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var g=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var x=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var y=e("verdocs_envelopes_list",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.viewEnvelope=n(this,"viewEnvelope",7);this.finishLater=n(this,"finishLater",7);this.endpoint=c.getDefault();this.view=undefined;this.status="all";this.sort="updated_at";this.name="";this.containing="";this.selectedPage=0;this.count=0;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleNameUpdated=function(){return this.queryEnvelopes()};e.prototype.handleContainingUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ENVELOPES] Must be authenticated");return}return this.queryEnvelopes()};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i,s,l;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage+1,limit:10};switch(this.view){case"all":i=__assign(__assign({},i),{sort_by:this.sort,ascending:this.sort==="envelope_name",envelope_status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign(__assign({},i),{is_recipient:true,sort_by:"updated_at",recipient_status:["invited","declined","opened","signed","submitted","canceled"]});break;case"sent":i=__assign(__assign({},i),{is_owner:true,sort_by:"updated_at"});break;case"action":i=__assign(__assign({},i),{sort_by:"updated_at",is_recipient:true,envelope_status:["pending","in progress"],recipient_status:["invited","opened","signed"]});break;case"waiting":i=__assign(__assign({},i),{is_owner:true,sort_by:"updated_at",ascending:false,envelope_status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{sort_by:"updated_at",ascending:false,envelope_status:["complete"]});break;default:i=__assign(__assign({},i),{sort_by:"updated_at",ascending:false,envelope_status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.envelope_status=[this.status]}}if(this.sort!=="updated_at"){i.sort_by=this.sort;i.ascending=this.sort==="envelope_name"}if(this.name.trim()){i.name=this.name.trim()}if(this.containing.trim()){i.text_field_value=this.containing.trim()}return[4,o(this.endpoint,i)];case 1:s=a.sent();this.envelopes=s.result;this.count=s.total;this.loading=false;return[3,3];case 2:l=a.sent();console.log("[ENVELOPES] Error with preview session",l);this.loading=true;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new v(l.message,(t=l.response)===null||t===void 0?void 0:t.status,(n=l.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;p(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);u("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){p(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);u("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return i(s,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.name,autocomplete:"off",placeholder:"Filter by Name...",onFocusout:function(t){e.name=t.target.value;return e.queryEnvelopes()}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:g,onOptionSelected:function(t){e.view=t.detail.value;return e.queryEnvelopes()}}),this.view==="all"&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:m,onOptionSelected:function(t){e.status=t.detail.value;return e.queryEnvelopes()}}),this.view==="all"&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:x,onOptionSelected:function(t){e.sort=t.detail.value;return e.queryEnvelopes()}}),i("div",{class:"containing"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-containing",value:this.containing,autocomplete:"off",placeholder:"Fields Containing...",onInput:function(t){e.containing=t.target.value;return e.queryEnvelopes()}}))),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(t){var n;var s=a(t);var o=d(e.endpoint.session,t);var c=s.find((function(t){var n;return t.email===((n=e.endpoint.session)===null||n===void 0?void 0:n.email)||""}));var p=c&&o&&r(((n=e.endpoint.session)===null||n===void 0?void 0:n.email)||"",s);var v=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!p},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!o}];return i("div",{class:"envelope",key:t.id,onClick:function(){var n;return(n=e.viewEnvelope)===null||n===void 0?void 0:n.emit({endpoint:e.endpoint,envelope:t})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===t.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(n){if(n.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[t],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==t.id}))}}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:h}),i("div",{class:"envelope-name"},t.name,":  ",i("div",{class:"envelope-recipients"},t.recipients.map((function(e){return e.full_name})).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:t,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(t.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:v,onOptionSelected:function(n){var i,s;switch(n.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:t});break;case"finish":(s=e.finishLater)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:t});break;case"download":e.downloadEnvelope(t);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){l(e.endpoint,t.id).then((function(){return u("Envelope canceled")})).catch((function(e){return u("Unable to cancel envelope: "+e.messabge,{style:"error"})}))}break}}})))})),!this.loading&&!this.envelopes.length?i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."):i("div",{style:{marginTop:"10px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:10,itemCount:this.count,onSelectPage:function(t){e.selectedPage=t.detail.selectedPage;return e.queryEnvelopes()}})))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],name:["handleNameUpdated"],containing:["handleContainingUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}());y.style=f}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[s]=t[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,i){function s(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function l(e){try{r(i.next(e))}catch(e){o(e)}}function a(e){try{r(i["throw"](e))}catch(e){o(e)}}function r(e){e.done?n(e.value):s(e.value).then(l,a)}r((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,s,o,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(t){return r([e,t])}}function r(l){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,s&&(o=l[0]&2?s["return"]:l[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;if(s=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;s=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1];o=l;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(l);break}if(o[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];s=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,o;i<s;i++){if(o||!(i in t)){if(!o)o=Array.prototype.slice.call(t,0,i);o[i]=t[i]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-2dbc05c6.system.js","./p-4cb3fa5f.system.js","./p-65e7b32a.system.js","./p-54498887.system.js","./p-d808a494.system.js","./p-62aaeefd.system.js","./p-ca13070e.system.js","./p-187b20b7.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js"],(function(e){"use strict";var t,n,i,s,o,l,a,r,d,c,p,u,v;return{setters:[function(e){t=e.r;n=e.c;i=e.h;s=e.H},function(e){o=e.s;l=e.c},function(e){a=e.g;r=e.a;d=e.b},function(){},function(e){c=e.V},function(e){p=e.s},function(e){u=e.V},function(e){v=e.S},function(){},function(){},function(){},function(){},function(){}],execute:function(){var f='verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:150px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:14px;display:-ms-flexbox;display:flex;padding:8px 20px;border-radius:6px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;font-size:16px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;font-size:18px;overflow:hidden;line-height:28px;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}';var h='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var g=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var x=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var y=e("verdocs_envelopes_list",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.viewEnvelope=n(this,"viewEnvelope",7);this.finishLater=n(this,"finishLater",7);this.endpoint=c.getDefault();this.view=undefined;this.status="all";this.sort="updated_at";this.name="";this.containing="";this.selectedPage=0;this.count=0;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleNameUpdated=function(){return this.queryEnvelopes()};e.prototype.handleContainingUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ENVELOPES] Must be authenticated");return}return this.queryEnvelopes()};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i,s,l;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage+1,limit:10};switch(this.view){case"all":i=__assign(__assign({},i),{sort_by:this.sort,ascending:this.sort==="envelope_name",envelope_status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign(__assign({},i),{is_recipient:true,sort_by:"updated_at",recipient_status:["invited","declined","opened","signed","submitted","canceled"]});break;case"sent":i=__assign(__assign({},i),{is_owner:true,sort_by:"updated_at"});break;case"action":i=__assign(__assign({},i),{sort_by:"updated_at",is_recipient:true,envelope_status:["pending","in progress"],recipient_status:["invited","opened","signed"]});break;case"waiting":i=__assign(__assign({},i),{is_owner:true,sort_by:"updated_at",ascending:false,envelope_status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{sort_by:"updated_at",ascending:false,envelope_status:["complete"]});break;default:i=__assign(__assign({},i),{sort_by:"updated_at",ascending:false,envelope_status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.envelope_status=[this.status]}}if(this.sort!=="updated_at"){i.sort_by=this.sort;i.ascending=this.sort==="envelope_name"}if(this.name.trim()){i.name=this.name.trim()}if(this.containing.trim()){i.text_field_value=this.containing.trim()}return[4,o(this.endpoint,i)];case 1:s=a.sent();this.envelopes=s.result;this.count=s.total;this.loading=false;return[3,3];case 2:l=a.sent();console.log("[ENVELOPES] Error with preview session",l);this.loading=true;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new v(l.message,(t=l.response)===null||t===void 0?void 0:t.status,(n=l.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;p(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);u("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){p(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);u("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return i(s,null,i("div",{class:"header"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-name",value:this.name,autocomplete:"off",placeholder:"Filter by Name...",onFocusout:function(t){e.name=t.target.value;return e.queryEnvelopes()}})),i("verdocs-quick-filter",{label:"View",value:this.view,options:g,onOptionSelected:function(t){e.view=t.detail.value;return e.queryEnvelopes()}}),this.view==="all"&&i("verdocs-quick-filter",{label:"Status",value:this.status,options:m,onOptionSelected:function(t){e.status=t.detail.value;return e.queryEnvelopes()}}),this.view==="all"&&i("verdocs-quick-filter",{label:"Sort By",value:this.sort,options:x,onOptionSelected:function(t){e.sort=t.detail.value;return e.queryEnvelopes()}}),i("div",{class:"containing"},i("div",{class:"filter"},i("verdocs-text-input",{id:"verdocs-filter-containing",value:this.containing,autocomplete:"off",placeholder:"Fields Containing...",onInput:function(t){e.containing=t.target.value;return e.queryEnvelopes()}}))),this.loading&&i("verdocs-spinner",{mode:"dark",size:24}),i("div",{style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(t){var n;var s=a(t);var o=d(e.endpoint.session,t);var c=s.find((function(t){var n;return t.email===((n=e.endpoint.session)===null||n===void 0?void 0:n.email)||""}));var p=c&&o&&r(((n=e.endpoint.session)===null||n===void 0?void 0:n.email)||"",s);var v=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!p},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!o}];return i("div",{class:"envelope",key:t.id,onClick:function(){var n;return(n=e.viewEnvelope)===null||n===void 0?void 0:n.emit({endpoint:e.endpoint,envelope:t})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===t.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(n){if(n.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[t],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==t.id}))}}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:h}),i("div",{class:"envelope-name"},t.name,":  ",i("div",{class:"envelope-recipients"},t.recipients.map((function(e){return e.full_name})).join(", "))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:t,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(t.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:v,onOptionSelected:function(n){var i,s;switch(n.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:t});break;case"finish":(s=e.finishLater)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:t});break;case"download":e.downloadEnvelope(t);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){l(e.endpoint,t.id).then((function(){return u("Envelope canceled")})).catch((function(e){return u("Unable to cancel envelope: "+e.messabge,{style:"error"})}))}break}}})))})),!this.loading&&!this.envelopes.length?i("div",{class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."):i("div",{style:{marginTop:"10px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:10,itemCount:this.count,onSelectPage:function(t){e.selectedPage=t.detail.selectedPage;return e.queryEnvelopes()}})))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],name:["handleNameUpdated"],containing:["handleContainingUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}());y.style=f}}}));
@@ -1 +1 @@
1
- import{r as i,c as t,h as e,H as o}from"./p-6d3e0994.js";import{g as a}from"./p-72c63106.js";import"./p-05788c2b.js";import{V as s}from"./p-69462ccd.js";import{i as n}from"./p-7291906c.js";import{S as r}from"./p-7a1b2643.js";const l=class{constructor(e){i(this,e),this.sdkError=t(this,"sdkError",7),this.viewEnvelope=t(this,"viewEnvelope",7),this.viewAll=t(this,"viewAll",7),this.endpoint=s.getDefault(),this.items=5,this.view=void 0,this.header=void 0,this.title="",this.count=0,this.loading=!0,this.entries=[]}async componentWillLoad(){var i,t,e;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[ACTIVITIES] Must be authenticated");this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o),null===(i=this.sdkError)||void 0===i||i.emit(new r(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(e=o.response)||void 0===e?void 0:e.data))}}handleItemsUpdated(){return this.loadActivity()}handleViewUpdated(){return this.loadActivity()}async loadActivity(){this.loading=!0;const i=await a(this.endpoint,0);let t;"action"===this.view?(t="Action Required",this.entries=i.action_required.result,this.count=i.action_required.total):"waiting"===this.view?(t="Waiting on Others",this.entries=i.waiting_others.result,this.count=i.waiting_others.total):"completed"===this.view&&(t="Completed",this.entries=i.completed.result,this.count=i.completed.total),this.title=void 0!==this.header?this.header:t,this.loading=!1}render(){return this.loading?e(o,{style:{minHeight:"300px"}},this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(0)")),n(0,this.items).map((()=>e("div",{class:"loading-placeholder"},e("div",{class:"loading-placeholder-bg"}))))):e(o,null,this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(",this.count,")"),e("div",{class:"spacer"}),e("verdocs-button",{label:"View All",size:"small",onClick:()=>{var i;return null===(i=this.viewAll)||void 0===i?void 0:i.emit({endpoint:this.endpoint,view:this.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((i=>e("div",{class:"activity-entry",onClick:()=>{var t;null===(t=this.viewEnvelope)||void 0===t||t.emit({endpoint:this.endpoint,entry:i})}},e("div",{class:"title"},i.name,e("br",null)," ",e("strong",null,i.recipient.name)),e("div",{class:"time-ago"},function(i){if(null==i)return"";var t;if("string"==typeof i||"number"==typeof i)t=new Date(i);else{if("object"!=typeof i)return"";t=i}var e=Math.floor(((new Date).getTime()-t.getTime())/1e3);return e>=31536e3?Math.floor(e/31536e3)+"Y":e>=604800?Math.floor(e/604800)+"W":e>=86400?Math.floor(e/86400)+"D":e>=3600?Math.floor(e/3600)+"H":e>=60?Math.floor(e/60)+"M":"".concat(e,"S")}(i.updated_at))))):e("img",{src:"https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png",alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))}static get watchers(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}}};l.style='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';export{l as verdocs_activity_box}
1
+ import{r as i,c as t,h as e,H as o}from"./p-6d3e0994.js";import{g as a}from"./p-72c63106.js";import"./p-05788c2b.js";import{V as s}from"./p-e06d9588.js";import{i as n}from"./p-7291906c.js";import{S as r}from"./p-7a1b2643.js";const l=class{constructor(e){i(this,e),this.sdkError=t(this,"sdkError",7),this.viewEnvelope=t(this,"viewEnvelope",7),this.viewAll=t(this,"viewAll",7),this.endpoint=s.getDefault(),this.items=5,this.view=void 0,this.header=void 0,this.title="",this.count=0,this.loading=!0,this.entries=[]}async componentWillLoad(){var i,t,e;try{if(this.endpoint.loadSession(),!this.endpoint.session)return void console.log("[ACTIVITIES] Must be authenticated");this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o),null===(i=this.sdkError)||void 0===i||i.emit(new r(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(e=o.response)||void 0===e?void 0:e.data))}}handleItemsUpdated(){return this.loadActivity()}handleViewUpdated(){return this.loadActivity()}async loadActivity(){this.loading=!0;const i=await a(this.endpoint,0);let t;"action"===this.view?(t="Action Required",this.entries=i.action_required.result,this.count=i.action_required.total):"waiting"===this.view?(t="Waiting on Others",this.entries=i.waiting_others.result,this.count=i.waiting_others.total):"completed"===this.view&&(t="Completed",this.entries=i.completed.result,this.count=i.completed.total),this.title=void 0!==this.header?this.header:t,this.loading=!1}render(){return this.loading?e(o,{style:{minHeight:"300px"}},this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(0)")),n(0,this.items).map((()=>e("div",{class:"loading-placeholder"},e("div",{class:"loading-placeholder-bg"}))))):e(o,null,this.title&&e("div",{class:"box-title"},this.title," ",e("span",{class:"count"},"(",this.count,")"),e("div",{class:"spacer"}),e("verdocs-button",{label:"View All",size:"small",onClick:()=>{var i;return null===(i=this.viewAll)||void 0===i?void 0:i.emit({endpoint:this.endpoint,view:this.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((i=>e("div",{class:"activity-entry",onClick:()=>{var t;null===(t=this.viewEnvelope)||void 0===t||t.emit({endpoint:this.endpoint,entry:i})}},e("div",{class:"title"},i.name,e("br",null)," ",e("strong",null,i.recipient.name)),e("div",{class:"time-ago"},function(i){if(null==i)return"";var t;if("string"==typeof i||"number"==typeof i)t=new Date(i);else{if("object"!=typeof i)return"";t=i}var e=Math.floor(((new Date).getTime()-t.getTime())/1e3);return e>=31536e3?Math.floor(e/31536e3)+"Y":e>=604800?Math.floor(e/604800)+"W":e>=86400?Math.floor(e/86400)+"D":e>=3600?Math.floor(e/3600)+"H":e>=60?Math.floor(e/60)+"M":"".concat(e,"S")}(i.updated_at))))):e("img",{src:"https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png",alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))}static get watchers(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}}};l.style='verdocs-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';export{l as verdocs_activity_box}
@@ -1 +1 @@
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 s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):i(e.value).then(s,a)}l((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,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(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=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++;i=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];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[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-54498887.system.js","./p-3fa63a12.system.js","./p-62aaeefd.system.js","./p-d8f1b3af.system.js","./p-187b20b7.system.js","./p-bbee73c8.system.js","./p-4cb3fa5f.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js","./p-2c95d99b.system.js","./p-11de0d75.system.js"],(function(e){"use strict";var t,n,r,i,o,s,a,l,u,c;return{setters:[function(e){t=e.r;n=e.c;r=e.h;i=e.H},function(){},function(e){o=e.V},function(e){s=e.r;a=e.a},function(e){l=e.g;u=e.a},function(e){c=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var d='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var f=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.store=null;this.endpoint=o.getDefault();this.templateId=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,l(this.endpoint,this.templateId,true)];case 1:r.store=o.sent();console.log("[PREVIEW] Loading template ".concat(this.templateId),this.endpoint.session);return[3,3];case 2:i=o.sent();console.log("[PREVIEW] Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(n=i.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handlePageRendered=function(e){var t=this;var n,r;var i=e.detail;var o=(r=(n=this.store)===null||n===void 0?void 0:n.state)===null||r===void 0?void 0:r.fields.filter((function(e){return e.page_sequence===i.pageNumber}));o.forEach((function(e){return s(e,i,a(u(t.store),e.role_name),{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,n,o,s;if(!((n=(t=this.store)===null||t===void 0?void 0:t.state)===null||n===void 0?void 0:n.isLoaded)){return r(i,null,r("verdocs-loader",null))}var a=__spreadArray([],(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.pages,true);a.sort((function(e,t){return e.sequence-t.sequence}));return r(i,null,a.map((function(t){return r("verdocs-template-document-page",{templateId:t.template_id,documentId:t.document_id,pageNumber:t.sequence,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}());f.style=d}}}));
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 s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):i(e.value).then(s,a)}l((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,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(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=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++;i=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];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[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-54498887.system.js","./p-d808a494.system.js","./p-62aaeefd.system.js","./p-a4129b09.system.js","./p-187b20b7.system.js","./p-bbee73c8.system.js","./p-4cb3fa5f.system.js","./p-327858f0.system.js","./p-7fd7152d.system.js","./p-1d010a79.system.js","./p-9dde58a8.system.js","./p-2c95d99b.system.js","./p-11de0d75.system.js"],(function(e){"use strict";var t,n,r,i,o,s,a,l,u,c;return{setters:[function(e){t=e.r;n=e.c;r=e.h;i=e.H},function(){},function(e){o=e.V},function(e){s=e.r;a=e.a},function(e){l=e.g;u=e.a},function(e){c=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var d='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var p=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.store=null;this.endpoint=o.getDefault();this.templateId=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,l(this.endpoint,this.templateId,true)];case 1:r.store=o.sent();console.log("[PREVIEW] Loading template ".concat(this.templateId),this.endpoint.session);return[3,3];case 2:i=o.sent();console.log("[PREVIEW] Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(n=i.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handlePageRendered=function(e){var t=this;var n,r;var i=e.detail;var o=(r=(n=this.store)===null||n===void 0?void 0:n.state)===null||r===void 0?void 0:r.fields.filter((function(e){return e.page_sequence===i.pageNumber}));o.forEach((function(e){return s(e,i,a(u(t.store),e.role_name),{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,n,o,s;if(!((n=(t=this.store)===null||t===void 0?void 0:t.state)===null||n===void 0?void 0:n.isLoaded)){return r(i,null,r("verdocs-loader",null))}var a=__spreadArray([],(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.pages,true);a.sort((function(e,t){return e.sequence-t.sequence}));return r(i,null,a.map((function(t){return r("verdocs-template-document-page",{templateId:t.template_id,documentId:t.document_id,pageNumber:t.sequence,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}());p.style=d}}}));