import { h as t, r as i, H as e, a as s } from "./p-9b9ccd0c.js";

import { L as a } from "./p-311eedf3.js";

import { u as r, a as n } from "./p-c9b9e260.js";

import { r as o, a as l, C as d } from "./p-e2b6d62b.js";

import { s as c } from "./p-02fb496a.js";

import { A as h, C as p, I as f } from "./p-2eae8843.js";

import "./p-4d330836.js";

import "./p-9663f418.js";

import "./p-c5196b3b.js";

import "./p-d42e842b.js";

import "./p-6534555e.js";

import "lit";

import "lit/directives/when.js";

import "lit/directives/if-defined.js";

/**
 * Filters a grid selection to only include rows from the given source ("pending" or "ignored").
 * Rows from the other category are unselected.
 *
 * @param {SourceType} gridSource - The source category of the selection.
 * @param {string[]} selectedRowsIds - The currently selected row IDs.
 * @returns {string[]} Filtered row IDs belonging to the specified source.
 */ const clearGridSelection = (t, i, e, s, a) => {
  let r = [];
  if (i.length > 1 && t === "pending") {
    i.forEach((async t => {
      if (s.has(t)) {
        await a.selectRow(t, false);
      } else {
        r.push(t);
      }
    }));
  } else if (i.length > 1 && t === "ignored") {
    i.forEach((async t => {
      if (e.has(t)) {
        await a.selectRow(t, false);
      } else {
        r.push(t);
      }
    }));
  } else {
    r = i;
  }
  return r;
};

const headerDetail = (i = "text", e, s, a, r) => t("div", {
  class: {
    [r]: true,
    "field field-block": true
  }
}, t("span", {
  class: "detail__label body-semi-bold-s"
}, e), i === "text" ? t("p", {
  class: "body-regular-s"
}, s) : t("button", {
  class: "detail__link body-regular-s",
  onClick: a
}, s));

const headerTitle = (i, e) => t("h2", {
  class: {
    [e]: true,
    "header__title subtitle-semi-bold-s": true
  }
}, i);

const changesetToComboBoxModel = t => {
  if (!t) return [];
  return t.map((t => ({
    value: t.id,
    caption: t.name === "All" ? "All Changesets" : t.label || t.name || ""
  })));
};

const foldersToComboBoxModel = t => t.map((t => ({
  value: t.name,
  caption: t.name === "All" ? "All Modules" : t.label || t.name || ""
})));

const typesToComboBoxItemModel = t => t.map((t => ({
  value: t.id,
  caption: t.name === "All" ? "All Types" : t.name || "",
  startImgSrc: t.icon
})));

