import{p as e,H as t,h as i,d as o,t as s}from"./p-yZBlG3YQ.js";import{A as a,l as c}from"./p-CjPsvAbb.js";import{V as r}from"./p-D97GxsI-.js";import{d as n}from"./p-CioaaWeS.js";const p=()=>`verdocs-text-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-text-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:34px;padding:0 9px;outline:none}verdocs-text-input .input-element:disabled{cursor:not-allowed;background:#aeb4bf;border:1px solid #33364b}verdocs-text-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:focus{outline:1px solid #7d88ff}verdocs-text-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}verdocs-text-input .required{color:red;margin-left:2px;display:inline-block}verdocs-text-input [data-lastpass-icon-root]{display:none !important}verdocs-text-input .input-container{position:relative}verdocs-text-input .clear{top:7px;right:5px;width:18px;height:18px;fill:#cccccc;position:absolute}verdocs-text-input .clear:hover{fill:#720101;cursor:pointer}verdocs-text-input .copy{top:7px;right:5px;width:18px;height:18px;fill:#cccccc;position:absolute}verdocs-text-input .copy:hover{fill:#654dcb;cursor:pointer}verdocs-text-input .toggle-pw{top:5px;right:7px;width:18px;height:18px;stroke:#cccccc;position:absolute}verdocs-text-input .toggle-pw:hover{fill:#654dcb;cursor:pointer}verdocs-text-input.clearable .input-element,verdocs-text-input.copyable .input-element{padding-right:32px}`;const l=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.picker=null;this.value="";this.label="";this.placeholder="";this.helpText="";this.disabled=false;this.required=false;this.showingPw=false;this.focused=false;this.containerId=`verdocs-date-input-${Math.random().toString(36).substring(2,11)}`}async focusField(){var e;this.focused=true;(e=this.picker)===null||e===void 0?void 0:e.show();setTimeout((()=>{this.focused=false}),500)}componentDidLoad(){this.picker=new a(`#${this.containerId}`,{locale:c,isMobile:true,autoClose:true,onShow:()=>this.focused=true,onHide:()=>this.focused=false,onSelect:({date:e,formattedDate:t})=>{const i=new CustomEvent("input",{detail:{date:e,formattedDate:t}});this.hostEl.dispatchEvent(i)}})}copyToClipboard(){this.inputEl.select();navigator.clipboard.writeText(this.value).then((()=>r("Copied!"))).catch((e=>console.log("Error copying to clipboard",e)))}render(){return i(o,{key:"a71872f25c3fbfdb8837f546340edd2324f141f9",class:`input-field`},i("label",{key:"68b0b363d48c045f6a6124467c81e3c8af7f6321"},this.label&&i("div",{key:"6cfe44246b5776315772da522b27482c362df563",class:"input-label"},this.label+":",this.required&&i("span",{key:"9c02382715b89aa7c8f1c4efd6e9e1e54cec6692",class:"required"},"*")),i("div",{key:"56e31da5bc7c6206a9f1045ad6317f6b95ca2206",class:"input-container"},i("input",{key:"bdca818f5c8df445d9e63c6597cc75d0634096f1",type:"text",value:this.value,required:this.required,class:"input-element","data-lpignore":"true",id:this.containerId,disabled:this.disabled,placeholder:this.placeholder,ref:e=>this.inputEl=e,onInput:e=>this.value=e.target.value})),this.helpText&&i("verdocs-help-icon",{key:"712354ce917bb818033fa6cd95dc2bf50daf678f",text:this.helpText})))}get hostEl(){return this}static get style(){return p()}},[0,"verdocs-date-input",{value:[1537],label:[1],placeholder:[1],helpText:[1,"help-text"],disabled:[4],required:[4],showingPw:[32],focused:[32],containerId:[32],focusField:[64]}]);function d(){if(typeof customElements==="undefined"){return}const e=["verdocs-date-input","verdocs-help-icon"];e.forEach((e=>{switch(e){case"verdocs-date-input":if(!customElements.get(s(e))){customElements.define(s(e),l)}break;case"verdocs-help-icon":if(!customElements.get(s(e))){n()}break}}))}const u=l;const h=d;export{u as VerdocsDateInput,h as defineCustomElement};
//# sourceMappingURL=verdocs-date-input.js.map