import {
  LocalizeController
} from "./chunk.X3FE7OHE.js";
import {
  watch
} from "./chunk.X2OQMWGY.js";
import {
  SolidElement,
  customElement
} from "./chunk.H53WQBDK.js";
import {
  __decorateClass
} from "./chunk.S3NI7NKU.js";

// src/components/breadcrumb-item/breadcrumb-item.ts
import { css, html } from "lit";
import { ifDefined } from "lit/directives/if-defined.js";
import { property, query } from "lit/decorators.js";
var SdBreadcrumbItem = class extends SolidElement {
  constructor() {
    super(...arguments);
    this.localize = new LocalizeController(this);
    this.href = "";
    this.current = false;
  }
  handleCurrentChange() {
    var _a, _b;
    if (!this.base || !this.current) return;
    (_b = (_a = this.base.shadowRoot) == null ? void 0 : _a.querySelector("a")) == null ? void 0 : _b.setAttribute("aria-current", "page");
  }
  connectedCallback() {
    if (!this.hasAttribute("role")) {
      this.setAttribute("role", "listitem");
    }
    super.connectedCallback();
  }
  firstUpdated() {
    requestAnimationFrame(() => this.handleCurrentChange());
  }
  render() {
    return html`<sd-6-22-0-link part="base" href="${ifDefined(!this.current ? this.href : void 0)}" target="${this.target}" standalone class="text-nowrap"><slot></slot></sd-6-22-0-link>`;
  }
};
SdBreadcrumbItem.styles = [
  ...SolidElement.styles,
  css`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
:host{display:inline-flex;align-items:center}sd-6-22-0-link::part(base){align-items:center}sd-6-22-0-link::part(icon-left){margin-right:calc(var(--sd-spacing-1) * 0);display:inline-flex}:host([current]) sd-6-22-0-link::part(base){color:rgba(var(--sd-breadcrumb--current-color-text,rgba(var(--sd-color-neutral-700))))}:host([current]) sd-6-22-0-link::part(label){text-decoration-line:none}`
];
__decorateClass([
  query('[part="base"]')
], SdBreadcrumbItem.prototype, "base", 2);
__decorateClass([
  property({ type: String, reflect: true })
], SdBreadcrumbItem.prototype, "href", 2);
__decorateClass([
  property({ type: String, reflect: true })
], SdBreadcrumbItem.prototype, "target", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], SdBreadcrumbItem.prototype, "current", 2);
__decorateClass([
  watch("current")
], SdBreadcrumbItem.prototype, "handleCurrentChange", 1);
SdBreadcrumbItem = __decorateClass([
  customElement("sd-6-22-0-breadcrumb-item")
], SdBreadcrumbItem);

export {
  SdBreadcrumbItem
};
