import { proxyCustomElement, HTMLElement, getAssetPath, h, Host } from '@stencil/core/internal/client';
import { g as getIconPath } from './mer-animated-dots.js';
import 'lit';
import 'lit/directives/when.js';
import 'lit/directives/if-defined.js';
import { c as config } from './config.js';
import { L as Locale } from './locale.js';
import { s as setSelectedItem, g as getSelectedItem } from './common.js';
import { r as renderChCheckboxItems, m as mapOptionsToComboBoxItemModel } from './helpers.js';
import { v as validateControls } from './form-validation.js';
import { r as removeIndex } from './array.js';

const newKbCss = "button.button-secondary{border-color:var(--color-border-neutral-default)}:host{display:grid;block-size:100%;overflow:auto;grid-template-rows:max-content 1fr max-content}.section{display:contents}.header-one-col{grid-template-columns:1fr}.location-wrapper{display:flex;align-items:center;gap:var(--spacing-gap-xs);min-block-size:var(--control-block-size)}.location-custom-wrapper{display:flex;align-items:center;gap:var(--spacing-gap-xs);flex-grow:1;min-inline-size:0}.location-field{flex-grow:1;min-inline-size:0}.location-field>.input{inline-size:100%}.basic{display:grid;grid-template:\"basic-top basic-top\" max-content \"back-end front-end\" 1fr;grid-template-columns:1fr 1fr}.basic__header{grid-area:basic-top;grid-template-columns:1fr 1fr}.dialog-header__back-end,.dialog-header__front-end{padding-block-start:16px}.main__back-end{border-inline-end:var(--section-common-border)}.main__back-end,.main__front-end{grid-auto-rows:max-content;padding-block:12px;overflow:auto}.section__back-end{grid-area:back-end;grid-auto-rows:max-content}.section__front-end{grid-area:front-end}.section__back-end,.section__front-end{display:grid;grid-template-rows:max-content 1fr;overflow:auto}.tab-advanced-title{grid-area:tab-advanced-title}.layout-tab-advanced-left-col{grid-area:layout-tab-advanced-left-col}.layout-tab-advanced-right-col{grid-area:layout-tab-advanced-right-col}.basic,.advanced{padding-block-start:12px;overflow:auto;block-size:100%}.tab-advanced__field-group{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:auto}.text-align-center{text-align:center}.tab::part(page){scrollbar-width:thin}.checkbox{inline-size:max-content}";

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 _GxIdeNewKb_advancedTabHasBeenRendered, _GxIdeNewKb_componentLocale, _GxIdeNewKb_frontEndsCheckedMap, _GxIdeNewKb_selectedPrototypingEnvironmentId, _GxIdeNewKb_selectedDataSourceId, _GxIdeNewKb_shortcutsSrc, _GxIdeNewKb_kbSectionsModel, _GxIdeNewKb_authenticationTypeEl, _GxIdeNewKb_collationEl, _GxIdeNewKb_createDataFilesInKBFolderEl, _GxIdeNewKb_databaseNameEl, _GxIdeNewKb_dataSourceEl, _GxIdeNewKb_kbNameEl, _GxIdeNewKb_locationEl, _GxIdeNewKb_locationModeEl, _GxIdeNewKb_locationModeModel, _GxIdeNewKb_locationElRegistered, _GxIdeNewKb_passwordEl, _GxIdeNewKb_prototypingEnvironmentEl, _GxIdeNewKb_prototypingTargetEl, _GxIdeNewKb_savePasswordEl, _GxIdeNewKb_serverNameEl, _GxIdeNewKb_userInterfaceLanguageEl, _GxIdeNewKb_userNameEl, _GxIdeNewKb_chShortcutsEl, _GxIdeNewKb_handlerAuthenticationTypeInput, _GxIdeNewKb_handlerServerNameInput, _GxIdeNewKb_prototypingEnvironmentValueChangedHandler, _GxIdeNewKb_prototypingTargetValueChangedHandler, _GxIdeNewKb_dataSourceValueChangedHandler, _GxIdeNewKb_renderAdvanced, _GxIdeNewKb_renderBasic, _GxIdeNewKb_cancelKbHandler, _GxIdeNewKb_createKbHandler, _GxIdeNewKb_evaluateCreateDataCheckboxEnabled, _GxIdeNewKb_evaluateTooltipRender, _GxIdeNewKb_evaluateUserInputsDisplay, _GxIdeNewKb_frontEndCheckboxInputHandler, _GxIdeNewKb_updateFrontEndsCheckedMap, _GxIdeNewKb_getPrototypingEnvironments, _GxIdeNewKb_getDataSources, _GxIdeNewKb_initialSetupAdvancedTab, _GxIdeNewKb_initializeValidatableControlsBasicTab, _GxIdeNewKb_initializeValidatableControlsAdvancedTab, _GxIdeNewKb_selectLocationHandler, _GxIdeNewKb_locationModeChangeHandler, _GxIdeNewKb_tabSelectionChangedHandler, _GxIdeNewKb_updateFrontEnds;
const CSS_BUNDLES = [
    "resets/box-sizing",
    "components/tab",
    "components/tooltip",
    "utils/form--full",
    "utils/layout",
    "utils/typography",
    "utils/spacing",
    "chameleon/scrollbar"
];
const WINDOWS_AUTHENTICATION_VALUE = "windows-authentication";
const MAIN_SECTION_CLASSES = "main";
const BASIC_SECTION_PARENT_CLASSES = "basic";
const SYSTEM_ICON = getIconPath({
    category: "system",
    name: "folder",
    colorType: "primary"
});
const LOCATION_MODE_DEFAULT = "default";
const LOCATION_MODE_CUSTOM = "custom";
const BASIC_TAB_SELECTOR = "basic";
const ADVANCED_TAB_SELECTOR = "advanced";
const GxIdeNewKb$1 = /*@__PURE__*/ proxyCustomElement(class GxIdeNewKb extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        _GxIdeNewKb_advancedTabHasBeenRendered.set(this, false);
        /**
         * The component hard-coded strings translations.
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_componentLocale.set(this, void 0);
        /**
         * frontEndsState saves the id's of the front ends checkboxes that are checked
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_frontEndsCheckedMap.set(this, new Map());
        _GxIdeNewKb_selectedPrototypingEnvironmentId.set(this, void 0);
        _GxIdeNewKb_selectedDataSourceId.set(this, void 0);
        _GxIdeNewKb_shortcutsSrc.set(this, getAssetPath(`./gx-ide-assets/new-kb/shortcuts.json`));
        _GxIdeNewKb_kbSectionsModel.set(this, []);
        /* References needed to collect data con "Create" button submit*/
        _GxIdeNewKb_authenticationTypeEl.set(this, void 0);
        _GxIdeNewKb_collationEl.set(this, void 0);
        _GxIdeNewKb_createDataFilesInKBFolderEl.set(this, void 0);
        _GxIdeNewKb_databaseNameEl.set(this, void 0);
        _GxIdeNewKb_dataSourceEl.set(this, void 0);
        _GxIdeNewKb_kbNameEl.set(this, void 0);
        _GxIdeNewKb_locationEl.set(this, void 0);
        _GxIdeNewKb_locationModeEl.set(this, void 0);
        _GxIdeNewKb_locationModeModel.set(this, void 0);
        _GxIdeNewKb_locationElRegistered.set(this, false);
        _GxIdeNewKb_passwordEl.set(this, void 0);
        _GxIdeNewKb_prototypingEnvironmentEl.set(this, void 0);
        _GxIdeNewKb_prototypingTargetEl.set(this, void 0);
        _GxIdeNewKb_savePasswordEl.set(this, void 0);
        _GxIdeNewKb_serverNameEl.set(this, void 0);
        _GxIdeNewKb_userInterfaceLanguageEl.set(this, void 0);
        _GxIdeNewKb_userNameEl.set(this, void 0);
        _GxIdeNewKb_chShortcutsEl.set(this, void 0);
        // Uncomment when "TODO: define button handler and logic" is done.
        // #geminiToolsSearchPrimary = getIconPath({
        //   category: "gemini-tools",
        //   name: "search",
        //   colorType: "primary"
        // });
        // #geminiToolsResetPrimary = getIconPath({
        //   category: "gemini-tools",
        //   name: "reset",
        //   colorType: "primary"
        // });
        _GxIdeNewKb_handlerAuthenticationTypeInput.set(this, (e) => {
            const authenticationTypeValue = e === null || e === void 0 ? void 0 : e.detail;
            __classPrivateFieldGet(this, _GxIdeNewKb_evaluateUserInputsDisplay, "f").call(this, authenticationTypeValue);
        });
        _GxIdeNewKb_handlerServerNameInput.set(this, (e) => {
            __classPrivateFieldGet(this, _GxIdeNewKb_evaluateCreateDataCheckboxEnabled, "f").call(this, e.detail);
        });
        _GxIdeNewKb_prototypingEnvironmentValueChangedHandler.set(this, (event) => {
            __classPrivateFieldSet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, event.detail, "f");
            __classPrivateFieldGet(this, _GxIdeNewKb_getDataSources, "f").call(this);
            __classPrivateFieldGet(this, _GxIdeNewKb_updateFrontEnds, "f").call(this);
        });
        _GxIdeNewKb_prototypingTargetValueChangedHandler.set(this, async () => {
            await __classPrivateFieldGet(this, _GxIdeNewKb_getPrototypingEnvironments, "f").call(this);
            __classPrivateFieldGet(this, _GxIdeNewKb_getDataSources, "f").call(this);
        });
        _GxIdeNewKb_dataSourceValueChangedHandler.set(this, () => {
            __classPrivateFieldSet(this, _GxIdeNewKb_selectedDataSourceId, __classPrivateFieldGet(this, _GxIdeNewKb_dataSourceEl, "f").value, "f");
        });
        _GxIdeNewKb_renderAdvanced.set(this, () => {
            return [
                h("h2", {
                    // #knowledge base storage
                    class: "dialog-header subtitle-regular-xs\t text-align-center"
                }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.tabTitle),
                h("div", { class: "field-group tab-advanced__field-group" }, h("div", {
                    // #server name
                    class: "field field-block server-name-field"
                }, h("label", { class: "label", htmlFor: "serverName" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.serverName.label), h("ch-combo-box-render", { class: "combo-box", disabled: this.serverNames.length === 0, placeholder: this.serverNames.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.serverName
                            .disabledPlaceholder
                        : "", value: this.serverNamesInitialValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_serverNameEl, el, "f")), model: this.serverNamesComboBoxModel, onInput: this.serverNames.length > 0 && __classPrivateFieldGet(this, _GxIdeNewKb_handlerServerNameInput, "f"), id: "serverName", part: "server-name" }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_serverNameEl, "f"))), h("div", {
                    // #authentication type
                    class: "field field-block authentication-type-field"
                }, h("label", { class: "label", htmlFor: "authenticationType" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.authenticationType.label), h("ch-combo-box-render", { class: "combo-box", disabled: this.authenticationTypes.length === 0, placeholder: this.authenticationTypes.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.authenticationType
                            .disabledPlaceholder
                        : "", value: this.authenticationTypesInitialValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_authenticationTypeEl, el, "f")), model: this.authenticationTypesComboBoxModel, id: "authenticationType", part: "authentication-type", onInput: this.authenticationTypes.length > 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_handlerAuthenticationTypeInput, "f")
                        : undefined }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_authenticationTypeEl, "f"))), h("div", {
                    // #database
                    class: "field field-block database-field"
                }, h("label", { class: "label", htmlFor: "databaseName" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.databaseName.label), h("ch-edit", {
                    // TODO add placeholder
                    class: "input", value: this.databaseName, id: "databaseName", part: "database-name", ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_databaseNameEl, el, "f"))
                }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_databaseNameEl, "f"))), this.userNameVisible ? (h("div", {
                    // #username
                    class: "field field-block username-field"
                }, h("label", { class: "label", htmlFor: "userName" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.userName.label), h("ch-edit", {
                    // TODO add placeholder
                    class: "input", value: this.userName, id: "userName", part: "user-name", ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_userNameEl, el, "f"))
                }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_userNameEl, "f")))) : null, h("div", {
                    // #collation
                    class: "field field-block collation-field"
                }, h("label", { class: "label", htmlFor: "collation" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.collation.label), h("ch-combo-box-render", { class: "combo-box", disabled: this.serverNames.length === 0, placeholder: this.collations.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.collation
                            .disabledPlaceholder
                        : "", value: this.collationsInitialValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_collationEl, el, "f")), model: this.collationsComboBoxModel, id: "collation", part: "collation" }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_collationEl, "f"))), this.passwordVisible ? (h("div", {
                    // #password
                    class: "field field-block password-field"
                }, h("label", { class: "label", htmlFor: "password" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.password.label), h("ch-edit", {
                    // TODO add placeholder
                    class: "input", type: "password", value: this.password, id: "password", part: "password", ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_passwordEl, el, "f"))
                }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_passwordEl, "f")))) : null, h("ch-checkbox", {
                    // #create data in knowledge base folder
                    class: "checkbox create-data-in-kb-checkbox", checkedValue: "createDataFilesInKBFolder", caption: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.createDataFilesInKbFolder, disabled: this.createDataInKbDisabled, part: "create-data-in-kb", id: "createDataFilesInKBFolder", ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_createDataFilesInKBFolderEl, el, "f"))
                }), this.savePasswordVisible ? (h("ch-checkbox", {
                    // #save password
                    class: "checkbox save-password-checkbox", checkedValue: "password", caption: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.savePassword, part: "save-password", id: "savePassword", ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_savePasswordEl, el, "f"))
                })) : null)
            ];
        });
        _GxIdeNewKb_renderBasic.set(this, () => {
            return [
                h("section", { class: "basic__header field-group dialog-header-with-border spacing-body-inline" }, h("div", {
                    // #prototyping  target
                    class: "field field-block prototyping-target"
                }, h("label", { class: "label", htmlFor: "prototypingTarget" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.prototypingTarget.label), h("ch-combo-box-render", { id: "prototypingTarget", class: "combo-box", part: "prototyping-target", disabled: this.prototypingTargets.length === 0, placeholder: this.prototypingTargets.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.prototypingTarget
                            .disabledPlaceholder
                        : "", value: this.prototypingTargetsInitialValue, model: this.prototypingTargetsComboBoxModel, onInput: this.prototypingTargets.length > 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetValueChangedHandler, "f")
                        : undefined, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_prototypingTargetEl, el, "f")) }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetEl, "f"))), h("div", {
                    // #user interface
                    class: "field field-block user-interface-language"
                }, h("label", { class: "label", htmlFor: "userInterfaceLanguage" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.userInterfaceLanguage.label), h("ch-combo-box-render", { class: "combo-box", disabled: this.userInterfaceLanguages.length === 0, placeholder: this.userInterfaceLanguages.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.userInterfaceLanguage
                            .disabledPlaceholder
                        : "", value: this.userInterfaceLanguagesInitialValue, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_userInterfaceLanguageEl, el, "f")), model: this.userInterfaceLanguagesComboBoxModel, id: "userInterfaceLanguage", part: "user-interface-language" }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_userInterfaceLanguageEl, "f")))),
                h("section", { class: "section__back-end" }, h("h2", {
                    // back end
                    class: "dialog-header dialog-header-with-border dialog-header__back-end subtitle-regular-xs\t text-align-center spacing-body-inline"
                }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.backEnd.backEndLabel), h("div", { class: "field-group main__back-end spacing-body-inline scrollable" }, h("div", {
                    // #prototyping environment
                    class: "field field-block"
                }, h("label", { class: "label", htmlFor: "prototypingEnvironment" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.backEnd.prototypingEnvironment
                    .label), h("ch-combo-box-render", { class: "combo-box", disabled: this.defaultPrototypingEnvironments.length === 0, placeholder: this.defaultPrototypingEnvironments.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.backEnd
                            .prototypingEnvironment.disabledPlaceholder
                        : "", value: __classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_prototypingEnvironmentEl, el, "f")), model: this.prototypingEnvironmentsComboBoxModel, onInput: __classPrivateFieldGet(this, _GxIdeNewKb_prototypingEnvironmentValueChangedHandler, "f"), part: "prototyping-environment", id: "prototypingEnvironment" }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_prototypingEnvironmentEl, "f"))), h("div", {
                    // #data source
                    class: "field field-block"
                }, h("label", { class: "label", htmlFor: "dataSource" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.backEnd.dataSource.label), h("ch-combo-box-render", { class: "combo-box", disabled: this.defaultDataSources.length === 0, placeholder: this.defaultDataSources.length === 0
                        ? __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.backEnd.dataSource
                            .disabledPlaceholder
                        : "", value: __classPrivateFieldGet(this, _GxIdeNewKb_selectedDataSourceId, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_dataSourceEl, el, "f")), onInput: __classPrivateFieldGet(this, _GxIdeNewKb_dataSourceValueChangedHandler, "f"), model: this.defaultDataSourcesComboBoxModel, part: "data-source", id: "dataSource" }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_dataSourceEl, "f"))))),
                h("section", { class: "section__front-end" }, h("h2", { class: "dialog-header dialog-header-with-border dialog-header__front-end subtitle-regular-xs\t text-align-center spacing-body-inline" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.frontEnd.frontEndLabel), h("div", { class: "field-group main__front-end spacing-body-inline scrollable" }, renderChCheckboxItems(this.frontEnds, __classPrivateFieldGet(this, _GxIdeNewKb_frontEndCheckboxInputHandler, "f"), __classPrivateFieldGet(this, _GxIdeNewKb_frontEndsCheckedMap, "f").get(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f")))))
            ];
        });
        // - - - - - - - - - -
        _GxIdeNewKb_cancelKbHandler.set(this, () => {
            if (this.cancelCallback) {
                this.cancelCallback();
            }
        });
        _GxIdeNewKb_createKbHandler.set(this, () => {
            var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
            const selectedFrontEndIds = (_a = __classPrivateFieldGet(this, _GxIdeNewKb_frontEndsCheckedMap, "f").get(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"))) !== null && _a !== void 0 ? _a : [];
            this.createCallback({
                authenticationType: (_b = __classPrivateFieldGet(this, _GxIdeNewKb_authenticationTypeEl, "f")) === null || _b === void 0 ? void 0 : _b.value,
                collation: (_c = __classPrivateFieldGet(this, _GxIdeNewKb_collationEl, "f")) === null || _c === void 0 ? void 0 : _c.value,
                createDataFilesInKBFolder: !!((_d = __classPrivateFieldGet(this, _GxIdeNewKb_createDataFilesInKBFolderEl, "f")) === null || _d === void 0 ? void 0 : _d.value),
                dataSource: (_e = __classPrivateFieldGet(this, _GxIdeNewKb_dataSourceEl, "f")) === null || _e === void 0 ? void 0 : _e.value,
                databaseName: (_f = __classPrivateFieldGet(this, _GxIdeNewKb_databaseNameEl, "f")) === null || _f === void 0 ? void 0 : _f.value,
                frontEnds: selectedFrontEndIds,
                kbLocation: (_g = __classPrivateFieldGet(this, _GxIdeNewKb_locationEl, "f")) === null || _g === void 0 ? void 0 : _g.value,
                kbName: (_h = __classPrivateFieldGet(this, _GxIdeNewKb_kbNameEl, "f")) === null || _h === void 0 ? void 0 : _h.value,
                password: (_j = __classPrivateFieldGet(this, _GxIdeNewKb_passwordEl, "f")) === null || _j === void 0 ? void 0 : _j.value,
                prototypingEnvironment: (_k = __classPrivateFieldGet(this, _GxIdeNewKb_prototypingEnvironmentEl, "f")) === null || _k === void 0 ? void 0 : _k.value,
                prototypingTarget: (_l = __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetEl, "f")) === null || _l === void 0 ? void 0 : _l.value,
                savePassword: !!((_m = __classPrivateFieldGet(this, _GxIdeNewKb_savePasswordEl, "f")) === null || _m === void 0 ? void 0 : _m.value),
                serverName: (_o = __classPrivateFieldGet(this, _GxIdeNewKb_serverNameEl, "f")) === null || _o === void 0 ? void 0 : _o.value,
                userInterfaceLanguage: (_p = __classPrivateFieldGet(this, _GxIdeNewKb_userInterfaceLanguageEl, "f")) === null || _p === void 0 ? void 0 : _p.value,
                userName: (_q = __classPrivateFieldGet(this, _GxIdeNewKb_userNameEl, "f")) === null || _q === void 0 ? void 0 : _q.value
            }).then((formSubmitResult) => {
                this.validatableControls = validateControls(formSubmitResult, this.validatableControls);
            });
        });
        /**
         * Disable "Create Data in Knowledge Base Folder" if the first Server Name
         * option is selected.
         * */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_evaluateCreateDataCheckboxEnabled.set(this, (serverNameValue) => {
            var _a;
            if (((_a = this.serverNames[0]) === null || _a === void 0 ? void 0 : _a.id) === serverNameValue) {
                this.createDataInKbDisabled = true;
            }
            else {
                this.createDataInKbDisabled = false;
            }
        });
        // TODO: evaluate if this should be a global helper function.
        // It is used on new-kb as well.
        _GxIdeNewKb_evaluateTooltipRender.set(this, (controlReference) => {
            var _a, _b, _c;
            return ((_b = (_a = this.validatableControls) === null || _a === void 0 ? void 0 : _a.get(controlReference === null || controlReference === void 0 ? void 0 : controlReference.id)) === null || _b === void 0 ? void 0 : _b.hasError) &&
                ((_c = this.validatableControls.get(controlReference.id)) === null || _c === void 0 ? void 0 : _c.message) && (h("ch-tooltip", { class: "tooltip", actionElement: controlReference, blockAlign: config.tooltipSettings.blockAlign, inlineAlign: config.tooltipSettings.inlineAlign, delay: config.tooltipSettings.delay }, this.validatableControls.get(controlReference.id).message));
        });
        /**
         * If "Authentication Type" is "Windows Authentication", hide User Name,
         * Password, and Save Password fields.
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_evaluateUserInputsDisplay.set(this, (authenticationTypeValue) => {
            if (authenticationTypeValue === WINDOWS_AUTHENTICATION_VALUE) {
                this.userNameVisible = false;
                this.passwordVisible = false;
                this.savePasswordVisible = false;
            }
            else {
                this.userNameVisible = true;
                this.passwordVisible = true;
                this.savePasswordVisible = true;
            }
        });
        _GxIdeNewKb_frontEndCheckboxInputHandler.set(this, (event) => {
            const checkedValue = event.target.checkedValue;
            const checked = event.detail === checkedValue;
            __classPrivateFieldGet(this, _GxIdeNewKb_updateFrontEndsCheckedMap, "f").call(this, checkedValue, checked);
        });
        /**
         * This function updates frontEndsCheckedMap, that contains the checked
         * checkboxes for each language front ends.
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_updateFrontEndsCheckedMap.set(this, (checkboxId, checked) => {
            let currentState = __classPrivateFieldGet(this, _GxIdeNewKb_frontEndsCheckedMap, "f").get(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"));
            if (!currentState) {
                // first time
                currentState = [];
                __classPrivateFieldGet(this, _GxIdeNewKb_frontEndsCheckedMap, "f").set(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"), currentState);
            }
            if (checked) {
                // update by adding
                currentState.push(checkboxId);
            }
            else {
                // update by removing
                const checkboxIndex = currentState.findIndex(id => id === checkboxId);
                removeIndex(currentState, checkboxIndex);
            }
        });
        _GxIdeNewKb_getPrototypingEnvironments.set(this, async () => {
            if (this.getPrototypingEnvironmentsCallback) {
                const selectedPrototypingTargetId = __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetEl, "f")
                    ? __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetEl, "f").value
                    : this.prototypingTargetsInitialValue;
                const envs = await this.getPrototypingEnvironmentsCallback(selectedPrototypingTargetId);
                if (envs) {
                    this.defaultPrototypingEnvironments = envs;
                }
            }
        });
        _GxIdeNewKb_getDataSources.set(this, () => {
            if (this.getDataSourcesCallback) {
                const selectedPrototypingEnvironmentId = __classPrivateFieldGet(this, _GxIdeNewKb_prototypingEnvironmentEl, "f").value;
                const selectedPrototypingTargetId = __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetEl, "f").value;
                const updatedDefaultDataSourcesPromise = this.getDataSourcesCallback(selectedPrototypingEnvironmentId, selectedPrototypingTargetId);
                updatedDefaultDataSourcesPromise
                    .then(result => {
                    if (result.length > 0) {
                        result = setSelectedItem(result, __classPrivateFieldGet(this, _GxIdeNewKb_selectedDataSourceId, "f"));
                        __classPrivateFieldSet(this, _GxIdeNewKb_selectedDataSourceId, getSelectedItem(result), "f");
                        this.defaultDataSources = result;
                        // set first option as selected
                        __classPrivateFieldGet(this, _GxIdeNewKb_dataSourceEl, "f").value =
                            __classPrivateFieldGet(this, _GxIdeNewKb_selectedDataSourceId, "f") !== undefined
                                ? __classPrivateFieldGet(this, _GxIdeNewKb_selectedDataSourceId, "f")
                                : this.defaultDataSources[0].id;
                    }
                })
                    .catch(() => {
                    // to do
                });
            }
        });
        _GxIdeNewKb_initialSetupAdvancedTab.set(this, () => {
            const selectedServerNameValue = __classPrivateFieldGet(this, _GxIdeNewKb_serverNameEl, "f").value;
            __classPrivateFieldGet(this, _GxIdeNewKb_evaluateCreateDataCheckboxEnabled, "f").call(this, selectedServerNameValue);
            const selectedAuthenticationType = __classPrivateFieldGet(this, _GxIdeNewKb_authenticationTypeEl, "f").value;
            __classPrivateFieldGet(this, _GxIdeNewKb_evaluateUserInputsDisplay, "f").call(this, selectedAuthenticationType);
            // map all "Advanced Tab" GxOption[]'s to ComboBoxModel's
            this.watchAuthenticationTypes(this.authenticationTypes);
            this.watchCollations(this.collations);
        });
        _GxIdeNewKb_initializeValidatableControlsBasicTab.set(this, () => {
            // populate #controlsValidation with the controls that could have errors.
            const validatableControls = [
                __classPrivateFieldGet(this, _GxIdeNewKb_dataSourceEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_kbNameEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_prototypingEnvironmentEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_prototypingTargetEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_userInterfaceLanguageEl, "f")
            ];
            validatableControls.forEach(validatableControl => {
                if (validatableControl.id) {
                    this.validatableControls.set(validatableControl.id, {
                        reference: validatableControl,
                        hasError: false,
                        message: undefined
                    });
                }
            });
        });
        _GxIdeNewKb_initializeValidatableControlsAdvancedTab.set(this, () => {
            // populate #controlsValidation with the controls that could have errors.
            const validatableControls = [
                __classPrivateFieldGet(this, _GxIdeNewKb_authenticationTypeEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_createDataFilesInKBFolderEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_serverNameEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_authenticationTypeEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_databaseNameEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_userNameEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_collationEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_passwordEl, "f"),
                __classPrivateFieldGet(this, _GxIdeNewKb_savePasswordEl, "f")
            ];
            validatableControls.forEach(validatableControl => {
                if (validatableControl.id) {
                    this.validatableControls.set(validatableControl.id, {
                        reference: validatableControl,
                        hasError: false,
                        message: undefined
                    });
                }
            });
        });
        /**
         * @description It allows defining the DBMS that will be used in the solution
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_selectLocationHandler.set(this, () => {
            this.selectLocationCallback().then(kbLocation => {
                if (kbLocation) {
                    this.kbLocation = kbLocation;
                }
            });
        });
        _GxIdeNewKb_locationModeChangeHandler.set(this, () => {
            this.locationMode = __classPrivateFieldGet(this, _GxIdeNewKb_locationModeEl, "f").value;
        });
        _GxIdeNewKb_tabSelectionChangedHandler.set(this, (event) => {
            if (event.detail.newSelectedId === ADVANCED_TAB_SELECTOR) {
                this.advancedTabIsVisible = true;
                // Some logic for advanced tab is done on componentDidRender lifecycle,
                // since the reference to the elements is needed.
            }
        });
        /**
         * Evaluates which front-end options need updates on 'getFrontEndsCallback'
         * by comparing the new state (getFrontEndsCallback result) and previous state.
         */
        // eslint-disable-next-line @stencil-community/own-props-must-be-private
        _GxIdeNewKb_updateFrontEnds.set(this, async () => {
            const updatedFrontEnds = await this.getFrontEndsCallback(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"));
            if ((updatedFrontEnds === null || updatedFrontEnds === void 0 ? void 0 : updatedFrontEnds.length) > 0) {
                this.frontEnds = updatedFrontEnds;
                // Seed the checked map from the data's checked property so that
                // initially checked items render as checked on first load.
                if (!__classPrivateFieldGet(this, _GxIdeNewKb_frontEndsCheckedMap, "f").has(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"))) {
                    const checkedIds = updatedFrontEnds
                        .filter(fe => fe.checked)
                        .map(fe => fe.value || fe.id);
                    if (checkedIds.length > 0) {
                        __classPrivateFieldGet(this, _GxIdeNewKb_frontEndsCheckedMap, "f").set(__classPrivateFieldGet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, "f"), checkedIds);
                    }
                }
            }
        });
        this.advancedTabIsVisible = false;
        this.locationMode = LOCATION_MODE_DEFAULT;
        this.frontEnds = undefined;
        this.validatableControls = new Map();
        this.createDataInKbDisabled = false;
        this.userNameVisible = true;
        this.passwordVisible = true;
        this.savePasswordVisible = true;
        this.authenticationTypesComboBoxModel = [];
        this.authenticationTypesInitialValue = undefined;
        this.collationsComboBoxModel = [];
        this.collationsInitialValue = undefined;
        this.defaultDataSourcesComboBoxModel = [];
        this.prototypingTargetsComboBoxModel = [];
        this.prototypingTargetsInitialValue = undefined;
        this.prototypingEnvironmentsComboBoxModel = [];
        this.prototypingEnvironmentsInitialValue = undefined;
        this.serverNamesComboBoxModel = [];
        this.serverNamesInitialValue = undefined;
        this.userInterfaceLanguagesComboBoxModel = [];
        this.userInterfaceLanguagesInitialValue = undefined;
        this.authenticationTypes = [];
        this.cancelCallback = undefined;
        this.canSetLocation = false;
        this.collations = undefined;
        this.createCallback = undefined;
        this.createDataFilesInKBFolder = false;
        this.databaseName = undefined;
        this.defaultDataSources = [];
        this.getDataSourcesCallback = undefined;
        this.getFrontEndsCallback = undefined;
        this.getPrototypingEnvironmentsCallback = undefined;
        this.isAdvanced = false;
        this.kbLocation = undefined;
        this.kbName = undefined;
        this.password = undefined;
        this.defaultPrototypingEnvironments = [];
        this.prototypingTargets = [];
        this.savePassword = false;
        this.selectLocationCallback = undefined;
        this.serverNames = [];
        this.userInterfaceLanguages = [];
        this.userName = undefined;
    }
    watchAuthenticationTypes(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.authenticationTypesComboBoxModel =
                mapOptionsToComboBoxItemModel(newValue);
            this.authenticationTypesInitialValue = getSelectedItem(newValue);
        }
    }
    watchCollations(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.collationsComboBoxModel = mapOptionsToComboBoxItemModel(newValue);
            this.collationsInitialValue = getSelectedItem(newValue);
        }
    }
    watchDefaultDataSources(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.defaultDataSourcesComboBoxModel =
                mapOptionsToComboBoxItemModel(newValue);
            const result = setSelectedItem(newValue, __classPrivateFieldGet(this, _GxIdeNewKb_selectedDataSourceId, "f"));
            __classPrivateFieldSet(this, _GxIdeNewKb_selectedDataSourceId, getSelectedItem(result), "f");
        }
    }
    watchDefaultPrototypingEnvironments(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.prototypingEnvironmentsComboBoxModel =
                mapOptionsToComboBoxItemModel(newValue);
            __classPrivateFieldSet(this, _GxIdeNewKb_selectedPrototypingEnvironmentId, getSelectedItem(newValue), "f");
            __classPrivateFieldGet(this, _GxIdeNewKb_updateFrontEnds, "f").call(this);
        }
    }
    watchPrototypingTargets(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.prototypingTargetsComboBoxModel =
                mapOptionsToComboBoxItemModel(newValue);
            this.prototypingTargetsInitialValue = getSelectedItem(newValue);
            __classPrivateFieldGet(this, _GxIdeNewKb_getPrototypingEnvironments, "f").call(this);
        }
    }
    watchServerNames(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.serverNamesComboBoxModel = mapOptionsToComboBoxItemModel(newValue);
            this.serverNamesInitialValue = getSelectedItem(newValue);
        }
    }
    watchUserInterfaceLanguages(newValue) {
        if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
            this.userInterfaceLanguagesComboBoxModel =
                mapOptionsToComboBoxItemModel(newValue);
            this.userInterfaceLanguagesInitialValue = getSelectedItem(newValue);
        }
    }
    async componentWillLoad() {
        __classPrivateFieldSet(this, _GxIdeNewKb_componentLocale, await Locale.getComponentStrings(this.el), "f");
        __classPrivateFieldSet(this, _GxIdeNewKb_kbSectionsModel, [
            {
                id: BASIC_TAB_SELECTOR,
                name: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabBasic.tabLabel
            },
            {
                id: ADVANCED_TAB_SELECTOR,
                name: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").tabAdvanced.tabLabel
            }
        ], "f");
        __classPrivateFieldSet(this, _GxIdeNewKb_locationModeModel, [
            {
                value: LOCATION_MODE_DEFAULT,
                caption: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").header.kbLocationDefault
            },
            {
                value: LOCATION_MODE_CUSTOM,
                caption: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").header.kbLocationCustom
            }
        ], "f");
    }
    connectedCallback() {
        this.watchDefaultDataSources(this.defaultDataSources);
        this.watchDefaultPrototypingEnvironments(this.defaultPrototypingEnvironments);
        this.watchPrototypingTargets(this.prototypingTargets);
        this.watchServerNames(this.serverNames);
        this.watchUserInterfaceLanguages(this.userInterfaceLanguages);
    }
    componentDidLoad() {
        __classPrivateFieldGet(this, _GxIdeNewKb_initializeValidatableControlsBasicTab, "f").call(this);
    }
    componentDidRender() {
        if (this.advancedTabIsVisible && !__classPrivateFieldGet(this, _GxIdeNewKb_advancedTabHasBeenRendered, "f")) {
            // just call this once.
            __classPrivateFieldGet(this, _GxIdeNewKb_initialSetupAdvancedTab, "f").call(this);
            __classPrivateFieldGet(this, _GxIdeNewKb_initializeValidatableControlsAdvancedTab, "f").call(this);
            __classPrivateFieldSet(this, _GxIdeNewKb_advancedTabHasBeenRendered, true, "f");
        }
        // Register the location input for validation once it's rendered (custom mode)
        if (this.locationMode === LOCATION_MODE_CUSTOM &&
            !__classPrivateFieldGet(this, _GxIdeNewKb_locationElRegistered, "f") &&
            __classPrivateFieldGet(this, _GxIdeNewKb_locationEl, "f")) {
            this.validatableControls.set(__classPrivateFieldGet(this, _GxIdeNewKb_locationEl, "f").id, {
                reference: __classPrivateFieldGet(this, _GxIdeNewKb_locationEl, "f"),
                hasError: false,
                message: undefined
            });
            __classPrivateFieldSet(this, _GxIdeNewKb_locationElRegistered, true, "f");
        }
    }
    /**
     * Suspends or reactivates the shortcuts
     */
    async suspendShortcuts(suspendShortcuts) {
        if (suspendShortcuts) {
            __classPrivateFieldGet(this, _GxIdeNewKb_chShortcutsEl, "f").suspend = true;
        }
        else {
            __classPrivateFieldGet(this, _GxIdeNewKb_chShortcutsEl, "f").suspend = false;
        }
    }
    render() {
        return (h(Host, { class: "widget" }, h("ch-theme", { model: CSS_BUNDLES }), h("ch-shortcuts", { src: __classPrivateFieldGet(this, _GxIdeNewKb_shortcutsSrc, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_chShortcutsEl, el, "f")) }), h("section", { class: "section" }, h("header", { class: {
                "field-group": true,
                "dialog-header-with-border": !this.isAdvanced,
                "dialog-header": this.isAdvanced,
                "header": true,
                "header-one-col": true,
                "spacing-body-block-start": true,
                "spacing-body-inline": true
            } }, h("div", {
            // #kb name
            class: "field field-inline kb-name"
        }, h("label", { class: "label kb-label", htmlFor: "kbName" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").header.kbName), h("ch-edit", {
            // TODO add placeholder
            autoFocus: true, class: "input kb-input", placeholder: "SalesInventory", value: this.kbName, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_kbNameEl, el, "f")), id: "kbName", part: "kb-name"
        }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_kbNameEl, "f"))), this.canSetLocation && (h("div", { class: "location-wrapper" }, h("label", { class: "label location-label" }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").header.kbLocation), h("ch-radio-group-render", { class: "radio-group", model: __classPrivateFieldGet(this, _GxIdeNewKb_locationModeModel, "f"), value: LOCATION_MODE_DEFAULT, onChange: __classPrivateFieldGet(this, _GxIdeNewKb_locationModeChangeHandler, "f"), ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_locationModeEl, el, "f")) }), this.locationMode === LOCATION_MODE_CUSTOM && (h("div", { class: "location-custom-wrapper" }, h("div", { class: "location-field" }, h("ch-edit", { class: "input", value: this.kbLocation, ref: (el) => (__classPrivateFieldSet(this, _GxIdeNewKb_locationEl, el, "f")), id: "kbLocation", part: "kb-location" }), __classPrivateFieldGet(this, _GxIdeNewKb_evaluateTooltipRender, "f").call(this, __classPrivateFieldGet(this, _GxIdeNewKb_locationEl, "f"))), h("button", { class: "button-tertiary button-icon-only location-icon", "aria-label": __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").header.selectLocationButton, title: __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").header.selectLocationButton, part: "button-select-location", onClick: __classPrivateFieldGet(this, _GxIdeNewKb_selectLocationHandler, "f") }, h("ch-image", { class: "icon-m", src: SYSTEM_ICON }))))))), this.isAdvanced ? (h("ch-tab-render", {
            // #tab
            class: {
                scrollable: true,
                tab: true,
                [MAIN_SECTION_CLASSES]: true
            }, tabListPosition: "block-start", model: __classPrivateFieldGet(this, _GxIdeNewKb_kbSectionsModel, "f"), selectedId: BASIC_TAB_SELECTOR, overflow: "auto", contain: "size", onSelectedItemChange: !this.advancedTabIsVisible && __classPrivateFieldGet(this, _GxIdeNewKb_tabSelectionChangedHandler, "f")
        }, h("div", { slot: BASIC_TAB_SELECTOR, class: BASIC_SECTION_PARENT_CLASSES, part: "tab-button-basic" }, __classPrivateFieldGet(this, _GxIdeNewKb_renderBasic, "f").call(this)), this.advancedTabIsVisible && (h("div", { slot: ADVANCED_TAB_SELECTOR, class: "advanced spacing-body-inline", part: "tab-button-advanced" }, __classPrivateFieldGet(this, _GxIdeNewKb_renderAdvanced, "f").call(this))))) : (h("div", { class: MAIN_SECTION_CLASSES }, h("div", { class: BASIC_SECTION_PARENT_CLASSES }, __classPrivateFieldGet(this, _GxIdeNewKb_renderBasic, "f").call(this)))), h("footer", { class: {
                "dialog-footer": this.isAdvanced,
                "dialog-footer-with-border": !this.isAdvanced,
                "spacing-body-block-end": true,
                "spacing-body-inline": true
            } }, h("div", { class: "buttons-spacer" }, h("button", {
            // #cancel
            class: "button-secondary", id: "button-cancel", onClick: __classPrivateFieldGet(this, _GxIdeNewKb_cancelKbHandler, "f"), part: "button-cancel"
        }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").footer.btnCancel), h("button", {
            // #create
            class: "button-primary", id: "button-create", onClick: __classPrivateFieldGet(this, _GxIdeNewKb_createKbHandler, "f"), part: "button-create"
        }, __classPrivateFieldGet(this, _GxIdeNewKb_componentLocale, "f").footer.btnCreate))))));
    }
    static get assetsDirs() { return ["gx-ide-assets/new-kb"]; }
    get el() { return this; }
    static get watchers() { return {
        "authenticationTypes": ["watchAuthenticationTypes"],
        "collations": ["watchCollations"],
        "defaultDataSources": ["watchDefaultDataSources"],
        "defaultPrototypingEnvironments": ["watchDefaultPrototypingEnvironments"],
        "prototypingTargets": ["watchPrototypingTargets"],
        "serverNames": ["watchServerNames"],
        "userInterfaceLanguages": ["watchUserInterfaceLanguages"]
    }; }
    static get style() { return newKbCss; }
}, [1, "gx-ide-new-kb", {
        "authenticationTypes": [16],
        "cancelCallback": [16],
        "canSetLocation": [4, "can-set-location"],
        "collations": [16],
        "createCallback": [16],
        "createDataFilesInKBFolder": [4, "create-data-files-in-k-b-folder"],
        "databaseName": [1, "database-name"],
        "defaultDataSources": [1040],
        "getDataSourcesCallback": [16],
        "getFrontEndsCallback": [16],
        "getPrototypingEnvironmentsCallback": [16],
        "isAdvanced": [4, "is-advanced"],
        "kbLocation": [1025, "kb-location"],
        "kbName": [1, "kb-name"],
        "password": [1],
        "defaultPrototypingEnvironments": [1040],
        "prototypingTargets": [16],
        "savePassword": [4, "save-password"],
        "selectLocationCallback": [16],
        "serverNames": [16],
        "userInterfaceLanguages": [16],
        "userName": [1, "user-name"],
        "advancedTabIsVisible": [32],
        "locationMode": [32],
        "frontEnds": [32],
        "validatableControls": [32],
        "createDataInKbDisabled": [32],
        "userNameVisible": [32],
        "passwordVisible": [32],
        "savePasswordVisible": [32],
        "authenticationTypesComboBoxModel": [32],
        "authenticationTypesInitialValue": [32],
        "collationsComboBoxModel": [32],
        "collationsInitialValue": [32],
        "defaultDataSourcesComboBoxModel": [32],
        "prototypingTargetsComboBoxModel": [32],
        "prototypingTargetsInitialValue": [32],
        "prototypingEnvironmentsComboBoxModel": [32],
        "prototypingEnvironmentsInitialValue": [32],
        "serverNamesComboBoxModel": [32],
        "serverNamesInitialValue": [32],
        "userInterfaceLanguagesComboBoxModel": [32],
        "userInterfaceLanguagesInitialValue": [32],
        "suspendShortcuts": [64]
    }, undefined, {
        "authenticationTypes": ["watchAuthenticationTypes"],
        "collations": ["watchCollations"],
        "defaultDataSources": ["watchDefaultDataSources"],
        "defaultPrototypingEnvironments": ["watchDefaultPrototypingEnvironments"],
        "prototypingTargets": ["watchPrototypingTargets"],
        "serverNames": ["watchServerNames"],
        "userInterfaceLanguages": ["watchUserInterfaceLanguages"]
    }]);
