import { c as i } from "../../chunks/runtime.js";
import { css as a, html as r } from "lit";
import { LitElement as n, safeStyleMap as l } from "@arcgis/lumina";
import { t as c } from "../../chunks/screenLocation.js";
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
const p = a`:host{display:contents}calcite-loader{position:absolute}`;
class d extends n {
  constructor() {
    super(...arguments), this.autoDestroyDisabled = !1, this.trackLocation = !1, this.screenLocation = c(this);
  }
  static {
    this.properties = { autoDestroyDisabled: 5, trackLocation: 5, screenLocation: 32, label: 1, location: 0, view: 0 };
  }
  static {
    this.styles = p;
  }
  async destroy() {
    await this.manager.destroy();
  }
  _getPositionStyles() {
    const { screenLocation: t, view: s } = this;
    if (s == null || t == null)
      return {};
    const { padding: o } = s, e = 16;
    return {
      "--calcite-loader-size": `${e}px`,
      left: `${t.x - (o.left ?? 0) - e / 2}px`,
      top: `${t.y - (o.top ?? 0) - e / 2}px`
    };
  }
  render() {
    return this.screenLocation ? r`<calcite-loader .label=${this.label ?? ""} inline style=${l(this._getPositionStyles())}></calcite-loader>` : null;
  }
}
i("arcgis-spinner", d);
export {
  d as ArcgisSpinner
};
