@verdocs/web-sdk 6.0.2 → 6.0.4
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.
- package/dist/cjs/{utils-DCB8q98B.js → utils-BXqLrKQZ.js} +3 -2
- package/dist/cjs/utils-BXqLrKQZ.js.map +1 -0
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-delegate-dialog_5.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -4
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +2 -5
- package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js.map +1 -1
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/{p-DCaVuows.js → p-BHeendgg.js} +5 -5
- package/dist/components/{p-DCaVuows.js.map → p-BHeendgg.js.map} +1 -1
- package/dist/components/{p-Cmm_Efcd.js → p-CAJEh6K0.js} +6 -6
- package/dist/components/{p-Cmm_Efcd.js.map → p-CAJEh6K0.js.map} +1 -1
- package/dist/components/{p-D9UxTdE4.js → p-CDDk2TOh.js} +4 -4
- package/dist/components/{p-D9UxTdE4.js.map → p-CDDk2TOh.js.map} +1 -1
- package/dist/components/{p-AQsHwZ27.js → p-CNvRd0Kp.js} +5 -5
- package/dist/components/{p-AQsHwZ27.js.map → p-CNvRd0Kp.js.map} +1 -1
- package/dist/components/{p-pTXj30z_.js → p-CSQjgm9n.js} +3 -3
- package/dist/components/{p-pTXj30z_.js.map → p-CSQjgm9n.js.map} +1 -1
- package/dist/components/{p-xS2v_6o_.js → p-CSpoYxdI.js} +3 -3
- package/dist/components/{p-xS2v_6o_.js.map → p-CSpoYxdI.js.map} +1 -1
- package/dist/components/{p-DepyvOoM.js → p-CsyhCKk4.js} +3 -3
- package/dist/components/{p-DepyvOoM.js.map → p-CsyhCKk4.js.map} +1 -1
- package/dist/components/{p-Bhib7RyH.js → p-DmXt1ckc.js} +3 -3
- package/dist/components/{p-Bhib7RyH.js.map → p-DmXt1ckc.js.map} +1 -1
- package/dist/components/{p-DnAJsr7Q.js → p-WvXI4EBm.js} +3 -3
- package/dist/components/{p-DnAJsr7Q.js.map → p-WvXI4EBm.js.map} +1 -1
- package/dist/components/{p-C1nftqjj.js → p-kCaWRqn0.js} +3 -6
- package/dist/components/p-kCaWRqn0.js.map +1 -0
- package/dist/components/{p-DsBOZHKo.js → p-y2dhcER7.js} +3 -2
- package/dist/components/{p-DsBOZHKo.js.map → p-y2dhcER7.js.map} +1 -1
- package/dist/components/verdocs-build.js +7 -7
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +2 -2
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-initial-dialog.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-quick-filter.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +3 -3
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/{utils-DmfOx9Ey.js → utils-tbEy96hU.js} +3 -2
- package/dist/esm/utils-tbEy96hU.js.map +1 -0
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-delegate-dialog_5.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +1 -4
- package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/{utils-DmfOx9Ey.js → utils-tbEy96hU.js} +1 -1
- package/dist/esm-es5/utils-tbEy96hU.js.map +1 -0
- package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm-es5/verdocs-delegate-dialog_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +2 -2
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.d.ts +2 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/verdocs-web-sdk/{p-92147c8e.entry.js → p-1138cbc8.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-23d2bebc.system.entry.js → p-1ac2de04.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-dd51c6cf.entry.js → p-21da2b89.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-4761e4b9.entry.js → p-25c15dc4.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4761e4b9.entry.js.map → p-25c15dc4.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-3a66ab11.system.entry.js → p-42b32d21.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-baaa811b.entry.js → p-49683659.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ceabec49.entry.js → p-6261f76f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9524927b.entry.js → p-664be870.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d5f1bffb.entry.js → p-75a43183.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fc5c2c45.system.entry.js → p-7a2842d3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5f7f20bb.system.entry.js → p-7cb0a86a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-35d8d17c.system.entry.js → p-8bf7be29.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-nr83qKQ0.system.js.map → p-B2S7Mlv-.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-D7IFi8me.system.js.map → p-BDRwNwHO.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-Bu5xpJsB.system.js.map → p-BGP1meB_.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-BEywLaeg.system.js.map → p-BskSN54G.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-DcCGkiJ-.system.js.map → p-C8jYVW5r.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-BscsgV4o.system.js.map → p-CB7Tnry2.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-DGdn9mfe.system.js.map → p-CmJ4fTid.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-DPhW-51Y.system.js.map → p-CuCpcHZy.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-CICLOJJr.system.js.map → p-Dp4d4aXG.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-fL0BKEnm.js → p-DvM2ECoi.js} +1 -1
- package/dist/verdocs-web-sdk/p-DvM2ECoi.js.map +1 -0
- package/dist/verdocs-web-sdk/p-RlE9Yh59.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-b4bfad4d.entry.js → p-d94cd03f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f05f021e.entry.js → p-da526fc0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f6598c9b.system.entry.js → p-def666e2.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b72d1a5f.system.entry.js → p-e3cf3f48.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b72d1a5f.system.entry.js.map → p-e3cf3f48.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-2d9b370b.system.entry.js → p-e962f3e2.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-e755e978.system.entry.js → p-ffcb5dbb.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-CD5uiThi.system.js → p-lZ900hhb.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-lZ900hhb.system.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/utils-DCB8q98B.js.map +0 -1
- package/dist/components/p-C1nftqjj.js.map +0 -1
- package/dist/esm/utils-DmfOx9Ey.js.map +0 -1
- package/dist/esm-es5/utils-DmfOx9Ey.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CD5uiThi.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-fL0BKEnm.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-92147c8e.entry.js.map → p-1138cbc8.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-23d2bebc.system.entry.js.map → p-1ac2de04.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-dd51c6cf.entry.js.map → p-21da2b89.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3a66ab11.system.entry.js.map → p-42b32d21.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-baaa811b.entry.js.map → p-49683659.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ceabec49.entry.js.map → p-6261f76f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9524927b.entry.js.map → p-664be870.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d5f1bffb.entry.js.map → p-75a43183.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fc5c2c45.system.entry.js.map → p-7a2842d3.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-5f7f20bb.system.entry.js.map → p-7cb0a86a.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-35d8d17c.system.entry.js.map → p-8bf7be29.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b4bfad4d.entry.js.map → p-d94cd03f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f05f021e.entry.js.map → p-da526fc0.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f6598c9b.system.entry.js.map → p-def666e2.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-2d9b370b.system.entry.js.map → p-e962f3e2.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e755e978.system.entry.js.map → p-ffcb5dbb.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o["throw"](e))}catch(e){a(e)}}function c(e){e.done?i(e.value):r(e.value).then(s,n)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(o)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(i=0)),i)try{if(o=1,r&&(a=n[0]&2?r["return"]:n[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;if(r=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;r=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){i.label=n[1];break}if(n[0]===6&&i.label<a[1]){i.label=a[1];a=n;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(n);break}if(a[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(e){n=[6,e];r=0}finally{o=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};System.register(["./p-B0FmVwBR.system.js","@verdocs/js-sdk","./p-CD5uiThi.system.js","./p-CmnBGerV.system.js","./p-DzZgjFK8.system.js","./p-Bzy18UgU.system.js","./p-DmF0GSqu.system.js","./p-80p0Fzir.system.js"],(function(e){"use strict";var t,i,o,r,a,s,n,c,l,d,u,p,h,f;return{setters:[function(e){t=e.r;i=e.c;o=e.h;r=e.H;a=e.F;s=e.g},function(e){n=e.VerdocsEndpoint;c=e.getTemplateDocumentPageDisplayUri;l=e.getTemplate},function(e){d=e.t;u=e.c;p=e.g},function(e){h=e.S},function(e){f=e.c},null,null,null],execute:function(){var b="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";var v=e("verdocs_template_document_page",function(){function e(e){t(this,e);this.pageRendered=i(this,"pageRendered");this.templateListenerId=null;this.endpoint=n.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,c(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(d((function(t){for(var i=0,o=t;i<o.length;i++){var r=o[i];var a=r.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return o(r,null,o("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return o(r,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){var r;return i.type==="div"?o("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}},i.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var i,r;var s=p(t);var n=t.name,c=t.type,l=t.multiline;var d=e,h=d.xScale,f=d.yScale,b=d.templateId,v=d.editable,m=d.disabled,g=d.done,y=d.pageNumber;if(((i=t["setting"])===null||i===void 0?void 0:i.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){c="textarea";l=true}switch(c){case"textbox":return o("verdocs-field-textbox",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,multiline:l,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"textarea":return o("verdocs-field-textarea",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"date":return o("verdocs-field-date",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"attachment":return o("verdocs-field-attachment",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"dropdown":return o("verdocs-field-dropdown",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"initial":return o("verdocs-field-initial",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"signature":return o("verdocs-field-signature",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,e.xScale,e.yScale)});case"timestamp":return o("verdocs-field-timestamp",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"checkbox":return o("verdocs-field-checkbox",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"radio":return o("verdocs-field-radio",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});default:return o(a,null,n)}}))):e.pageDisplayUri?o("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):o("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());v.style=b;var m='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var g=e("verdocs_toolbar_icon",function(){function e(e){t(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=f(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return o(r,{key:"656b7717e9f46bf4d331a6e60f0aabcaae611018",class:{}},o("div",{key:"4c14eeea26b0dced9d82e26e909fc1e85d11cadd","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),o("div",{key:"281a88b6d6fce3950a5beb24c56d3399f0125cfa",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,o("div",{key:"f0618b5716de254e43eecd233cc9d882a895e124","data-popper-arrow":"true",class:"arrow"})))};return e}());g.style=m}}}));
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o["throw"](e))}catch(e){a(e)}}function c(e){e.done?i(e.value):r(e.value).then(s,n)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(o)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(i=0)),i)try{if(o=1,r&&(a=n[0]&2?r["return"]:n[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;if(r=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;r=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){i.label=n[1];break}if(n[0]===6&&i.label<a[1]){i.label=a[1];a=n;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(n);break}if(a[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(e){n=[6,e];r=0}finally{o=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};System.register(["./p-B0FmVwBR.system.js","@verdocs/js-sdk","./p-lZ900hhb.system.js","./p-CmnBGerV.system.js","./p-DzZgjFK8.system.js","./p-Bzy18UgU.system.js","./p-DmF0GSqu.system.js","./p-80p0Fzir.system.js"],(function(e){"use strict";var t,i,o,r,a,s,n,c,l,d,u,p,h,f;return{setters:[function(e){t=e.r;i=e.c;o=e.h;r=e.H;a=e.F;s=e.g},function(e){n=e.VerdocsEndpoint;c=e.getTemplateDocumentPageDisplayUri;l=e.getTemplate},function(e){d=e.t;u=e.c;p=e.g},function(e){h=e.S},function(e){f=e.c},null,null,null],execute:function(){var b="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";var v=e("verdocs_template_document_page",function(){function e(e){t(this,e);this.pageRendered=i(this,"pageRendered");this.templateListenerId=null;this.endpoint=n.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,c(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(d((function(t){for(var i=0,o=t;i<o.length;i++){var r=o[i];var a=r.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return o(r,null,o("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return o(r,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){var r;return i.type==="div"?o("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}},i.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var i,r;var s=p(t);var n=t.name,c=t.type,l=t.multiline;var d=e,h=d.xScale,f=d.yScale,b=d.templateId,v=d.editable,m=d.disabled,g=d.done,y=d.pageNumber;if(((i=t["setting"])===null||i===void 0?void 0:i.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){c="textarea";l=true}switch(c){case"textbox":return o("verdocs-field-textbox",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,multiline:l,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"textarea":return o("verdocs-field-textarea",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"date":return o("verdocs-field-date",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"attachment":return o("verdocs-field-attachment",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"dropdown":return o("verdocs-field-dropdown",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"initial":return o("verdocs-field-initial",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"signature":return o("verdocs-field-signature",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,e.xScale,e.yScale)});case"timestamp":return o("verdocs-field-timestamp",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"checkbox":return o("verdocs-field-checkbox",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});case"radio":return o("verdocs-field-radio",{id:s,fieldname:n,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:y,style:u(t,h,f)});default:return o(a,null,n)}}))):e.pageDisplayUri?o("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):o("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());v.style=b;var m='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';var g=e("verdocs_toolbar_icon",function(){function e(e){t(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=f(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return o(r,{key:"656b7717e9f46bf4d331a6e60f0aabcaae611018",class:{}},o("div",{key:"4c14eeea26b0dced9d82e26e909fc1e85d11cadd","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),o("div",{key:"281a88b6d6fce3950a5beb24c56d3399f0125cfa",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,o("div",{key:"f0618b5716de254e43eecd233cc9d882a895e124","data-popper-arrow":"true",class:"arrow"})))};return e}());g.style=m}}}));
|
2
|
+
//# sourceMappingURL=p-42b32d21.system.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as s,h as i,H as l}from"./p-6vpKbd31.js";import{VerdocsEndpoint as t,getEnvelopes as a,integerSequence as o,getRecipientsWithActions as n,userCanCancelEnvelope as d,userCanAct as r,formatFullName as c,cancelEnvelope as p}from"@verdocs/js-sdk";import{s as h}from"./p-fL0BKEnm.js";import{V as v}from"./p-CyvDgtoV.js";import{S as f}from"./p-C1sRVZWv.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const x='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';const u=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>`;const b=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];const m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];const g=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];const w=class{constructor(i){e(this,i);this.changeView=s(this,"changeView");this.changeStatus=s(this,"changeStatus");this.changeSort=s(this,"changeSort");this.changeMatch=s(this,"changeMatch");this.sdkError=s(this,"sdkError");this.viewEnvelope=s(this,"viewEnvelope");this.finishEnvelope=s(this,"finishEnvelope");this.endpoint=t.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}handleViewUpdated(){return this.queryEnvelopes()}handleStatusUpdated(){return this.queryEnvelopes()}handleSortUpdated(){return this.queryEnvelopes()}handleMatchUpdated(){return this.queryEnvelopes()}handlePageUpdated(){return this.queryEnvelopes()}componentWillLoad(){this.endpoint.onSessionChanged(((e,s,i)=>{console.log("[ENVELOPES_LIST] onSessionChanged",s,i)}));this.endpoint.loadSession()}async componentDidLoad(){await this.queryEnvelopes();this.initiallyLoaded=true}async queryEnvelopes(){var e,s,i;try{this.loading=true;let e={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":e={...e,status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]};break;case"inbox":e={...e};break;case"sent":e={...e};break;case"action":e={...e,status:["pending","in progress"]};break;case"waiting":e={...e,status:["pending","in progress"]};break;case"completed":e={...e,status:["complete"]};break;default:e={...e,status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]}}if(this.view==="all"){if(this.status!=="all"){e.status=[this.status]}}if(this.match.trim());const s=await a(this.endpoint,e);this.envelopes=s.envelopes;this.count=s.count;this.loading=false}catch(l){this.loading=false;console.log("[ENVELOPES] Error listing envelopes",l);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new f(l.message,(s=l.response)===null||s===void 0?void 0:s.status,(i=l.response)===null||i===void 0?void 0:i.data))}}handleDownload(){h(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e);v("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){h(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e);v("Download error: "+e.message,{style:"error"})}))}render(){return i(l,{key:"43bb496e91b0891e680e476c0cb842c8a71a6dbe"},i("div",{key:"a63499bc8c56ec934ca3c8598d45cd2b2cf167bb",class:"header"},i("div",{key:"0c710bfa77e0cd52a87eb2de542f41874d342cef",class:"filter"},i("verdocs-text-input",{key:"7f2f134343fc5e877a9f1e5d58aa773e0ce99bb5",id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:e=>{var s;this.match=e.target.value.trim();(s=this.changeMatch)===null||s===void 0?void 0:s.emit(this.match)}})),i("verdocs-quick-filter",{key:"1ad11247696bafc2a8468e370ad558e6686de0ba",label:"View",value:this.view,options:b,onOptionSelected:e=>{this.view=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"a9a85fef5de5e17c3206257508c425e1e0dfb47d",label:"Status",value:this.status,options:m,onOptionSelected:e=>{this.status=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"8eea4f02f9bdd8d42b01c046ad9e18fae4cf4a34",label:"Sort By",value:this.sort,options:g,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{key:"b45c5ea18fe8344444a6d2275cd9e22031685ee2",mode:"dark",size:24}),i("div",{key:"a87ed02343a9ebf3aa8fa075b58ede3d7295f095",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{key:"4cfde469bbf48a4e05b5e7166d6be933257de015",label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const l=n(e);const t=d(this.endpoint.profile,e);const a=l.find((e=>{var s;return e.email===((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||""}));const o=a&&t&&r(((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||"",l);const h=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!o},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!t}];return i("div",{class:"envelope",key:e.id,onClick:()=>{var s;return(s=this.viewEnvelope)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:e})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:this.selectedEnvelopes.findIndex((s=>s.id===e.id))!==-1,onClick:e=>e.stopPropagation(),onInput:s=>{if(s.target.checked){this.selectedEnvelopes=[...this.selectedEnvelopes,e]}else{this.selectedEnvelopes=this.selectedEnvelopes.filter((s=>s.id!==e.id))}}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:u,class:"envelope-icon"}),i("div",{class:"envelope-name"},e.name,": ",i("div",{class:"envelope-recipients"},e.recipients.map((e=>c(e))))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:e,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(e.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:h,onOptionSelected:s=>{var i,l;switch(s.detail.id){case"view":(i=this.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:e});break;case"finish":(l=this.finishEnvelope)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,envelope:e});break;case"download":this.downloadEnvelope(e);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){p(this.endpoint,e.id).then((()=>v("Envelope canceled"))).catch((e=>v("Unable to cancel envelope: "+e.messabge,{style:"error"})));this.queryEnvelopes().catch((()=>{}))}break}}})))})),!this.initiallyLoaded&&i("div",{key:"dee1ed02683c459f29e503651684dce31f1c26d9",style:{width:"100%"}},o(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{key:"b8381cec788ae60740e629e0ebe5f4de6c622139",class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null))}static get watchers(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}}};w.style=x;export{w as verdocs_envelopes_list};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as s,h as i,H as l}from"./p-6vpKbd31.js";import{VerdocsEndpoint as t,getEnvelopes as a,integerSequence as o,getRecipientsWithActions as n,userCanCancelEnvelope as d,userCanAct as r,formatFullName as c,cancelEnvelope as p}from"@verdocs/js-sdk";import{s as h}from"./p-DvM2ECoi.js";import{V as v}from"./p-CyvDgtoV.js";import{S as f}from"./p-C1sRVZWv.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const x='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';const u=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>`;const b=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];const m=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];const g=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];const w=class{constructor(i){e(this,i);this.changeView=s(this,"changeView");this.changeStatus=s(this,"changeStatus");this.changeSort=s(this,"changeSort");this.changeMatch=s(this,"changeMatch");this.sdkError=s(this,"sdkError");this.viewEnvelope=s(this,"viewEnvelope");this.finishEnvelope=s(this,"finishEnvelope");this.endpoint=t.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}handleViewUpdated(){return this.queryEnvelopes()}handleStatusUpdated(){return this.queryEnvelopes()}handleSortUpdated(){return this.queryEnvelopes()}handleMatchUpdated(){return this.queryEnvelopes()}handlePageUpdated(){return this.queryEnvelopes()}componentWillLoad(){this.endpoint.onSessionChanged(((e,s,i)=>{console.log("[ENVELOPES_LIST] onSessionChanged",s,i)}));this.endpoint.loadSession()}async componentDidLoad(){await this.queryEnvelopes();this.initiallyLoaded=true}async queryEnvelopes(){var e,s,i;try{this.loading=true;let e={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":e={...e,status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]};break;case"inbox":e={...e};break;case"sent":e={...e};break;case"action":e={...e,status:["pending","in progress"]};break;case"waiting":e={...e,status:["pending","in progress"]};break;case"completed":e={...e,status:["complete"]};break;default:e={...e,status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]}}if(this.view==="all"){if(this.status!=="all"){e.status=[this.status]}}if(this.match.trim());const s=await a(this.endpoint,e);this.envelopes=s.envelopes;this.count=s.count;this.loading=false}catch(l){this.loading=false;console.log("[ENVELOPES] Error listing envelopes",l);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new f(l.message,(s=l.response)===null||s===void 0?void 0:s.status,(i=l.response)===null||i===void 0?void 0:i.data))}}handleDownload(){h(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e);v("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){h(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e);v("Download error: "+e.message,{style:"error"})}))}render(){return i(l,{key:"43bb496e91b0891e680e476c0cb842c8a71a6dbe"},i("div",{key:"a63499bc8c56ec934ca3c8598d45cd2b2cf167bb",class:"header"},i("div",{key:"0c710bfa77e0cd52a87eb2de542f41874d342cef",class:"filter"},i("verdocs-text-input",{key:"7f2f134343fc5e877a9f1e5d58aa773e0ce99bb5",id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:e=>{var s;this.match=e.target.value.trim();(s=this.changeMatch)===null||s===void 0?void 0:s.emit(this.match)}})),i("verdocs-quick-filter",{key:"1ad11247696bafc2a8468e370ad558e6686de0ba",label:"View",value:this.view,options:b,onOptionSelected:e=>{this.view=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"a9a85fef5de5e17c3206257508c425e1e0dfb47d",label:"Status",value:this.status,options:m,onOptionSelected:e=>{this.status=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"8eea4f02f9bdd8d42b01c046ad9e18fae4cf4a34",label:"Sort By",value:this.sort,options:g,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{key:"b45c5ea18fe8344444a6d2275cd9e22031685ee2",mode:"dark",size:24}),i("div",{key:"a87ed02343a9ebf3aa8fa075b58ede3d7295f095",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{key:"4cfde469bbf48a4e05b5e7166d6be933257de015",label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const l=n(e);const t=d(this.endpoint.profile,e);const a=l.find((e=>{var s;return e.email===((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||""}));const o=a&&t&&r(((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||"",l);const h=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!o},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!t}];return i("div",{class:"envelope",key:e.id,onClick:()=>{var s;return(s=this.viewEnvelope)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:e})}},i("div",{class:"inner"},i("verdocs-checkbox",{checked:this.selectedEnvelopes.findIndex((s=>s.id===e.id))!==-1,onClick:e=>e.stopPropagation(),onInput:s=>{if(s.target.checked){this.selectedEnvelopes=[...this.selectedEnvelopes,e]}else{this.selectedEnvelopes=this.selectedEnvelopes.filter((s=>s.id!==e.id))}}}),i("div",{class:"vert-spacer"}),i("span",{innerHTML:u,class:"envelope-icon"}),i("div",{class:"envelope-name"},e.name,": ",i("div",{class:"envelope-recipients"},e.recipients.map((e=>c(e))))),i("div",{class:"vert-spacer"}),i("verdocs-status-indicator",{envelope:e,style:{width:"125px"}}),i("div",{class:"vert-spacer"}),i("div",{class:"last-modified"},new Date(e.updated_at).toLocaleString()),i("div",{class:"vert-spacer"}),i("verdocs-dropdown",{options:h,onOptionSelected:s=>{var i,l;switch(s.detail.id){case"view":(i=this.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:e});break;case"finish":(l=this.finishEnvelope)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,envelope:e});break;case"download":this.downloadEnvelope(e);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){p(this.endpoint,e.id).then((()=>v("Envelope canceled"))).catch((e=>v("Unable to cancel envelope: "+e.messabge,{style:"error"})));this.queryEnvelopes().catch((()=>{}))}break}}})))})),!this.initiallyLoaded&&i("div",{key:"dee1ed02683c459f29e503651684dce31f1c26d9",style:{width:"100%"}},o(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{key:"b8381cec788ae60740e629e0ebe5f4de6c622139",class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null))}static get watchers(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}}};w.style=x;export{w as verdocs_envelopes_list};
|
2
|
+
//# sourceMappingURL=p-49683659.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-6vpKbd31.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,c as n,g as p}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-6vpKbd31.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,c as n,g as p}from"./p-DvM2ECoi.js";import{S as h}from"./p-DmsV595e.js";import{c as b}from"./p-BfP9ezJQ.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const u="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";const m=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered");this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,null,r)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio;this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null)})))}get container(){return a(this)}};m.style=u;const f='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';const g=class{constructor(t){e(this,t);this.text="";this.icon="";this.placement="bottom";this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=b(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")}render(){return i(o,{key:"656b7717e9f46bf4d331a6e60f0aabcaae611018",class:{}},i("div",{key:"4c14eeea26b0dced9d82e26e909fc1e85d11cadd","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:e=>this.iconEl=e}),i("div",{key:"281a88b6d6fce3950a5beb24c56d3399f0125cfa",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"f0618b5716de254e43eecd233cc9d882a895e124","data-popper-arrow":"true",class:"arrow"})))}};g.style=f;export{m as verdocs_template_document_page,g as verdocs_toolbar_icon};
|
2
|
+
//# sourceMappingURL=p-6261f76f.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as i,h as s,H as o,g as t}from"./p-6vpKbd31.js";import{integerSequence as r}from"@verdocs/js-sdk";import{b as a}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as i,h as s,H as o,g as t}from"./p-6vpKbd31.js";import{integerSequence as r}from"@verdocs/js-sdk";import{b as a}from"./p-DvM2ECoi.js";import{c as l}from"./p-BfP9ezJQ.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const n='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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}';const c=`<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>`;const 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="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>`;const f=5;const b=({page:e,selected:i,onClick:o})=>{let t;if(e==="first"){t=c}else if(e==="last"){t=d}else{t=String(e+1)}return s("div",{class:`page-button ${e===i?"selected":""}`,onClick:()=>o(e),innerHTML:t})};const p=class a{constructor(s){e(this,s);this.selectPage=i(this,"selectPage");this.selectedPage=0;this.itemCount=1;this.perPage=10}handleSelectPage(e){var i;this.selectedPage=e;(i=this.selectPage)===null||i===void 0?void 0:i.emit({selectedPage:e})}render(){const e=Math.max(0,this.selectedPage-2);const i=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;const t=r(0,Math.ceil(this.itemCount/this.perPage)).slice(e,e+f);return s(o,{key:"be5c85f6d219c3589c3ef508e2305cbebea4f320"},this.selectedPage>0&&s(b,{key:"de0c9f90c0af7b77f6d9112c7e2d43978511d0d7",page:"first",selected:this.selectedPage,onClick:()=>this.handleSelectPage(0)}),e>0&&s("div",{key:"f89043de5ca509613e85e3dc00abc8bd3450be6d",class:"ellipsis"},"..."),t.map((e=>s(b,{page:e,selected:this.selectedPage,onClick:e=>this.handleSelectPage(+e)}))),this.selectedPage<i-1&&s("div",{key:"2ddedd7acfab567d550e77bc9471f35114d427de",class:"ellipsis"},"..."),this.selectedPage<i-1&&s(b,{key:"64be509651e68b79bc0f1084eb2e0204d769dfef",page:"last",selected:this.selectedPage,onClick:()=>this.handleSelectPage(i-1)}))}get el(){return t(this)}};p.style=n;const h='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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:rgba(76, 86, 203, 0.2470588235)}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)}';const g=`<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>`;const u=class{constructor(s){e(this,s);this.optionSelected=i(this,"optionSelected");this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.clickListenerSymbol=new AbortController}componentDidLoad(){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})}disconnectedCallback(){this.clickListenerSymbol.abort()}clickListener(e){const i=!(e.target==this.el||this.el.contains(e.target));if(i){this.hide()}}handleSelectOption(e,i){e.stopPropagation();this.optionSelected.emit(i);this.value=i.value;this.hide()}showDropdown(){var e,i;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:true}]}))).catch((()=>{}));(i=this.popper)===null||i===void 0?void 0:i.update().catch((()=>{}))}handleHideDropdown(e){var i,s;if(((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.localName)==="button"&&((s=e===null||e===void 0?void 0:e.target)===null||s===void 0?void 0:s.className)==="arrow"){return}this.hide()}toggleDropdown(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}}hide(){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((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:false}]}))).catch((()=>{}))}render(){var e,i,t;const r=(e=this.options)===null||e===void 0?void 0:e.find((e=>e.value===this.value));const l=(i=this.options)===null||i===void 0?void 0:i.reduce(((e,i)=>e.label.length>i.label.length?e:i));const n=a((l===null||l===void 0?void 0:l.label)||"FILLER","14px Inter, Barlow, sans-serif");const c=a(this.label,"14px Inter, Barlow, sans-serif");const d=`${n+c+40}px`;return s(o,{key:"322a8f4a3843cec17261ac8a20004db1a6a2d8d7",class:{open:!!this.open},style:{minWidth:d,display:"inline-block"}},s("div",{key:"1491f6b3986ccd0764a4dd5bc03ad66fc5d4b7b2",class:"control",onClick:e=>this.toggleDropdown(e),onBlur:e=>this.handleHideDropdown(e)},s("div",{key:"485f1f741ced9c8af1a5eaffffbe87448b3337b4",class:"title",ref:e=>this.dropdownButton=e},s("span",{key:"01aefe07e5802cb69055ac7996fdf1fd1b58d5a5",class:"prefix"},this.label,":"),r?r.label:this.placeholder),s("div",{key:"a5c2a36da359f121a418299018fe6e424f3186b8",style:{flex:"1"}}),s("div",{key:"c1f3ec97d938fe36d90e7047838c67238a4125c4",class:"separator"}),s("div",{key:"86c1ebdabf1b7fcf600f48d3dda1eb33a2184789",class:"arrow",innerHTML:g,"aria-label":"Open Menu"})),s("div",{key:"b4a49186874d81758eee6768f95b136378620439",class:"items","aria-hidden":!this.open,ref:e=>this.dropdownMenu=e,style:{minWidth:d}},(t=this.options)===null||t===void 0?void 0:t.map((e=>e.label?s("button",{onClick:i=>this.handleSelectOption(i,e),class:`option ${e.value===this.value?"selected":""}`,disabled:e.disabled},e.label):s("div",{class:"separator"})))))}get el(){return t(this)}};u.style=h;export{p as verdocs_pagination,u as verdocs_quick_filter};
|
2
|
+
//# sourceMappingURL=p-664be870.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as i,h as t,H as s,F as o}from"./p-6vpKbd31.js";import{VerdocsEndpoint as n,startSigningSession as a,envelopeRecipientAgree as l,updateEnvelopeField as r,createSignature as d,updateEnvelopeFieldSignature as c,createInitials as h,updateEnvelopeFieldInitials as p,isValidPhone as g,isValidEmail as u,sortFields as v,envelopeRecipientSubmit as f,uploadEnvelopeFieldAttachment as m,deleteEnvelopeFieldAttachment as x,formatFullName as b,fullNameToInitials as y,verifySigner as w,delegateRecipient as k,envelopeRecipientDecline as S,integerSequence as N}from"@verdocs/js-sdk";import{a as I,u as G,g as D,r as P}from"./p-fL0BKEnm.js";import{D as F}from"./p-C_Xku1v2.js";import{V as z}from"./p-CyvDgtoV.js";import{S as T}from"./p-C1sRVZWv.js";import{S as E}from"./p-DmsV595e.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const U='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:360px;width:50%;font-size:16px;background:white;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';const A=`\n<ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the\n <a href="https://verdocs.com/en/electronic-record-signature-disclosure/" target="_blank">\n Electronic Record and Signatures Disclosure</a>.</li>\n <li>\n Agree to Verdocs'\n <a href="https://verdocs.com/en/eula" target="_blank">\n End User License Agreement</a>\n and confirm you have read Verdocs'\n <a href="https://verdocs.com/en/privacy-policy/" target="_blank">\n Privacy Policy</a>.\n </li>\n</ul>`;const R=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=F;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=A;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.loading=true;this.envelope=null}componentWillLoad(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new n({sessionType:"signing"})}}async componentDidLoad(){var e,i,t,s,o,n;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new T("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new T("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new T(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}}processAuthResponse(e){var i,t,s;const{envelope:o,recipient:n}=e;const{auth_step:a}=n;this.recipient=n;this.envelope=o;this.disclosures=((t=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||t===void 0?void 0:t.disclaimer)||A;this.authStep=a;this.delegated=!!n.delegated_to;this.agreed=n.agreed;this.submitted=n.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;E.updateEnvelope(this.envelopeId,o);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=n.auth_method_states||{};this.kbaQuestions=n.kba_questions;if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(n.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);l(this.endpoint,this.envelopeId,this.roleId,this.disclosures).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Unable to accept disclosures",e);z("Unable to accept disclosures, please try again later",{style:"error"});this.submitting=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>e.type==="attachment"));if(e){I(this.endpoint,this.envelope,e.id).catch((e=>{z("Unable to download PDF, please try again later",{style:"error"});console.log("[SIGN] Error downloading PDF",e)}));(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}break}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e,i);this.getRecipientFields().forEach((t=>{if(t.name===e){t.value=i.value;t.settings=i.settings;G(t);this.checkRecipientFields()}}))}saveFieldChange(e,i){console.log("[SIGN] saveFieldChange",e,i);r(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);z("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new T(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"radio":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"dropdown":console.log("Saving dropdown",e.name,i.detail);return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":if(!i.detail){return}this.showSpinner=true;const o=await(await fetch(i.detail)).blob();return h(this.endpoint,"initial",o).then((async i=>{const t=await p(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);z("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(!i.detail){return}this.showSpinner=true;const n=await(await fetch(i.detail)).blob();return d(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await c(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);z("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:a}=i.detail;if(a){return this.saveFieldChange(e.name,{prepared:false,value:a})}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e);break}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return u(i);case"phone":return g(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>e.value==="true"))}return e.value==="true";default:return false}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));v(e);return e}async handleNext(){var e;if(this.nextSubmits){try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const i=await f(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i);window.location.reload()}catch(e){console.log("[SIGN] Error submitting",e)}return}const i=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldFilled(e)));v(i);const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let o=i[s];let n=0;if(n<i.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){n++;s++;if(s>=i.length){s=0}o=i[s]}if(n>=i.length){o=null}if(o){const e=D(o);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth"});i===null||i===void 0?void 0:i.focusField();this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t){if(t.getAttribute("attached")==="1"){return}t.setAttribute("attached","1");t.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));t.addEventListener("attached",(async t=>{console.log("[SIGN] onAttached",t.detail,t.target.value);this.showSpinner=true;try{const s=await m(this.endpoint,this.envelopeId,i.name,t.detail);this.updateRecipientFieldValue(i.name,s);this.checkRecipientFields();const o=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,o);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("deleted",(async t=>{console.log("[SIGN] onDeleted",t.detail,t.target.value);this.showSpinner=true;try{const t=await x(this.endpoint,this.envelopeId,i.name);console.log("[SIGN] Deleted attachment",t);this.updateRecipientFieldValue(i.name,t);this.checkRecipientFields();const s=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,s);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("focusout",(e=>{if(i.type!=="dropdown"&&i.type!=="attachment"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}}));t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);const s=b(this.recipient);t.setAttribute("initials",y(s));t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail;const t=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,t);t.forEach(((e,t)=>{if(e.page!==i.pageNumber){return}const s=P("envelope",e,i,{disabled:false,editable:false,draggable:false,done:this.isDone},t);if(!s){return}if(Array.isArray(s)){s.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=P("envelope",e,i,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!t){return}if(Array.isArray(t)){t.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,t)}}))}));this.checkRecipientFields()}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);w(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var i,t,s,o,n;console.log("[SIGN] Error submitting authentication step",e);if((s=(t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||s===void 0?void 0:s.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{z(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}render(){if(this.showLoadError){return t(s,null,t("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`,buttonLabel:"OK",onNext:()=>{window.location.reload()}}))}if(!this.envelope){return t(s,null,t("verdocs-loader",null))}if(this.fatalErrorMessage){return t(s,{class:{agreed:this.agreed}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},this.fatalErrorHeader),t("p",null,this.fatalErrorMessage))))}if(this.delegated){return t(s,{class:{agreed:false}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},"Delegated Signing Request"),t("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:e=>{e.preventDefault();e.stopPropagation();this.showDone=false;this.isDone=true}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)))}if(this.delegating){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{k(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{z("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);z("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return t("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{S(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);window.location.reload()})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);z("Unable to decline, please try again later",{style:"error"})}))}})}if(!this.agreed){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,placeholder:"Enter your passcode...",helptitle:"Document is protected by a Passcode",helptext:"Please enter your Passcode to proceed. If you do not have one, please contact the sender.",label:"Passcode",onNext:e=>this.handleAuthenticateSigner({auth_method:"passcode",code:e.detail})}))))}if(this.authStep==="email"){return t("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const i=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:i.first_name,last_name:i.last_name,address:i.address,city:i.city,state:i.state,zip:i.zip,dob:i.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const i=this.kbaQuestions[e];return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?t("verdocs-spinner",null):t("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const i=e.detail;this.kbaChoices=[...this.kbaChoices,i];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,i)=>({type:e.type,answer:this.kbaChoices[i]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const e=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const i=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){e.unshift({id:"delegate",label:"Delegate"})}const n=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));n.length>0?console.log("[SIGN] Invalid fields remaining",n.map((e=>e.name))):console.log("[SIGN] All field valid");return t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?e:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=N(1,e.pages);return t(o,null,i.map((i=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=false}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=false;this.isDone=true}}),(this.submitting||this.showSpinner)&&t("verdocs-portal",null,t("div",{class:"spinner-overlay"},t("verdocs-spinner",null))))}};R.style=U;export{R as verdocs_sign};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as i,h as t,H as s,F as o}from"./p-6vpKbd31.js";import{VerdocsEndpoint as n,startSigningSession as a,envelopeRecipientAgree as l,updateEnvelopeField as r,createSignature as d,updateEnvelopeFieldSignature as c,createInitials as h,updateEnvelopeFieldInitials as p,isValidPhone as g,isValidEmail as u,sortFields as v,envelopeRecipientSubmit as f,uploadEnvelopeFieldAttachment as m,deleteEnvelopeFieldAttachment as x,formatFullName as b,fullNameToInitials as y,verifySigner as w,delegateRecipient as k,envelopeRecipientDecline as S,integerSequence as N}from"@verdocs/js-sdk";import{a as I,u as G,g as D,r as P}from"./p-DvM2ECoi.js";import{D as F}from"./p-C_Xku1v2.js";import{V as z}from"./p-CyvDgtoV.js";import{S as T}from"./p-C1sRVZWv.js";import{S as E}from"./p-DmsV595e.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const U='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:360px;width:50%;font-size:16px;background:white;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';const A=`\n<ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the\n <a href="https://verdocs.com/en/electronic-record-signature-disclosure/" target="_blank">\n Electronic Record and Signatures Disclosure</a>.</li>\n <li>\n Agree to Verdocs'\n <a href="https://verdocs.com/en/eula" target="_blank">\n End User License Agreement</a>\n and confirm you have read Verdocs'\n <a href="https://verdocs.com/en/privacy-policy/" target="_blank">\n Privacy Policy</a>.\n </li>\n</ul>`;const R=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=F;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=A;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.loading=true;this.envelope=null}componentWillLoad(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new n({sessionType:"signing"})}}async componentDidLoad(){var e,i,t,s,o,n;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new T("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new T("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new T(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}}processAuthResponse(e){var i,t,s;const{envelope:o,recipient:n}=e;const{auth_step:a}=n;this.recipient=n;this.envelope=o;this.disclosures=((t=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||t===void 0?void 0:t.disclaimer)||A;this.authStep=a;this.delegated=!!n.delegated_to;this.agreed=n.agreed;this.submitted=n.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;E.updateEnvelope(this.envelopeId,o);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=n.auth_method_states||{};this.kbaQuestions=n.kba_questions;if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(n.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);l(this.endpoint,this.envelopeId,this.roleId,this.disclosures).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Unable to accept disclosures",e);z("Unable to accept disclosures, please try again later",{style:"error"});this.submitting=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>e.type==="attachment"));if(e){I(this.endpoint,this.envelope,e.id).catch((e=>{z("Unable to download PDF, please try again later",{style:"error"});console.log("[SIGN] Error downloading PDF",e)}));(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}break}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e,i);this.getRecipientFields().forEach((t=>{if(t.name===e){t.value=i.value;t.settings=i.settings;G(t);this.checkRecipientFields()}}))}saveFieldChange(e,i){console.log("[SIGN] saveFieldChange",e,i);r(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);z("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new T(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"radio":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"dropdown":console.log("Saving dropdown",e.name,i.detail);return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":if(!i.detail){return}this.showSpinner=true;const o=await(await fetch(i.detail)).blob();return h(this.endpoint,"initial",o).then((async i=>{const t=await p(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);z("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(!i.detail){return}this.showSpinner=true;const n=await(await fetch(i.detail)).blob();return d(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await c(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);z("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:a}=i.detail;if(a){return this.saveFieldChange(e.name,{prepared:false,value:a})}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e);break}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return u(i);case"phone":return g(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>e.value==="true"))}return e.value==="true";default:return false}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));v(e);return e}async handleNext(){var e;if(this.nextSubmits){try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const i=await f(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i);window.location.reload()}catch(e){console.log("[SIGN] Error submitting",e)}return}const i=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldFilled(e)));v(i);const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let o=i[s];let n=0;if(n<i.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){n++;s++;if(s>=i.length){s=0}o=i[s]}if(n>=i.length){o=null}if(o){const e=D(o);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth"});i===null||i===void 0?void 0:i.focusField();this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t){if(t.getAttribute("attached")==="1"){return}t.setAttribute("attached","1");t.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));t.addEventListener("attached",(async t=>{console.log("[SIGN] onAttached",t.detail,t.target.value);this.showSpinner=true;try{const s=await m(this.endpoint,this.envelopeId,i.name,t.detail);this.updateRecipientFieldValue(i.name,s);this.checkRecipientFields();const o=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,o);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("deleted",(async t=>{console.log("[SIGN] onDeleted",t.detail,t.target.value);this.showSpinner=true;try{const t=await x(this.endpoint,this.envelopeId,i.name);console.log("[SIGN] Deleted attachment",t);this.updateRecipientFieldValue(i.name,t);this.checkRecipientFields();const s=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,s);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("focusout",(e=>{if(i.type!=="dropdown"&&i.type!=="attachment"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}}));t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);const s=b(this.recipient);t.setAttribute("initials",y(s));t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail;const t=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,t);t.forEach(((e,t)=>{if(e.page!==i.pageNumber){return}const s=P("envelope",e,i,{disabled:false,editable:false,draggable:false,done:this.isDone},t);if(!s){return}if(Array.isArray(s)){s.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=P("envelope",e,i,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!t){return}if(Array.isArray(t)){t.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,t)}}))}));this.checkRecipientFields()}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);w(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var i,t,s,o,n;console.log("[SIGN] Error submitting authentication step",e);if((s=(t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||s===void 0?void 0:s.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{z(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}render(){if(this.showLoadError){return t(s,null,t("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`,buttonLabel:"OK",onNext:()=>{window.location.reload()}}))}if(!this.envelope){return t(s,null,t("verdocs-loader",null))}if(this.fatalErrorMessage){return t(s,{class:{agreed:this.agreed}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},this.fatalErrorHeader),t("p",null,this.fatalErrorMessage))))}if(this.delegated){return t(s,{class:{agreed:false}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},"Delegated Signing Request"),t("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:e=>{e.preventDefault();e.stopPropagation();this.showDone=false;this.isDone=true}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)))}if(this.delegating){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{k(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{z("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);z("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return t("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{S(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);window.location.reload()})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);z("Unable to decline, please try again later",{style:"error"})}))}})}if(!this.agreed){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,placeholder:"Enter your passcode...",helptitle:"Document is protected by a Passcode",helptext:"Please enter your Passcode to proceed. If you do not have one, please contact the sender.",label:"Passcode",onNext:e=>this.handleAuthenticateSigner({auth_method:"passcode",code:e.detail})}))))}if(this.authStep==="email"){return t("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const i=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:i.first_name,last_name:i.last_name,address:i.address,city:i.city,state:i.state,zip:i.zip,dob:i.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const i=this.kbaQuestions[e];return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"})),t("div",{class:"cover"},t("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?t("verdocs-spinner",null):t("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const i=e.detail;this.kbaChoices=[...this.kbaChoices,i];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,i)=>({type:e.type,answer:this.kbaChoices[i]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const e=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const i=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){e.unshift({id:"delegate",label:"Delegate"})}const n=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));n.length>0?console.log("[SIGN] Invalid fields remaining",n.map((e=>e.name))):console.log("[SIGN] All field valid");return t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?e:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=N(1,e.pages);return t(o,null,i.map((i=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=false}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=false;this.isDone=true}}),(this.submitting||this.showSpinner)&&t("verdocs-portal",null,t("div",{class:"spinner-overlay"},t("verdocs-spinner",null))))}};R.style=U;export{R as verdocs_sign};
|
2
|
+
//# sourceMappingURL=p-75a43183.entry.js.map
|