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

import { g as a } from "./p-d42e842b.js";

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

import "lit";

import "lit/directives/when.js";

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

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

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

import { r as o } from "./p-2eae8843.js";

import { f as c } from "./p-4d330836.js";

import { c as d } from "./p-c5196b3b.js";

import { C as p } from "./p-e2b6d62b.js";

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

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

const mapObjectTypeToComboBoxItemModel = e => e.map((e => ({
  value: e.id,
  caption: e.name,
  startImgSrc: e.icon
})));

const u = '.custom-icon-text-wrapper {\n  display: flex;\n  align-items: center;\n  gap: var(--spacing-gap-m);\n}\n\n.warning-error-description {\n  display: flex;\n  align-items: center;\n  gap: var(--spacing-gap-m);\n  padding: var(--spacing-padding-m);\n  max-inline-size: 800px;\n  line-height: var(--line-height-spacious);\n}\n\n.warning-error-icon {\n  flex-shrink: 0;\n}\n\n/*@container queries*/\n/* hiChar styles\nFound on /common/helpers.tsx hiChar function is used to add a span/class to every character that matches a search value. It is used to help the user see why the filter results are filtered. The span/class on the characters are useless without proper styling.\n*/\nbutton.button-secondary {\n  border-color: var(--color-border-neutral-default);\n}\n\n:host {\n  --pill-border-radius: 12px;\n  --pill-padding-inline: var(--spacing-padding-m);\n  --pill-padding-block: var(--spacing-padding-xxs);\n  --pill-font-size: var(--font-size-body-s);\n  display: grid;\n  block-size: 100%;\n  overflow: auto;\n  grid-template-rows: max-content max-content 1fr;\n}\n\n.detail__version, .detail__knowledge-base {\n  padding-inline: var(--spacing-padding-xxl);\n  border-inline-end: 1px solid var(--color-border-surface-on-elevation-1);\n}\n\n.detail__genexus-server {\n  padding-inline-end: var(--spacing-padding-xxl);\n  border-inline-end: 1px solid var(--color-border-surface-on-elevation-1);\n}\n\n.detail__last-full-update {\n  padding-inline-start: var(--spacing-padding-xxl);\n}\n\n.section {\n  display: contents;\n}\n\n.header {\n  display: grid;\n  grid-template-columns: 1fr max-content;\n}\n\n.header__detail {\n  display: grid;\n  row-gap: var(--spacing-gap-xl);\n  grid-auto-columns: max-content;\n  grid-auto-rows: max-content;\n  grid-template-areas: "detail-heading-gx . . ." "detail-genexus-server detail-knowledge-base detail-version detail-last-full-update";\n}\n\n.detail__label {\n  color: var(--color-text-neutral-disabled);\n}\n\n.detail__heading-genexus-server {\n  grid-area: detail-heading-gx;\n}\n\n.detail__genexus-server {\n  grid-area: detail-genexus-server;\n}\n.detail__genexus-server > a {\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  display: inline-block;\n}\n\n.detail__link {\n  align-items: start;\n  color: var(--color-text-primary-default);\n  text-decoration: underline;\n}\n.detail__link:hover {\n  color: var(--color-text-primary-hover);\n}\n.detail__link:active {\n  color: var(--color-text-primary-pressed);\n}\n\n.detail__knowledge-base {\n  grid-area: detail-knowledge-base;\n}\n\n.detail__version {\n  grid-area: detail-version;\n}\n\n.detail__last-full-update {\n  grid-area: detail-last-full-update;\n}\n\n.filter-container {\n  container-type: inline-size;\n  box-sizing: border-box;\n}\n\n.filter {\n  display: grid;\n  margin-block-start: var(--spacing-padding-xxl);\n  grid-template-areas: "filter-search filter-types filter-actions filter-kb-properties filter-buttons";\n  grid-template-columns: 200px 200px 200px max-content 1fr;\n}\n\n@container (max-width: 1100px) {\n  .filter-container > .filter {\n    grid-template-columns: 200px 200px 200px 1fr;\n    grid-template-areas: "filter-search filter-types filter-actions filter-buttons" "filter-kb-properties . . .";\n    grid-auto-rows: max-content;\n  }\n}\n@container (max-width: 900px) {\n  .filter-container > .filter {\n    grid-template-columns: 1fr 1fr 1fr;\n    grid-template-areas: "filter-search filter-types filter-actions" "filter-kb-properties filter-buttons filter-buttons";\n    grid-auto-rows: max-content;\n  }\n}\n.filter__search {\n  grid-area: filter-search;\n}\n\n.filter__types {\n  grid-area: filter-types;\n}\n\n.filter__actions {\n  grid-area: filter-actions;\n}\n\n.filter__kb-properties {\n  grid-area: filter-kb-properties;\n}\n\n.filter__buttons {\n  margin-inline-start: auto;\n  grid-area: filter-buttons;\n}\n\n.main {\n  position: relative;\n  display: grid;\n  overflow: auto;\n}\n\n.loader {\n  position: relative;\n  inline-size: 100%;\n  block-size: 100%;\n  inset-block-start: 0;\n}\n\n.tabular-grid {\n  border-radius: 4px;\n  overflow: hidden;\n}\n\n.empty-state {\n  block-size: 100%;\n}\n\n.loader {\n  --elevation-background-color: var(--color-accent-surface-elevation-1);\n}\n\n.messages-list {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  max-inline-size: 800px;\n  padding: var(--spacing-padding-m) 0;\n  list-style-type: none;\n  display: flex;\n  flex-direction: column;\n  gap: var(--spacing-gap-xxs);\n}\n\n.message-description {\n  line-height: var(--line-height-spacious);\n  display: flex;\n  align-items: center;\n  gap: var(--spacing-gap-m);\n}\n\n.message-icon {\n  flex-shrink: 0;\n}\n\n.tabular-grid.empty-result::part(main) {\n  overflow: hidden;\n}\n\n.input-comments-container {\n  position: relative;\n}\n\n.input-comments {\n  --control-border-color: transparent;\n  padding-block: 0 !important;\n  padding-inline: 0 !important;\n  --line-height-tight: 1.4;\n  block-size: 100%;\n  background-color: var(--color-accent-surface-surface);\n  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;\n}\n\n.input-comments:focus {\n  position: absolute;\n  block-size: 200px;\n  inline-size: 100%;\n  z-index: 99;\n  background-color: var(--color-accent-surface-elevation-1);\n  padding-block: var(--control-padding-block) !important;\n  padding-inline: var(--control-padding-inline) !important;\n}\n\nch-tabular-grid-cell.tabular-grid-cell::part(actions-icon) {\n  background-size: contain;\n  margin-inline-end: 0;\n  --icon-path: var(--icon__gemini-tools_show-more-vertical_neutral--enabled);\n  cursor: pointer;\n}\nch-tabular-grid-cell.tabular-grid-cell::part(actions-icon):hover {\n  --icon-path: var(--icon__gemini-tools_show-more-vertical_neutral--hover);\n}\nch-tabular-grid-cell.tabular-grid-cell::part(actions-icon):active {\n  --icon-path: var(--icon__gemini-tools_show-more-vertical_neutral--active);\n}\n\n.tabular-grid-row-actions::part(main),\n.property-grid-row-actions::part(main) {\n  gap: 0 !important;\n}\n\n.tabular-grid-row-actions > button {\n  justify-content: start;\n}\n\n.pill {\n  --pill-background-color: transparent;\n  --pill-color: transparent;\n  --pill-border-color: transparent;\n  background-color: var(--pill-background-color);\n  color: var(--pill-color);\n  border: 1px solid var(--pill-border-color);\n  inline-size: 100%;\n  padding: var(--pill-padding-block) var(--pill-padding-inline);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: var(--pill-border-radius);\n  position: relative;\n  font-weight: var(--font-style-semi-bold);\n}\n.pill--update, .pill--pending {\n  --pill-background-color: var();\n  --pill-color: var(--color-text-neutral-disabled);\n  --pill-border-color: var();\n}\n.pill--to-merge-marked {\n  --pill-background-color: var();\n  --pill-color: var(--color-border-primary-default);\n  --pill-border-color: var();\n}\n.pill--ignored {\n  --pill-background-color: var(--color-accent-surface-elevation-2);\n  --pill-color: var(--color-text-neutral-on-disabled);\n  --pill-border-color: var(--color-border-neutral-default);\n}\n.pill--pending {\n  --pill-background-color: var(--color-accent-neutral-contrast);\n  --pill-color: var(--color-border-primary-default);\n  --pill-border-color: var(--color-accent-primary-pressed);\n}\n.pill--warning {\n  --pill-background-color: var(--color-accent-warning-contrast);\n  --pill-color: var(--color-border-warning-default);\n  --pill-border-color: var(--color-border-warning-default);\n}\n.pill--error {\n  --pill-background-color: var(--color-accent-error-contrast);\n  --pill-color: var(--color-border-error-default);\n  --pill-border-color: var(--color-border-error-light);\n}\n.pill--updated {\n  --pill-background-color: var(--color-accent-success-contrast);\n  --pill-color: var(--color-border-success-default);\n  --pill-border-color: var(--color-accent-success-default);\n}\n.pill--transitioning {\n  --pill-color: transparent;\n}\n\n.updating-spinner-caption {\n  display: flex;\n  align-items: center;\n  gap: var(--spacing-gap-m);\n  --status-circle-color: transparent;\n  --status-circle-size: $size;\n  --status-circle-inset-inline-start: 16px;\n  --pill-color: var(--color-border-primary-default);\n}\n.updating-spinner-caption::before {\n  display: inline-block;\n  content: "";\n  width: 16px;\n  height: 16px;\n  border: calc(16px / 7) solid var(--color-accent-primary-pressed);\n  border-top: calc(16px / 7) solid var(--color-border-primary-on-default);\n  border-radius: 50%;\n  animation: spin var(--timing-regular) linear infinite;\n}\n@keyframes spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n.tabular-grid .button-secondary {\n  --control-padding-block: var(--pill-padding-block);\n  --control-padding-inline: var(--pill-padding-inline);\n  font-size: inherit;\n  font-weight: inherit;\n  /* font-size: var(--pill-font-size); */\n}\n\n.tabular-grid .tabular-grid-cell--for-pill {\n  padding-block: 0;\n  align-items: center;\n  justify-content: center;\n}\n\n.tabular-grid.disabled-custom-selector .tabular-grid-cell::part(selector-label),\n.tabular-grid.disabled-custom-selector .tabular-grid-column::part(bar-selector),\n.tabular-grid.disabled-custom-selector .tabular-grid-cell::part(actions-icon) {\n  pointer-events: none;\n  opacity: 0.5;\n}\n\n.tabular-grid-column--settings-custom-selector,\n.tabular-grid-cell--settings-custom-selector {\n  padding-block: 0;\n  padding-inline: 0;\n}\n\n.tabular-grid-cell::part(actions-icon) {\n  padding-block: var(--spacing-padding-m);\n}\n\nch-tabular-grid-cell.tabular-grid-cell::part(actions-icon) {\n  block-size: 100%;\n  display: block;\n  background-size: 16px;\n  padding-inline: var(--spacing-padding-xl);\n}\n\n.tabular-grid-cell.no-checkbox-custom-selector::part(selector-label) {\n  visibility: hidden;\n  pointer-events: none;\n}\n\n.tabular-grid-row-actions::part(window) {\n  background-color: var(--color-accent-surface-elevation-2) !important;\n}\n\n.tabular-grid-row .tabular-grid-cell:nth-child(3) {\n  min-inline-size: 200px;\n}';

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

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

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

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