const g = '.detail__knowledge-base{padding-inline:var(--spacing-padding-xxl);border-inline-end:1px solid var(--color-border-surface-on-elevation-1)}.detail__genexus-server{padding-inline-end:var(--spacing-padding-xxl);border-inline-end:1px solid var(--color-border-surface-on-elevation-1)}.detail__version{padding-inline-start:var(--spacing-padding-xxl)}.filter,.filter-secondary>div{display:grid;gap:var(--spacing-gap-l)}:host{display:grid;block-size:100%;overflow:auto;grid-template-rows:max-content max-content 1fr;--pill-border-radius:12px;--pill-padding-inline:var(--spacing-padding-m);--pill-padding-block:var(--spacing-padding-xxs);--pill-font-size:var(--font-size-body-s)}.section{display:grid;display:contents}.header__details{display:grid;row-gap:var(--spacing-gap-xl);grid-auto-columns:max-content;grid-auto-rows:max-content;margin-block-end:var(--spacing-padding-xxl)}.detail__label{color:var(--color-text-neutral-disabled)}.detail__link{align-items:start;color:var(--color-text-primary-default);text-decoration:underline}.detail__link:hover{color:var(--color-text-primary-hover)}.detail__link:active{color:var(--color-text-primary-pressed)}.filter__combo{max-block-size:minmax(0, 200px)}.main{position:relative;display:grid;overflow:auto}.loader{position:relative;inline-size:100%;block-size:100%;inset-block-start:0;--elevation-background-color:var(--color-accent-surface-elevation-1)}.empty-state{block-size:100%}.tabular-grid.disabled-custom-selector .tabular-grid-cell::part(selector-label),.tabular-grid.disabled-custom-selector .tabular-grid-column::part(bar-selector),.tabular-grid.disabled-custom-selector .tabular-grid-cell::part(actions-icon){pointer-events:none;opacity:0.5}.tabular-grid-cell.no-checkbox-custom-selector::part(selector-label){visibility:hidden;pointer-events:none}.tabular-grid{border-radius:4px;overflow:hidden}.tabular-grid .tabular-grid-cell--for-pill{padding-block:0;align-items:center;justify-content:center}.tabular-grid .button-action-custom-selector{--control-padding-block:var(--pill-padding-block);--control-padding-inline:var(--pill-padding-inline);font-size:inherit;font-weight:inherit;}.tabular-grid.empty-result::part(main){overflow:hidden}.messages-list{margin:0;padding:0;list-style:none;max-inline-size:800px;padding:var(--spacing-padding-m) 0;list-style-type:none;display:flex;flex-direction:column;gap:var(--spacing-gap-xxs)}.message-description{line-height:var(--line-height-spacious);display:flex;align-items:center;gap:var(--spacing-gap-m)}.message-icon{flex-shrink:0}.pill{--pill-background-color:transparent;--pill-color:transparent;--pill-border-color:transparent;background-color:var(--pill-background-color);color:var(--pill-color);border:1px solid var(--pill-border-color);inline-size:100%;padding:var(--pill-padding-block) var(--pill-padding-inline);display:flex;align-items:center;justify-content:center;border-radius:var(--pill-border-radius);position:relative;font-weight:var(--font-style-semi-bold)}.pill--update,.pill--pending{--pill-background-color:var();--pill-color:var(--color-text-neutral-disabled);--pill-border-color:var()}.pill--to-merge-marked{--pill-background-color:var();--pill-color:var(--color-border-primary-default);--pill-border-color:var()}.pill--ignored{--pill-background-color:var(--color-accent-surface-elevation-2);--pill-color:var(--color-text-neutral-on-disabled);--pill-border-color:var(--color-border-neutral-default)}.pill--pending{--pill-background-color:var(--color-accent-neutral-contrast);--pill-color:var(--color-border-primary-default);--pill-border-color:var(--color-accent-primary-pressed)}.pill--warning{--pill-background-color:var(--color-accent-warning-contrast);--pill-color:var(--color-border-warning-default);--pill-border-color:var(--color-border-warning-default)}.pill--error{--pill-background-color:var(--color-accent-error-contrast);--pill-color:var(--color-border-error-default);--pill-border-color:var(--color-border-error-light)}.pill--committed{--pill-background-color:var(--color-accent-success-contrast);--pill-color:var(--color-border-success-default);--pill-border-color:var(--color-accent-success-default)}.pill--transitioning{--pill-color:transparent}.spinner-caption{display:flex;align-items:center;gap:var(--spacing-gap-m);--status-circle-color:transparent;--status-circle-size:$size;--status-circle-inset-inline-start:16px;--pill-color:var(--color-border-primary-default)}.spinner-caption::before{display:inline-block;content:"";width:16px;height:16px;border:calc(16px / 7) solid var(--color-accent-primary-pressed);border-top:calc(16px / 7) solid var(--color-border-primary-on-default);border-radius:50%;animation:spin var(--timing-regular) linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.hiChar{color:var(--color-text-primary-default);filter:brightness(1.3)}.custom-icon-text-wrapper{display:flex;align-items:center;gap:var(--spacing-gap-m)}.warning-error-description{display:flex;align-items:center;gap:var(--spacing-gap-m);padding:var(--spacing-padding-m);max-inline-size:800px;line-height:var(--line-height-spacious)}.warning-error-icon{flex-shrink:0}button.button-secondary{border-color:var(--color-border-neutral-default)}.header__details{grid-template-areas:"detail-heading-gx . . ." "detail-genexus-server detail-knowledge-base detail-version detail-last-full-update"}.detail__heading-genexus-server{grid-area:detail-heading-gx}.detail__genexus-server{grid-area:detail-genexus-server}.detail__knowledge-base{grid-area:detail-knowledge-base}.detail__version{grid-area:detail-version}.filter-container{container-type:inline-size;box-sizing:border-box;display:grid;column-gap:var(--spacing-gap-l);grid-template-areas:"filter-primary filter-toggle-button filter-action-buttons" "filter-secondary . ." "comments comments comments";grid-template-columns:minmax(0, max-content) max-content 1fr}.filter-primary{grid-area:filter-primary;grid-template-columns:minmax(0, 200px) minmax(0, 200px) minmax(0, 200px)}.filter-container>:nth-child(2){grid-area:filter-toggle-button}.filter-container>:nth-child(3){grid-area:filter-action-buttons;justify-content:end}.filter__toggle-secondary-filter-btn{grid-area:filter-toggle-button}.filter__buttons{grid-area:filter-buttons;margin-inline-start:auto}.filter-secondary{display:grid;grid-template-rows:0fr;grid-area:filter-secondary;transition:grid-template-rows var(--timing-fast)}.filter-secondary--visible{grid-template-rows:1fr}.filter-secondary>div{display:grid;overflow:hidden;font-size:0;grid-template-columns:repeat(3, minmax(0, 200px))}.filter-secondary>div>.combo-box,.comments{margin-block-start:var(--spacing-gap-l)}.comments{grid-area:comments}.input-comments-container{position:relative}.input-comments{--control-border-color:transparent;padding-block:0 !important;padding-inline:0 !important;--line-height-tight:1.4;block-size:100%;background-color:var(--color-accent-surface-surface);transition:var(--timing-super-fast) block-size, var(--timing-super-fast) background-color, var(--timing-super-fast) padding-block, var(--timing-super-fast) padding-inline}.input-comments:focus{position:absolute;block-size:minmax(0, 200px);inline-size:100%;z-index:99;background-color:var(--color-accent-surface-elevation-1);padding-block:var(--control-padding-block) !important;padding-inline:var(--control-padding-inline) !important}';

