var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { Host, h, forceUpdate, } from "@stencil/core";
import { addFormResetListener, checkSlotInChildMutations, getInputDescribedByText, isMobileOrTablet, isSlotUsed, removeDisabledFalse, removeFormResetListener, renderHiddenInput, } from "../../utils/helpers";
import { IC_INHERITED_ARIA } from "../../utils/constants";
import { IcInformationStatus, } from "../../utils/types";
import Expand from "./assets/Expand.svg";
import Clear from "./assets/Clear.svg";
let inputIds = 0;
const MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, "tabindex", "title"];
/**
 * @slot helper-text - Content is set as the helper text for the select.
 * @slot icon - Content will be placed to the left of the select text input.
 */
export class Select {
    constructor() {
        this.inputId = `ic-select-input-${inputIds++}`;
        this.menuId = `${this.inputId}-menu`;
        this.inheritedAttributes = {};
        this.hostMutationObserver = null;
        this.timeoutTimer = null;
        this.hasTimedOut = false;
        this.initialRender = true;
        this.pressedCharacters = "";
        this.hasError = false;
        this.searchableSelectInputValue = "";
        this.selectButtonAriaLiveText = "";
        this.selectInputAriaLiveText = "";
        /**
         * If `true`, the disabled state will be set.
         */
        this.disabled = false;
        /**
         * If `true`, the built in filtering will be disabled for a searchable variant. For example, if options will already be filtered from external source.
         */
        this.disableAutoFiltering = false;
        /**
         * The text displayed when there are no options in the option list.
         */
        this.emptyOptionListText = "No results found";
        /**
         * If `true`, the select will fill the width of the container.
         */
        this.fullWidth = false;
        /**
         * The helper text that will be displayed for additional field guidance.
         */
        this.helperText = "";
        /**
         * If `true`, the label will be hidden and the required label value will be applied as an aria-label.
         */
        this.hideLabel = false;
        /**
         * If `true`, descriptions of options will be included when filtering options in a searchable select. Only applies to built in filtering.
         */
        this.includeDescriptionsInSearch = false;
        /**
         * If `true`, group titles of grouped options will be included when filtering options in a searchable select. Only applies to built in filtering.
         */
        this.includeGroupTitlesInSearch = false;
        /**
         * The message displayed when external loading times out.
         */
        this.loadingErrorLabel = "Loading Error";
        /**
         * The message displayed whilst the options are being loaded externally.
         */
        this.loadingLabel = "Loading...";
        /**
         * If `true`, multiple options can be selected.
         */
        this.multiple = false;
        /**
         * The name of the control, which is submitted with the form data.
         */
        this.name = this.inputId;
        /**
         * The placeholder value to be displayed.
         */
        this.placeholder = "Select an option";
        /**
         * If `true`, the readonly state will be set.
         */
        this.readonly = false;
        /**
         * If `true`, the select will require a value.
         */
        this.required = false;
        /**
         * If `true`, a searchable variant of the select will be displayed which can be typed in to filter options. This functionality is only available on the single-select variant of the select component.
         */
        this.searchable = false;
        /**
         * Whether the search string of the searchable select should match the start of or anywhere in the options. Only applies to built in filtering.
         */
        this.searchMatchPosition = "anywhere";
        /**
         * If `true`, the icOptionSelect event will be fired on enter instead of ArrowUp and ArrowDown on the single select.
         */
        this.selectOnEnter = false;
        /**
         * If `true`, a button which clears the select input when clicked will be displayed. The button will always appear on the searchable select.
         */
        this.showClearButton = false;
        /**
         * The size of the select.
         */
        this.size = "medium";
        /**
         * Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
         */
        this.theme = "inherit";
        /**
         * The value of the `aria-live` attribute on the validation message.
         */
        this.validationAriaLive = "polite";
        /**
         * The validation status - e.g. 'error' | 'warning' | 'success'.
         */
        this.validationStatus = "";
        /**
         * The text to display as the validation message.
         */
        this.validationText = "";
        /**
         * If `true` and on a mobile or tablet device, the native select element will be used instead of the custom select component for better usability.
         */
        this.useNativeSelectOnMobile = true;
        /**
         * If `true`, the loading state will be triggered when fetching options asynchronously.
         */
        this.loading = false;
        /**
         * The possible selection options.
         */
        this.options = [];
        this.flatOptions = [];
        /**
         * The amount of time, in milliseconds, to wait to trigger the `icInput` event after each keystroke.
         */
        this.debounce = 0;
        this.currDebounce = this.debounce;
        /**
         * The value of the select, reflected by the value of the currently selected option.
         * For the searchable variant, the value is also reflected by the user input.
         * For the multi-select variant, the value must be an array of option values.
         */
        this.value = null;
        this.initialValue = this.value;
        this.open = false;
        this.getValidatedValue = (value) => {
            const validValues = this.flatOptions.map((opt) => opt.value);
            if (validValues.length === 0)
                return value;
            if (this.multiple) {
                if (!value)
                    return null;
                const arr = Array.isArray(value) ? value : [value]; // Ensure value is an array
                const filtered = validValues.filter((v) => arr.includes(v)); // Keep only valid values
                return filtered.length > 0 ? filtered : null;
            }
            else {
                return validValues.includes(value) ? value : null;
            }
        };
        this.getFilteredOptions = (searchString, searchMatchPosition, includeDescriptionsInSearch, includeGroupTitlesInSearch) => {
            const search = searchString.toLowerCase();
            const match = (text, method) => method === "anywhere" ? text.includes(search) : text.startsWith(search);
            return this.unflattenOptions(this.flatOptions.filter((option) => {
                var _a, _b, _c, _d;
                const label = option.label.toLowerCase();
                const group = (_b = (_a = option.group) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : "";
                const description = (_d = (_c = option.description) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : "";
                return (match(label, searchMatchPosition) ||
                    (includeDescriptionsInSearch &&
                        match(description, searchMatchPosition)) ||
                    (includeGroupTitlesInSearch && match(group, searchMatchPosition)));
            }));
        };
        this.getOptions = () => {
            const options = this.searchable &&
                !this.disableAutoFiltering &&
                this.searchableSelectInputValue
                ? this.getFilteredOptions(this.searchableSelectInputValue, this.searchMatchPosition, this.includeDescriptionsInSearch, this.includeGroupTitlesInSearch)
                : this.unflattenOptions(this.flatOptions);
            if (this.hasTimedOut)
                return [{ label: this.loadingErrorLabel, value: "", timedOut: true }];
            if (this.loading)
                return [{ label: this.loadingLabel, value: "", loading: true }];
            if (options.length > 0)
                return options;
            return [{ label: this.emptyOptionListText, value: "" }];
        };
        this.getFlatOptions = (options) => options.flatMap((item) => ("children" in item && item.children
            ? [...item.children.map((child) => (Object.assign({ group: item.label }, child)))]
            : [item]));
        this.unflattenOptions = (flatOptions) => {
            const groupMap = new Map();
            const result = [];
            for (const option of flatOptions) {
                if (option.group) {
                    let group = groupMap.get(option.group);
                    if (!group) {
                        group = { label: option.group, children: [] };
                        groupMap.set(option.group, group);
                        result.push(group);
                    }
                    const { group: _ } = option, rest = __rest(option, ["group"]);
                    group.children.push(rest);
                }
                else {
                    result.push(option);
                }
            }
            return result;
        };
        this.getLabelFromValue = (value) => { var _a, _b; return (_b = (_a = this.flatOptions.find((option) => option.value === value)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : ""; };
        // Construct the string that will be shown in the select input or button
        this.getLabelString = () => {
            if (Array.isArray(this.value)) {
                return this.value.map(this.getLabelFromValue).filter(Boolean).join(", ");
            }
            return (this.getLabelFromValue(this.value) ||
                (this.searchable ? "" : this.placeholder));
        };
        this.handleClick = (event) => {
            var _a;
            if (event.detail !== 0) {
                (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleClickOpen();
            }
        };
        this.handleExpandIconMouseDown = (event) => {
            var _a;
            if (!this.disabled) {
                event.preventDefault();
                (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
                this.handleClick(event);
            }
        };
        this.handleBlur = ({ relatedTarget }) => {
            var _a, _b;
            const target = relatedTarget;
            if (this.el.contains(target) ||
                ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(target)) ||
                ((_b = this.menu) === null || _b === void 0 ? void 0 : _b.contains(target)) ||
                target === this.clearButton) {
                return;
            }
            this.open = false;
            this.handleFocusIndicatorDisplay();
            if (this.searchable) {
                this.searchableSelectInputValue = "";
            }
            this.icBlur.emit();
        };
        this.handleTimeoutBlur = (event) => {
            this.handleBlur(event.detail.ev);
        };
        this.handleFocus = () => {
            this.icFocus.emit();
        };
        this.handleClear = () => {
            this.clearTimer();
            this.loading = false;
            this.value = null;
            this.searchableSelectInputValue = "";
            this.icClear.emit();
            this.setFocus();
        };
        this.setTextColor = () => {
            if (this.nativeSelectElement) {
                this.nativeSelectElement.className =
                    this.nativeSelectElement.selectedIndex === 0
                        ? "placeholder"
                        : "select-option-selected";
            }
        };
        this.handleNativeSelectChange = () => {
            if (this.nativeSelectElement) {
                this.icOptionSelect.emit({ value: this.nativeSelectElement.value });
                this.icChange.emit({ value: this.nativeSelectElement.value });
            }
            this.setTextColor();
        };
        this.handleFocusIndicatorDisplay = () => {
            var _a;
            const focusIndicator = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".focus-indicator");
            if (focusIndicator) {
                if (this.open) {
                    focusIndicator.classList.add("focus-indicator-enabled");
                }
                else {
                    focusIndicator.classList.remove("focus-indicator-enabled");
                }
            }
        };
        this.handleKeyDown = (event) => {
            var _a, _b;
            if (!(event.key === " " && this.pressedCharacters.length > 0)) {
                if (this.open) {
                    (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleMenuKeyDown(event);
                }
                else {
                    (_b = this.menu) === null || _b === void 0 ? void 0 : _b.handleKeyboardOpen(event);
                }
            }
            if (!this.multiple &&
                !this.searchable &&
                !this.selectOnEnter &&
                /^[a-zA-Z0-9 ]$/.test(event.key)) {
                this.handleCharacterKeyDown(event.key);
            }
        };
        this.handleCharacterKeyDown = (key) => {
            // Only close menu when space is pressed if not being used alongside character keys to quickly select options
            if (this.open && key === " " && this.pressedCharacters.length === 0) {
                this.open = false;
            }
            if (key.length !== 1 || this.searchable) {
                this.pressedCharacters = "";
                return;
            }
            window.clearTimeout(this.characterKeyPressTimer);
            this.characterKeyPressTimer = window.setTimeout(() => (this.pressedCharacters = ""), 1000);
            if (key !== " " || !!this.pressedCharacters) {
                this.pressedCharacters += key;
                const filteredOptions = this.getFilteredOptions(this.pressedCharacters, "start", false, false);
                if (filteredOptions.length > 0) {
                    const firstOption = filteredOptions[0];
                    if ("children" in firstOption) {
                        this.value = firstOption.children[0].value;
                    }
                    else {
                        this.value = firstOption.value;
                    }
                }
            }
        };
        this.handleNativeSelectKeyDown = (event) => {
            this.handleKeyDown(event);
        };
        this.handleSelectChange = (event) => {
            const { value } = event.detail;
            if (!value || this.getLabelFromValue(value) === this.emptyOptionListText) {
                this.value = null;
                return;
            }
            if (this.multiple) {
                let valueArray = Array.isArray(this.value) ? [...this.value] : [];
                const index = valueArray.indexOf(value);
                if (index > -1) {
                    valueArray.splice(index, 1);
                    this.icOptionDeselect.emit({ value });
                }
                else {
                    this.icOptionSelect.emit({ value });
                    valueArray.push(value);
                    valueArray = this.getValidatedValue(valueArray);
                }
                this.value = valueArray.length ? valueArray : null;
            }
            else {
                this.icOptionSelect.emit({ value });
                this.value = value;
                if (this.searchable)
                    this.searchableSelectInputValue = "";
            }
        };
        this.handleSelectAllChange = ({ detail, }) => {
            const allSelectableValues = this.flatOptions
                .filter((option) => !option.disabled)
                .map((option) => option.value);
            if (detail.select) {
                allSelectableValues
                    .filter((value) => { var _a; return !((_a = this.value) !== null && _a !== void 0 ? _a : []).includes(value); })
                    .forEach((value) => {
                    this.icOptionSelect.emit({ value });
                });
                this.value = allSelectableValues;
            }
            else {
                this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
                this.value = null;
            }
        };
        this.handleFormReset = () => {
            this.value = this.initialValue;
            this.searchableSelectInputValue = "";
            if (this.searchable) {
                this.hiddenInputValue = this.initialValue;
            }
        };
        this.handleRetry = () => {
            this.clearTimer();
            this.hasTimedOut = false;
            this.hasError = false;
            this.loading = true;
            this.icRetryLoad.emit({
                value: this.searchable
                    ? this.searchableSelectInputValue
                    : this.hiddenInputValue,
            });
            this.setFocus();
        };
        this.handleSearchableSelectInput = (event) => {
            var _a;
            this.updateSearchableSelectResultAriaLive();
            if (!this.multiple) {
                this.value = null;
            }
            this.searchableSelectInputValue =
                (_a = event.target.value) !== null && _a !== void 0 ? _a : "";
            this.open = true;
            clearTimeout(this.debounceIcInput);
            this.debounceIcInput = window.setTimeout(() => this.icInput.emit({ value: this.searchableSelectInputValue }), this.currDebounce);
        };
        this.hostMutationCallback = (mutationList) => {
            let forceComponentUpdate = false;
            mutationList.forEach(({ attributeName, type, addedNodes, removedNodes }) => {
                if (attributeName) {
                    const attribute = this.el.getAttribute(attributeName);
                    if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {
                        this.inheritedAttributes[attributeName] = attribute;
                        forceComponentUpdate = true;
                    }
                }
                else if (type === "childList") {
                    forceComponentUpdate = checkSlotInChildMutations(addedNodes, removedNodes, "icon");
                }
            });
            if (forceComponentUpdate) {
                forceUpdate(this);
            }
        };
        this.updateSelectButtonAriaLive = () => {
            const value_label = this.getLabelFromValue(this.value);
            this.selectButtonAriaLiveText = this.multiple
                ? `${this.value ? this.value.length : 0} of ${this.flatOptions.length} selected`
                : this.value
                    ? value_label !== null && value_label !== void 0 ? value_label : `${value_label} selected`
                    : "";
        };
        this.updateSearchableSelectResultAriaLive = () => {
            var _a, _b;
            this.selectInputAriaLiveText =
                ((_b = (_a = this.getOptions()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.label) == this.emptyOptionListText
                    ? this.emptyOptionListText
                    : "";
        };
        this.updateAriaActiveDescendant = (event) => {
            this.ariaActiveDescendant = event.detail.optionId;
        };
        this.handleMenuChange = (event) => {
            this.open = event.detail.open;
            this.pressedCharacters = "";
        };
        this.getDeduplicatedOptions = (flatOptions) => {
            const seen = new Set();
            return flatOptions.filter((option) => {
                if (option.value && seen.has(option.value)) {
                    console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
                    return false;
                }
                if (option.value)
                    seen.add(option.value);
                return true;
            });
        };
        this.renderNativeOption = (option) => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label));
    }
    watchDisabledHandler() {
        removeDisabledFalse(this.disabled, this.el);
    }
    loadingHandler(newValue) {
        this.hasTimedOut = false;
        if (newValue) {
            this.hasError = false;
            if (this.timeout) {
                if (this.timeoutTimer) {
                    this.clearTimer();
                }
                this.timeoutTimer = window.setTimeout(() => {
                    this.loading = false;
                    this.hasTimedOut = true;
                    forceUpdate(this);
                }, this.timeout);
            }
        }
        else {
            if (this.timeoutTimer) {
                this.clearTimer();
            }
        }
    }
    clearTimer() {
        if (this.timeoutTimer) {
            clearTimeout(this.timeoutTimer);
            this.timeoutTimer = null;
        }
    }
    optionsChangedHandler() {
        const flat = this.getFlatOptions(this.options)
            .filter((option) => option.value != null || option.label != null) // filter out options missing both value and label
            .map((option) => {
            var _a, _b;
            return (Object.assign(Object.assign({}, option), { value: (_a = option.value) !== null && _a !== void 0 ? _a : option.label, label: (_b = option.label) !== null && _b !== void 0 ? _b : option.value }));
        });
        this.flatOptions = this.getDeduplicatedOptions(flat);
        if (!this.initialRender)
            this.loading = false;
        this.clearTimer();
        this.updateSelectButtonAriaLive();
    }
    debounceChangedHandler(newValue) {
        if (this.currDebounce !== newValue) {
            this.currDebounce = newValue;
        }
    }
    valueChangedHandler(newValue) {
        const validated = this.getValidatedValue(newValue);
        const isEqual = Array.isArray(validated) && Array.isArray(this.value)
            ? validated.length === this.value.length &&
                validated.every((v, i) => v === this.value[i])
            : validated === this.value;
        if (!isEqual) {
            this.value = validated;
            return;
        }
        this.updateSelectButtonAriaLive();
        this.icChange.emit({ value: this.value });
    }
    openChangedHandler() {
        this.open ? this.icOpen.emit() : this.icClose.emit();
        if (!this.open) {
            this.ariaActiveDescendant = undefined;
        }
        this.handleFocusIndicatorDisplay();
    }
    /**
     * Sets focus on the select component.
     */
    async setFocus() {
        if (this.nativeSelectElement) {
            this.nativeSelectElement.focus();
        }
        else if (this.selectElement) {
            this.selectElement.focus();
        }
        else if (this.searchableSelectElement) {
            this.searchableSelectElement.focus();
        }
    }
    componentDidRender() {
        if (this.nativeSelectElement && !this.disabled) {
            this.setTextColor();
        }
        this.initialRender = false;
    }
    disconnectedCallback() {
        var _a;
        removeFormResetListener(this.el, this.handleFormReset);
        (_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
        this.clearTimer();
    }
    componentDidLoad() {
        forceUpdate(this);
        this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
        this.hostMutationObserver.observe(this.el, {
            attributes: true,
            childList: true,
        });
    }
    componentWillLoad() {
        this.optionsChangedHandler();
        this.value = this.getValidatedValue(this.value);
        this.initialValue = this.value;
        if (this.loading)
            this.loadingHandler(true);
        addFormResetListener(this.el, this.handleFormReset);
    }
    render() {
        const { disabled, searchable, size, fullWidth, theme, readonly, hideLabel, inputId, label, helperText, required, value, options, menuId, multiple, validationStatus, open, showClearButton, selectOnEnter, loading, searchableSelectInputValue, validationText, validationAriaLive, form, ariaActiveDescendant, placeholder, name, inheritedAttributes, selectInputAriaLiveText, selectButtonAriaLiveText, } = this;
        const hasValue = !!value;
        const hasInput = !!searchableSelectInputValue;
        const isClearable = !disabled &&
            ((searchable && (hasInput || hasValue)) ||
                (!searchable && hasValue && !loading && showClearButton));
        const showValidation = !!validationStatus && !disabled;
        const invalid = validationStatus === IcInformationStatus.Error;
        const describedBy = getInputDescribedByText(this.el, inputId, helperText !== "", showValidation).trim();
        const menuOptions = this.getOptions();
        const noOptions = disabled ||
            (menuOptions.length === 1 &&
                (menuOptions[0].label === this.emptyOptionListText ||
                    "loading" in menuOptions[0] ||
                    "timedOut" in menuOptions[0]));
        renderHiddenInput(this.el, value, name || inputId, disabled);
        const ClearButton = () => (h("ic-button", { key: '983b6bfae4f3a9d439f23fe022652605d91f0a1e', ref: (el) => (this.clearButton = el), id: "clear-button", "aria-label": this.searchable ? "Clear input" : "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onBlur: this.handleBlur, size: size, variant: "icon-tertiary" }));
        const NativeSelect = () => (h("select", Object.assign({ key: '2fb628398e722cff8c3759229af969600e553485', ref: (el) => (this.nativeSelectElement = el), disabled: disabled, onChange: this.handleNativeSelectChange, required: required, id: inputId, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid ? "true" : "false", onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyDown: this.handleNativeSelectKeyDown, form: form }, inheritedAttributes), h("option", { key: '5fb827fef7ab7c597a2361ac4d019f9e07adb55f', value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => "children" in option ? (h("optgroup", { label: option.label }, option.children.map((child) => this.renderNativeOption(child)))) : (this.renderNativeOption(option)))));
        const SelectButton = () => (h("div", { key: '47ad04d6da391fcb88a8b6a6a841dec93f53cd74', class: "select-container" }, h("button", { key: '7ee23a4f16c4aca4b287391ac5bf5f6ee4441b07', class: "select-input", role: "combobox", ref: (el) => (this.selectElement = el), id: inputId, "aria-label": `${label}, ${(multiple && value
                ? `${value.length} of ${this.flatOptions.length} selected, ${this.getLabelString()}`
                : this.getLabelString()) || placeholder}`, onClick: this.handleClick, "aria-describedby": describedBy, "aria-invalid": invalid ? "true" : "false", "aria-haspopup": "listbox", "aria-expanded": `${open}`, "aria-controls": menuId, "aria-required": `${required}`, disabled: disabled, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, "aria-activedescendant": ariaActiveDescendant }, h("ic-typography", { key: '438cce7c257e37d0a0aef5247d28d31586725a1e', variant: "body", class: {
                "value-text": true,
                "with-clear-button": !!isClearable,
                placeholder: !value,
            } }, this.getLabelString()), h("div", { key: '8926d05851401339717c159651b802fb41e53096', class: "select-input-end" }, isClearable && h("div", { key: '5c94e4ba98ad972001890d639b00c82887e0fb5d', class: "divider" }), h("span", { key: '23569f5196d66f2b4a834d44006f6a05446598cd', class: {
                "expand-icon": true,
                "expand-icon-open": open,
            }, innerHTML: Expand, "aria-hidden": "true" }))), isClearable && h(ClearButton, { key: 'e4165cb01b0bdc1681e3d9490007182b934f40ea' }), h("div", { key: '6208229358ee8ba7a007a08f5e551d494015a347', "aria-live": "polite", "aria-atomic": "true", class: "aria-live-hidden-text" }, selectButtonAriaLiveText)));
        const SelectInput = () => (h("div", { key: 'af39791c29e8d792c16fed1fffe08db8f621fcac', class: "searchable-select-container" }, h("input", { key: '366bd3c57ad76f130d73ab2390c557b9e8fe98c8', class: {
                "value-text": true,
                "select-input": true,
                "with-clear-button": !!searchableSelectInputValue,
            }, role: "combobox", autocomplete: "off", "aria-label": label, "aria-describedby": describedBy, "aria-activedescendant": ariaActiveDescendant, "aria-autocomplete": "list", "aria-expanded": `${open}`, "aria-invalid": invalid ? "true" : "false", "aria-required": `${required}`, "aria-controls": menuId, ref: (el) => (this.searchableSelectElement = el), id: inputId, value: multiple
                ? ""
                : value
                    ? this.getLabelString()
                    : searchableSelectInputValue || undefined, disabled: disabled, placeholder: placeholder, onInput: this.handleSearchableSelectInput, onClick: this.handleClick, onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyDown: this.handleKeyDown, form: form }), isClearable && (h("div", { key: 'e9260358a6c8ac3683d1de3015064665d32d907f', class: "clear-button-container" }, h(ClearButton, { key: '0c05ed1cf92ac8fde61ba55192a8a1511338239e' }), h("div", { key: 'e44933edcc7c79459f1ecd551eec43a86fd53b11', class: "divider" }))), h("span", { key: '36e7fe34e7d438caab2967fae27bfe4fb2e49041', onMouseDown: this.handleExpandIconMouseDown, class: {
                "expand-icon": true,
                "expand-icon-open": open,
            }, innerHTML: Expand, "aria-hidden": "true" }), h("div", { key: 'c3e06f04e62b273b8a7a6f9df0aa27bf71060ed4', "aria-live": "polite", role: "status", class: "aria-live-hidden-text" }, selectInputAriaLiveText)));
        const ReadOnly = () => (h("ic-typography", { key: '979d342f453fdb2ed79a6cf231d9a40275662a44' }, h("p", { key: '221530958da8731657b5ad4d455041dc3934718f' }, this.getLabelString() === placeholder ? "" : this.getLabelString())));
        return (h(Host, { key: 'efbdccb0f0b7e86142cd530d52a86f7ce95d6c1c', class: {
                "ic-select-disabled": disabled,
                "ic-select-searchable": searchable,
                [`ic-select-${size}`]: size !== "medium",
                "ic-select-full-width": fullWidth,
                [`ic-theme-${theme}`]: theme !== "inherit",
            } }, h("ic-input-container", { key: '48fe83c1c79ec578f94a2d8af4b8b452570a421f', readonly: readonly }, !hideLabel && (h("ic-input-label", { key: '8410dabe6d0d62c7c1459991631807cfa6546735', for: inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly }, h("slot", { key: '77ce0ab9ca879ecf515de633ff27ba8e2320cf2c', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: '699375a82eb49f5eb351cf95b4822b4cad7bcc1a', ref: (el) => (this.anchorEl = el), class: { "menu-open": open }, size: size, fullWidth: fullWidth, disabled: disabled, readonly: readonly, validationStatus: validationStatus }, isSlotUsed(this.el, "icon") &&
            !disabled &&
            (!readonly || !!value) && (h("span", { key: 'fcfec6b75fdb0eb41950460af3c6d7dc5ad43657', slot: "left-icon", class: {
                readonly,
                "has-value": !!value,
            } }, h("slot", { key: '08d321011ba86b6d50bf3c8c85bf16595c8df657', name: "icon" }))), isMobileOrTablet() && this.useNativeSelectOnMobile && !multiple ? (h(NativeSelect, null)) : readonly ? (h(ReadOnly, null)) : !searchable ? (h(SelectButton, null)) : (h(SelectInput, null))), !(isMobileOrTablet() &&
            this.useNativeSelectOnMobile &&
            !multiple) && (h("ic-menu", { key: '3fc0ee9172a93e744174e2f2b7a16c4f327a82c9', ref: (el) => (this.menu = el), class: { "no-results": noOptions }, inputEl: searchable ? this.searchableSelectElement : this.selectElement, allowMenuFocus: false, inputLabel: label, anchorEl: this.anchorEl, size: size, menuId: menuId, open: open, options: this.getOptions(), value: multiple ? value : value, fullWidth: fullWidth, selectOnEnter: selectOnEnter, onMenuStateChange: this.handleMenuChange, onMenuOptionSelect: this.handleSelectChange, onMenuOptionSelectAll: this.handleSelectAllChange, onTimeoutBlur: this.handleTimeoutBlur, onMenuOptionId: this.updateAriaActiveDescendant, onClick: this.setFocus, parentEl: this.el, activationType: searchable || multiple || selectOnEnter ? "manual" : "automatic", onRetryButtonClicked: this.handleRetry, closeOnSelect: !multiple, multiSelect: multiple, searchableSelect: searchable })), h("ic-input-validation", { key: '6b8bd66f22d67776d418e0aac1b41d2f03f3c9cd', class: {
                "menu-open": open,
            }, ariaLiveMode: validationAriaLive, status: showValidation ? validationStatus : "", message: showValidation ? validationText : "", for: inputId }))));
    }
    static get is() { return "ic-select"; }
    static get encapsulation() { return "shadow"; }
    static get delegatesFocus() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["ic-select.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["ic-select.css"]
        };
    }
    static get properties() {
        return {
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the disabled state will be set."
                },
                "getter": false,
                "setter": false,
                "attribute": "disabled",
                "reflect": true,
                "defaultValue": "false"
            },
            "disableAutoFiltering": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the built in filtering will be disabled for a searchable variant. For example, if options will already be filtered from external source."
                },
                "getter": false,
                "setter": false,
                "attribute": "disable-auto-filtering",
                "reflect": false,
                "defaultValue": "false"
            },
            "emptyOptionListText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The text displayed when there are no options in the option list."
                },
                "getter": false,
                "setter": false,
                "attribute": "empty-option-list-text",
                "reflect": false,
                "defaultValue": "\"No results found\""
            },
            "form": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The <form> element to associate the select with."
                },
                "getter": false,
                "setter": false,
                "attribute": "form",
                "reflect": false
            },
            "fullWidth": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the select will fill the width of the container."
                },
                "getter": false,
                "setter": false,
                "attribute": "full-width",
                "reflect": false,
                "defaultValue": "false"
            },
            "helperText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The helper text that will be displayed for additional field guidance."
                },
                "getter": false,
                "setter": false,
                "attribute": "helper-text",
                "reflect": false,
                "defaultValue": "\"\""
            },
            "hideLabel": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the label will be hidden and the required label value will be applied as an aria-label."
                },
                "getter": false,
                "setter": false,
                "attribute": "hide-label",
                "reflect": false,
                "defaultValue": "false"
            },
            "includeDescriptionsInSearch": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, descriptions of options will be included when filtering options in a searchable select. Only applies to built in filtering."
                },
                "getter": false,
                "setter": false,
                "attribute": "include-descriptions-in-search",
                "reflect": false,
                "defaultValue": "false"
            },
            "includeGroupTitlesInSearch": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, group titles of grouped options will be included when filtering options in a searchable select. Only applies to built in filtering."
                },
                "getter": false,
                "setter": false,
                "attribute": "include-group-titles-in-search",
                "reflect": false,
                "defaultValue": "false"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The label for the select."
                },
                "getter": false,
                "setter": false,
                "attribute": "label",
                "reflect": false
            },
            "loadingErrorLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The message displayed when external loading times out."
                },
                "getter": false,
                "setter": false,
                "attribute": "loading-error-label",
                "reflect": false,
                "defaultValue": "\"Loading Error\""
            },
            "loadingLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The message displayed whilst the options are being loaded externally."
                },
                "getter": false,
                "setter": false,
                "attribute": "loading-label",
                "reflect": false,
                "defaultValue": "\"Loading...\""
            },
            "multiple": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, multiple options can be selected."
                },
                "getter": false,
                "setter": false,
                "attribute": "multiple",
                "reflect": false,
                "defaultValue": "false"
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The name of the control, which is submitted with the form data."
                },
                "getter": false,
                "setter": false,
                "attribute": "name",
                "reflect": false,
                "defaultValue": "this.inputId"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The placeholder value to be displayed."
                },
                "getter": false,
                "setter": false,
                "attribute": "placeholder",
                "reflect": false,
                "defaultValue": "\"Select an option\""
            },
            "readonly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the readonly state will be set."
                },
                "getter": false,
                "setter": false,
                "attribute": "readonly",
                "reflect": false,
                "defaultValue": "false"
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the select will require a value."
                },
                "getter": false,
                "setter": false,
                "attribute": "required",
                "reflect": false,
                "defaultValue": "false"
            },
            "searchable": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, a searchable variant of the select will be displayed which can be typed in to filter options. This functionality is only available on the single-select variant of the select component."
                },
                "getter": false,
                "setter": false,
                "attribute": "searchable",
                "reflect": false,
                "defaultValue": "false"
            },
            "searchMatchPosition": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcSearchMatchPositions",
                    "resolved": "\"anywhere\" | \"start\"",
                    "references": {
                        "IcSearchMatchPositions": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcSearchMatchPositions"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether the search string of the searchable select should match the start of or anywhere in the options. Only applies to built in filtering."
                },
                "getter": false,
                "setter": false,
                "attribute": "search-match-position",
                "reflect": false,
                "defaultValue": "\"anywhere\""
            },
            "selectOnEnter": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the icOptionSelect event will be fired on enter instead of ArrowUp and ArrowDown on the single select."
                },
                "getter": false,
                "setter": false,
                "attribute": "select-on-enter",
                "reflect": false,
                "defaultValue": "false"
            },
            "showClearButton": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, a button which clears the select input when clicked will be displayed. The button will always appear on the searchable select."
                },
                "getter": false,
                "setter": false,
                "attribute": "show-clear-button",
                "reflect": false,
                "defaultValue": "false"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcSizes",
                    "resolved": "\"large\" | \"medium\" | \"small\"",
                    "references": {
                        "IcSizes": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcSizes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The size of the select."
                },
                "getter": false,
                "setter": false,
                "attribute": "size",
                "reflect": false,
                "defaultValue": "\"medium\""
            },
            "timeout": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If using external filtering, set a timeout for when loading takes too long."
                },
                "getter": false,
                "setter": false,
                "attribute": "timeout",
                "reflect": false
            },
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcThemeMode",
                    "resolved": "\"dark\" | \"inherit\" | \"light\"",
                    "references": {
                        "IcThemeMode": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcThemeMode"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component."
                },
                "getter": false,
                "setter": false,
                "attribute": "theme",
                "reflect": false,
                "defaultValue": "\"inherit\""
            },
            "validationAriaLive": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcAriaLive",
                    "resolved": "\"assertive\" | \"off\" | \"polite\"",
                    "references": {
                        "IcAriaLive": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcAriaLive"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The value of the `aria-live` attribute on the validation message."
                },
                "getter": false,
                "setter": false,
                "attribute": "validation-aria-live",
                "reflect": false,
                "defaultValue": "\"polite\""
            },
            "validationStatus": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IcInformationStatusOrEmpty",
                    "resolved": "\"\" | \"error\" | \"success\" | \"warning\"",
                    "references": {
                        "IcInformationStatusOrEmpty": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcInformationStatusOrEmpty"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The validation status - e.g. 'error' | 'warning' | 'success'."
                },
                "getter": false,
                "setter": false,
                "attribute": "validation-status",
                "reflect": false,
                "defaultValue": "\"\""
            },
            "validationText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The text to display as the validation message."
                },
                "getter": false,
                "setter": false,
                "attribute": "validation-text",
                "reflect": false,
                "defaultValue": "\"\""
            },
            "useNativeSelectOnMobile": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true` and on a mobile or tablet device, the native select element will be used instead of the custom select component for better usability."
                },
                "getter": false,
                "setter": false,
                "attribute": "use-native-select-on-mobile",
                "reflect": false,
                "defaultValue": "true"
            },
            "loading": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the loading state will be triggered when fetching options asynchronously."
                },
                "getter": false,
                "setter": false,
                "attribute": "loading",
                "reflect": false,
                "defaultValue": "false"
            },
            "options": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IcSelectOption[]",
                    "resolved": "IcSelectOption[]",
                    "references": {
                        "IcSelectOption": {
                            "location": "import",
                            "path": "./ic-select.types",
                            "id": "src/components/ic-select/ic-select.types.ts::IcSelectOption"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The possible selection options."
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            },
            "debounce": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The amount of time, in milliseconds, to wait to trigger the `icInput` event after each keystroke."
                },
                "getter": false,
                "setter": false,
                "attribute": "debounce",
                "reflect": false,
                "defaultValue": "0"
            },
            "value": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string | string[] | null",
                    "resolved": "null | string | string[]",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The value of the select, reflected by the value of the currently selected option.\nFor the searchable variant, the value is also reflected by the user input.\nFor the multi-select variant, the value must be an array of option values."
                },
                "getter": false,
                "setter": false,
                "attribute": "value",
                "reflect": false,
                "defaultValue": "null"
            }
        };
    }
    static get states() {
        return {
            "ariaActiveDescendant": {},
            "debounceIcInput": {},
            "hiddenInputValue": {},
            "hasError": {},
            "searchableSelectInputValue": {},
            "selectButtonAriaLiveText": {},
            "selectInputAriaLiveText": {},
            "flatOptions": {},
            "currDebounce": {},
            "initialValue": {},
            "open": {}
        };
    }
    static get events() {
        return [{
                "method": "icBlur",
                "name": "icBlur",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the select loses focus."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "icChange",
                "name": "icChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the value changes."
                },
                "complexType": {
                    "original": "IcMultiValueEventDetail",
                    "resolved": "IcMultiValueEventDetail",
                    "references": {
                        "IcMultiValueEventDetail": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcMultiValueEventDetail"
                        }
                    }
                }
            }, {
                "method": "icClear",
                "name": "icClear",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the clear or clear all button is clicked."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "icClose",
                "name": "icClose",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the select options menu is closed."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "icFocus",
                "name": "icFocus",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the select gains focus."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "icInput",
                "name": "icInput",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when a keyboard input occurred."
                },
                "complexType": {
                    "original": "IcMultiValueEventDetail",
                    "resolved": "IcMultiValueEventDetail",
                    "references": {
                        "IcMultiValueEventDetail": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcMultiValueEventDetail"
                        }
                    }
                }
            }, {
                "method": "icOpen",
                "name": "icOpen",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the select options menu is opened."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "icOptionSelect",
                "name": "icOptionSelect",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when an option is selected.\nSelecting an option will also trigger an `icChange/onIcChange` due to the value being updated."
                },
                "complexType": {
                    "original": "IcOptionSelectEventDetail",
                    "resolved": "IcOptionSelectEventDetail",
                    "references": {
                        "IcOptionSelectEventDetail": {
                            "location": "import",
                            "path": "../ic-menu/ic-menu.types",
                            "id": "src/components/ic-menu/ic-menu.types.ts::IcOptionSelectEventDetail"
                        }
                    }
                }
            }, {
                "method": "icOptionDeselect",
                "name": "icOptionDeselect",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when `multiple` is `true` and an option is deselected."
                },
                "complexType": {
                    "original": "IcOptionSelectEventDetail",
                    "resolved": "IcOptionSelectEventDetail",
                    "references": {
                        "IcOptionSelectEventDetail": {
                            "location": "import",
                            "path": "../ic-menu/ic-menu.types",
                            "id": "src/components/ic-menu/ic-menu.types.ts::IcOptionSelectEventDetail"
                        }
                    }
                }
            }, {
                "method": "icRetryLoad",
                "name": "icRetryLoad",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the 'retry loading' button is clicked for a searchable variant."
                },
                "complexType": {
                    "original": "IcMultiValueEventDetail",
                    "resolved": "IcMultiValueEventDetail",
                    "references": {
                        "IcMultiValueEventDetail": {
                            "location": "import",
                            "path": "../../utils/types",
                            "id": "src/utils/types.ts::IcMultiValueEventDetail"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "setFocus": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Sets focus on the select component.",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "disabled",
                "methodName": "watchDisabledHandler"
            }, {
                "propName": "loading",
                "methodName": "loadingHandler"
            }, {
                "propName": "options",
                "methodName": "optionsChangedHandler"
            }, {
                "propName": "debounce",
                "methodName": "debounceChangedHandler"
            }, {
                "propName": "value",
                "methodName": "valueChangedHandler"
            }, {
                "propName": "open",
                "methodName": "openChangedHandler"
            }];
    }
}
//# sourceMappingURL=ic-select.js.map
