import{r as e,c as t,h as s,F as i,H as n,g as o}from"./p-CjTHbolG.js";import{i as a}from"./p-CGNX5HqF.js";import{S as r}from"./p-BU5rnXp2.js";import{S as l}from"./p-C7hFgM52.js";import"./p-BFTU3MAI.js";import"@verdocs/js-sdk";const d=()=>`verdocs-field-payment{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-payment .settings-icon svg{fill:#707ae5}verdocs-field-payment .settings-icon:hover{opacity:1}`;const c=class{constructor(s){e(this,s);this.settingsChanged=t(this,"settingsChanged");this.deleted=t(this,"deleted");this.source="template";this.sourceid="";this.fieldname="";this.field=null;this.disabled=false;this.done=false;this.editable=false;this.moveable=false;this.xscale=1;this.yscale=1;this.pagenumber=1;this.showingProperties=false;this.focused=false;this.signed=false;this.signatureUrl="";this.roleindex=0}handleBlur(){this.focused=false}componentWillLoad(){if(this.recipients&&this.recipients.length>0){const e=this.recipients.find((e=>e.type==="preparer"));console.log("Found preparer",e);if(e){this.preparedMessage=`Prepared by ${e["full_name"]}`}}}async focusField(){this.el.focus();this.focused=true}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.showPanel){e.showPanel()}}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.fieldname}`);if(e&&e.hidePanel){e.hidePanel()}}onEditableChanged(e,t){if(t&&!e){a(this.el).unset()}}disconnectedCallback(){a(this.el).unset()}render(){const{source:e,sourceid:t,fieldname:o,editable:a=false,done:d=false,disabled:c=false,focused:p,xscale:h=1,yscale:f=1}=this;const{index:g,field:m}=l.getField(e,t,o,this.field);const u=`signer-${g%10+1}`;if(!m){return s(i,null)}if(d){return s(n,{class:{"verdocs-field":true,done:d}},"$✓")}return s(n,{class:{"verdocs-field":true,focused:p,disabled:c,[u]:true}},s("button",{class:{hide:this.signed}},"$"),this.signed?s("div",{class:"frame"}):s("div",{style:{display:"none"}}),s("img",{width:"100%",height:"100%",src:this.signatureUrl,alt:"Payment Icon"}),a&&s(i,null,s("div",{id:`verdocs-settings-panel-trigger-${o}`,style:{transform:`scale(${Math.floor(1/h*1e3)/1e3}, ${Math.floor(1/f*1e3)/1e3})`},class:"settings-icon",innerHTML:r,onClick:e=>{e.stopPropagation();this.showingProperties=!this.showingProperties}}),this.showingProperties&&s("verdocs-portal",{anchor:`verdocs-settings-panel-trigger-${m.name}`,onClickAway:()=>this.showingProperties=false},s("verdocs-template-field-properties",{templateId:t,fieldName:m.name,onClose:()=>this.showingProperties=false,onDelete:()=>{var e;(e=this.deleted)===null||e===void 0?void 0:e.emit({fieldName:o});return this.hideSettingsPanel()},onSettingsChanged:e=>{var t;(t=this.settingsChanged)===null||t===void 0?void 0:t.emit(e.detail);return this.hideSettingsPanel()},helpText:"Check boxes allow the user to select one or more (non-exclusive) options."}))))}get el(){return o(this)}static get watchers(){return{editable:[{onEditableChanged:0}]}}};c.style=d();export{c as verdocs_field_payment};
//# sourceMappingURL=p-50d51d96.entry.js.map