import { r as n, c as f, h as e, H as m, g as d } from "./index.e6beb8d9.js";
import { c as h } from "./index-orsBiyT_.fc4357c3.js";
import { D as u } from "./media-query.service-CCYT6DU8.f0931fdc.js";
import "react";
import "react-dom";
import "./utils-CCck-DTo.e4e43b6a.js";
const b = () => '.sc-swirl-resource-list-file-item-h{display:block;width:100%}.sc-swirl-resource-list-file-item-h *.sc-swirl-resource-list-file-item{box-sizing:border-box}.resource-list-file-item.sc-swirl-resource-list-file-item{position:relative;display:flex;width:100%;padding:var(--s-space-12) var(--s-space-16);align-items:center;background-color:var(--s-background-default);line-height:var(--s-line-height-base);gap:var(--s-space-12)}.resource-list-file-item.sc-swirl-resource-list-file-item:focus{outline:none}.resource-list-file-item.sc-swirl-resource-list-file-item:focus-visible{background-color:var(--s-background-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.resource-list-file-item.sc-swirl-resource-list-file-item{padding:var(--s-space-12);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.resource-list-file-item--has-control.sc-swirl-resource-list-file-item .resource-list-file-item__label-container.sc-swirl-resource-list-file-item{padding-right:calc(var(--s-space-12) + 2.5rem)}.resource-list-file-item__icon.sc-swirl-resource-list-file-item{width:1.5rem;height:1.5rem;color:var(--s-icon-highlight)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.resource-list-file-item__icon.sc-swirl-resource-list-file-item{width:1.25rem;height:1.25rem}}.resource-list-file-item__label-container.sc-swirl-resource-list-file-item{position:relative;display:flex;min-width:0;min-height:2.875rem;flex-grow:1;justify-content:center;flex-direction:column}.resource-list-file-item__label-container.sc-swirl-resource-list-file-item:after{position:absolute;right:0;bottom:calc(-1 * var(--s-space-12));left:0;height:0.0625rem;background-color:var(--s-border-default);content:""}.resource-list-file-item__label.sc-swirl-resource-list-file-item{overflow:hidden;font-weight:var(--s-font-weight-medium);white-space:nowrap;text-overflow:ellipsis}.resource-list-file-item__description.sc-swirl-resource-list-file-item{overflow:hidden;margin-top:var(--s-space-2);color:var(--s-text-subdued);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);white-space:nowrap;text-overflow:ellipsis}.resource-list-file-item__error-message.sc-swirl-resource-list-file-item{margin-top:var(--s-space-2)}.resource-list-file-item__remove-button.sc-swirl-resource-list-file-item{position:absolute;top:50%;right:var(--s-space-16);display:inline-flex;transform:translateY(-50%)}.resource-list-file-item__spinner.sc-swirl-resource-list-file-item{position:absolute;top:50%;right:var(--s-space-24);display:inline-flex;transform:translateY(-50%)}', p = class {
  constructor(i) {
    n(this, i), this.remove = f(this, "remove", 7), this.icon = "<swirl-icon-file></swirl-icon-file>", this.removeButtonLabel = "Remove file", this.mediaQueryUnsubscribe = () => {
    };
  }
  componentDidLoad() {
    this.mediaQueryUnsubscribe = u.subscribe((i) => {
      this.forceIconProps(i);
    });
  }
  disconnectedCallback() {
    this.mediaQueryUnsubscribe();
  }
  forceIconProps(i) {
    if (!Boolean(this.iconEl))
      return;
    const s = this.iconEl.children[0];
    s == null || s.setAttribute("size", i ? "20" : "24");
  }
  render() {
    const i = Boolean(this.errorMessage), s = !i && Boolean(this.description), r = !i && this.loading, t = this.removable && !r, l = this.el.closest('[role="grid"]') ? "row" : "listitem", o = l === "row" ? "gridcell" : void 0, c = h("resource-list-file-item", {
      "resource-list-file-item--has-control": r || t
    });
    return e(m, { key: "a283315588efac0606445f5507619969d27baae9", role: l }, e("div", { key: "d8b0085a08dcb3c366f16fdef5fc9f7be3401b9f", class: c, part: "resource-list-file-item", role: o }, e("span", { key: "96ffda39ea366226c27e5a17845d74cc88201515", class: "resource-list-file-item__icon", innerHTML: this.icon, ref: (a) => this.iconEl = a }), e("span", { key: "684a04ed8b998777d88f5e8450d6be4883bf5121", class: "resource-list-file-item__label-container" }, e("span", { key: "3a966b873acac29ffc32f2b5738c82305ec12d4f", class: "resource-list-file-item__label", id: "label" }, this.label), s && e("span", { key: "457d0402996ce8787bc24bf582da9a5a401531ad", class: "resource-list-file-item__description" }, this.description), i && e("span", { key: "79376b385ac63619750a23c69a7bc38b50e91f27", "aria-live": "polite", class: "resource-list-file-item__error-message" }, e("swirl-inline-error", { key: "376769f5e4faa29cff63d35dce9908a9c85ce9a2", message: this.errorMessage, size: "s" }))), r && e("span", { key: "b57446eb985aaeeb8e0159f0baade416da60bfce", class: "resource-list-file-item__spinner" }, e("swirl-spinner", { key: "7f2a5a21039c781d452613c0996727b05571c0af", size: "s" })), t && e("span", { key: "3228ceddc419fe1fb91c27a36df8c7c11728cb25", class: "resource-list-file-item__remove-button" }, e("swirl-button", { key: "03bfbbaa74df4369938eec9a15f5dfd8fb644b8f", hideLabel: !0, icon: "<swirl-icon-close></swirl-icon-close>", label: this.removeButtonLabel, onClick: this.remove.emit }))));
  }
  get el() {
    return d(this);
  }
};
p.style = b();
export {
  p as swirl_resource_list_file_item
};
