import {
  __decorateClass,
  __privateAdd,
  __privateGet,
  __privateMethod
} from "../../../chunks/chunk.QU3DSPNU.js";
var _GdsBreadcrumb_instances, defaultRel_get, renderContents_fn, renderMainContent_fn, renderOverflowMenu_fn, renderItem_fn, renderCurrent_fn;
import { nothing } from "lit";
import { property } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { GdsElement } from "../../../gds-element.js";
import {
  gdsCustomElement,
  html
} from "../../../utils/helpers/custom-element-scoping.js";
import { GdsLink } from "../../link/link.component.js";
import { GdsText } from "../../text/text.component.js";
import BreadcrumbStyles from "./breadcrumb.styles.js";
let GdsBreadcrumb = class extends GdsElement {
  constructor() {
    super(...arguments);
    __privateAdd(this, _GdsBreadcrumb_instances);
    this.href = "";
    this.label = "";
    this.overflow = false;
  }
  render() {
    return html`
      <div role="listitem" class="list-item">${__privateMethod(this, _GdsBreadcrumb_instances, renderContents_fn).call(this)}</div>
    `;
  }
};
_GdsBreadcrumb_instances = new WeakSet();
defaultRel_get = function() {
  return this.target === "_blank" ? "noreferrer noopener" : void 0;
};
renderContents_fn = function() {
  const elements = [__privateMethod(this, _GdsBreadcrumb_instances, renderMainContent_fn).call(this)];
  return elements.map((element) => html`${element}`);
};
renderMainContent_fn = function() {
  if (this.overflow) return __privateMethod(this, _GdsBreadcrumb_instances, renderOverflowMenu_fn).call(this);
  if (this.href) return __privateMethod(this, _GdsBreadcrumb_instances, renderItem_fn).call(this);
  return __privateMethod(this, _GdsBreadcrumb_instances, renderCurrent_fn).call(this);
};
renderOverflowMenu_fn = function() {
  return html`<slot></slot>`;
};
renderItem_fn = function() {
  return html`
      <gds-link
        href=${ifDefined(this.href)}
        target=${ifDefined(this.target)}
        rel=${ifDefined(this.rel || __privateGet(this, _GdsBreadcrumb_instances, defaultRel_get))}
        aria-label=${this.label || nothing}
      >
        <slot name="lead"></slot>
        <slot></slot>
        <slot name="trail"></slot>
      </gds-link>
    `;
};
renderCurrent_fn = function() {
  return html`
      <gds-text
        color="neutral-02"
        font-weight="regular"
        aria-current=${ifDefined(!this.href ? "page" : void 0)}
      >
        <slot></slot>
      </gds-text>
    `;
};
GdsBreadcrumb.styles = [BreadcrumbStyles];
__decorateClass([
  property()
], GdsBreadcrumb.prototype, "href", 2);
__decorateClass([
  property()
], GdsBreadcrumb.prototype, "target", 2);
__decorateClass([
  property()
], GdsBreadcrumb.prototype, "rel", 2);
__decorateClass([
  property()
], GdsBreadcrumb.prototype, "label", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], GdsBreadcrumb.prototype, "overflow", 2);
GdsBreadcrumb = __decorateClass([
  gdsCustomElement("gds-breadcrumb", {
    dependsOn: [GdsLink, GdsText]
  })
], GdsBreadcrumb);
export {
  GdsBreadcrumb
};
