import { LitElement as S, css as b } from "lit";
import { property as I, state as u } from "lit/decorators.js";
const n = {
  xxs: 12,
  xs: 16,
  s: 20,
  m: 24,
  l: 28,
  xl: 32,
  xxl: 40
}, p = Object.keys(n), g = "xs", f = 8, c = 32;
function x(t, e, s) {
  const r = parseInt(t, 10), i = r % s === 0;
  return r >= e && i;
}
const v = {
  large: (t) => x(t, c, f),
  regular: (t) => p.includes(t)
};
function y(t) {
  const e = v.large(t);
  return { isValid: e, size: e ? t : c };
}
function m(t) {
  const e = v.regular(t), s = e ? n[t] : n[g];
  return { isValid: e, size: s };
}
const C = (t, e, s, r) => {
  const i = t.endsWith("Large") || t.endsWith("-large");
  let a, l;
  if (s) {
    if ({ isValid: a, size: l } = i ? y(s) : m(s), !a) {
      const z = i ? `Invalid prop "size" value supplied to "${r}". The prop value should be a number equal or greater than ${c} and multiple of ${f}.` : `Invalid prop "size" value supplied to "${r}". The prop value should be one of the following values: ${p.join(", ")}.`;
      console.error(z);
    }
  } else
    l = i ? c : n[g];
  return {
    class: [t, e].filter(Boolean).join(" "),
    width: l,
    height: l
  };
};
var _ = Object.defineProperty, h = (t, e, s, r) => {
  for (var i = void 0, a = t.length - 1, l; a >= 0; a--)
    (l = t[a]) && (i = l(e, s, i) || i);
  return i && _(e, s, i), i;
};
const d = class d extends S {
  constructor() {
    super(...arguments), this.defaultClasses = "";
  }
  firstUpdated() {
    this.updateIconSize();
  }
  willUpdate(e) {
    e.has("size") && this.updateIconSize();
  }
  updateIconSize() {
    const e = C(this.defaultClasses, "", this.size, this.name);
    this._svgWidth = e.width, this._svgHeight = e.height;
  }
  attributeChangedCallback(e, s, r) {
    if (e === "class" && r !== null) {
      const i = r.trim().split(" ").filter((a) => !this.defaultClasses.split(" ").includes(a));
      this.class = [this.defaultClasses, ...i].join(" ");
    } else
      super.attributeChangedCallback(e, s, r);
  }
};
d.styles = b`
        :host {
            display: inline-block;
            /* Inline SVGs can cause an additional ~4px height in their containers (such as this host).*/
            line-height: 0;
        }

        :host svg {
            /* When the --icon-size-override CSS variable does not exist, the height and width in the HTML attributes will be used. */
            width: var(--icon-size-override);
            height: var(--icon-size-override);
        }
    `;
let o = d;
h([
  I({ type: String, reflect: !0 })
], o.prototype, "size");
h([
  u()
], o.prototype, "_svgWidth");
h([
  u()
], o.prototype, "_svgHeight");
export {
  o as PieIconComponent
};
