import { p as proxyCustomElement, H, c as createEvent, h } from './p-D16h8pzh.js';
import { D as DefaultEndpoint } from './p-C_Xku1v2.js';
import { d as defineCustomElement$1 } from './p-CZTe2XIO.js';

const verdocsDelegateDialogCss = "@-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-delegate-dialog{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;}verdocs-delegate-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog .input{gap:10px;margin:5px 0;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:row;flex-direction:row}verdocs-delegate-dialog .input label{margin:8px 0 0 0;-ms-flex:0 0 100px;flex:0 0 100px;font-size:13px;font-weight:500;line-height:10px;white-space:nowrap}verdocs-delegate-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #cccccc}verdocs-delegate-dialog .input textarea{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #cccccc;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-delegate-dialog .input.names input{width:80px}verdocs-delegate-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-delegate-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-delegate-dialog .field label{-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-delegate-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-delegate-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-delegate-dialog .buttons{gap:20px;display:-ms-flexbox;display:flex;margin-top:14px;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-delegate-dialog .buttons button{-ms-flex:1;flex:1;border:0;height:38px;display:-ms-flexbox;display:flex;color:#ffffff;font-size:14px;cursor:pointer;-ms-flex-align:center;align-items:center;border-radius:6px;-ms-flex-pack:center;justify-content:center}verdocs-delegate-dialog .buttons button.cancel{background-color:#654dcb}verdocs-delegate-dialog .buttons button.proceed{background-color:#55bc81}verdocs-delegate-dialog .buttons button:disabled{background-color:#6c727f}";

