import { Host, h } from "@stencil/core";
import { cls, getId } from "../../utils/helpers";
import { Lang } from "../../services/lang";
import IMask from "imask";
export class XInput {
    constructor() {
        /**
         * Typing timer instance
         */
        this.typingTimer = null;
        /**
         * Typing input event instance
         */
        this.typingEvent = null;
        /**
         * Element ID for internal reference
         */
        this.inputId = getId('input');
        this.label = undefined;
        this.name = undefined;
        this.type = 'text';
        this.placeholder = undefined;
        this.info = undefined;
        this.typingtimeout = 1200;
        this.validate = undefined;
        this.required = undefined;
        this.loading = undefined;
        this.readonly = undefined;
        this.cleanable = undefined;
        this.autofocus = undefined;
        this.capitalize = 'off';
        this.autocorrect = 'off';
        this.pattern = undefined;
        this.autocomplete = 'off';
        this.enterkeyhint = undefined;
        this.inputmode = undefined;
        this.max = undefined;
        this.min = undefined;
        this.step = undefined;
        this.maxlength = undefined;
        this.minlength = undefined;
        this.mask = undefined;
        this.value = '';
        this.inputType = this.type;
        this.isValid = true;
        this.isTyping = undefined;
        this.isFocused = undefined;
        this.isLoading = undefined;
        this.isDisabled = undefined;
    }
    /**
     * On watch mask pattern/options
     */
    maskChanged() {
        if (this.mask && !this.maskInstance) {
            this.maskInstance = IMask(this.el.querySelector('input'), this.mask);
        }
        this.maskInstance.updateOptions(this.mask);
    }
    /**
     * On watch type property hook
     */
    typeChanged() {
        this.validateInputType();
    }
    /**
     * Set the value of the input
     */
    async setValue(value) {
        this.value = value;
        this.internals.setFormValue(value);
    }
    /**
     * Validate the input and get the validation result
    */
    async checkValidity() {
        this.onValidate();
        return this.isValid;
    }
    /**
     * This is called when the 'disabled' attribute of the element or or an ancestor <fieldset> is updated
     *
     * @param disabled
     */
    formDisabledCallback(disabled) {
        this.isDisabled = disabled;
    }
    /**
     * This is called when the parent/owner form is reset
     */
    formResetCallback() {
        this.isValid = true;
        this.internals.setFormValue('');
    }
    /**
     * This is called on component before load
     */
    componentWillLoad() {
        this.validateInputType();
    }
    /**
     * This is called on component did load
     */
    componentDidLoad() {
        if (this.mask && !this.maskInstance) {
            this.maskInstance = IMask(this.el.querySelector('input'), this.mask);
        }
    }
    /**
     * Set element value by event
     *
     * @param event
     */
    onInput(event) {
        this.value = event.target.value;
        this.internals.setFormValue(event.target.value);
    }
    /**
     * This called on input field is unfocused
     */
    onBlurInput() {
        this.isFocused = false;
        setTimeout(() => this.onValidate(), 50);
    }
    /**
     * This called on input field is focused
     */
    onFocusInput() {
        this.isFocused = true;
    }
    /**
     * This called on input field was changed
     *
     * @param event
     */
    onKeyUpInput(event) {
        this.isTyping = true;
        this.typingEvent = event;
        clearTimeout(this.typingTimer);
        this.typingTimer = setTimeout(this.onDoneTypingInput.bind(this), this.typingtimeout);
    }
    /**
     * This called on input field detect key is down
     */
    onKeyDownInput() {
        clearTimeout(this.typingTimer);
    }
    /**
     * This called on input field finished typing
     */
    onDoneTypingInput() {
        this.onValidate();
        this.isTyping = false;
        this.onDoneTypingEvent.emit(this.typingEvent);
    }
    /**
     * Validate the field input
     *
     * @returns
     */
    onValidate() {
        if (!this.validate) {
            return;
        }
        const selectors = ["input", "select", "textarea"];
        let input = null;
        selectors.forEach((selector) => {
            if (input === null) {
                input = this.el.querySelector(selector);
            }
        });
        this.isValid = (input === null || input === void 0 ? void 0 : input.validity) ? input.validity.valid : true;
        this.onValidateInputEvent.emit(input);
    }
    /**
     * Return validation of showing the input label
     *
     * @returns
     */
    showLabel() {
        var _a;
        return (this.label && this.placeholder) || (this.label && (((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()).length > 0 || this.isFocused)) || (this.label && ['color', 'otp'].includes(this.type));
    }
    /**
     * Compute the placeholder value
     *
     * @returns
     */
    placeholderValue() {
        if (this.type == 'otp') {
            return [...Array(this.maxlength || 0).keys()].map(() => '0').join('');
        }
        if (this.label) {
            if (this.placeholder) {
                return this.placeholder;
            }
            else if (!this.showLabel()) {
                return this.label;
            }
        }
        return this.placeholder;
    }
    /**
     * Show the content of input when type is `password`
     *
     * @returns
     */
    togglePasswordVisibility() {
        if (this.isDisabled) {
            return;
        }
        this.inputType = this.inputType == 'password' ? 'text' : 'password';
        setTimeout(() => {
            this.el.querySelector('input').focus();
        }, 100);
    }
    /**
     * Sumarize the actual value if type is `numeric`
     *
     * @returns
     */
    sumValue() {
        if (isNaN(parseInt(this.value.toString()))) {
            this.value = this.min ? this.min : 0;
        }
        if (typeof this.value !== 'number') {
            this.value = parseInt(this.value);
        }
        if (!isNaN(this.max) && this.value >= this.max) {
            return;
        }
        this.value = this.value + (this.step || 1);
    }
    /**
     * Substract the actual value if type is `numeric`
     *
     * @returns
     */
    subValue() {
        if (isNaN(parseInt(this.value.toString()))) {
            this.value = this.max ? this.max : 0;
        }
        if (typeof this.value !== 'number') {
            this.value = parseInt(this.value);
        }
        if (!isNaN(this.min) && this.value <= this.min) {
            return;
        }
        this.value = this.value - (this.step || 1);
    }
    /**
     * Validate the initials values of the input by type
     */
    validateInputType() {
        this.inputType = this.type;
        switch (this.type) {
            case 'email':
                this.inputmode = this.inputmode || 'email';
                break;
            case 'tel':
                this.inputmode = this.inputmode || 'tel';
                break;
            case 'url':
                this.inputmode = this.inputmode || 'url';
                break;
            case 'search':
                this.inputmode = this.inputmode || 'search';
                this.enterkeyhint = this.enterkeyhint || 'search';
                break;
            case 'number':
            case 'numeric':
                this.inputmode = this.inputmode || 'numeric';
                break;
            case 'amount':
                this.inputmode = this.inputmode || 'numeric';
                this.mask = {
                    mask: Number,
                    scale: 2,
                    radix: '.',
                    mapToRadix: ['.'],
                    thousandsSeparator: ',',
                    padFractionalZeros: false,
                    normalizeZeros: true,
                };
                break;
            case 'otp':
                this.inputmode = this.inputmode || 'text';
                this.inputType = 'tel';
                this.autocomplete = 'one-time-code';
                this.mask = [...Array(this.maxlength || 0).keys()].map(() => '0').join('');
                break;
            default:
                this.inputmode = this.inputmode || 'text';
                break;
        }
        if (this.mask) {
            this.inputType = 'text';
        }
    }
    /**
     * Clears the input value
     */
    clearInput() {
        this.value = '';
        if (this.typingTimer != null) {
            clearTimeout(this.typingTimer);
        }
        this.onClearInputEvent.emit(this.typingEvent);
    }
    /**
     * Paste the clipboard content to the input
     */
    pasteClipboard() {
        navigator.clipboard.readText().then((text) => {
            if (this.maskInstance) {
                this.maskInstance.unmaskedValue = text;
                this.value = this.maskInstance.value;
                this.internals.setFormValue(this.maskInstance.value);
                this.el.dispatchEvent(new CustomEvent('input'));
            }
            else {
                this.value = text;
                this.internals.setFormValue(this.value);
                this.el.dispatchEvent(new CustomEvent('input'));
            }
        });
    }
    /**
     * Render component
     */
    render() {
        return h(Host, { key: '7a7f276d4a5e38132f62e0c1bc790b67caaa2ee6', "data-for": this.name }, h("div", { key: '26877d9eff1ab0b9e84a895083c20a3b4c5a9563', class: cls({
                "input-container": true,
                "focus": this.isFocused,
                "loading": this.loading || this.isLoading,
                "disabled": this.isDisabled,
                "invalid": !this.isValid,
                "required": this.required,
            }) }, h("div", { key: '387b696d5a84ddc35368ba9772a70a1231f3ca7a', class: "indicator" }, h("slot", { key: '2b8ddba91a2c84bfff399f81115f72d3ef228c47', name: "indicator" })), h("div", { key: '37a07c146bf92fb363791326292b921e22aeda55', class: "separator" }), h("div", { key: '9cd41244272429640c65fde1c904abbdb2434135', class: "buttons" }, this.inputType == 'numeric' && h("x-button", { key: '6d7fa58f2c32486d9acea9df2cdb13fef27b2ae2', icon: "plus", onClick: () => this.sumValue() })), h("div", { key: '5c8908c796018b109435ea550d1b388d26e64574', class: "wrap" }, this.showLabel() && h("label", { key: '0ce35658c93bc776ab14c912e28a6259781e7cdb', htmlFor: this.inputId }, this.label), h("input", { key: '6de49cc3affe134aea2e4a48bd5c7efcdcb3c40a', "data-field": this.type, id: this.inputId, type: this.inputType, required: this.required, disabled: this.isDisabled || this.loading || this.isLoading, pattern: this.pattern, readOnly: this.readonly, autoCorrect: this.autocorrect, autoCapitalize: this.capitalize, autoComplete: this.autocomplete, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholderValue(), value: this.value, onChange: (e) => this.onInput(e), onInput: (e) => this.onInput(e), onBlur: () => this.onBlurInput(), onFocus: () => this.onFocusInput(), onKeyUp: (e) => this.onKeyUpInput(e), onKeyDown: () => this.onKeyDownInput() }), this.inputType == 'color' && h("div", { key: 'ebdad471290ff71d523303b7d7427a18780d5b20', class: "color-indicator" }, h("i", { key: '215ac92c703a18ff4a925990c4695fbd1099f36e', style: { background: this.value.toString() } }), h("span", { key: '7f1daa66d82df48a0877c05adf7c8028ff5b44ae' }, this.value || this.placeholderValue() || Lang.get('fields.input.color')))), this.loading && h("div", { key: 'e7b96b286700466e406b452c104276c989b00765', class: "loading-indicator" }), h("div", { key: '13ecda3ae941e32a7eefd9cde3de51bc14891e62', class: "buttons" }, this.cleanable && (this.value.toString()).length > 0 && h("x-button", { key: '88c5bd38eab20e83817b5d05eb133502e7ab57bb', icon: "backclear", onClick: () => this.clearInput() }), this.type == 'password' && h("x-button", { key: '5ada425baa33c58eeb98e14cb08a882668b7e691', icon: this.inputType == 'password' ? 'visible' : 'invisible', onClick: () => this.togglePasswordVisibility() }), this.type == 'otp' && h("x-button", { key: 'f2cb4dee00ebbaca1d13c3138ecdf2940a8102ed', icon: "clipboard", onClick: () => this.pasteClipboard() }), this.inputType == 'numeric' && h("x-button", { key: 'cc3b5cbd766bbf8b8b984e3b3509afe896f4740d', icon: "minus", onClick: () => this.subValue() }), h("slot", { key: '1798caf50bef2f71930cef84797e99f14eb9bdf6', name: "buttons" })), this.info && h("div", { key: '70b619ec712695907a62f7898d502c5a10bf53bd', class: "info" }, h("x-tooltip", { key: '5831279367a3b0740356fe5bf17270cc50727b2f', content: this.info }, h("x-icon", { key: 'c1edcc4d0a7e74b4a49932cc8b256c43483f5911', name: "info" })))), h("slot", { key: '965cf776f7d7f0e6bc8c44c98c51e9a2092f73cb' }));
    }
    static get is() { return "x-input"; }
    static get formAssociated() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["./style.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["style.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input label text"
                },
                "attribute": "label",
                "reflect": false
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input name for forms keys"
                },
                "attribute": "name",
                "reflect": false
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "InputType",
                    "resolved": "\"amount\" | \"color\" | \"email\" | \"number\" | \"numeric\" | \"otp\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {
                        "InputType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputType"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input type"
                },
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'text'"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input placeholder text"
                },
                "attribute": "placeholder",
                "reflect": false
            },
            "info": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input information block"
                },
                "attribute": "info",
                "reflect": false
            },
            "typingtimeout": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input debounce time"
                },
                "attribute": "typingtimeout",
                "reflect": false,
                "defaultValue": "1200"
            },
            "validate": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element enable internal validation"
                },
                "attribute": "validate",
                "reflect": false
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input required for forms validations"
                },
                "attribute": "required",
                "reflect": false
            },
            "loading": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element show loading and block for edit"
                },
                "attribute": "loading",
                "reflect": false
            },
            "readonly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input block for edit"
                },
                "attribute": "readonly",
                "reflect": false
            },
            "cleanable": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input clear button"
                },
                "attribute": "cleanable",
                "reflect": false
            },
            "autofocus": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element autofocus on render"
                },
                "attribute": "autofocus",
                "reflect": false
            },
            "capitalize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "InputAutocapitalizeTypes",
                    "resolved": "\"characters\" | \"none\" | \"off\" | \"on\" | \"sentences\" | \"words\"",
                    "references": {
                        "InputAutocapitalizeTypes": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputAutocapitalizeTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input autocapitalize options"
                },
                "attribute": "capitalize",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "autocorrect": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'on' | 'off'",
                    "resolved": "\"off\" | \"on\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input auto correction should be enabled"
                },
                "attribute": "autocorrect",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "pattern": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input regular expression that the value is checked against"
                },
                "attribute": "pattern",
                "reflect": false
            },
            "autocomplete": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputAutocompleteTypes",
                    "resolved": "\"name\" | \"url\" | \"on\" | \"off\" | \"email\" | \"tel\" | \"honorific-prefix\" | \"given-name\" | \"additional-name\" | \"family-name\" | \"honorific-suffix\" | \"nickname\" | \"username\" | \"new-password\" | \"current-password\" | \"one-time-code\" | \"organization-title\" | \"organization\" | \"street-address\" | \"address-line1\" | \"address-line2\" | \"address-line3\" | \"address-level4\" | \"address-level3\" | \"address-level2\" | \"address-level1\" | \"country\" | \"country-name\" | \"postal-code\" | \"cc-name\" | \"cc-given-name\" | \"cc-additional-name\" | \"cc-family-name\" | \"cc-number\" | \"cc-exp\" | \"cc-exp-month\" | \"cc-exp-year\" | \"cc-csc\" | \"cc-type\" | \"transaction-currency\" | \"transaction-amount\" | \"language\" | \"bday\" | \"bday-day\" | \"bday-month\" | \"bday-year\" | \"sex\" | \"tel-country-code\" | \"tel-national\" | \"tel-area-code\" | \"tel-local\" | \"tel-extension\" | \"impp\" | \"photo\"",
                    "references": {
                        "InputAutocompleteTypes": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputAutocompleteTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Element input value of the control can be automatically completed by the browser"
                },
                "attribute": "autocomplete",
                "reflect": false,
                "defaultValue": "'off'"
            },
            "enterkeyhint": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputEnterKeyHintType",
                    "resolved": "\"done\" | \"enter\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\"",
                    "references": {
                        "InputEnterKeyHintType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputEnterKeyHintType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input hint to the browser for which enter key to display"
                },
                "attribute": "enterkeyhint",
                "reflect": false
            },
            "inputmode": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "InputModeType",
                    "resolved": "\"decimal\" | \"email\" | \"none\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {
                        "InputModeType": {
                            "location": "local",
                            "path": "/opt/atlassian/pipelines/agent/build/src/components/x-input/component.tsx",
                            "id": "src/components/x-input/component.tsx::InputModeType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input hint to the browser for which keyboard to display"
                },
                "attribute": "inputmode",
                "reflect": false
            },
            "max": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input maximun value"
                },
                "attribute": "max",
                "reflect": false
            },
            "min": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input minimun value"
                },
                "attribute": "min",
                "reflect": false
            },
            "step": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input value in steps only for numeric|number type"
                },
                "attribute": "step",
                "reflect": false
            },
            "maxlength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input maximun count of characters"
                },
                "attribute": "maxlength",
                "reflect": false
            },
            "minlength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input minimun count of characters"
                },
                "attribute": "minlength",
                "reflect": false
            },
            "mask": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string | Object",
                    "resolved": "Object | string",
                    "references": {
                        "Object": {
                            "location": "global",
                            "id": "global::Object"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input imaks pattern/options"
                },
                "attribute": "mask",
                "reflect": false
            },
            "value": {
                "type": "any",
                "mutable": true,
                "complexType": {
                    "original": "string | number | null",
                    "resolved": "number | string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Element input value"
                },
                "attribute": "value",
                "reflect": false,
                "defaultValue": "''"
            }
        };
    }
    static get states() {
        return {
            "inputType": {},
            "isValid": {},
            "isTyping": {},
            "isFocused": {},
            "isLoading": {},
            "isDisabled": {}
        };
    }
    static get events() {
        return [{
                "method": "onDoneTypingEvent",
                "name": "doneTyping",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On done input typing finish event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onClearInputEvent",
                "name": "clearInput",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On clear input event"
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }, {
                "method": "onValidateInputEvent",
                "name": "validated",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "On validate input event"
                },
                "complexType": {
                    "original": "HTMLObjectElement",
                    "resolved": "HTMLObjectElement",
                    "references": {
                        "HTMLObjectElement": {
                            "location": "global",
                            "id": "global::HTMLObjectElement"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "setValue": {
                "complexType": {
                    "signature": "(value: string) => Promise<void>",
                    "parameters": [{
                            "name": "value",
                            "type": "string",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Set the value of the input",
                    "tags": []
                }
            },
            "checkValidity": {
                "complexType": {
                    "signature": "() => Promise<boolean>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<boolean>"
                },
                "docs": {
                    "text": "Validate the input and get the validation result",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "mask",
                "methodName": "maskChanged"
            }, {
                "propName": "type",
                "methodName": "typeChanged"
            }];
    }
    static get attachInternalsMemberName() { return "internals"; }
}
