@verdocs/web-sdk 6.10.2 → 6.10.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.
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as i,d as a,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as l,getEnvelopes as n,integerSequence as d,getRecipientsWithActions as r,userCanCancelEnvelope as c,userCanAct as p,formatFullName as v,cancelEnvelope as h}from"@verdocs/js-sdk";import{s as f}from"./p-BCwFpXpV.js";import{V as m}from"./p-D97GxsI-.js";import{S as u}from"./p-C1sRVZWv.js";import{d as x}from"./p-C0SHIuoK.js";import{d as b}from"./p-DVx4efoX.js";import{d as w}from"./p-D17kbVUt.js";import{d as g}from"./p-D9yawpPk.js";import{d as k}from"./p-CxIhMndz.js";import{d as y}from"./p-BD2vHbCJ.js";import{d as E}from"./p-CIgqf7hj.js";import{d as S}from"./p-CVjehb2X.js";import{d as C}from"./p-CoeB7U-_.js";import{d as V}from"./p-CL2-oWjL.js";import{d as j}from"./p-BMGs9CCD.js";const P=()=>`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 D=[{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 z=[{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 L=[{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 M=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.changeView=t(this,"changeView");this.changeStatus=t(this,"changeStatus");this.changeSort=t(this,"changeSort");this.changeMatch=t(this,"changeMatch");this.sdkError=t(this,"sdkError");this.viewEnvelope=t(this,"viewEnvelope");this.finishEnvelope=t(this,"finishEnvelope");this.endpoint=l.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,t)=>{console.log("[ENVELOPES_LIST] onSessionChanged",s,t)}));this.endpoint.loadSession()}async componentDidLoad(){await this.queryEnvelopes();this.initiallyLoaded=true}async queryEnvelopes(){var e,s,t;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 n(this.endpoint,e);this.envelopes=s.envelopes;this.count=s.count;this.loading=false}catch(i){this.loading=false;console.log("[ENVELOPES] Error listing envelopes",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(i.message,(s=i.response)===null||s===void 0?void 0:s.status,(t=i.response)===null||t===void 0?void 0:t.data))}}handleDownload(){f(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e);m("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){f(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e);m("Download error: "+e.message,{style:"error"})}))}render(){return i(a,{key:"fb5fc11c18997ded54acd749784a52ad772c0b19"},i("div",{key:"458b115c96614a9c9c9c34bbf07b51387ff3eea9",class:"header"},i("div",{key:"0faaf795ba54424f396372751043e23ae0b1aa99",class:"filter"},i("verdocs-text-input",{key:"7c13defc25a6b39d4dd5280292c54cb23077102a",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:"93f37d059ca898d1247d700b7a1374a160d23d10",label:"View",value:this.view,options:D,onOptionSelected:e=>{this.view=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"3bed5e69a1625d8c571e78e7e9fa26727962e8d7",label:"Status",value:this.status,options:z,onOptionSelected:e=>{this.status=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"f2d1b55b0ab1e57f7d923ed4d64d4ce1d421b6bc",label:"Sort By",value:this.sort,options:L,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{key:"e36f23e1a028ec1aa34501e6f2b4537357115ac9",mode:"dark",size:24}),i("div",{key:"ee030ffd3f87e1c38879fd16b54c4994b91a25e4",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{key:"8dc303a71431c6a49370036434fb9fc5c8519d06",label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const t=r(e);const a=c(this.endpoint.profile,e);const o=t.find((e=>{var s;return e.email===((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||""}));const l=o&&a&&p(((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||"",t);const n=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!l},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!a}];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=>v(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:n,onOptionSelected:s=>{var t,i;switch(s.detail.id){case"view":(t=this.viewEnvelope)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:e});break;case"finish":(i=this.finishEnvelope)===null||i===void 0?void 0:i.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?")){h(this.endpoint,e.id).then((()=>m("Envelope canceled"))).catch((e=>m("Unable to cancel envelope: "+e.messabge,{style:"error"})));this.queryEnvelopes().catch((()=>{}))}break}}})))})),!this.initiallyLoaded&&i("div",{key:"a7a469eb18e834fb8bb854e156f0b62d2c3cd13a",style:{width:"100%"}},d(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{key:"91cb817669da6aaf629e24393edfdc2ea4de6091",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:0}],status:[{handleStatusUpdated:0}],sort:[{handleSortUpdated:0}],match:[{handleMatchUpdated:0}],selectedPage:[{handlePageUpdated:0}]}}static get style(){return P()}},[0,"verdocs-envelopes-list",{endpoint:[16],view:[1537],status:[1537],sort:[1537],match:[1537],showPagination:[4,"show-pagination"],rowsPerPage:[2,"rows-per-page"],selectedPage:[2,"selected-page"],count:[32],initiallyLoaded:[32],loading:[32],selectedEnvelopes:[32],envelopes:[32]},undefined,{view:[{handleViewUpdated:0}],status:[{handleStatusUpdated:0}],sort:[{handleSortUpdated:0}],match:[{handleMatchUpdated:0}],selectedPage:[{handlePageUpdated:0}]}]);function H(){if(typeof customElements==="undefined"){return}const e=["verdocs-envelopes-list","verdocs-button","verdocs-checkbox","verdocs-dropdown","verdocs-flag","verdocs-help-icon","verdocs-pagination","verdocs-portal","verdocs-quick-filter","verdocs-spinner","verdocs-status-indicator","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-envelopes-list":if(!customElements.get(o(e))){customElements.define(o(e),M)}break;case"verdocs-button":if(!customElements.get(o(e))){x()}break;case"verdocs-checkbox":if(!customElements.get(o(e))){b()}break;case"verdocs-dropdown":if(!customElements.get(o(e))){w()}break;case"verdocs-flag":if(!customElements.get(o(e))){g()}break;case"verdocs-help-icon":if(!customElements.get(o(e))){k()}break;case"verdocs-pagination":if(!customElements.get(o(e))){y()}break;case"verdocs-portal":if(!customElements.get(o(e))){E()}break;case"verdocs-quick-filter":if(!customElements.get(o(e))){S()}break;case"verdocs-spinner":if(!customElements.get(o(e))){C()}break;case"verdocs-status-indicator":if(!customElements.get(o(e))){V()}break;case"verdocs-text-input":if(!customElements.get(o(e))){j()}break}}))}const I=M;const O=H;export{I as VerdocsEnvelopesList,O as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as i,d as a,t as o}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as l,getEnvelopes as n,integerSequence as d,getRecipientsWithActions as r,userCanCancelEnvelope as c,userCanAct as p,formatFullName as v,cancelEnvelope as h}from"@verdocs/js-sdk";import{s as f}from"./p-BCwFpXpV.js";import{V as m}from"./p-D97GxsI-.js";import{S as u}from"./p-C1sRVZWv.js";import{d as x}from"./p-C0SHIuoK.js";import{d as b}from"./p-DVx4efoX.js";import{d as w}from"./p-D17kbVUt.js";import{d as g}from"./p-D9yawpPk.js";import{d as k}from"./p-CxIhMndz.js";import{d as y}from"./p-BD2vHbCJ.js";import{d as E}from"./p-CIgqf7hj.js";import{d as S}from"./p-CVjehb2X.js";import{d as C}from"./p-CoeB7U-_.js";import{d as V}from"./p-DtHLJ-XO.js";import{d as j}from"./p-BMGs9CCD.js";const P=()=>`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 D=[{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 z=[{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 H=[{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 M=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.changeView=t(this,"changeView");this.changeStatus=t(this,"changeStatus");this.changeSort=t(this,"changeSort");this.changeMatch=t(this,"changeMatch");this.sdkError=t(this,"sdkError");this.viewEnvelope=t(this,"viewEnvelope");this.finishEnvelope=t(this,"finishEnvelope");this.endpoint=l.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,t)=>{console.log("[ENVELOPES_LIST] onSessionChanged",s,t)}));this.endpoint.loadSession()}async componentDidLoad(){await this.queryEnvelopes();this.initiallyLoaded=true}async queryEnvelopes(){var e,s,t;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 n(this.endpoint,e);this.envelopes=s.envelopes;this.count=s.count;this.loading=false}catch(i){this.loading=false;console.log("[ENVELOPES] Error listing envelopes",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(i.message,(s=i.response)===null||s===void 0?void 0:s.status,(t=i.response)===null||t===void 0?void 0:t.data))}}handleDownload(){f(this.endpoint,this.selectedEnvelopes).then((()=>{this.selectedEnvelopes=[]})).catch((e=>{console.log("[ENVELOPES] Download error",e);m("Download error: "+e.message,{style:"error"})}))}downloadEnvelope(e){f(this.endpoint,[e]).catch((e=>{console.log("[ENVELOPES] Download error",e);m("Download error: "+e.message,{style:"error"})}))}render(){return i(a,{key:"fb5fc11c18997ded54acd749784a52ad772c0b19"},i("div",{key:"458b115c96614a9c9c9c34bbf07b51387ff3eea9",class:"header"},i("div",{key:"0faaf795ba54424f396372751043e23ae0b1aa99",class:"filter"},i("verdocs-text-input",{key:"7c13defc25a6b39d4dd5280292c54cb23077102a",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:"93f37d059ca898d1247d700b7a1374a160d23d10",label:"View",value:this.view,options:D,onOptionSelected:e=>{this.view=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"3bed5e69a1625d8c571e78e7e9fa26727962e8d7",label:"Status",value:this.status,options:z,onOptionSelected:e=>{this.status=e.detail.value}}),this.view==="all"&&i("verdocs-quick-filter",{key:"f2d1b55b0ab1e57f7d923ed4d64d4ce1d421b6bc",label:"Sort By",value:this.sort,options:H,onOptionSelected:e=>{this.sort=e.detail.value}}),this.loading&&i("verdocs-spinner",{key:"e36f23e1a028ec1aa34501e6f2b4537357115ac9",mode:"dark",size:24}),i("div",{key:"ee030ffd3f87e1c38879fd16b54c4994b91a25e4",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&i("verdocs-button",{key:"8dc303a71431c6a49370036434fb9fc5c8519d06",label:`Download (${this.selectedEnvelopes.length})`,onClick:()=>this.handleDownload()})),this.envelopes.map((e=>{var s;const t=r(e);const a=c(this.endpoint.profile,e);const o=t.find((e=>{var s;return e.email===((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||""}));const l=o&&a&&p(((s=this.endpoint.session)===null||s===void 0?void 0:s.email)||"",t);const n=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!l},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!a}];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=>v(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:n,onOptionSelected:s=>{var t,i;switch(s.detail.id){case"view":(t=this.viewEnvelope)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:e});break;case"finish":(i=this.finishEnvelope)===null||i===void 0?void 0:i.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?")){h(this.endpoint,e.id).then((()=>m("Envelope canceled"))).catch((e=>m("Unable to cancel envelope: "+e.messabge,{style:"error"})));this.queryEnvelopes().catch((()=>{}))}break}}})))})),!this.initiallyLoaded&&i("div",{key:"a7a469eb18e834fb8bb854e156f0b62d2c3cd13a",style:{width:"100%"}},d(0,this.rowsPerPage).map((()=>i("div",{class:"envelope-placeholder"})))),this.initiallyLoaded&&!this.envelopes.length&&i("div",{key:"91cb817669da6aaf629e24393edfdc2ea4de6091",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:0}],status:[{handleStatusUpdated:0}],sort:[{handleSortUpdated:0}],match:[{handleMatchUpdated:0}],selectedPage:[{handlePageUpdated:0}]}}static get style(){return P()}},[0,"verdocs-envelopes-list",{endpoint:[16],view:[1537],status:[1537],sort:[1537],match:[1537],showPagination:[4,"show-pagination"],rowsPerPage:[2,"rows-per-page"],selectedPage:[2,"selected-page"],count:[32],initiallyLoaded:[32],loading:[32],selectedEnvelopes:[32],envelopes:[32]},undefined,{view:[{handleViewUpdated:0}],status:[{handleStatusUpdated:0}],sort:[{handleSortUpdated:0}],match:[{handleMatchUpdated:0}],selectedPage:[{handlePageUpdated:0}]}]);function L(){if(typeof customElements==="undefined"){return}const e=["verdocs-envelopes-list","verdocs-button","verdocs-checkbox","verdocs-dropdown","verdocs-flag","verdocs-help-icon","verdocs-pagination","verdocs-portal","verdocs-quick-filter","verdocs-spinner","verdocs-status-indicator","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-envelopes-list":if(!customElements.get(o(e))){customElements.define(o(e),M)}break;case"verdocs-button":if(!customElements.get(o(e))){x()}break;case"verdocs-checkbox":if(!customElements.get(o(e))){b()}break;case"verdocs-dropdown":if(!customElements.get(o(e))){w()}break;case"verdocs-flag":if(!customElements.get(o(e))){g()}break;case"verdocs-help-icon":if(!customElements.get(o(e))){k()}break;case"verdocs-pagination":if(!customElements.get(o(e))){y()}break;case"verdocs-portal":if(!customElements.get(o(e))){E()}break;case"verdocs-quick-filter":if(!customElements.get(o(e))){S()}break;case"verdocs-spinner":if(!customElements.get(o(e))){C()}break;case"verdocs-status-indicator":if(!customElements.get(o(e))){V()}break;case"verdocs-text-input":if(!customElements.get(o(e))){j()}break}}))}const O=M;const I=L;export{O as VerdocsEnvelopesList,I as defineCustomElement};
2
2
  //# sourceMappingURL=verdocs-envelopes-list.js.map
@@ -1,2 +1,2 @@
1
- import{V as o,d as s}from"./p-CL2-oWjL.js";const t=o;const p=s;export{t as VerdocsStatusIndicator,p as defineCustomElement};
1
+ import{V as o,d as s}from"./p-DtHLJ-XO.js";const t=o;const p=s;export{t as VerdocsStatusIndicator,p as defineCustomElement};
2
2
  //# sourceMappingURL=verdocs-status-indicator.js.map
@@ -256,6 +256,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
256
256
  return import(
257
257
  /* webpackMode: "lazy" */
258
258
  './verdocs-envelope-recipient-link_2.entry.js').then(processMod, consoleError);
259
+ case 'verdocs-status-indicator':
260
+ return import(
261
+ /* webpackMode: "lazy" */
262
+ './verdocs-status-indicator.entry.js').then(processMod, consoleError);
259
263
  case 'verdocs-file-chooser_2':
260
264
  return import(
261
265
  /* webpackMode: "lazy" */
@@ -296,10 +300,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
296
300
  return import(
297
301
  /* webpackMode: "lazy" */
298
302
  './verdocs-adopt-signature-dialog_7.entry.js').then(processMod, consoleError);
299
- case 'verdocs-status-indicator':
300
- return import(
301
- /* webpackMode: "lazy" */
302
- './verdocs-status-indicator.entry.js').then(processMod, consoleError);
303
303
  }
304
304
  }
305
305
  return import(