@verdocs/web-sdk 2.3.74 → 2.3.75

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 (74) hide show
  1. package/dist/cjs/{utils-7fe82705.js → utils-13f8ed3f.js} +1 -1
  2. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  3. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-field-attachment_15.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-preview_8.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-sign.cjs.entry.js +4 -1
  11. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +23 -30
  12. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  13. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -0
  14. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +23 -30
  15. package/dist/collection/utils/utils.js +1 -1
  16. package/dist/components/utils.js +1 -1
  17. package/dist/components/verdocs-sign.js +3 -0
  18. package/dist/components/verdocs-template-fields2.js +23 -30
  19. package/dist/docs.json +1 -1
  20. package/dist/esm/{utils-0943d004.js → utils-a56ee5e9.js} +2 -2
  21. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  22. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  23. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  24. package/dist/esm/verdocs-field-attachment_15.entry.js +1 -1
  25. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  26. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  27. package/dist/esm/verdocs-preview_8.entry.js +1 -1
  28. package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
  29. package/dist/esm/verdocs-sign.entry.js +4 -1
  30. package/dist/esm/verdocs-template-fields_4.entry.js +23 -30
  31. package/dist/esm/verdocs-view.entry.js +1 -1
  32. package/dist/esm-es5/{utils-0943d004.js → utils-a56ee5e9.js} +1 -1
  33. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  34. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  35. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  36. package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -1
  37. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  38. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  39. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  40. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  41. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  42. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  43. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  44. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +0 -1
  45. package/dist/types/utils/utils.d.ts +1 -1
  46. package/dist/verdocs-web-sdk/{p-1bb19298.system.js → p-0cafdb16.system.js} +1 -1
  47. package/dist/verdocs-web-sdk/{p-bf9f8047.system.entry.js → p-0e6b2f10.system.entry.js} +1 -1
  48. package/dist/verdocs-web-sdk/{p-eadda835.system.entry.js → p-15c88a05.system.entry.js} +1 -1
  49. package/dist/verdocs-web-sdk/{p-b47fe83f.system.entry.js → p-28c93a3a.system.entry.js} +1 -1
  50. package/dist/verdocs-web-sdk/{p-5a8b3b8f.system.entry.js → p-320a0e0c.system.entry.js} +1 -1
  51. package/dist/verdocs-web-sdk/{p-6a62eddb.system.entry.js → p-4b84b04e.system.entry.js} +1 -1
  52. package/dist/verdocs-web-sdk/{p-e848a210.system.entry.js → p-5e8e5761.system.entry.js} +1 -1
  53. package/dist/verdocs-web-sdk/{p-7a2d4ffb.entry.js → p-6ca72beb.entry.js} +1 -1
  54. package/dist/verdocs-web-sdk/p-8f36c42a.system.entry.js +1 -0
  55. package/dist/verdocs-web-sdk/{p-bf751c92.entry.js → p-91e94910.entry.js} +1 -1
  56. package/dist/verdocs-web-sdk/{p-f4660e16.system.entry.js → p-a12b2c26.system.entry.js} +1 -1
  57. package/dist/verdocs-web-sdk/{p-94587de6.entry.js → p-a9da16c6.entry.js} +1 -1
  58. package/dist/verdocs-web-sdk/{p-ed44db6d.entry.js → p-b2d3ac44.entry.js} +1 -1
  59. package/dist/verdocs-web-sdk/{p-1ea48b99.js → p-b72328af.js} +1 -1
  60. package/dist/verdocs-web-sdk/{p-3b679607.entry.js → p-bbf52926.entry.js} +1 -1
  61. package/dist/verdocs-web-sdk/p-c179b3e4.entry.js +1 -0
  62. package/dist/verdocs-web-sdk/{p-45964056.entry.js → p-d0140be2.entry.js} +1 -1
  63. package/dist/verdocs-web-sdk/{p-4bdbe568.entry.js → p-d11ffc76.entry.js} +1 -1
  64. package/dist/verdocs-web-sdk/{p-95bfc8c0.entry.js → p-d151150e.entry.js} +1 -1
  65. package/dist/verdocs-web-sdk/{p-e543e5eb.entry.js → p-d1c52218.entry.js} +1 -1
  66. package/dist/verdocs-web-sdk/{p-49dfb0bd.system.entry.js → p-d61bf72b.system.entry.js} +1 -1
  67. package/dist/verdocs-web-sdk/{p-086350e1.system.entry.js → p-de5b9b23.system.entry.js} +1 -1
  68. package/dist/verdocs-web-sdk/{p-cc2c6409.system.entry.js → p-e7d7bcae.system.entry.js} +1 -1
  69. package/dist/verdocs-web-sdk/{p-bae72cf4.entry.js → p-ef99042b.entry.js} +1 -1
  70. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  71. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  72. package/package.json +1 -1
  73. package/dist/verdocs-web-sdk/p-3fdb08f6.system.entry.js +0 -1
  74. package/dist/verdocs-web-sdk/p-fce0d8da.entry.js +0 -1
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];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,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function l(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):s(e.value).then(r,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=r[0]&2?s["return"]:r[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,r[1])).done)return n;if(s=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];s=0}finally{o=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,s=t.length,n;o<s;o++){if(n||!(o in t)){if(!n)n=Array.prototype.slice.call(t,0,o);n[o]=t[o]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-f246348c.system.js","./p-95080569.system.js","./p-8324a7a3.system.js","./p-d0d9ac6d.system.js","./p-1bb19298.system.js","./p-187b20b7.system.js","./p-8aae8d16.system.js","./p-877c2b06.system.js","./p-05eb4fed.system.js","./p-6e9af353.system.js","./p-3f628837.system.js","./p-ca13070e.system.js","./p-3af6b910.system.js","./p-bbee73c8.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,s,n,r,l,a,d,c,p,u,h,m,v,f,g,b,x,y,w,_,k,S,I,E,C,P;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H},function(){},function(e){n=e.V;r=e.b;l=e.u},function(e){a=e.g},function(e){d=e.g;c=e.b;p=e.a},function(e){u=e.g},function(e){h=e.r},function(e){m=e.S},function(e){v=e.j},function(e){f=e.a;g=e.i},function(e){b=e.g},function(e){x=e.c;y=e.d},function(e){w=e.D;_=e.P;k=e.J;S=e.a;I=e.F;E=e.b;C=e.T},function(e){P=e.V},function(){},function(){},function(){},function(){}],execute:function(){var D=function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))};var L=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),o).then((function(e){return e.data}))};var T=function(e,t,i){return e.api.delete("/templates/".concat(t,"/reminder/").concat(i)).then((function(e){return e.data}))};var z='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 R=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(s){try{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]}u(this.endpoint,this.templateId,true).then((function(e){var t,i;o.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);o.fieldStore=a(o.templateId);o.roleStore=d(o.templateId);console.log("RS",(t=o.roleStore)===null||t===void 0?void 0:t.state);console.log("FS",(i=o.fieldStore)===null||i===void 0?void 0:i.state);console.log("[PREVIEW] Loaded template",o.templateStore.state,o.roleStore.get("roles"),o.fieldStore.get("fields"));o.loading=false})).catch((function(e){console.log(e)}))}catch(o){console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t,i;var o=e.detail;var s=(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.fields.filter((function(e){return e.page_sequence===o.pageNumber}));console.log("[PREVIEW] Page rendered",o,s);s.forEach((function(e){return h(e,o,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i;if(this.loading){return o(s,null,o("verdocs-loader",null))}var n=__spreadArray([],(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.pages,true);n.sort((function(e,t){return e.sequence-t.sequence}));return o(s,null,n.map((function(t){return o("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}());R.style=z;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 A='<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 N='<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 M='<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 j='<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 H=e("verdocs_send",function(){function e(e){t(this,e);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.templateStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;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,i,o,s,n,r,l,a,c;var p=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,2,,3]);r=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]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.templateStore=h.sent();this.roleStore=d(this.templateId);if(!((t=(e=this.templateStore)===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(this.roleStore.get("roles")){a={};this.rolesCompleted={};this.roleStore.get("roles").forEach((function(e){var t=e.sequence-1;a[t]||(a[t]=[]);var i="r-".concat(t,"-").concat(a[t].length);a[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){p.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=a;this.levels=Object.keys(a).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((i=r===null||r===void 0?void 0:r.session)===null||i===void 0?void 0:i.profile){this.sessionContacts.push({id:r.session.profile.id,name:"".concat(r.session.profile.first_name," ").concat(r.session.profile.last_name),email:r.session.profile.email,phone:r.session.profile.phone})}return[3,3];case 2:c=h.sent();console.log("[SEND] Error with preview session",c);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new m(c.message,(s=c.response)===null||s===void 0?void 0:s.status,(n=c.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return o("div",{class:"level-icon",innerHTML:N})}else if(e>=this.levels.length){return o("div",{class:"level-icon",innerHTML:j})}else{return o("div",{class:"level-icon",innerHTML:M})}};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=this;var i,o;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var s={template_id:this.templateId,name:(o=(i=this.templateStore)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",s);v(this.endpoint,s).then((function(e){var i;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.send)===null||i===void 0?void 0:i.emit(__assign(__assign({},s),{envelope_id:e.id,envelope:e}))})).catch((function(e){console.log("Send error",e);t.sending=false}))};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,i;var n=c(this.roleStore);var r=Object.values(this.rolesCompleted).filter((function(e){return f(e.email)||g(e.phone)}));var l=r.length>=n.length;return o(s,{class:{sendable:(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_sendable}},o("div",{class:"recipients"},o("div",{class:"left-line"}),o("div",{class:"level level-start"},this.getLevelIcon(-1),o("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return o("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,s,n,r,l,a;var d=!t.email;var c="verdocs-send-recipient-".concat(t.name);return d?o("div",{class:"recipient",style:{backgroundColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(s=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&s!==void 0?s:t.name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(n=e.rolesCompleted[t.id])!==null&&n!==void 0?n:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):o("div",{class:"recipient",style:{borderColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(l=(r=e.rolesCompleted[t.id])===null||r===void 0?void 0:r.full_name)!==null&&l!==void 0?l:t.full_name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(a=e.rolesCompleted[t.id])!==null&&a!==void 0?a:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),o("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),o("div",{class:"complete"},"Signing Complete"))),o("div",{class:"buttons"},o("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),o("verdocs-button",{label:"Send",size:"small",disabled:!l||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&o("verdocs-spinner",null)))};return e}());H.style=U;var F='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=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=n.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,i,o,s;return __generator(this,(function(n){switch(n.label){case 0:n.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]}o=this;return[4,u(this.endpoint,this.templateId,false)];case 1:o.store=n.sent();return[3,3];case 2:s=n.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.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,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();n=e.detail.file;if(!n){return[2]}console.log("[ATTACHMENTS] Uploading...",n);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,x(this.endpoint,this.templateId,n,this.handleUploadProgress.bind(this))];case 2:r=d.sent();console.log("[ATTACHMENTS] Created attachment",r);l=this;return[4,u(this.endpoint,this.templateId,false)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(s=a.response)===null||s===void 0?void 0:s.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,y(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,u(this.endpoint,this.templateId,false)];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(i){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 S;case"image/jpeg":return k;case"image/png":return _;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return w}return I};e.prototype.render=function(){var e=this;var t,i,n;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var r=(t=this.store)===null||t===void 0?void 0:t.state;if(!r.isLoaded){return o(s,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session||!r.profile_id){return o(s,{class:"empty"})}return o(s,null,o("h5",null,"Existing Attachments"),o("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.template_documents.map((function(t){return o("div",{class:"attachment"},o("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),o("div",{class:"filename",title:t.name},t.name),o("div",{class:"pages"},o("div",{class:"count"},t.page_numbers),o("div",{class:"pages-icon",innerHTML:E})),o("div",{class:"trash-icon",innerHTML:C,onClick:function(){return e.handleDelete(t)}}))}))),o("h5",null,"Attach a New Document"),this.uploading?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((n=this.store)===null||n===void 0?void 0:n.state.template_documents.length)||this.uploading})),this.showDeleteError&&o("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&o("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=F;var O='verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';var W=["attachments","roles","settings","fields","preview"];var V=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=n.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(o){console.log("[BUILD_TABS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,u(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,n,r,l,a,d,c,p;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var u=false;var h=false;var m=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){m=((n=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.template_documents)===null||n===void 0?void 0:n.length)>0;h=m&&((a=(l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;u=h&&((p=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||p===void 0?void 0:p.length)>0}var v=Math.max(W.indexOf(this.step),0);if(!u&&v>=4){v=3}if(!h&&v>=3){v=1}if(!m&&v>=1){v=0}console.log({selectedStepIndex:v,canPreview:u,canEditFields:h,canEditRoles:m});return o(s,null,o("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!u,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());V.style=O;var q='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 Y=" ";var G='<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 J=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=n.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,i,o,s,n;var l=this;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";a.label=1;case 1:a.trys.push([1,3,,4]);return[4,r(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){l.progressLabel="Processing...";l.progressPercent=100}else{l.progressPercent=e}}))];case 2:s=a.sent();console.log("[CREATE] Created template",s);u(this.endpoint,s.id,true).then((function(){var e,t;(e=l.templateCreated)===null||e===void 0?void 0:e.emit({endpoint:l.endpoint,template:s,templateId:s.id});(t=l.next)===null||t===void 0?void 0:t.emit(s);l.creating=false;l.progressLabel="";l.progressPercent=0})).catch((function(e){console.log(e)}));return[3,4];case 3:n=a.sent();console.log("[CREATE] Error creating template",n);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new m(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(o=n.response)===null||o===void 0?void 0:o.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("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?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("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")}},o("div",null,o("span",{innerHTML:G})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?Y:"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());J.style=q;var K="";var Q=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.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,u(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE NAME] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{name:this.name})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return o(s,{class:"loading"},o("verdocs-loader",null))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("label",{htmlFor:"verdocs-template-name"},"Template Name"),o("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,o;e.name=t.target.value;e.dirty=e.name!==((o=(i=e.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name)}}),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Q.style=K;var X='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 Z=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.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,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.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,u(this.endpoint,this.templateId,false)];case 1:n.store=l.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:r=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n,r,l,a,d,c,p,h,v,f;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];c={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,D(this.endpoint,this.templateId,c)];case 2:g.sent();p=this;return[4,u(this.endpoint,this.templateId,false)];case 3:p.store=g.sent();return[3,7];case 4:return[4,L(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id,c)];case 5:g.sent();h=this;return[4,u(this.endpoint,this.templateId,false)];case 6:h.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,T(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id)];case 9:g.sent();v=this;return[4,u(this.endpoint,this.templateId,false)];case 10:v.store=g.sent();g.label=11;case 11:(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:f=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",f);P(f.message);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new m(f.message,(l=f.response)===null||l===void 0?void 0:l.status,(a=f.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Reminders"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),o("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}})),o("p",null,o("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),o("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})),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),o("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})),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&o("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}());Z.style=X;var $='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}';var ee=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new m(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,s,n;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.is_public;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,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("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)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());ee.style=$}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];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,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function l(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):s(e.value).then(r,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=r[0]&2?s["return"]:r[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,r[1])).done)return n;if(s=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];s=0}finally{o=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,s=t.length,n;o<s;o++){if(n||!(o in t)){if(!n)n=Array.prototype.slice.call(t,0,o);n[o]=t[o]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-f246348c.system.js","./p-95080569.system.js","./p-8324a7a3.system.js","./p-d0d9ac6d.system.js","./p-0cafdb16.system.js","./p-187b20b7.system.js","./p-8aae8d16.system.js","./p-877c2b06.system.js","./p-05eb4fed.system.js","./p-6e9af353.system.js","./p-3f628837.system.js","./p-ca13070e.system.js","./p-3af6b910.system.js","./p-bbee73c8.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,s,n,r,l,a,d,c,p,u,h,m,v,f,g,b,x,y,w,_,k,S,I,E,C,P;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H},function(){},function(e){n=e.V;r=e.b;l=e.u},function(e){a=e.g},function(e){d=e.g;c=e.b;p=e.a},function(e){u=e.g},function(e){h=e.r},function(e){m=e.S},function(e){v=e.j},function(e){f=e.a;g=e.i},function(e){b=e.g},function(e){x=e.c;y=e.d},function(e){w=e.D;_=e.P;k=e.J;S=e.a;I=e.F;E=e.b;C=e.T},function(e){P=e.V},function(){},function(){},function(){},function(){}],execute:function(){var D=function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))};var L=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),o).then((function(e){return e.data}))};var T=function(e,t,i){return e.api.delete("/templates/".concat(t,"/reminder/").concat(i)).then((function(e){return e.data}))};var z='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 R=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(s){try{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]}u(this.endpoint,this.templateId,true).then((function(e){var t,i;o.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);o.fieldStore=a(o.templateId);o.roleStore=d(o.templateId);console.log("RS",(t=o.roleStore)===null||t===void 0?void 0:t.state);console.log("FS",(i=o.fieldStore)===null||i===void 0?void 0:i.state);console.log("[PREVIEW] Loaded template",o.templateStore.state,o.roleStore.get("roles"),o.fieldStore.get("fields"));o.loading=false})).catch((function(e){console.log(e)}))}catch(o){console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t,i;var o=e.detail;var s=(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.fields.filter((function(e){return e.page_sequence===o.pageNumber}));console.log("[PREVIEW] Page rendered",o,s);s.forEach((function(e){return h(e,o,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i;if(this.loading){return o(s,null,o("verdocs-loader",null))}var n=__spreadArray([],(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.pages,true);n.sort((function(e,t){return e.sequence-t.sequence}));return o(s,null,n.map((function(t){return o("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}());R.style=z;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 A='<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 N='<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 M='<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 j='<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 H=e("verdocs_send",function(){function e(e){t(this,e);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.templateStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;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,i,o,s,n,r,l,a,c;var p=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,2,,3]);r=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]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.templateStore=h.sent();this.roleStore=d(this.templateId);if(!((t=(e=this.templateStore)===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(this.roleStore.get("roles")){a={};this.rolesCompleted={};this.roleStore.get("roles").forEach((function(e){var t=e.sequence-1;a[t]||(a[t]=[]);var i="r-".concat(t,"-").concat(a[t].length);a[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){p.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=a;this.levels=Object.keys(a).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((i=r===null||r===void 0?void 0:r.session)===null||i===void 0?void 0:i.profile){this.sessionContacts.push({id:r.session.profile.id,name:"".concat(r.session.profile.first_name," ").concat(r.session.profile.last_name),email:r.session.profile.email,phone:r.session.profile.phone})}return[3,3];case 2:c=h.sent();console.log("[SEND] Error with preview session",c);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new m(c.message,(s=c.response)===null||s===void 0?void 0:s.status,(n=c.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return o("div",{class:"level-icon",innerHTML:N})}else if(e>=this.levels.length){return o("div",{class:"level-icon",innerHTML:j})}else{return o("div",{class:"level-icon",innerHTML:M})}};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=this;var i,o;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var s={template_id:this.templateId,name:(o=(i=this.templateStore)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",s);v(this.endpoint,s).then((function(e){var i;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.send)===null||i===void 0?void 0:i.emit(__assign(__assign({},s),{envelope_id:e.id,envelope:e}))})).catch((function(e){console.log("Send error",e);t.sending=false}))};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,i;var n=c(this.roleStore);var r=Object.values(this.rolesCompleted).filter((function(e){return f(e.email)||g(e.phone)}));var l=r.length>=n.length;return o(s,{class:{sendable:(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_sendable}},o("div",{class:"recipients"},o("div",{class:"left-line"}),o("div",{class:"level level-start"},this.getLevelIcon(-1),o("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return o("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,s,n,r,l,a;var d=!t.email;var c="verdocs-send-recipient-".concat(t.name);return d?o("div",{class:"recipient",style:{backgroundColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(s=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&s!==void 0?s:t.name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(n=e.rolesCompleted[t.id])!==null&&n!==void 0?n:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):o("div",{class:"recipient",style:{borderColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(l=(r=e.rolesCompleted[t.id])===null||r===void 0?void 0:r.full_name)!==null&&l!==void 0?l:t.full_name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(a=e.rolesCompleted[t.id])!==null&&a!==void 0?a:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),o("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),o("div",{class:"complete"},"Signing Complete"))),o("div",{class:"buttons"},o("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),o("verdocs-button",{label:"Send",size:"small",disabled:!l||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&o("verdocs-spinner",null)))};return e}());H.style=U;var F='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=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=n.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,i,o,s;return __generator(this,(function(n){switch(n.label){case 0:n.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]}o=this;return[4,u(this.endpoint,this.templateId,false)];case 1:o.store=n.sent();return[3,3];case 2:s=n.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.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,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();n=e.detail.file;if(!n){return[2]}console.log("[ATTACHMENTS] Uploading...",n);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,x(this.endpoint,this.templateId,n,this.handleUploadProgress.bind(this))];case 2:r=d.sent();console.log("[ATTACHMENTS] Created attachment",r);l=this;return[4,u(this.endpoint,this.templateId,false)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(s=a.response)===null||s===void 0?void 0:s.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,y(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,u(this.endpoint,this.templateId,false)];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(i){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 S;case"image/jpeg":return k;case"image/png":return _;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return w}return I};e.prototype.render=function(){var e=this;var t,i,n;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var r=(t=this.store)===null||t===void 0?void 0:t.state;if(!r.isLoaded){return o(s,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session||!r.profile_id){return o(s,{class:"empty"})}return o(s,null,o("h5",null,"Existing Attachments"),o("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.template_documents.map((function(t){return o("div",{class:"attachment"},o("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),o("div",{class:"filename",title:t.name},t.name),o("div",{class:"pages"},o("div",{class:"count"},t.page_numbers),o("div",{class:"pages-icon",innerHTML:E})),o("div",{class:"trash-icon",innerHTML:C,onClick:function(){return e.handleDelete(t)}}))}))),o("h5",null,"Attach a New Document"),this.uploading?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((n=this.store)===null||n===void 0?void 0:n.state.template_documents.length)||this.uploading})),this.showDeleteError&&o("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&o("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=F;var O='verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';var W=["attachments","roles","settings","fields","preview"];var V=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=n.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(o){console.log("[BUILD_TABS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,u(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,n,r,l,a,d,c,p;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var u=false;var h=false;var m=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){m=((n=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.template_documents)===null||n===void 0?void 0:n.length)>0;h=m&&((a=(l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;u=h&&((p=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||p===void 0?void 0:p.length)>0}var v=Math.max(W.indexOf(this.step),0);if(!u&&v>=4){v=3}if(!h&&v>=3){v=1}if(!m&&v>=1){v=0}console.log({selectedStepIndex:v,canPreview:u,canEditFields:h,canEditRoles:m});return o(s,null,o("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!u,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());V.style=O;var q='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 Y=" ";var G='<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 J=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=n.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,i,o,s,n;var l=this;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";a.label=1;case 1:a.trys.push([1,3,,4]);return[4,r(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){l.progressLabel="Processing...";l.progressPercent=100}else{l.progressPercent=e}}))];case 2:s=a.sent();console.log("[CREATE] Created template",s);u(this.endpoint,s.id,true).then((function(){var e,t;(e=l.templateCreated)===null||e===void 0?void 0:e.emit({endpoint:l.endpoint,template:s,templateId:s.id});(t=l.next)===null||t===void 0?void 0:t.emit(s);l.creating=false;l.progressLabel="";l.progressPercent=0})).catch((function(e){console.log(e)}));return[3,4];case 3:n=a.sent();console.log("[CREATE] Error creating template",n);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new m(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(o=n.response)===null||o===void 0?void 0:o.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("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?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("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")}},o("div",null,o("span",{innerHTML:G})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?Y:"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());J.style=q;var K="";var Q=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.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,u(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE NAME] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{name:this.name})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return o(s,{class:"loading"},o("verdocs-loader",null))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("label",{htmlFor:"verdocs-template-name"},"Template Name"),o("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,o;e.name=t.target.value;e.dirty=e.name!==((o=(i=e.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name)}}),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Q.style=K;var X='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 Z=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.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,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.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,u(this.endpoint,this.templateId,false)];case 1:n.store=l.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:r=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n,r,l,a,d,c,p,h,v,f;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];c={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,D(this.endpoint,this.templateId,c)];case 2:g.sent();p=this;return[4,u(this.endpoint,this.templateId,false)];case 3:p.store=g.sent();return[3,7];case 4:return[4,L(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id,c)];case 5:g.sent();h=this;return[4,u(this.endpoint,this.templateId,false)];case 6:h.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,T(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id)];case 9:g.sent();v=this;return[4,u(this.endpoint,this.templateId,false)];case 10:v.store=g.sent();g.label=11;case 11:(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:f=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",f);P(f.message);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new m(f.message,(l=f.response)===null||l===void 0?void 0:l.status,(a=f.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Reminders"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),o("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}})),o("p",null,o("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),o("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})),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),o("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})),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&o("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}());Z.style=X;var $='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}';var ee=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new m(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,s,n;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.is_public;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,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("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)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());ee.style=$}}}));
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,n=t.length,r;o<n;o++){if(r||!(o in t)){if(!r)r=Array.prototype.slice.call(t,0,o);r[o]=t[o]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-3bcd86ea.system.js","./p-1bb19298.system.js","./p-9a5ff58c.system.js","./p-bbee73c8.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,n,r,s,a,l;return{setters:[function(e){t=e.r;i=e.c;o=e.h;n=e.H;r=e.a},function(e){s=e.i},function(e){a=e.d},function(e){l=e.c},function(){},function(){},function(){},function(){},function(){}],execute:function(){var c='verdocs-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';var d='<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="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>';var p='<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="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>';var f=5;var u=function(e){var t=e.page,i=e.selected,n=e.onClick;var r;if(t==="first"){r=d}else if(t==="last"){r=p}else{r=String(t+1)}return o("div",{class:"page-button ".concat(t===i?"selected":""),onClick:function(){return n(t)},innerHTML:r})};var h=e("verdocs_pagination",function(){function e(e){t(this,e);this.selectPage=i(this,"selectPage",7);this.selectedPage=0;this.itemCount=1;this.perPage=10}e.prototype.handleSelectPage=function(e){var t;this.selectedPage=e;(t=this.selectPage)===null||t===void 0?void 0:t.emit({selectedPage:e})};e.prototype.render=function(){var e=this;var t=Math.max(0,this.selectedPage-2);var i=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;var r=s(0,Math.ceil(this.itemCount/this.perPage)).slice(t,t+f);return o(n,null,this.selectedPage>0&&o(u,{page:"first",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(0)}}),t>0&&o("div",{class:"ellipsis"},"..."),r.map((function(t){return o(u,{page:t,selected:e.selectedPage,onClick:function(t){return e.handleSelectPage(+t)}})})),this.selectedPage<i-1&&o("div",{class:"ellipsis"},"..."),this.selectedPage<i-1&&o(u,{page:"last",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(i-1)}}))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());h.style=c;var g='verdocs-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:#4c56cb3f}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';var v='<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>';var b=e("verdocs_quick_filter",function(){function e(e){t(this,e);this.optionSelected=i(this,"optionSelected",7);this.clickListenerSymbol=new AbortController;this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.open=undefined}e.prototype.componentDidLoad=function(){this.popper=l(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var t=!(e.target==this.el||this.el.contains(e.target));if(t){this.hide()}};e.prototype.handleSelectOption=function(e,t){e.stopPropagation();this.optionSelected.emit(t);this.value=t.value;this.hide()};e.prototype.showDropdown=function(){var e,t;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(t=this.popper)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var t,i;if(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.localName)==="button"&&((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var t,i,r;var s=(t=this.options)===null||t===void 0?void 0:t.find((function(t){return t.value===e.value}));var l=(i=this.options)===null||i===void 0?void 0:i.reduce((function(e,t){return e.label.length>t.label.length?e:t}));var c=a((l===null||l===void 0?void 0:l.label)||"FILLER","14px Inter, Barlow, sans-serif");var d=a(this.label,"14px Inter, Barlow, sans-serif");var p="".concat(c+d+40,"px");return o(n,{class:{open:!!this.open},style:{minWidth:p,display:"inline-block"}},o("div",{class:"control",onClick:function(t){return e.toggleDropdown(t)},onBlur:function(t){return e.handleHideDropdown(t)}},o("div",{class:"title",ref:function(t){return e.dropdownButton=t}},o("span",{class:"prefix"},this.label,":"),s?s.label:this.placeholder),o("div",{style:{flex:"1"}}),o("div",{class:"separator"}),o("div",{class:"arrow",innerHTML:v,"aria-label":"Open Menu"})),o("div",{class:"items","aria-hidden":!this.open,ref:function(t){return e.dropdownMenu=t},style:{minWidth:p}},(r=this.options)===null||r===void 0?void 0:r.map((function(t){return t.label?o("button",{onClick:function(i){return e.handleSelectOption(i,t)},class:"option ".concat(t.value===e.value?"selected":""),disabled:t.disabled},t.label):o("div",{class:"separator"})}))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());b.style=g}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,n=t.length,r;o<n;o++){if(r||!(o in t)){if(!r)r=Array.prototype.slice.call(t,0,o);r[o]=t[o]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-3bcd86ea.system.js","./p-0cafdb16.system.js","./p-9a5ff58c.system.js","./p-bbee73c8.system.js","./p-8aae8d16.system.js","./p-54498887.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,n,r,s,a,l;return{setters:[function(e){t=e.r;i=e.c;o=e.h;n=e.H;r=e.a},function(e){s=e.i},function(e){a=e.d},function(e){l=e.c},function(){},function(){},function(){},function(){},function(){}],execute:function(){var c='verdocs-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';var d='<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="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>';var p='<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="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>';var f=5;var u=function(e){var t=e.page,i=e.selected,n=e.onClick;var r;if(t==="first"){r=d}else if(t==="last"){r=p}else{r=String(t+1)}return o("div",{class:"page-button ".concat(t===i?"selected":""),onClick:function(){return n(t)},innerHTML:r})};var h=e("verdocs_pagination",function(){function e(e){t(this,e);this.selectPage=i(this,"selectPage",7);this.selectedPage=0;this.itemCount=1;this.perPage=10}e.prototype.handleSelectPage=function(e){var t;this.selectedPage=e;(t=this.selectPage)===null||t===void 0?void 0:t.emit({selectedPage:e})};e.prototype.render=function(){var e=this;var t=Math.max(0,this.selectedPage-2);var i=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;var r=s(0,Math.ceil(this.itemCount/this.perPage)).slice(t,t+f);return o(n,null,this.selectedPage>0&&o(u,{page:"first",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(0)}}),t>0&&o("div",{class:"ellipsis"},"..."),r.map((function(t){return o(u,{page:t,selected:e.selectedPage,onClick:function(t){return e.handleSelectPage(+t)}})})),this.selectedPage<i-1&&o("div",{class:"ellipsis"},"..."),this.selectedPage<i-1&&o(u,{page:"last",selected:this.selectedPage,onClick:function(){return e.handleSelectPage(i-1)}}))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());h.style=c;var g='verdocs-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:#4c56cb3f}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';var v='<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>';var b=e("verdocs_quick_filter",function(){function e(e){t(this,e);this.optionSelected=i(this,"optionSelected",7);this.clickListenerSymbol=new AbortController;this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.open=undefined}e.prototype.componentDidLoad=function(){this.popper=l(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var t=!(e.target==this.el||this.el.contains(e.target));if(t){this.hide()}};e.prototype.handleSelectOption=function(e,t){e.stopPropagation();this.optionSelected.emit(t);this.value=t.value;this.hide()};e.prototype.showDropdown=function(){var e,t;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(t=this.popper)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var t,i;if(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.localName)==="button"&&((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var t,i,r;var s=(t=this.options)===null||t===void 0?void 0:t.find((function(t){return t.value===e.value}));var l=(i=this.options)===null||i===void 0?void 0:i.reduce((function(e,t){return e.label.length>t.label.length?e:t}));var c=a((l===null||l===void 0?void 0:l.label)||"FILLER","14px Inter, Barlow, sans-serif");var d=a(this.label,"14px Inter, Barlow, sans-serif");var p="".concat(c+d+40,"px");return o(n,{class:{open:!!this.open},style:{minWidth:p,display:"inline-block"}},o("div",{class:"control",onClick:function(t){return e.toggleDropdown(t)},onBlur:function(t){return e.handleHideDropdown(t)}},o("div",{class:"title",ref:function(t){return e.dropdownButton=t}},o("span",{class:"prefix"},this.label,":"),s?s.label:this.placeholder),o("div",{style:{flex:"1"}}),o("div",{class:"separator"}),o("div",{class:"arrow",innerHTML:v,"aria-label":"Open Menu"})),o("div",{class:"items","aria-hidden":!this.open,ref:function(t){return e.dropdownMenu=t},style:{minWidth:p}},(r=this.options)===null||r===void 0?void 0:r.map((function(t){return t.label?o("button",{onClick:function(i){return e.handleSelectOption(i,t)},class:"option ".concat(t.value===e.value?"selected":""),disabled:t.disabled},t.label):o("div",{class:"separator"})}))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());b.style=g}}}));