var u = undefined && undefined.__classPrivateFieldGet || function(t, i, e, s) {
  if (e === "a" && !s) throw new TypeError("Private accessor was defined without a getter");
  if (typeof i === "function" ? t !== i || !s : !i.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return e === "m" ? s : e === "a" ? s.call(t) : s ? s.value : i.get(t);
};

var m = undefined && undefined.__classPrivateFieldSet || function(t, i, e, s, a) {
  if (s === "m") throw new TypeError("Private method is not writable");
  if (s === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
  if (typeof i === "function" ? t !== i || !a : !i.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return s === "a" ? a.call(t, e) : a ? a.value = e : i.set(t, e), e;
};

var b, v, w, y, x, k, _, M, C, j, W, S, z, I, A, T, O, N, E, L, P, D, R, F, G, H, U;

const X = "filters-secondary-container";

const Y = "filter-toggle-button";

const $ = [ "resets/box-sizing", "components/tabular-grid", "utils/form--full", "utils/layout", "utils/typography", "utils/spacing", "chameleon/scrollbar" ];

const q = class {
  constructor(t) {
    i(this, t);
    /**
         * The component hard-coded strings translations.
         */
    // eslint-disable-next-line @stencil-community/own-props-must-be-private
        b.set(this, void 0);
    /**
         * The ComboBoxModel for "Local State" filter.
         */    v.set(this, void 0);
    /**
         * Used to determine if pendingItemsCheckedCallback callback has to be
         * called or not. It should be ignored if the grid checkboxes state is
         * changed programmatically, by setting markRow to false once the object
         * has been successfully updated, for example.
         */    w.set(this, true);
    /**
         * A reference to the tablar grid. Used to call methods.
         */    y.set(this, void 0);
    // commit related
        x.set(this, (() => {
      u(this, _, "f").call(this, [ ...this.markedObjectsSet ]);
    }));
    k.set(this, (t => async () => {
      const i = new Map(this.objectsStatusMap);
      i.set(t, "committing");
      this.objectsStatusMap = i;
      u(this, _, "f").call(this, [ t ]);
    }));
    _.set(this, (async t => {
      if (this.commentsValue.length === 0) {
        // A comment is required to commit.
        this.commentInputHasError = true;
        return;
      }
      this.commentInputHasError = false;
      this.committing = true;
      t.forEach((t => {
        this.objectsStatusMap.set(t, "committing");
      }));
      const i = await this.commitCallback(t, this.commentsValue);
      i.forEach((async t => {
        const i = t.messages;
        if (i.length) {
          this.objectsMessagesDataMap.set(t.id, t.messages);
        } else {
          // clear messages
          this.objectsMessagesDataMap.delete(t.id);
        }
        if (t.result === "committed") {
          // Apply a new Set to "alreadyCommittedObjectsIdsSet" in order for the Watch to fire.
          this.alreadyCommittedObjectsIdsSet = new Set([ ...this.alreadyCommittedObjectsIdsSet, t.id ]);
          this.objectsStatusMap.set(t.id, "committed");
          await u(this, y, "f").markRow(t.id, false);
        } else {
          this.objectsStatusMap.set(t.id, "pending");
        }
      }));
      this.committing = false;
      this.commentsValue = "";
    }));
    // handlers
        M.set(this, (async t => {
      const i = t.detail.rowsId;
      this.markedObjectsSet = new Set(i.filter((t => !this.alreadyCommittedObjectsIdsSet.has(t))));
      if (u(this, w, "f")) {
        u(this, L, "f").call(this, t);
      }
    }));
    C.set(this, (async t => {
      const i = t.detail.rowsId;
      const e = i[0];
      const s = this.pendingIdsSet.has(e) ? "pending" : "ignored";
      const a = clearGridSelection(s, i, this.pendingIdsSet, this.ignoredIdsSet, u(this, y, "f"));
      await this.selectCallback(s, a);
    }));
    j.set(this, (t => {
      this.commentsValue = t.detail;
      if (this.commentsValue.length && this.commentInputHasError) {
        // remove error style and tooltip
        this.commentInputHasError = false;
      }
    }));
    // filter related
        W.set(this, (() => {
      this.pendingObjectsAfterFilter = u(this, S, "f").call(this, this.pendingAndIgnored.pendingForCommit);
      this.ignoredObjectsAfterFilter = u(this, S, "f").call(this, this.pendingAndIgnored.ignoredObjects);
    }));
    S.set(this, (t => {
      let i = t;
      // name or description
            if (this.searchValue.length) {
        i = i.filter((t => {
          const i = t.name.toLowerCase().includes(this.searchValue.toLowerCase());
          const e = t.description.toLowerCase().includes(this.searchValue.toLowerCase());
          return i || e;
        }));
      }
      // status
            if (this.selectedState && this.selectedState !== h) {
        i = i.filter((t => t.state === this.selectedState));
      }
      return i;
    }));
    z.set(this, (() => {
      if (
      // this.selectedChangeset !== ALL_VALUE ||
      this.selectedFolder !== h) {
        this.filterSecondaryHasConditions = true;
      } else {
        this.filterSecondaryHasConditions = false;
      }
    }));
    I.set(this, (() => {
      this.filterSecondaryIsHidden = !this.filterSecondaryIsHidden;
    }));
    A.set(this, (t => {
      this.searchValue = t.detail.trim();
      u(this, W, "f").call(this);
    }));
    T.set(this, (t => {
      this.selectedType = t.detail;
      u(this, D, "f").call(this);
    }));
    O.set(this, (t => {
      this.selectedState = t.detail;
      u(this, W, "f").call(this);
    }));
    // changeset is a WIP.
    // #changesetChangedHandler = (event: CustomEvent<string> | InputEvent) => {
    //   this.selectedChangeset = event.detail as string;
    //   this.#loadData();
    //   this.#evaluateSecondaryFilterHasConditions();
    // };
        N.set(this, (t => {
      this.selectedFolder = t.detail;
      u(this, D, "f").call(this);
      u(this, z, "f").call(this);
    }));
    // #categoryChangedHandler = (event: CustomEvent<string> | InputEvent) => {
    //   this.selectedCategory = event.detail as string;
    //   this.#loadData();
    //   this.#evaluateSecondaryFilterHasConditions();
    // };
        E.set(this, (() => async t => {
      t.preventDefault();
      t.stopPropagation();
      const i = await u(this, y, "f").getSelectedRows();
      const e = i[0];
      const s = this.pendingIdsSet.has(e) ? "pending" : "ignored";
      await this.objectsContextMenuCallback(s, {
        selection: i,
        clientX: t.detail.clientX,
        clientY: t.detail.clientY
      });
    }));
    // other methods
        L.set(this, (async t => {
      m(this, w, false, "f");
      const i = t.detail.addedRowsId;
      const e = t.detail.removedRowsId;
      try {
        const t = await this.pendingItemsCheckedCallback({
          itemsChecked: i,
          itemsUnchecked: e
        });
        if (t === undefined) {
          // undo check/uncheck
          await u(this, F, "f").call(this, i, e);
        } else {
          await u(this, G, "f").call(this, t);
        }
      } catch (t) {
        //catch exception if necessary
      } finally {
        m(this, w, true, "f");
      }
    }));
    P.set(this, (() => {
      this.pendingAndIgnored.pendingForCommit.forEach((t => {
        const i = "pending";
        this.objectsStatusMap.set(t.id, i);
      }));
      this.pendingAndIgnored.ignoredObjects.forEach((t => {
        const i = "ignored";
        this.objectsStatusMap.set(t.id, i);
      }));
    }));
    D.set(this, (async () => {
      this.loading = true;
      this.pendingAndIgnored = await this.loadCallback({
        search: this.searchValue,
        type: this.selectedType,
        changeset: this.selectedChangeset,
        folder: this.selectedFolder,
        category: this.selectedCategory
      });
      this.loading = false;
      // Is is required to mark/check all objects after loadCallback.
      // this.#markPendingObjects();
        }));
    /**
         * Marks all pending objects that have not been committed yet.
         *
         * Iterates through all pending object IDs and adds them to the marked objects set
         * if they are not already in the committed objects set. This effectively identifies
         * and marks all the pending objects that still need to be processed.
         **/    R.set(this, (() => {
      for (const t of this.pendingIdsSet) {
        if (!this.alreadyCommittedObjectsIdsSet.has(t)) {
          this.markedObjectsSet = new Set([ ...this.markedObjectsSet, t ]);
        }
      }
    }));
    // render methods
        F.set(this, (async (t, i) => {
      if (u(this, y, "f")) {
        for (const i of t) {
          await u(this, y, "f").markRow(i, false);
        }
        for (const t of i) {
          await u(this, y, "f").markRow(t, true);
        }
      }
    }));
    G.set(this, (async t => {
      if (u(this, y, "f")) {
        const i = t.itemsToCheck;
        const e = t.itemsToUncheck;
        // check
                for (const t of i) {
          await u(this, y, "f").markRow(t, true);
        }
        // uncheck
                for (const t of e) {
          await u(this, y, "f").markRow(t, false);
        }
      }
    }));
    H.set(this, (t => {
      const i = t.detail.columnId;
      let e;
      let s = "string";
      if (i === d.type) {
        e = "name";
 // the type name
                s = "object";
      } else if (i === d.modifiedOn || i === d.lastSynchronized) {
        s = "dateString";
      }
      this.pendingObjectsAfterFilter = [ ...c(t, this.pendingObjectsAfterFilter, s, e) ];
      this.ignoredObjectsAfterFilter = [ ...c(t, this.ignoredObjectsAfterFilter, s, e) ];
    }));
    /**
         * WA: Ignored objects must always remain unchecked.
         * Because `tabular-grid` selects all rows when the checkbox column is toggled,
         * we need to manually unselect the ignored IDs. // TODO: Move this function
         * to common
         */    U.set(this, (async t => {
      const i = t.detail;
      if (i) {
        const t = await u(this, y, "f").getMarkedRows();
        const i = t.filter((t => this.ignoredIdsSet.has(t)));
        if (i.length) {
          r(i, u(this, y, "f"));
        }
      }
    }));
    this.allPendingAreCommitted = false;
    this.alreadyCommittedObjectsIdsSet = new Set([]);
    this.ignoredIdsSet = new Set([]);
    this.pendingIdsSet = new Set([]);
    this.markedObjectsSet = new Set([]);
    this.objectsStatusMap = new Map;
    this.objectsMessagesDataMap = new Map;
    this.atLeastOneObjectIsChecked = false;
    this.commentInputHasError = false;
    this.committing = false;
    this.filterSecondaryIsHidden = true;
    this.filterSecondaryHasConditions = false;
    this.loading = true;
    this.changesetsComboBoxModel = undefined;
    this.pendingObjectsAfterFilter = [];
    this.ignoredObjectsAfterFilter = [];
    this.typesComboBoxModel = [];
    this.pendingAndIgnored = {
      pendingForCommit: [],
      ignoredObjects: []
    };
    this.commentsValue = "";
    this.searchValue = "";
    this.selectedType = undefined;
    this.selectedState = h;
    this.selectedChangeset = undefined;
    this.selectedFolder = undefined;
    this.selectedCategory = undefined;
    this.foldersComboBoxModel = undefined;
    this.isCommitDisabled = false;
    this.commitCallback = undefined;
    this.objectsContextMenuCallback = undefined;
    this.loadCallback = undefined;
    this.openServerCallback = undefined;
    this.pendingItemsCheckedCallback = undefined;
    this.selectCallback = undefined;
    this.types = undefined;
    this.changeset = undefined;
    this.folders = undefined;
    this.updatePillAsButton = false;
    this.serverDetails = undefined;
  }
  alreadyCommittedObjectsIdsSetChanged(t) {
    const i = n(t, this.pendingIdsSet);
    this.allPendingAreCommitted = i && this.pendingIdsSet.size > 0;
  }
  markedObjectsSetChanged(t) {
    this.atLeastOneObjectIsChecked = t.size > 0;
  }
  objectsStatusMapChanged(t) {
    const i = [ ...t.entries() ].find((([, t]) => t === "committing"));
    if (!i) {
      this.committing = false;
    }
  }
  pendingAndIgnoredChanged(t) {
    var i, e;
    // clear previous state
        this.pendingIdsSet.clear();
 // before pendingIdsSet.add
        this.ignoredIdsSet.clear();
 // before ignoredIdsSet.add
        this.objectsMessagesDataMap = new Map;
    this.alreadyCommittedObjectsIdsSet = new Set;
    this.commentInputHasError = false;
    this.markedObjectsSet = new Set;
 // before #markPendingObjects
        (i = t.pendingForCommit) === null || i === void 0 ? void 0 : i.forEach((t => {
      this.pendingIdsSet.add(t.id);
    }));
    (e = t.ignoredObjects) === null || e === void 0 ? void 0 : e.forEach((t => {
      this.ignoredIdsSet.add(t.id);
    }));
    u(this, R, "f").call(this);
 // after pendingIdsSet.add and ignoredIdsSet.add
        u(this, P, "f").call(this);
 // after pendingIdsSet.add and ignoredIdsSet.add
        u(this, W, "f").call(this);
  }
  typesChanged(t) {
    this.typesComboBoxModel = typesToComboBoxItemModel(t);
  }
  changesetChanged(t) {
    this.changesetsComboBoxModel = changesetToComboBoxModel(t);
  }
  folderChanged(t) {
    this.foldersComboBoxModel = foldersToComboBoxModel(t);
  }
  async componentWillLoad() {
    m(this, b, await a.getComponentStrings(this.el), "f");
    // Initiate "actions" combo box filter
        m(this, v, [ {
      caption: u(this, b, "f").states.all,
      value: h
    }, {
      caption: u(this, b, "f").states.inserted,
      value: "inserted"
    }, {
      caption: u(this, b, "f").states.modified,
      value: "modified"
    }, {
      caption: u(this, b, "f").states.conflicted,
      value: "conflicted"
    }, {
      caption: u(this, b, "f").states.deleted,
      value: "deleted"
    } ], "f");
    // intialize combo-box models
        this.typesComboBoxModel = typesToComboBoxItemModel(this.types);
    this.selectedType = this.typesComboBoxModel[0].value;
    this.selectedState = u(this, v, "f")[0].value;
    this.changesetChanged(this.changeset);
    this.selectedChangeset = this.changesetsComboBoxModel.length > 0 ? this.changesetsComboBoxModel[0].value : h;
    this.folderChanged(this.folders);
    this.selectedFolder = this.foldersComboBoxModel && this.foldersComboBoxModel.length > 0 ? this.foldersComboBoxModel[0].value : h;
    // this.categoryChanged(this.categories);
    // this.selectedCategory =
    //   this.categoriesComboBoxModel.length > 0
    //     ? this.categoriesComboBoxModel[0].value
    //     : ALL_VALUE;
        u(this, z, "f").call(this);
  }
  async componentDidLoad() {
    await u(this, D, "f").call(this);
    // initialize "allPendingAreCommitted"
        this.alreadyCommittedObjectsIdsSetChanged(this.alreadyCommittedObjectsIdsSet);
  }
  /**
     * Used by the host to instruct the component to force a data reload in the grids.
     */  async reload() {
    await u(this, D, "f").call(this);
  }
  /**
     * Used by the host to instruct the component to disable the commit button.
     */  async disableCommit(t) {
    this.isCommitDisabled = t;
  }
  render() {
    const i = this.committing || this.loading || this.isCommitDisabled;
    const s = this.pendingObjectsAfterFilter.length === 0 && this.ignoredObjectsAfterFilter.length === 0;
    const a = this.filterSecondaryHasConditions ? f.filterWithConditions : f.filter;
    const r = this.atLeastOneObjectIsChecked && this.commentsValue.length > 0 && !this.allPendingAreCommitted && !this.isCommitDisabled;
    return t(e, {
      class: "widget"
    }, t("ch-theme", {
      model: $
    }), t("section", {
      class: "section"
    }, t("header", {
      class: {
        [p.HEADER]: true
      }
    }, t("div", {
      // header details
      class: {
        [p.HEADER_DETAILS]: true
      }
    }, headerTitle(u(this, b, "f").commitDetail.title), 
    // genexus server
    headerDetail("link", u(this, b, "f").commitDetail.genexusServer, this.serverDetails ? this.serverDetails.serverUrl : "", this.openServerCallback, "detail__genexus-server"), 
    // knowledge base
    headerDetail("text", u(this, b, "f").commitDetail.knowledgeBase, this.serverDetails ? this.serverDetails.kbName : "", undefined, "detail__knowledge-base"), 
    // version
    headerDetail("text", u(this, b, "f").commitDetail.version, this.serverDetails ? this.serverDetails.versionName : "", undefined, "detail__version"))), t("div", {
      class: "filter-container spacing-body-inline"
    }, t("div", {
      class: {
        [p.FILTER]: true,
        "filter-primary": true
      }
    }, t("ch-edit", {
      // searchch-edit
      class: "input filter__combo",
      disabled: i,
      startImgSrc: f.search,
      accessibleName: u(this, b, "f").filter.searchAccessibleName,
      placeholder: u(this, b, "f").filter.searchPlaceholder,
      type: "search",
      onInput: u(this, A, "f")
    }), t("ch-combo-box-render", {
      // types
      class: "combo-box filter__combo",
      disabled: i,
      model: this.typesComboBoxModel,
      value: this.selectedType,
      accessibleName: u(this, b, "f").filter.typeAccesibleName,
      placeholder: u(this, b, "f").filter.typePlaceholder,
      onInput: u(this, T, "f")
    }), t("ch-combo-box-render", {
      // local states
      class: "combo-box filter__combo",
      disabled: i,
      model: u(this, v, "f"),
      value: this.selectedState,
      onInput: u(this, O, "f"),
      accessibleName: u(this, b, "f").filter.localStateAccesibleName,
      placeholder: u(this, b, "f").filter.localStatePlaceholder
    })), t("button", {
      // toggle secondary filter button
      id: Y,
      class: "button-secondary button-icon-only",
      disabled: i,
      "aria-label": u(this, b, "f").filter.secondaryFilterAriaLabel,
      "aria-expanded": this.filterSecondaryIsHidden ? "false" : "true",
      "aria-controls": X,
      onClick: u(this, I, "f"),
      title: u(this, b, "f").filter.secondaryFilterAriaLabel
    }, t("ch-image", {
      class: "icon-m",
      src: a
    })), t("div", {
      class: "buttons-spacer"
    }, t("button", {
      // reload button
      class: "button-secondary button-icon-and-text",
      disabled: i,
      onClick: u(this, D, "f")
    }, t("ch-image", {
      class: "icon-m",
      src: f.refresh
    }), u(this, b, "f").filter.reload), t("button", {
      // commit button
      class: "button-primary",
      disabled: !r || i,
      onClick: u(this, x, "f")
    }, u(this, b, "f").filter.commit)), t("div", {
      // secondary filter
      id: X,
      "aria-labelledby": Y,
      class: {
        [p.FILTER]: true,
        "filter-secondary": true,
        "filter-secondary--visible": !this.filterSecondaryIsHidden
      },
      inert: this.filterSecondaryIsHidden,
      hidden: this.filterSecondaryIsHidden
    }, t("div", null, t("ch-combo-box-render", {
      // folder
      class: "combo-box",
      disabled: i,
      model: this.foldersComboBoxModel,
      value: this.selectedFolder,
      onInput: u(this, N, "f"),
      accessibleName: u(this, b, "f").filter.folderAccesibleName,
      placeholder: u(this, b, "f").filter.folderPlaceholder
    }))), t("ch-edit", {
      // commit comments
      class: "input comments",
      multiline: true,
      autoGrow: true,
      placeholder: u(this, b, "f").commitCommentPlaceholder,
      onInput: u(this, j, "f"),
      value: this.commentsValue
    })), t("div", {
      class: p.MAIN
    }, !this.loading ? t("ch-tabular-grid", {
      class: {
        "tabular-grid": true,
        "objects-tabular-grid": true,
        "disabled-custom-selector": this.committing,
        "empty-result": s
      },
      keyboardNavigationMode: "focus",
      rowSelectionMode: "multiple",
      onSelectionChanged: u(this, C, "f"),
      onRowMarkingChanged: u(this, M, "f"),
      onRowContextMenu: u(this, E, "f").call(this),
      ref: t => m(this, y, t, "f")
    }, o([ "action" ], s, u(this, H, "f"), u(this, U, "f"), u(this, b, "f"), !this.allPendingAreCommitted), !s ? [ t("ch-tabular-grid-rowset", {
      class: "tabular-grid-rowset"
    }, t("ch-tabular-grid-rowset-legend", {
      class: "tabular-grid-rowset-legend"
    }, u(this, b, "f").objects.pendingCommits), l("pending", this.pendingObjectsAfterFilter, this.ignoredObjectsAfterFilter, this.alreadyCommittedObjectsIdsSet, this.markedObjectsSet, this.objectsMessagesDataMap, this.updatePillAsButton, u(this, k, "f"), this.objectsStatusMap, this.searchValue, u(this, b, "f"))), t("ch-tabular-grid-rowset", {
      class: "tabular-grid-rowset"
    }, t("ch-tabular-grid-rowset-legend", {
      class: "tabular-grid-rowset-legend"
    }, u(this, b, "f").objects.ignoredObjects), l("ignored", this.pendingObjectsAfterFilter, this.ignoredObjectsAfterFilter, this.alreadyCommittedObjectsIdsSet, this.markedObjectsSet, this.objectsMessagesDataMap, this.updatePillAsButton, u(this, k, "f"), this.objectsStatusMap, this.searchValue, u(this, b, "f"))) ] : null, t("ch-tabular-grid-rowset", {
      class: "tabular-grid-rowset"
    }, s && t("ch-tabular-grid-rowset-empty", null, t("gx-ide-empty-state", {
      class: "empty-state",
      isAnimated: true,
      stateIconSrc: f.filter,
      stateTitle: "No object matched your filter"
    })))) : t("gx-ide-loader", {
      cancelLabel: u(this, b, "f").loader.cancelLabel,
      loaderTitle: u(this, b, "f").loader.title,
      description: u(this, b, "f").loader.description,
      show: true,
      class: "loader"
    }))));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/team-dev-commit" ];
  }
  get el() {
    return s(this);
  }
  static get watchers() {
    return {
      alreadyCommittedObjectsIdsSet: [ "alreadyCommittedObjectsIdsSetChanged" ],
      markedObjectsSet: [ "markedObjectsSetChanged" ],
      objectsStatusMap: [ "objectsStatusMapChanged" ],
      pendingAndIgnored: [ "pendingAndIgnoredChanged" ],
      types: [ "typesChanged" ],
      changeset: [ "changesetChanged" ],
      folders: [ "folderChanged" ]
    };
  }
};

b = new WeakMap, v = new WeakMap, w = new WeakMap, y = new WeakMap, x = new WeakMap, 
k = new WeakMap, _ = new WeakMap, M = new WeakMap, C = new WeakMap, j = new WeakMap, 
W = new WeakMap, S = new WeakMap, z = new WeakMap, I = new WeakMap, A = new WeakMap, 
T = new WeakMap, O = new WeakMap, N = new WeakMap, E = new WeakMap, L = new WeakMap, 
P = new WeakMap, D = new WeakMap, R = new WeakMap, F = new WeakMap, G = new WeakMap, 
H = new WeakMap, U = new WeakMap;

q.style = g;

export { q as gx_ide_team_dev_commit };
//# sourceMappingURL=p-cd9e9e2b.entry.js.map