import { jsxs as b, jsx as o } from "react/jsx-runtime";
import { classNames as s } from "./index-classNames.js";
import { useEffect as f } from "react";
import a from "./index-AIOrb.module.scss.js";
var i;
(function(r) {
  r.Waiting = "waiting", r.Thinking = "thinking", r.Error = "error", r.Warning = "warning", r.Disconnected = "disconnected";
})(i || (i = {}));
var d;
(function(r) {
  r[r.Small = 40] = "Small", r[r.Medium = 72] = "Medium", r[r.Large = 140] = "Large";
})(d || (d = {}));
const y = (r) => {
  const {
    state: h = i.Waiting,
    size: g = d.Medium,
    className: N
  } = r;
  f(() => {
    const c = document.documentElement, e = v();
    Object.keys(e).forEach((l) => {
      c.style.setProperty(l, e[l]);
    });
  }, [h]);
  const v = () => {
    let c = 8, e = 6, l = "var(--p500)", n = "hsl(from var(--ai-orb-base-color) calc(h + 123) s calc(l + 6))", t = "hsl(from var(--ai-orb-base-color) calc(h - 35) 62 62)", m = "hsl(from var(--ai-orb-base-color) h s 98)";
    switch (h) {
      case i.Thinking:
        c = 3, e = 1.5, l = "hsla(217, 100%, 50%, 1)";
        break;
      case i.Error:
        c = 5, e = 10, l = "hsla(15, 100%, 50%, 1)", n = "hsla(15, 100%, 56%, 1)", t = "hsla(25, 62%, 62%, 1)", m = "hsla(0, 100%, 80%, 1)";
        break;
      case i.Disconnected:
        c = 20, e = 25, l = "hsla(217, 20%, 50%, 0.5)", n = "hsla(217, 20%, 56%, 0.5)", t = "hsla(250, 20%, 62%, 0.5)", m = "hsla(217, 20%, 95%, 0.75)";
        break;
      case i.Warning:
        c = 5, e = 8, l = "hsla(40, 100%, 50%, 1)", n = "hsla(35, 100%, 56%, 1)", t = "hsla(45, 100%, 62%, 1)", m = "hsla(35, 100%, 45%, 1)";
        break;
      case i.Waiting:
    }
    return {
      "--animation-duration-rotation": `${c}s`,
      "--animation-duration-scale": `${e}s`,
      "--ai-orb-base-color": l,
      "--color1": n,
      "--color2": t,
      "--color3": m,
      "--container-size": `${g}px`
    };
  };
  return b("div", {
    className: s(a.aiOrb, N),
    style: v(),
    children: [o("div", {
      className: s(a.orbsContainer)
    }), b("div", {
      className: s(a.orbsContainer),
      children: [o("div", {
        className: s(a.orbs, a.orbsLarge)
      }), o("div", {
        className: s(a.orbs, a.orbsLarge)
      }), o("div", {
        className: s(a.orbs, a.orbsLarge)
      }), o("div", {
        className: s(a.orbs, a.orbsLarge)
      })]
    }), b("div", {
      className: s(a.orbsContainer),
      children: [o("div", {
        className: s(a.orbs, a.orbsSmall)
      }), o("div", {
        className: s(a.orbs, a.orbsSmall)
      }), o("div", {
        className: s(a.orbs, a.orbsSmall)
      }), o("div", {
        className: s(a.orbs, a.orbsSmall)
      })]
    }), b("div", {
      className: s(a.orbsContainer),
      children: [o("div", {
        className: s(a.orbs, a.orbsLarge)
      }), o("div", {
        className: s(a.orbs, a.orbsLarge)
      }), o("div", {
        className: s(a.orbs, a.orbsLarge)
      }), o("div", {
        className: s(a.orbs, a.orbsLarge)
      })]
    })]
  });
};
export {
  y as AIOrb,
  d as AIOrbSize,
  i as AIOrbStatus
};
