import { r as registerInstance, g as getAssetPath, h, H as Host, a as getElement } from './index-b153bfd0.js';
import { g as getIconPath } from './assets-manager-7d6fc08f.js';
import './mer-animated-dots-7cbae6ef.js';
import 'lit';
import 'lit/directives/when.js';
import 'lit/directives/if-defined.js';
import { L as Locale } from './locale-e5107fad.js';
import { c as config } from './config-5a775b7a.js';
import { f as formatDate } from './helpers-b443f9e9.js';
import { F as FILTER_AFTER } from './constants-f9193da7.js';

// - - - - - - - - - - - -
// Data Mappings
// - - - - - - - - - - - -
// ch-combo-box-render
const mapObjectTypeToComboBoxItemModel = (objectTypeModel) => objectTypeModel.map(objectType => ({
    value: objectType.id,
    caption: objectType.name
}));
const mapCategoryToComboBoxItemModel = (categoryModel) => categoryModel.map(category => ({
    value: category.id,
    caption: category.label
}));

const objectSelectorCss = "button.button-secondary{border-color:var(--color-border-neutral-default)}:host{block-size:100%;display:grid;grid-template-rows:auto 1fr auto;overflow:auto}.section{display:contents}.filter-layout{grid-template:\"pattern type\" \"category module\" \"modified modified\";grid-template-columns:1fr 1fr}.pattern{grid-area:pattern}.type{grid-area:type}.category{grid-area:category}.module{grid-area:module}.modified-accordion{grid-area:modified;display:flex;flex-direction:column}.field-group-modified{grid-template-columns:1fr 1fr 1fr}gx-ide-container::part(content){display:grid}ch-tabular-grid{overflow:auto}.tabular-grid-object-selector ch-tabular-grid-cell:is(:nth-child(5)){align-items:start;justify-content:start;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-inline-size:0}.objects-count{display:grid;grid-template-columns:1fr 1fr;border-block-start:1px solid var(--color-border-surface-on-elevation-3)}.objects-selected,.objects-matching{padding-block-end:8px}ch-tabular-grid-rowset-empty{position:relative}ch-tabular-grid.empty-result::part(main){overflow:hidden}input::-webkit-datetime-edit-fields-wrapper{padding:none}";

var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f)
        throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
        throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m")
        throw new TypeError("Private method is not writable");
    if (kind === "a" && !f)
        throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
        throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _GxIdeObjectSelector_componentLocale, _GxIdeObjectSelector_shortcutsSrc, _GxIdeObjectSelector_afterModel, _GxIdeObjectSelector_patternInput, _GxIdeObjectSelector_typeComboBox, _GxIdeObjectSelector_categoryComboBox, _GxIdeObjectSelector_moduleEntitySelector, _GxIdeObjectSelector_afterTypeComboBox, _GxIdeObjectSelector_userInput, _GxIdeObjectSelector_modifiedDateInput, _GxIdeObjectSelector_objectsGrid, _GxIdeObjectSelector_shortcutsEl, _GxIdeObjectSelector_cancelCallbackHandler, _GxIdeObjectSelector_chGridKeyDownHandler, _GxIdeObjectSelector_deselectAll, _GxIdeObjectSelector_evaluateObjectsCount, _GxIdeObjectSelector_getToday, _GxIdeObjectSelector_handleAfterValueChange, _GxIdeObjectSelector_handleObjectsSelectionChange, _GxIdeObjectSelector_hostKeyPressHandler, _GxIdeObjectSelector_newObjectCallbackHandler, _GxIdeObjectSelector_openSelectionCallbackHandler, _GxIdeObjectSelector_refreshUIWithNewConfiguration, _GxIdeObjectSelector_renderFilter, _GxIdeObjectSelector_renderFooter, _GxIdeObjectSelector_renderObjects, _GxIdeObjectSelector_selectAll, _GxIdeObjectSelector_setAfterDefaultValue, _GxIdeObjectSelector_setAfterOptions, _GxIdeObjectSelector_sortObjectsByName;