_GxIdeNewKb_advancedTabHasBeenRendered = new WeakMap(), _GxIdeNewKb_componentLocale = new WeakMap(), _GxIdeNewKb_frontEndsCheckedMap = new WeakMap(), _GxIdeNewKb_selectedPrototypingEnvironmentId = new WeakMap(), _GxIdeNewKb_selectedDataSourceId = new WeakMap(), _GxIdeNewKb_shortcutsSrc = new WeakMap(), _GxIdeNewKb_kbSectionsModel = new WeakMap(), _GxIdeNewKb_authenticationTypeEl = new WeakMap(), _GxIdeNewKb_collationEl = new WeakMap(), _GxIdeNewKb_createDataFilesInKBFolderEl = new WeakMap(), _GxIdeNewKb_databaseNameEl = new WeakMap(), _GxIdeNewKb_dataSourceEl = new WeakMap(), _GxIdeNewKb_kbNameEl = new WeakMap(), _GxIdeNewKb_locationEl = new WeakMap(), _GxIdeNewKb_locationModeEl = new WeakMap(), _GxIdeNewKb_locationModeModel = new WeakMap(), _GxIdeNewKb_locationElRegistered = new WeakMap(), _GxIdeNewKb_passwordEl = new WeakMap(), _GxIdeNewKb_prototypingEnvironmentEl = new WeakMap(), _GxIdeNewKb_prototypingTargetEl = new WeakMap(), _GxIdeNewKb_savePasswordEl = new WeakMap(), _GxIdeNewKb_serverNameEl = new WeakMap(), _GxIdeNewKb_userInterfaceLanguageEl = new WeakMap(), _GxIdeNewKb_userNameEl = new WeakMap(), _GxIdeNewKb_chShortcutsEl = new WeakMap(), _GxIdeNewKb_handlerAuthenticationTypeInput = new WeakMap(), _GxIdeNewKb_handlerServerNameInput = new WeakMap(), _GxIdeNewKb_prototypingEnvironmentValueChangedHandler = new WeakMap(), _GxIdeNewKb_prototypingTargetValueChangedHandler = new WeakMap(), _GxIdeNewKb_dataSourceValueChangedHandler = new WeakMap(), _GxIdeNewKb_renderAdvanced = new WeakMap(), _GxIdeNewKb_renderBasic = new WeakMap(), _GxIdeNewKb_cancelKbHandler = new WeakMap(), _GxIdeNewKb_createKbHandler = new WeakMap(), _GxIdeNewKb_evaluateCreateDataCheckboxEnabled = new WeakMap(), _GxIdeNewKb_evaluateTooltipRender = new WeakMap(), _GxIdeNewKb_evaluateUserInputsDisplay = new WeakMap(), _GxIdeNewKb_frontEndCheckboxInputHandler = new WeakMap(), _GxIdeNewKb_updateFrontEndsCheckedMap = new WeakMap(), _GxIdeNewKb_getPrototypingEnvironments = new WeakMap(), _GxIdeNewKb_getDataSources = new WeakMap(), _GxIdeNewKb_initialSetupAdvancedTab = new WeakMap(), _GxIdeNewKb_initializeValidatableControlsBasicTab = new WeakMap(), _GxIdeNewKb_initializeValidatableControlsAdvancedTab = new WeakMap(), _GxIdeNewKb_selectLocationHandler = new WeakMap(), _GxIdeNewKb_locationModeChangeHandler = new WeakMap(), _GxIdeNewKb_tabSelectionChangedHandler = new WeakMap(), _GxIdeNewKb_updateFrontEnds = new WeakMap();
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["gx-ide-new-kb"];
    components.forEach(tagName => { switch (tagName) {
        case "gx-ide-new-kb":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, GxIdeNewKb$1);
            }
            break;
    } });
}

const GxIdeNewKb = GxIdeNewKb$1;
const defineCustomElement = defineCustomElement$1;

export { GxIdeNewKb, defineCustomElement };

//# sourceMappingURL=gx-ide-new-kb.js.map