import{p as e,H as s,c as o,h as t,d,t as i}from"./p-yZBlG3YQ.js";import{verifySigner as c}from"@verdocs/js-sdk";import{D as a}from"./p-C_Xku1v2.js";import{V as l}from"./p-D97GxsI-.js";import{d as n}from"./p-Bdf8pPWm.js";import{d as r}from"./p-DT0LGcPi.js";import{d as f}from"./p-CioaaWeS.js";import{d as p}from"./p-DYtSnUj9.js";const b=()=>`verdocs-passcode-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-passcode-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-passcode-dialog .heading{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-passcode-dialog .heading .title{font-size:20px;font-weight:500}verdocs-passcode-dialog .step{color:#666;margin-left:6px}verdocs-passcode-dialog .help-box{padding:0;color:black;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;margin-bottom:20px}verdocs-passcode-dialog .help-details{gap:5px;display:-ms-flexbox;display:flex;margin-left:0;font-size:14px;-ms-flex-direction:column;flex-direction:column}verdocs-passcode-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-passcode-dialog .help-text{font-weight:400}verdocs-passcode-dialog .buttons{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-passcode-dialog .buttons verdocs-button{margin-left:16px}`;const m=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.exit=o(this,"exit");this.next=o(this,"next");this.endpoint=a;this.response=""}handleCancel(){this.exit.emit()}handleSubmit(){c(this.endpoint,{auth_method:"passcode",code:this.response}).then((e=>{console.log("Verification completed",e);this.next.emit({response:e})})).catch((e=>{l("Invalid passcode. Please try again.");console.log("Invalid code",e)}));this.response=""}render(){return t(d,{key:"4c665e302ef9e73300b2e8a8199a1bca4fbc7553"},t("verdocs-dialog",{key:"d22e5c4521b9e5afef6d23a61e0df2787e8ff483",persistent:true,onExit:()=>this.handleCancel()},t("div",{key:"5244c91f2cc688b936dfdccb4058c31c620ad4e2",slot:"heading",class:"heading"},t("div",{key:"ba2fbb864b8f7df54efb7f7b06241ef1acc64afd",class:"title"},"Passcode Required")),t("div",{key:"60c75c98dd4af071a05c23aa714c0901f51fad86",slot:"content",class:"content"},t("div",{key:"36f257208d95c5250f7c9507eec255d9109e7d75",class:"help-box"},t("div",{key:"03d48212677d1739754f757fe121bbd5158a0505",class:"help-details"},t("div",{key:"8f60c2bc945a2b506c91720b56f52e863d2c2309",class:"help-text"},"This document is protected by a passcode. Please enter it below to proceed. If you do not have one, please contact the sender."))),t("verdocs-text-input",{key:"29da253e3865a8d25762e6e6cf7b9cc18c33ecf0",id:"verdocs-passcode-input",value:this.response,onClick:e=>e.stopPropagation(),placeholder:"Enter passcode...",onInput:e=>this.response=e.target.value})),t("div",{key:"23be778ccfabd914752f77ed40f4d931332d6b7a",slot:"footer",class:"buttons footer"},t("verdocs-button",{key:"73c3c19c8618b46da14762baa63edf1aa5985dc4",label:"Cancel",variant:"outline",onClick:()=>this.handleCancel()}),t("verdocs-button",{key:"5d6f474ff34ef9e9ef2d1d475783bce69934ca99",label:"Submit",onClick:()=>this.handleSubmit(),disabled:!this.response}))))}static get style(){return b()}},[0,"verdocs-passcode-dialog",{endpoint:[1040],response:[32]}]);function x(){if(typeof customElements==="undefined"){return}const e=["verdocs-passcode-dialog","verdocs-button","verdocs-dialog","verdocs-help-icon","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-passcode-dialog":if(!customElements.get(i(e))){customElements.define(i(e),m)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-dialog":if(!customElements.get(i(e))){r()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){f()}break;case"verdocs-text-input":if(!customElements.get(i(e))){p()}break}}))}export{m as V,x as d};
//# sourceMappingURL=p-BxOEoXie.js.map