const VerdocsDelegateDialog = /*@__PURE__*/ proxyCustomElement(class VerdocsDelegateDialog extends H {
    constructor() {
        super();
        this.__registerHost();
        this.exit = createEvent(this, "exit");
        this.next = createEvent(this, "next");
        /**
         * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
         */
        this.endpoint = DefaultEndpoint;
        /**
         * The envelope to process.
         */
        this.envelope = null;
        this.first_name = '';
        this.last_name = '';
        this.email = '';
        this.phone = '';
        this.message = '';
    }
    handleCancel() {
        this.exit.emit();
    }
    // We need a separate event handler for clicking the background because it can receive events "through" other child components
    handleDismiss(e) {
        if (e.target.class === 'background-overlay') {
            e.preventDefault();
            this.handleCancel();
        }
    }
    // We need a separate event handler for clicking the background because it can receive events "through" other child components
    handleDelegate() {
        this.next.emit({
            first_name: this.first_name,
            last_name: this.last_name,
            email: this.email,
            phone: this.phone,
            message: this.message,
        });
    }
    render() {
        return (h("verdocs-dialog", { key: 'c8b2b8b55b6f0aa0ce22b232ada78eb65d839e5d' }, h("div", { key: 'a232d72b90086b7dd21246567b4ab7db80ba9855', slot: "heading", class: "heading" }, h("div", { key: 'bade50c544129ed54a43d76c475f8dc378d46ffd', class: "icon" }, h("svg", { key: '72299a219d60e292ce32f63d25b647d448f24add', width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: 'f6b2269e403530b00d16c545e3681236ca335650', "clip-path": "url(#clip0_34208_4881)" }, h("path", { key: '4184d176c8fbe132a217b869ca5e742d38b5f3cd', d: "M3.125 0.75C1.88398 0.75 0.875 1.75898 0.875 3V16.5C0.875 17.741 1.88398 18.75 3.125 18.75H12.125C13.366 18.75 14.375 17.741 14.375 16.5V15.8215C14.2801 15.8602 14.1852 15.8918 14.0867 15.9164L11.9738 16.4437C11.8684 16.4684 11.7629 16.4859 11.6574 16.493C11.6258 16.4965 11.5941 16.5 11.5625 16.5H9.3125C9.09805 16.5 8.90469 16.3805 8.80977 16.1906L8.50039 15.5684C8.44062 15.4488 8.32109 15.375 8.19102 15.375C8.06094 15.375 7.93789 15.4488 7.88164 15.5684L7.57227 16.1906C7.47031 16.398 7.24883 16.5211 7.02031 16.5C6.7918 16.4789 6.59492 16.3207 6.53164 16.1027L5.9375 14.1445L5.59297 15.2977C5.37852 16.0113 4.72109 16.5 3.97578 16.5H3.6875C3.37812 16.5 3.125 16.2469 3.125 15.9375C3.125 15.6281 3.37812 15.375 3.6875 15.375H3.97578C4.22539 15.375 4.44336 15.2133 4.51367 14.9742L5.0375 13.234C5.15703 12.8367 5.52266 12.5625 5.9375 12.5625C6.35234 12.5625 6.71797 12.8367 6.8375 13.234L7.24531 14.591C7.50547 14.373 7.83594 14.25 8.1875 14.25C8.74648 14.25 9.25625 14.5664 9.50586 15.0656L9.66055 15.375H9.97344C9.86445 15.0656 9.84336 14.7281 9.92422 14.3977L10.4516 12.2848C10.55 11.8875 10.7539 11.5289 11.0422 11.2406L14.375 7.90781V6.375H9.875C9.25273 6.375 8.75 5.87227 8.75 5.25V0.75H3.125ZM9.875 0.75V5.25H14.375L9.875 0.75ZM20.2039 5.66133C19.6555 5.11289 18.766 5.11289 18.2141 5.66133L17.1805 6.69492L19.6766 9.19102L20.7102 8.15742C21.2586 7.60898 21.2586 6.71953 20.7102 6.16758L20.2039 5.66133ZM11.8402 12.0352C11.6961 12.1793 11.5941 12.3586 11.5449 12.559L11.0176 14.6719C10.9684 14.8652 11.0246 15.0656 11.1652 15.2063C11.3059 15.3469 11.5062 15.4031 11.6996 15.3539L13.8125 14.8266C14.0094 14.7773 14.1922 14.6754 14.3363 14.5312L18.8785 9.98555L16.3824 7.48945L11.8402 12.0352Z", fill: "white" })), h("defs", { key: '4aa388d7b0c799d426c7da94de93ab1be61ccbf0' }, h("clipPath", { key: '0260929f251a0c3ad8bfc1f9e1bc9687cb3b60f6', id: "clip0_34208_4881" }, h("path", { key: '64c42049336d37be15cb53adc91fe232955768d4', d: "M0.875 0.75H21.125V18.75H0.875V0.75Z", fill: "white" }))))), h("div", { key: 'f9111aedb3a8e09a5898e560603592cdd972539b', class: "title" }, "Delegate \"", this.envelope.name, "\"")), h("div", { key: 'cee68483e20d610fa6f27f91bc31782717b89326', slot: "content", class: "content" }, h("div", { key: '7316f1efd0cec724711236179efb949980e2fce1', class: "input names" }, h("label", { key: 'f26c2b853c322858a6376ee124f008adc807cc01', htmlFor: "verdocs-delegate-email" }, "New Recipient:"), h("input", { key: '0c8e5895ff3bedb18112a29952402b4b0b6594c3', type: "text", id: "verdocs-delegate-first", name: "verdocs-delegate-first", autocomplete: "blocked", placeholder: "First name...", value: this.first_name, onInput: (e) => (this.first_name = e.target.value) }), h("input", { key: '1c103e348495c708313f0d5d8718f0b16bfe51a8', type: "text", id: "verdocs-delegate-last", name: "verdocs-delegate-last", autocomplete: "blocked", placeholder: "Last name...", value: this.last_name, onInput: (e) => (this.last_name = e.target.value) })), h("div", { key: '2d1371968cc1e39566f5442b8f1d1d7cad99bd16', class: "input" }, h("label", { key: '4288dba409f55402f2dde44697cf4e5282b812b8', htmlFor: "verdocs-delegate-email" }, "Email Address:"), h("input", { key: 'db7e71075d6024a8207cd0fbcb9bd1461a526378', type: "text", id: "verdocs-delegate-email", name: "verdocs-delegate-email", autocomplete: "blocked", placeholder: "New recipient email address...", value: this.email, onInput: (e) => (this.email = e.target.value) })), h("div", { key: 'ec28591dc85cc862779023cb2987a71c5c13c66e', class: "input" }, h("label", { key: '7b17786a3511eaeaf4c45997a632f2533071d6f9', htmlFor: "verdocs-delegate-phone" }, "Phone:"), h("input", { key: '0a3ba95551a66756c77f4ccd9c5269aaa20f5d6f', type: "text", id: "verdocs-delegate-phone", name: "verdocs-delegate-phone", autocomplete: "blocked", placeholder: "Optional phone number...", value: this.phone, onInput: (e) => (this.phone = e.target.value) })), h("div", { key: '2e94fd83e0d58ba0ad37f97be2e09971ad8a80c4', class: "input" }, h("label", { key: 'ec0c5fb1d5c3e4985ee57bbb7d1722aa55b7a2b3', htmlFor: "verdocs-delegate-email" }, "Message:"), h("textarea", { key: '9962c1d2dc7f61fea639204766bd0eb0b030c90b', id: "verdocs-delegate-message", name: "verdocs-delegate-message", rows: 3, autocomplete: "blocked", placeholder: "Optional message to include in the invitation...", onInput: (e) => (this.message = e.target.value) }, this.message))), h("div", { key: '67062f5d1ecca5fd8206149067351a93d717282f', class: "footer", slot: "footer" }, h("div", { key: 'c05f381f9be5a54ad71e98233999aa69fbf57d61', class: "buttons" }, h("button", { key: 'cc64ad9c6d68f4136227aa8e18a65aadb4f788a8', class: "cancel", onClick: () => this.handleCancel() }, "Cancel"), h("button", { key: '41750cc0bd2e3234053ca015c59febaee914d5c3', class: "proceed", onClick: () => this.handleDelegate(), disabled: !this.first_name || !this.last_name || !this.email }, "Proceed")))));
    }
    static get style() { return verdocsDelegateDialogCss; }
}, [256, "verdocs-delegate-dialog", {
        "endpoint": [1040],
        "envelope": [16],
        "first_name": [32],
        "last_name": [32],
        "email": [32],
        "phone": [32],
        "message": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["verdocs-delegate-dialog", "verdocs-dialog"];
    components.forEach(tagName => { switch (tagName) {
        case "verdocs-delegate-dialog":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, VerdocsDelegateDialog);
            }
            break;
        case "verdocs-dialog":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { VerdocsDelegateDialog as V, defineCustomElement as d };
//# sourceMappingURL=p-DmgutWwH.js.map

//# sourceMappingURL=p-DmgutWwH.js.map