const q = "true";

const H = "false";

const V = "detail__label body-semi-bold-s";

// icons
const X = a({
  category: "system",
  name: "add",
  colorType: "on-surface"
});

const Y = a({
  category: "system",
  name: "edit",
  colorType: "on-surface"
});

const B = a({
  category: "window-tools",
  name: "filter",
  colorType: "on-surface"
});

const G = a({
  category: "system",
  name: "search",
  colorType: "on-surface"
});

const J = a({
  category: "system",
  name: "substract",
  colorType: "on-surface"
});

const K = a({
  category: "system",
  name: "warning",
  colorType: "warning"
});

const Q = a({
  category: "system",
  name: "error",
  colorType: "error"
});

const Z = a({
  category: "system",
  name: "check ",
  colorType: "success"
});

const ee = a({
  category: "system",
  name: "information",
  colorType: "on-surface"
});

const te = a({
  category: "gemini-tools",
  name: "reset",
  colorType: "interactive"
});

const ne = class {
  constructor(n) {
    e(this, n);
    /**
         * The component hard-coded strings translations.
         */
    // eslint-disable-next-line @stencil-community/own-props-must-be-private
        b.set(this, void 0);
    m.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.
         */    v.set(this, true);
    w.set(this, void 0);
    y.set(this, (async () => {
      g(this, x, "f").call(this, [ ...this.markedObjectsSet ]);
    }));
    k.set(this, (async () => {
      g(this, O, "f").call(this, true);
    }));
    x.set(this, (async e => {
      this.updating = true;
      e.forEach((e => {
        this.objectsStatusMap.set(e, "updating");
      }));
      const t = await this.updateCallback(e);
      t.forEach((async e => {
        const t = e.messages;
        if (t.length) {
          this.objectsMessagesDataMap.set(e.id, e.messages);
        } else {
          // clear messages
          this.objectsMessagesDataMap.delete(e.id);
        }
        if (e.result === "updated") {
          this.alreadyUpdatedObjectsIdsSet = new Set(this.alreadyUpdatedObjectsIdsSet).add(e.id);
          this.objectsStatusMap.set(e.id, "updated");
          await g(this, w, "f").markRow(e.id, false);
        } else {
          this.objectsStatusMap.set(e.id, "pending");
        }
      }));
      this.updating = false;
    }));
    _.set(this, (e => {
      let n;
      let i;
      let a;
      if (e === "deleted") {
        n = J;
        i = g(this, b, "f").actions.delete;
        a = "--color-icon-error-default";
      } else if (e === "inserted") {
        n = X;
        i = g(this, b, "f").actions.insert;
        a = "--color-icon-success-default";
      } else if (e === "modified") {
        n = Y;
        i = g(this, b, "f").actions.modify;
        a = "--color-icon-warning-default";
      } else if (e === "modified-with-conflicts") {
        n = K;
        i = g(this, b, "f").actions.modifyWithConflicts;
        a = "--color-icon-warning-default";
      } else if (!e) {
        // proably is "ignored"
        return null;
      }
      return t("span", {
        class: "custom-icon-text-wrapper"
      }, t("ch-image", {
        type: "mask",
        class: "icon-s",
        src: n,
        style: {
          backgroundColor: `var(${a})`
        }
      }), `${i}`);
    }));
    M.set(this, (e => async () => {
      const t = new Map(this.objectsStatusMap);
      t.set(e, "updating");
      this.objectsStatusMap = t;
      g(this, x, "f").call(this, [ e ]);
    }));
    z.set(this, (e => {
      const n = this.objectsStatusMap.get(e);
      const i = n === "pending" && this.updatePillAsButton ? g(this, b, "f").status.update : g(this, b, "f").status[n];
      if (n === "updating") {
        return t("span", {
          class: "updating-spinner-caption"
        }, i);
      }
      const a = `pill pill--${n}`;
      if (this.updatePillAsButton && n === "pending") {
        return t("button", {
          class: "button-secondary pill pill--update",
          onClick: g(this, M, "f").call(this, e)
        }, i);
      } else {
        return t("span", {
          class: a
        }, i);
      }
    }));
    C.set(this, (e => {
      let n;
      if (e === "pending") {
        n = this.pendingObjectsAfterActionFilter;
      } else if (e === "ignored") {
        n = this.ignoredObjectsAfterActionFilter;
      }
      return n.map((n => {
        const i = {
          id: n.id,
          icon: n.typeIcon,
          name: n.type
        };
        const a = this.alreadyUpdatedObjectsIdsSet.has(n.id);
        const s = a || e === "ignored";
        const r = this.markedObjectsSet.has(n.id);
        const l = this.objectsMessagesDataMap.get(n.id);
        return t("ch-tabular-grid-row", {
          class: "tabular-grid-row",
          key: n.id,
          rowid: n.id,
          ref: e => r && (e === null || e === void 0 ? void 0 : e.setAttribute("marked", "true"))
        }, t("ch-tabular-grid-cell", {
          "cell-type": "rich",
          "row-selector": "true",
          class: {
            "tabular-grid-cell": true,
            "no-checkbox-custom-selector": s
          },
          size: "max-content"
        }, n.name), t("ch-tabular-grid-cell", {
          class: "tabular-grid-cell"
        }, o(i)), t("ch-tabular-grid-cell", {
          class: "tabular-grid-cell"
        }, n.description), t("ch-tabular-grid-cell", {
          class: "tabular-grid-cell"
        }, c(n.modifiedOn)), t("ch-tabular-grid-cell", {
          class: "tabular-grid-cell"
        }, g(this, _, "f").call(this, n.action)), t("ch-tabular-grid-cell", {
          class: "tabular-grid-cell tabular-grid-cell--for-pill"
        }, g(this, z, "f").call(this, n.id)), (l === null || l === void 0 ? void 0 : l.length) && t("ch-tabular-grid-rowset", {
          class: "tabular-grid-rowset"
        }, t("ch-tabular-grid-rowset-empty", {
          class: {
            "tabular-grid-rowset-empty": true
          }
        }, t("ul", {
          class: "messages-list"
        }, l.map((e => {
          let n;
          if (e.type === "error") {
            n = Q;
          } else if (e.type === "warning") {
            n = K;
          } else if (e.type === "success") {
            n = Z;
          } else {
            // info
            n = ee;
          }
          return t("li", {
            class: "message-description"
          }, t("ch-image", {
            class: "icon-s message-icon",
            src: n
          }), e.text);
        }))))));
      }));
    }));
    j.set(this, (async e => {
      const t = e.detail.rowsId;
      this.markedObjectsSet = new Set(t.filter((e => !this.alreadyUpdatedObjectsIdsSet.has(e))));
      if (g(this, v, "f")) {
        g(this, S, "f").call(this, e);
      }
    }));
    S.set(this, (async e => {
      f(this, v, false, "f");
      const t = e.detail.addedRowsId;
      const n = e.detail.removedRowsId;
      try {
        const e = await this.pendingItemsCheckedCallback({
          itemsChecked: t,
          itemsUnchecked: n
        });
        if (e === undefined) {
          // undo check/uncheck
          await g(this, L, "f").call(this, t, n);
        } else {
          await g(this, P, "f").call(this, e);
        }
      } catch (e) {
        //catch exception if necessary
      } finally {
        f(this, v, true, "f");
      }
    }));
    W.set(this, (e => {
      this.searchValue = e.detail;
      g(this, O, "f").call(this);
    }));
    // Local Methods Update
        I.set(this, (e => {
      this.selectedAction = e.detail;
      g(this, O, "f").call(this);
    }));
    T.set(this, (async e => {
      this.selectedType = e.detail;
      g(this, O, "f").call(this);
    }));
    N.set(this, (() => {
      this.pendingAndIgnored.pendingForUpdate.forEach((e => {
        var t;
        const n = (t = e.status) !== null && t !== void 0 ? t : "pending";
        this.objectsStatusMap.set(e.id, n);
        if (n === "updated") {
          this.alreadyUpdatedObjectsIdsSet.add(e.id);
        }
      }));
      this.pendingAndIgnored.ignoredObjects.forEach((e => {
        var t;
        const n = (t = e.status) !== null && t !== void 0 ? t : "ignored";
        this.objectsStatusMap.set(e.id, n);
      }));
    }));
    O.set(this, (async (e = false) => {
      const t = {
        search: this.searchValue,
        type: this.selectedType,
        kbProperties: this.kbPropertiesChecked,
        action: this.selectedAction
      };
      try {
        this.loading = true;
        this.objectsMessagesDataMap.clear();
        this.pendingAndIgnored = await this.loadCallback(t, e);
        g(this, N, "f").call(this);
        // Is is required to mark/check all objects after loadCallback.
                g(this, U, "f").call(this);
      } catch (e) {
        // Error handling for update operation
      } finally {
        this.loading = false;
      }
    }));
    /**
         * 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.
         **/    U.set(this, (() => {
      for (const e of this.pendingIdsSet) {
        if (!this.alreadyUpdatedObjectsIdsSet.has(e)) {
          this.markedObjectsSet = new Set([ ...this.markedObjectsSet, e ]);
        }
      }
    }));
    E.set(this, (() => {
      // this.pendingObjectsAfterActionFilter = this.#filteredObjects(
      //   this.pendingAndIgnored.pendingForUpdate
      // );
      this.pendingObjectsAfterActionFilter = this.pendingAndIgnored.pendingForUpdate;
      // this.ignoredObjectsAfterActionFilter = this.#filteredObjects(
      //   this.pendingAndIgnored.ignoredObjects
      // );
            this.ignoredObjectsAfterActionFilter = this.pendingAndIgnored.ignoredObjects;
    }));
    // #filteredObjects = (objects: ModifiedObject[]): ModifiedObject[] => {
    //   let filtered = objects;
    //   // name or description
    //   if (this.searchValue.length) {
    //     filtered = filtered.filter(object => {
    //       const nameFiltered = object.name
    //         .toLowerCase()
    //         .includes(this.searchValue.toLowerCase());
    //       const descriptionFiltered = object.description
    //         .toLowerCase()
    //         .includes(this.searchValue.toLowerCase());
    //       return nameFiltered || descriptionFiltered;
    //     });
    //   }
    //   return filtered;
    // };
        A.set(this, (() => async e => {
      e.preventDefault();
      e.stopPropagation();
      const t = await g(this, w, "f").getSelectedRows();
      const n = (await g(this, w, "f").getSelectedCell()).rowId;
      const i = this.pendingIdsSet.has(n) ? "pending" : "ignored";
      let a = [];
      // remove selected rows from the other source, if any.
            if (t.length > 1 && i === "pending") {
        t.forEach((async e => {
          if (this.ignoredIdsSet.has(e)) {
            await g(this, w, "f").selectRow(e, false);
          } else {
            a.push(e);
          }
        }));
      } else if (t.length > 1 && i === "ignored") {
        t.forEach((async e => {
          if (this.pendingIdsSet.has(e)) {
            await g(this, w, "f").selectRow(e, false);
          } else {
            a.push(e);
          }
        }));
      } else {
        a = t;
      }
      await this.contextMenuCallback(i, {
        selection: a,
        clientX: e.detail.clientX,
        clientY: e.detail.clientY
      });
    }));
    L.set(this, (async (e, t) => {
      if (g(this, w, "f")) {
        for (const t of e) {
          await g(this, w, "f").markRow(t, false);
        }
        for (const e of t) {
          await g(this, w, "f").markRow(e, true);
        }
      }
    }));
    P.set(this, (async e => {
      if (g(this, w, "f")) {
        const t = e.itemsToCheck;
        const n = e.itemsToUncheck;
        // check
                for (const e of t) {
          await g(this, w, "f").markRow(e, true);
        }
        // uncheck
                for (const e of n) {
          await g(this, w, "f").markRow(e, false);
        }
      }
    }));
    R.set(this, (e => {
      this.kbPropertiesChecked = e.detail === q;
      g(this, O, "f").call(this, true);
    }));
    $.set(this, (e => {
      const t = e.detail.columnId;
      let n;
      let i = "string";
      if (t === p.lastSynchronized) {
        i = "dateString";
      }
      this.pendingObjectsAfterActionFilter = [ ...h(e, this.pendingObjectsAfterActionFilter, i, n) ];
      this.ignoredObjectsAfterActionFilter = [ ...h(e, this.ignoredObjectsAfterActionFilter, i, n) ];
    }));
    /**
         * 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
         */    D.set(this, (async e => {
      const t = e.detail;
      if (t) {
        const e = await g(this, w, "f").getMarkedRows();
        const t = e.filter((e => this.ignoredIdsSet.has(e)));
        if (t.length) {
          r(t, g(this, w, "f"));
        }
      }
    }));
    this.atLeastOneObjectIsChecked = false;
    this.loading = true;
    this.menuContextAction = undefined;
    this.searchValue = "";
    this.selectedAction = "all-actions";
    this.markedObjectsSet = new Set([]);
    this.alreadyUpdatedObjectsIdsSet = new Set([]);
    this.pendingIdsSet = new Set([]);
    this.ignoredIdsSet = new Set([]);
    this.objectsMessagesDataMap = new Map;
    this.updating = false;
    this.allPendingAreUpdated = false;
    this.kbPropertiesChecked = false;
    this.typesComboBoxModel = undefined;
    this.selectedType = undefined;
    this.isUpdateDisabled = false;
    this.objectsStatusMap = new Map;
    this.contextMenuCallback = undefined;
    this.pendingAndIgnored = {
      pendingForUpdate: [],
      ignoredObjects: []
    };
    this.pendingObjectsAfterActionFilter = [];
    this.ignoredObjectsAfterActionFilter = [];
    this.loadCallback = undefined;
    this.pendingItemsCheckedCallback = undefined;
    this.types = undefined;
    this.updatePillAsButton = false;
    this.updateCallback = undefined;
    this.openServerCallback = undefined;
    this.updateFrom = undefined;
  }
  markedObjectsSetChanged(e) {
    this.atLeastOneObjectIsChecked = e.size > 0;
  }
  alreadyUpdatedObjectsIdsSetChanged(e) {
    const t = l(e, this.pendingIdsSet);
    this.allPendingAreUpdated = t && this.pendingIdsSet.size > 0;
  }
  objectsStatusMapChanged(e) {
    const t = [ ...e.entries() ].find((([, e]) => e === "updating"));
    if (!t) {
      this.updating = false;
    }
  }
  pendingAndIgnoredChanged() {
    this.pendingIdsSet.clear();
 // before pendingIdsSet.add
        this.ignoredIdsSet.clear();
 // before pendingIdsSet.add
        this.objectsMessagesDataMap = new Map;
    this.alreadyUpdatedObjectsIdsSet = new Set;
    this.markedObjectsSet = new Set;
 // before #markPendingObjects
        this.pendingAndIgnored.pendingForUpdate.forEach((e => {
      this.pendingIdsSet.add(e.id);
    }));
    this.pendingAndIgnored.ignoredObjects.forEach((e => {
      this.ignoredIdsSet.add(e.id);
    }));
    g(this, U, "f").call(this);
 // after pendingIdsSet.add and ignoredIdsSet.add
        g(this, N, "f").call(this);
 // after pendingIdsSet.add and ignoredIdsSet.add
        g(this, E, "f").call(this);
  }
  async componentWillLoad() {
    var e;
    f(this, b, await s.getComponentStrings(this.el), "f");
    // Initiate "actions" combo box filter
        f(this, m, [ {
      caption: g(this, b, "f").actions.allActions,
      value: "all-actions"
    }, {
      caption: g(this, b, "f").actions.insert,
      value: "inserted"
    }, {
      caption: g(this, b, "f").actions.modify,
      value: "modified"
    }, {
      caption: g(this, b, "f").actions.modifyWithConflicts,
      value: "modified-with-conflicts"
    }, {
      caption: g(this, b, "f").actions.delete,
      value: "deleted"
    } ], "f");
    // Set type initial value
        this.selectedType = (e = this.types[0]) === null || e === void 0 ? void 0 : e.id;
    this.typesComboBoxModel = mapObjectTypeToComboBoxItemModel(this.types);
  }
  async componentDidLoad() {
    await g(this, O, "f").call(this, true);
    // initialize "allPendingAreUpdated"
        this.alreadyUpdatedObjectsIdsSetChanged(this.alreadyUpdatedObjectsIdsSet);
  }
  /**
     * Used by the host to instruct the component to force a data reload in the grids.
     */  async reload() {
    await g(this, O, "f").call(this, true);
  }
  /**
     * Used by the host to instruct the component to disable the update button.
     */  async disableUpdate(e) {
    this.isUpdateDisabled = e;
  }
  render() {
    const e = this.updating || this.loading || this.isUpdateDisabled;
    const i = this.pendingObjectsAfterActionFilter.length === 0 && this.ignoredObjectsAfterActionFilter.length === 0;
    return t(n, {
      class: "widget"
    }, t("ch-theme", {
      model: F
    }), t("section", {
      class: "section"
    }, t("header", {
      class: "header spacing-body-inline spacing-body-block-start"
    }, t("div", {
      // header details
      class: "header__detail header__detail-1"
    }, t("p", {
      class: "detail__heading-genexus-server subtitle-semi-bold-s"
    }, g(this, b, "f").commitDetail.title), t("div", {
      // genexus server
      class: "detail__genexus-server field field-block"
    }, t("span", {
      class: V
    }, g(this, b, "f").commitDetail.genexusServer), t("button", {
      class: "detail__link body-regular-s",
      onClick: this.openServerCallback
    }, this.updateFrom ? this.updateFrom.serverUrl : "")), t("div", {
      // knowledge base
      class: "detail__knowledge-base field field-block"
    }, t("span", {
      class: V
    }, g(this, b, "f").commitDetail.knowledgeBase), t("p", {
      class: "body-regular-s"
    }, this.updateFrom ? this.updateFrom.kbName : "")), t("div", {
      // version
      class: "detail__version field field-block"
    }, t("span", {
      class: V
    }, g(this, b, "f").commitDetail.version), t("p", {
      class: "body-regular-s"
    }, this.updateFrom ? this.updateFrom.versionName : "")), t("div", {
      // last full update
      class: "detail__last-full-update field field-block"
    }, t("span", {
      class: V
    }, g(this, b, "f").commitDetail.lastFullUpdate), t("p", {
      class: "body-regular-s"
    }, c(this.updateFrom.lastFullUpdate))))), t("div", {
      class: "filter-container spacing-body-inline"
    }, t("div", {
      class: "filter field-group"
    }, t("ch-edit", {
      // search
      class: "input filter__search",
      disabled: e,
      startImgSrc: G,
      accessibleName: g(this, b, "f").filter.searchAccessibleName,
      placeholder: g(this, b, "f").filter.searchPlaceholder,
      type: "search",
      onInput: g(this, W, "f"),
      debounce: d.inputDebounce
    }), t("ch-combo-box-render", {
      // types
      class: "combo-box filter__types",
      disabled: e,
      model: this.typesComboBoxModel,
      value: this.selectedType,
      accessibleName: g(this, b, "f").filter.typeAccesibleName,
      placeholder: g(this, b, "f").filter.typePlaceholder,
      onInput: g(this, T, "f")
    }), t("ch-combo-box-render", {
      // actions
      class: "combo-box filter__actions",
      disabled: e,
      model: g(this, m, "f"),
      value: this.selectedAction,
      onInput: g(this, I, "f"),
      accessibleName: g(this, b, "f").filter.actionAccesibleName,
      placeholder: g(this, b, "f").filter.actionPlaceholder
    }), t("ch-checkbox", {
      // kb properties
      class: "checkbox filter__kb-properties",
      caption: g(this, b, "f").filter.kbProperties,
      checkedValue: q,
      value: H,
      onInput: g(this, R, "f"),
      disabled: e
    }), t("div", {
      class: "buttons-spacer filter__buttons"
    }, t("button", {
      // reload button
      class: "button-secondary button-icon-and-text",
      disabled: e,
      onClick: g(this, k, "f")
    }, t("ch-image", {
      class: "icon-m",
      src: te
    }), g(this, b, "f").filter.reload), t("button", {
      // update button
      class: "button-primary button-update",
      disabled: !this.atLeastOneObjectIsChecked || e,
      onClick: g(this, y, "f")
    }, g(this, b, "f").filter.update)))), t("div", {
      class: "main spacing-body"
    }, !this.loading ? t("ch-tabular-grid", {
      class: {
        "tabular-grid": true,
        "objects-tabular-grid": true,
        "disabled-custom-selector": this.updating,
        "empty-result": i
      },
      keyboardNavigationMode: "focus",
      rowSelectionMode: "multiple",
      onRowMarkingChanged: g(this, j, "f"),
      onRowContextMenu: g(this, A, "f").call(this),
      ref: e => f(this, w, e, "f")
    }, t("ch-tabular-grid-columnset", {
      class: "tabular-grid-column-set"
    }, t("ch-tabular-grid-column", {
      class: "tabular-grid-column",
      columnId: p.name,
      columnName: g(this, b, "f").objects.name,
      columnType: "rich",
      richRowSelector: !this.allPendingAreUpdated,
      richRowSelectorMode: "mark",
      settingable: false,
      sortable: true,
      onColumnSortChanged: g(this, $, "f"),
      onColumnSelectorClicked: g(this, D, "f"),
      size: "max-content"
    }), t("ch-tabular-grid-column", {
      class: "tabular-grid-column",
      columnId: p.type,
      columnName: g(this, b, "f").objects.type,
      settingable: false,
      sortable: true,
      onColumnSortChanged: g(this, $, "f"),
      size: "max-content"
    }), t("ch-tabular-grid-column", {
      class: "tabular-grid-column",
      columnId: p.description,
      columnName: g(this, b, "f").objects.description,
      settingable: false,
      sortable: true,
      onColumnSortChanged: g(this, $, "f"),
      size: d.tabularGrid.colSize.description
    }), t("ch-tabular-grid-column", {
      class: "tabular-grid-column",
      columnId: p.modifiedOn,
      columnName: g(this, b, "f").objects.modifiedOn,
      settingable: false,
      sortable: true,
      onColumnSortChanged: g(this, $, "f"),
      size: "max-content"
    }), t("ch-tabular-grid-column", {
      class: "tabular-grid-column",
      columnId: p.action,
      columnName: g(this, b, "f").objects.action,
      settingable: false,
      sortable: false,
      size: "max-content"
    }), t("ch-tabular-grid-column", {
      // size of this column should the enough for the largest pill, and no more.
      // this prevents layout shifts when pills state changes.
      class: "tabular-grid-column",
      columnId: p.status,
      columnName: g(this, b, "f").objects.status,
      settingable: false,
      sortable: false,
      size: "100px"
    })), !i ? [ t("ch-tabular-grid-rowset", {
      class: "tabular-grid-rowset"
    }, t("ch-tabular-grid-rowset-legend", {
      class: "tabular-grid-rowset-legend"
    }, g(this, b, "f").objects.pending), g(this, C, "f").call(this, "pending")), t("ch-tabular-grid-rowset", {
      class: "tabular-grid-rowset"
    }, t("ch-tabular-grid-rowset-legend", {
      class: "tabular-grid-rowset-legend"
    }, g(this, b, "f").objects.ignored), g(this, C, "f").call(this, "ignored")) ] : null, t("ch-tabular-grid-rowset", {
      class: "tabular-grid-rowset"
    }, i && t("ch-tabular-grid-rowset-empty", null, t("gx-ide-empty-state", {
      class: "empty-state",
      isAnimated: true,
      stateIconSrc: B,
      stateTitle: "No object matched your filter"
    })))) : t("gx-ide-loader", {
      cancelLabel: g(this, b, "f").loader.cancelLabel,
      loaderTitle: g(this, b, "f").loader.title,
      description: g(this, b, "f").loader.description,
      show: true,
      class: "loader"
    }))));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/team-dev-update" ];
  }
  get el() {
    return i(this);
  }
  static get watchers() {
    return {
      markedObjectsSet: [ "markedObjectsSetChanged" ],
      alreadyUpdatedObjectsIdsSet: [ "alreadyUpdatedObjectsIdsSetChanged" ],
      objectsStatusMap: [ "objectsStatusMapChanged" ],
      pendingAndIgnored: [ "pendingAndIgnoredChanged" ]
    };
  }
};

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

ne.style = u;

export { ne as gx_ide_team_dev_update };
//# sourceMappingURL=p-f1b452fb.entry.js.map