const CSS_BUNDLES = [
    "resets/box-sizing",
    "utils/form--full",
    "components/accordion",
    "components/tabular-grid",
    "utils/typography",
    "utils/layout",
    "utils/spacing"
];
const FILTER_ICON = getIconPath({
    category: "window-tools",
    name: "filter",
    colorType: "on-surface"
});
const USER_ICON = getIconPath({
    category: "system",
    name: "user",
    colorType: "on-surface"
});
const MODIFIED_ACCORDION_MODEL = [
    {
        id: "modified",
        caption: "Modified",
        expanded: false
    }
];
let TODAY = null;
const GxIdeObjectSelector = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        _GxIdeObjectSelector_componentLocale.set(this, void 0);
        _GxIdeObjectSelector_shortcutsSrc.set(this, getAssetPath(`./gx-ide-assets/object-selector/shortcuts.json`));
        _GxIdeObjectSelector_afterModel.set(this, null);
        /* References needed to collect data */
        _GxIdeObjectSelector_patternInput.set(this, void 0);
        _GxIdeObjectSelector_typeComboBox.set(this, void 0);
        _GxIdeObjectSelector_categoryComboBox.set(this, void 0);
        _GxIdeObjectSelector_moduleEntitySelector.set(this, void 0);
        _GxIdeObjectSelector_afterTypeComboBox.set(this, void 0);
        _GxIdeObjectSelector_userInput.set(this, void 0);
        _GxIdeObjectSelector_modifiedDateInput.set(this, void 0);
        _GxIdeObjectSelector_objectsGrid.set(this, void 0);
        _GxIdeObjectSelector_shortcutsEl.set(this, void 0);
        _GxIdeObjectSelector_cancelCallbackHandler.set(this, () => {
            this.cancelCallback();
        });
        _GxIdeObjectSelector_chGridKeyDownHandler.set(this, (e) => {
            if (e.key === "Enter") {
                __classPrivateFieldGet(this, _GxIdeObjectSelector_openSelectionCallbackHandler, "f").call(this, e);
            }
        });
        _GxIdeObjectSelector_deselectAll.set(this, () => {
            __classPrivateFieldGet(this, _GxIdeObjectSelector_objectsGrid, "f").selectAllRows(false);
        });
        _GxIdeObjectSelector_evaluateObjectsCount.set(this, (type) => {
            const locale = __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f");
            if (type === "selected") {
                if (this.selectedObjectsIdsArray.length === 0) {
                    return locale.objCount.selected.none;
                }
                if (this.selectedObjectsIdsArray.length === 1) {
                    return `1 ${locale.objCount.selected.one}`;
                }
                return `${this.selectedObjectsIdsArray.length} ${locale.objCount.selected.many}`;
            }
            // type === "matching"
            if (this.objects.length === 0) {
                return locale.objCount.matching.none;
            }
            if (this.objects.length === 1) {
                return `1 ${locale.objCount.matching.one}`;
            }
            return `${this.objects.length} ${locale.objCount.matching.many}`;
        });
        _GxIdeObjectSelector_getToday.set(this, () => {
            const now = new Date();
            const date = now.toISOString().split("T")[0];
            const time = now.toISOString().split("T")[1].slice(0, 5); // Only take 'HH:MM' part
            return `${date}T${time}`;
        });
        _GxIdeObjectSelector_handleAfterValueChange.set(this, (event) => {
            this.modifiedAfterValue = event.detail;
            if (this.modifiedAfterValue !== FILTER_AFTER.DATE_TIME ||
                (this.modifiedAfterValue === FILTER_AFTER.DATE_TIME &&
                    __classPrivateFieldGet(this, _GxIdeObjectSelector_modifiedDateInput, "f").value)) {
                // if "modified" is "after date/time" only refresh ui if date/time is valid.
                __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f").call(this);
            }
        });
        _GxIdeObjectSelector_handleObjectsSelectionChange.set(this, (event) => {
            this.selectedObjectsIdsArray = event.detail.rowsId;
        });
        _GxIdeObjectSelector_hostKeyPressHandler.set(this, (e) => {
            // just prevent keypress propagation
            if (e.key === "Enter") {
                e.stopPropagation();
            }
        });
        _GxIdeObjectSelector_newObjectCallbackHandler.set(this, () => {
            this.newObjectCallback();
        });
        _GxIdeObjectSelector_openSelectionCallbackHandler.set(this, (e) => {
            e.stopPropagation();
            this.openSelectionCallback(this.selectedObjectsIdsArray);
        });
        _GxIdeObjectSelector_refreshUIWithNewConfiguration.set(this, () => {
            var _a, _b, _c, _d, _e, _f;
            /* 'modified' checkbox, should only be considered if 'date' || 'user' */
            const modifiedAfter = __classPrivateFieldGet(this, _GxIdeObjectSelector_afterTypeComboBox, "f").value;
            const user = (_b = (_a = __classPrivateFieldGet(this, _GxIdeObjectSelector_userInput, "f")) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.trim();
            const filters = {
                pattern: (_c = __classPrivateFieldGet(this, _GxIdeObjectSelector_patternInput, "f")) === null || _c === void 0 ? void 0 : _c.value,
                type: __classPrivateFieldGet(this, _GxIdeObjectSelector_typeComboBox, "f").value,
                category: __classPrivateFieldGet(this, _GxIdeObjectSelector_categoryComboBox, "f").value,
                module: (_e = (_d = __classPrivateFieldGet(this, _GxIdeObjectSelector_moduleEntitySelector, "f")) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.id,
                modifiedAfter: modifiedAfter ? modifiedAfter : null,
                modifiedBy: user ? user : null,
                modifiedDate: modifiedAfter === FILTER_AFTER.DATE_TIME
                    ? new Date((_f = __classPrivateFieldGet(this, _GxIdeObjectSelector_modifiedDateInput, "f")) === null || _f === void 0 ? void 0 : _f.value)
                    : null
            };
            this.loading = true;
            this.objects = [];
            this.loadCallback(filters).then((objects) => {
                if (objects) {
                    this.objects = __classPrivateFieldGet(this, _GxIdeObjectSelector_sortObjectsByName, "f").call(this, objects);
                }
                this.selectedObjectsIdsArray = [];
                __classPrivateFieldGet(this, _GxIdeObjectSelector_deselectAll, "f").call(this);
                this.loading = false;
            });
        });
        _GxIdeObjectSelector_renderFilter.set(this, () => {
            return (h("header", { class: "dialog-header spacing-body-inline spacing-body-block-start" }, h("form", { class: "field-group filter-layout" }, h("div", { class: "field field-block pattern" }, h("label", {
                // pattern
                class: "label", htmlFor: "pattern"
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.pattern), h("ch-edit", { accessibleName: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.pattern, debounce: config.inputDebounce, class: "input", part: "filter-pattern", id: "pattern", name: "pattern", value: this.patternValue, mode: "text", ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_patternInput, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f") })), h("div", { class: "field field-block type" }, h("label", {
                // type
                class: "label", htmlFor: "type"
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.type), h("ch-combo-box-render", { accessibleName: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.type, class: "combo-box", disabled: !this.types, value: this.defaultType, part: "filter-type", id: "type", model: mapObjectTypeToComboBoxItemModel(this.types), ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_typeComboBox, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f") })), h("div", { class: "field field-block category" }, h("label", {
                // category
                class: "label", htmlFor: "category"
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.category), h("ch-combo-box-render", { id: "category", class: "combo-box", accessibleName: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.category, disabled: !this.categories, model: mapCategoryToComboBoxItemModel(this.categories), value: this.defaultCategory, part: "filter-category", onInput: this.categories && __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_categoryComboBox, el, "f")) })), h("gx-ide-entity-selector", {
                // module
                class: "module", id: "module", value: this.defaultModule, ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_moduleEntitySelector, el, "f")), labelCaption: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.module, labelPosition: "block-start", onValueChanged: __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f"), defaultValue: this.defaultModule, selectEntityCallback: this.selectModuleCallback
            }), h("ch-accordion-render", {
                // modified
                class: "accordion-outlined modified-accordion", model: MODIFIED_ACCORDION_MODEL
            }, h("div", { slot: "modified", class: "spacing-body" }, h("div", { class: "field-group field-group-modified" }, h("div", { class: "field field-block after" }, h("label", {
                // after
                class: "label", htmlFor: "after-type"
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.after), h("ch-combo-box-render", { class: "combo-box", value: this.modifiedAfterValue, part: "filter-after-type", id: "after-type", model: __classPrivateFieldGet(this, _GxIdeObjectSelector_afterModel, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_afterTypeComboBox, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeObjectSelector_handleAfterValueChange, "f") })), h("div", { class: "field field-block" }, h("label", {
                // user
                class: "label", htmlFor: "user-name"
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.user), h("ch-edit", { class: "input", part: "filter-user", value: this.patternValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_userInput, el, "f")), id: "user-name", name: "userName", startImgSrc: USER_ICON, onInput: __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f") })), h("div", { class: "field field-block" }, h("label", {
                // date
                class: {
                    "label": true,
                    "label--disabled": this.modifiedAfterValue !== "afterDateTime"
                }, htmlFor: "modified-date"
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.dateTime), h("input", { type: "datetime-local", class: "input input-date-time", id: "modified-date", name: "modifiedDate", part: "filter-pattern", value: this.patternValue, max: TODAY, ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_modifiedDateInput, el, "f")), disabled: this.modifiedAfterValue !== "afterDateTime", onInput: __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f") }))))))));
        });
        _GxIdeObjectSelector_renderFooter.set(this, () => {
            return (h("footer", { class: "footer dialog-footer-space-between" }, h("div", { class: "dialog-footer dialog-footer-space-between objects-count spacing-body-inline", slot: "footer-above" }, h("p", { class: "body-regular-s objects-selected", part: "objects-selected" }, __classPrivateFieldGet(this, _GxIdeObjectSelector_evaluateObjectsCount, "f").call(this, "selected")), h("p", { class: "body-regular-s objects-matching", part: "objects-matching" }, __classPrivateFieldGet(this, _GxIdeObjectSelector_evaluateObjectsCount, "f").call(this, "matching"))), h("div", { class: "dialog-footer-with-border dialog-footer-space-between spacing-body-inline spacing-body-block-end" }, h("button", {
                // button new object
                class: "button-secondary", part: "button button-new", onClick: !this.loading ? __classPrivateFieldGet(this, _GxIdeObjectSelector_newObjectCallbackHandler, "f") : undefined, disabled: this.loading
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").footer.btnNew), h("div", { class: "end buttons-spacer" }, h("button", {
                // button cancel
                class: "button-secondary", part: "button button-cancel", onClick: __classPrivateFieldGet(this, _GxIdeObjectSelector_cancelCallbackHandler, "f")
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").footer.btnCancel), this.multiSelection ? (h("button", { class: "button-secondary", onClick: __classPrivateFieldGet(this, _GxIdeObjectSelector_selectAll, "f"), part: "button button-select-all" }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").footer.btnSelectAll)) : null, h("button", {
                // button confirm
                class: "button-primary", part: "button button-confirm", onClick: __classPrivateFieldGet(this, _GxIdeObjectSelector_openSelectionCallbackHandler, "f"), disabled: this.loading
            }, __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").footer.btnConfirm)))));
        });
        _GxIdeObjectSelector_renderObjects.set(this, () => {
            return (h("ch-tabular-grid", { class: {
                    "tabular-grid": true,
                    "tabular-grid-object-selector": true,
                    "empty-result": this.objects.length === 0
                }, rowSelectionMode: this.multiSelection ? "multiple" : "single", ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_objectsGrid, el, "f")), part: "ch-grid-objects", onKeyDown: __classPrivateFieldGet(this, _GxIdeObjectSelector_chGridKeyDownHandler, "f"), onSelectionChanged: __classPrivateFieldGet(this, _GxIdeObjectSelector_handleObjectsSelectionChange, "f"), onDblClick: __classPrivateFieldGet(this, _GxIdeObjectSelector_openSelectionCallbackHandler, "f") }, h("ch-tabular-grid-columnset", { class: "tabular-grid-column-set" }, h("ch-tabular-grid-column", { "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { "column-name": __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").tableHead.name, "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { "column-name": __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").tableHead.type, "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { "column-name": __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").tableHead.module, "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { "column-name": __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").tableHead.description, "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.commonDouble, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { "column-name": __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").tableHead.modifiedDate, "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" }), h("ch-tabular-grid-column", { "column-name": __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").tableHead.importDate, "column-name-position": "text", settingable: false, sortable: false, size: config.tabularGrid.colSize.maxContent, class: "tabular-grid-column" })), this.objects.length ? (h("ch-tabular-grid-rowset", { class: "tabular-grid-rowset" }, this.objects.map((obj) => (h("ch-tabular-grid-row", { rowid: obj.id, key: obj.id, class: "tabular-grid-row" }, h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, h("ch-image", { src: obj.icon, class: "icon-s" })), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.name), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.type), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.module), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, obj.description), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, `${formatDate(obj.modifiedDate, "date-time")}`), h("ch-tabular-grid-cell", { class: "tabular-grid-cell" }, `${formatDate(obj.importDate, "date-time")}`)))))) : (h("ch-tabular-grid-rowset", { class: "tabular-grid-rowset" }, h("ch-tabular-grid-rowset-empty", null, this.loader && this.loading ? (h("gx-ide-loader", { loaderTitle: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").loader.title, show: true })) : (h("gx-ide-empty-state", { stateIconSrc: FILTER_ICON, stateTitle: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").emptyState.title })))))));
        });
        _GxIdeObjectSelector_selectAll.set(this, () => {
            __classPrivateFieldGet(this, _GxIdeObjectSelector_objectsGrid, "f").selectAllRows();
        });
        _GxIdeObjectSelector_setAfterDefaultValue.set(this, () => {
            this.modifiedAfterValue = FILTER_AFTER.NONE;
        });
        _GxIdeObjectSelector_setAfterOptions.set(this, () => {
            __classPrivateFieldSet(this, _GxIdeObjectSelector_afterModel, [
                {
                    caption: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter.afterNone,
                    value: FILTER_AFTER.NONE
                },
                {
                    caption: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter[FILTER_AFTER.DATE_TIME],
                    value: FILTER_AFTER.DATE_TIME
                },
                {
                    caption: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter[FILTER_AFTER.IMPORT],
                    value: FILTER_AFTER.IMPORT
                },
                {
                    caption: __classPrivateFieldGet(this, _GxIdeObjectSelector_componentLocale, "f").filter[FILTER_AFTER.LAST_BUILD],
                    value: FILTER_AFTER.LAST_BUILD
                }
            ], "f");
        });
        _GxIdeObjectSelector_sortObjectsByName.set(this, (objects) => {
            return objects.sort((a, b) => {
                const nameA = a.name.toLowerCase(), nameB = b.name.toLowerCase();
                if (nameA < nameB) {
                    return -1;
                }
                if (nameA > nameB) {
                    return 1;
                }
                return 0;
            });
        });
        this.filterModified = false;
        this.loading = false;
        this.modifiedAfterValue = undefined;
        this.objects = [];
        this.selectedObjectsIdsArray = [];
        this.cancelCallback = undefined;
        this.categories = undefined;
        this.defaultCategory = undefined;
        this.defaultModule = undefined;
        this.defaultType = undefined;
        this.loader = false;
        this.loadCallback = undefined;
        this.multiSelection = false;
        this.newObjectCallback = undefined;
        this.openSelectionCallback = undefined;
        this.patternValue = undefined;
        this.selectModuleCallback = undefined;
        this.types = undefined;
    }
    async connectedCallback() {
        TODAY = __classPrivateFieldGet(this, _GxIdeObjectSelector_getToday, "f").call(this);
    }
    async componentWillLoad() {
        __classPrivateFieldSet(this, _GxIdeObjectSelector_componentLocale, await Locale.getComponentStrings(this.el), "f");
        __classPrivateFieldGet(this, _GxIdeObjectSelector_setAfterOptions, "f").call(this);
        __classPrivateFieldGet(this, _GxIdeObjectSelector_setAfterDefaultValue, "f").call(this);
    }
    componentDidLoad() {
        __classPrivateFieldGet(this, _GxIdeObjectSelector_refreshUIWithNewConfiguration, "f").call(this);
        __classPrivateFieldGet(this, _GxIdeObjectSelector_patternInput, "f").focus();
    }
    componentDidRender() { }
    /**
     * Suspends or reactivates the shortcuts
     */
    async suspendShortcuts(suspendShortcuts) {
        if (suspendShortcuts) {
            __classPrivateFieldGet(this, _GxIdeObjectSelector_shortcutsEl, "f").suspend = true;
        }
        else {
            __classPrivateFieldGet(this, _GxIdeObjectSelector_shortcutsEl, "f").suspend = false;
        }
    }
    /**
     * Validate necessary data input
     */
    async validate() {
        const isValid = true;
        return isValid;
    }
    render() {
        return (h(Host, { onKeyPress: __classPrivateFieldGet(this, _GxIdeObjectSelector_hostKeyPressHandler, "f"), class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeObjectSelector_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeObjectSelector_shortcutsEl, el, "f")) }), h("section", { class: "section" }, __classPrivateFieldGet(this, _GxIdeObjectSelector_renderFilter, "f").call(this), __classPrivateFieldGet(this, _GxIdeObjectSelector_renderObjects, "f").call(this), __classPrivateFieldGet(this, _GxIdeObjectSelector_renderFooter, "f").call(this))));
    }
    static get delegatesFocus() { return true; }
    static get assetsDirs() { return ["gx-ide-assets/object-selector"]; }
    get el() { return getElement(this); }
};
_GxIdeObjectSelector_componentLocale = new WeakMap(), _GxIdeObjectSelector_shortcutsSrc = new WeakMap(), _GxIdeObjectSelector_afterModel = new WeakMap(), _GxIdeObjectSelector_patternInput = new WeakMap(), _GxIdeObjectSelector_typeComboBox = new WeakMap(), _GxIdeObjectSelector_categoryComboBox = new WeakMap(), _GxIdeObjectSelector_moduleEntitySelector = new WeakMap(), _GxIdeObjectSelector_afterTypeComboBox = new WeakMap(), _GxIdeObjectSelector_userInput = new WeakMap(), _GxIdeObjectSelector_modifiedDateInput = new WeakMap(), _GxIdeObjectSelector_objectsGrid = new WeakMap(), _GxIdeObjectSelector_shortcutsEl = new WeakMap(), _GxIdeObjectSelector_cancelCallbackHandler = new WeakMap(), _GxIdeObjectSelector_chGridKeyDownHandler = new WeakMap(), _GxIdeObjectSelector_deselectAll = new WeakMap(), _GxIdeObjectSelector_evaluateObjectsCount = new WeakMap(), _GxIdeObjectSelector_getToday = new WeakMap(), _GxIdeObjectSelector_handleAfterValueChange = new WeakMap(), _GxIdeObjectSelector_handleObjectsSelectionChange = new WeakMap(), _GxIdeObjectSelector_hostKeyPressHandler = new WeakMap(), _GxIdeObjectSelector_newObjectCallbackHandler = new WeakMap(), _GxIdeObjectSelector_openSelectionCallbackHandler = new WeakMap(), _GxIdeObjectSelector_refreshUIWithNewConfiguration = new WeakMap(), _GxIdeObjectSelector_renderFilter = new WeakMap(), _GxIdeObjectSelector_renderFooter = new WeakMap(), _GxIdeObjectSelector_renderObjects = new WeakMap(), _GxIdeObjectSelector_selectAll = new WeakMap(), _GxIdeObjectSelector_setAfterDefaultValue = new WeakMap(), _GxIdeObjectSelector_setAfterOptions = new WeakMap(), _GxIdeObjectSelector_sortObjectsByName = new WeakMap();
GxIdeObjectSelector.style = objectSelectorCss;

export { GxIdeObjectSelector as gx_ide_object_selector };

//# sourceMappingURL=gx-ide-object-selector.entry.js.map