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

const n = ":host{display:grid;block-size:100%}.opacity-0{opacity:0}.gxi-hidden{display:none !important}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-style-regular);font-size:var(--font-size-body-m);font-family:var(--font-family-body);height:100%;display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.buttons-container{display:flex;gap:var(--spacing-gap-m)}.giu-static-pill-icon-and-text,.giu-static-pill{background-color:var(--elevation-background-color, var(--color-accent-surface-elevation-1));padding-inline:var(--spacing-padding-m);color:var(--color-text-neutral-default);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-weight:var(--font-style-regular);border-radius:4px;min-block-size:25px;display:inline-grid;align-items:center;pointer-events:none;inline-size:max-content}.giu-static-pill-icon-and-text{display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:var(--spacing-gap-m)}.tab-full-width-buttons::part(tab-list block-start),.tab-full-width-buttons::part(tab-list block-end){grid-auto-columns:1fr}.tab-full-width-buttons::part(tab block-start){justify-content:center}.tree-view::part(item__header){--icon__system_warning_warning--disabled:var(\n    --icon__system_warning_warning--enabled\n  )}.tabular-grid{--focus-outline-width:1px}:host{display:inline-grid}.item-content{display:inline-flex;align-items:center;gap:var(--spacing-gap-xs)}.action{display:inline-flex;align-items:center;gap:var(--spacing-gap-xs);padding-block:var(--spacing-padding-xxs);padding-inline:var(--spacing-padding-xs);border:none;border-radius:4px;background:transparent;text-decoration:none;cursor:pointer;font:inherit;}.action:not(a){color:var(--color-text-interactive-default)}.action:hover:not(.disabled){background-color:var(--color-accent-surface-elevation-1-hover)}.action:not(a):hover:not(.disabled){color:var(--color-text-interactive-hover)}.action:focus-visible{outline:2px solid var(--color-border-focus-default);outline-offset:-2px}.action.disabled{color:var(--color-text-neutral-disabled);cursor:not-allowed}.action.selected{color:var(--color-text-primary-default)}.caption{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item__img{flex-shrink:0;background-size:contain;background-repeat:no-repeat;background-position:center}.item__img:not(.item__img-icon){inline-size:var(--icon-s);block-size:var(--icon-s)}.item__img--mask{background-color:currentColor;background-size:contain;background-repeat:no-repeat;background-position:center}";

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

var o, r, s, l;

const d = class {
  constructor(e) {
    i(this, e);
    o.set(this, (() => {
      var i, t;
      if (this.getImagePathCallback) {
        const i = this.getImagePathCallback(this.model);
        if (i === null || i === void 0 ? void 0 : i.base) return i.base;
      }
      return (i = this.startImgSrc) !== null && i !== void 0 ? i : (t = this.model) === null || t === void 0 ? void 0 : t.startImgSrc;
    }));
    r.set(this, (() => {
      var i, t, e;
      return (e = (i = this.caption) !== null && i !== void 0 ? i : (t = this.model) === null || t === void 0 ? void 0 : t.caption) !== null && e !== void 0 ? e : "";
    }));
    s.set(this, (() => {
      var i, t, e, n;
      return (n = (e = (i = this.accessibleName) !== null && i !== void 0 ? i : (t = this.model) === null || t === void 0 ? void 0 : t.accessibleName) !== null && e !== void 0 ? e : a(this, r, "f").call(this)) !== null && n !== void 0 ? n : "";
    }));
    l.set(this, (() => {
      var i, e;
      const n = a(this, o, "f").call(this);
      if (!n) return undefined;
      const r = (i = this.startImgType) !== null && i !== void 0 ? i : (e = this.model) === null || e === void 0 ? void 0 : e.startImgType;
      const s = n.trim().toLowerCase().startsWith("url(");
      if (s && (r === "background" || r === "mask")) {
        return t("span", {
          class: {
            item__img: true,
            "item__img--background": r === "background",
            "item__img--mask": r === "mask"
          },
          style: r === "background" ? {
            backgroundImage: n
          } : {
            maskImage: n,
            WebkitMaskImage: n
          },
          "aria-hidden": "true"
        });
      }
      return t("ch-image", {
        class: "item__img item__img-icon icon-m",
        src: n,
        "aria-hidden": "true"
      });
    }));
    this.model = undefined;
    this.caption = undefined;
    this.accessibleName = undefined;
    this.disabled = undefined;
    this.link = undefined;
    this.selected = false;
    this.selectedLinkIndicator = false;
    this.startImgSrc = undefined;
    this.startImgType = undefined;
    this.getImagePathCallback = undefined;
    this.itemId = undefined;
  }
  render() {
    var i, n, o, d, c;
    const u = a(this, r, "f").call(this);
    const p = a(this, s, "f").call(this);
    const h = (o = (i = this.disabled) !== null && i !== void 0 ? i : (n = this.model) === null || n === void 0 ? void 0 : n.disabled) !== null && o !== void 0 ? o : false;
    const g = ((d = this.link) === null || d === void 0 ? void 0 : d.url) !== undefined && ((c = this.link) === null || c === void 0 ? void 0 : c.url) !== "";
    const f = a(this, l, "f").call(this);
    const m = {
      caption: true,
      "body-regular-s": !this.selected || !this.selectedLinkIndicator,
      "body-semi-bold-s": this.selected && this.selectedLinkIndicator
    };
    const v = t("span", {
      class: "item-content"
    }, f, u ? t("span", {
      class: m,
      part: "item-caption"
    }, u) : null);
    const b = {
      action: true,
      disabled: h,
      selected: this.selected && this.selectedLinkIndicator,
      "not-selected": !this.selected
    };
    if (g && !h) {
      return t(e, {
        role: "listitem",
        "data-item-id": this.itemId,
        "data-has-link": "true",
        part: "item-action item-link"
      }, t("a", {
        class: Object.assign(Object.assign({}, b), {
          "link-primary": true
        }),
        href: this.link.url,
        "aria-current": this.selected ? "page" : undefined,
        "aria-label": p || undefined,
        part: "item-link"
      }, v));
    }
    if (g && h) {
      return t(e, {
        role: "listitem",
        "data-item-id": this.itemId,
        "data-has-link": "true",
        part: "item-action disabled"
      }, t("span", {
        class: b,
        "aria-disabled": "true",
        "aria-label": p || undefined,
        part: "item-link disabled"
      }, v));
    }
    return t(e, {
      role: "listitem",
      "data-item-id": this.itemId,
      "data-has-link": "false",
      part: "item-action item-button"
    }, t("button", {
      type: "button",
      class: b,
      disabled: h,
      "aria-label": p || undefined,
      part: "item-button"
    }, v));
  }
};

o = new WeakMap, r = new WeakMap, s = new WeakMap, l = new WeakMap;

d.style = n;

export { d as gx_ide_breadcrumb_item };
//# sourceMappingURL=p-be7a6b7f.entry.js.map