import { useColor as m, useWord as v, useDictRecordsFor as k, openBlock as l, createElementBlock as n, createBaseVNode as o, toDisplayString as x, unref as e, letterFilter as b, normalizeClass as g, dictRecord as r, withModifiers as C, Fragment as _, renderList as w, createBlock as y, createCommentVNode as D, normalizeStyle as S, pushScopeId as $, popScopeId as B } from "./composables-Ci32s3jE.js";
import { DictDefCard as I } from "./components.js";
import { _export_sfc as z } from "./_plugin-vue_export-helper-DueaC3du.js";
const u = (t) => ($("data-v-bb42b76c"), t = t(), B(), t), F = { class: "flex items-center rounded-lg capitalize mb-4" }, W = { class: "text-2xl font-bold" }, N = /* @__PURE__ */ u(() => /* @__PURE__ */ o("div", { class: "flex-1" }, null, -1)), P = /* @__PURE__ */ u(() => /* @__PURE__ */ o("div", { class: "i-la-times text-xl" }, null, -1)), R = [
  P
], V = { class: "flex flex-wrap gap-2" }, j = {
  __name: "DictWordPage",
  props: {
    hash: { type: String, default: "" }
  },
  emits: ["def", "close"],
  setup(t) {
    const a = t, p = m("light"), { word: f } = v(a.hash), d = k(a.hash);
    return (h, s) => (l(), n("div", {
      class: "flex flex-col p-4 rounded-xl",
      style: S({ backgroundColor: e(p).hex(t.hash) })
    }, [
      o("div", F, [
        o("div", W, x(e(b)(e(f))), 1),
        o("div", {
          class: g(["i-la-link link", { active: e(r).word == t.hash || e(d)[e(r).def] }]),
          onClick: s[0] || (s[0] = C((i) => e(r).word = e(r).word == t.hash ? null : t.hash, ["stop", "prevent"]))
        }, null, 2),
        N,
        o("button", {
          class: "cursor-pointer p-2",
          onClick: s[1] || (s[1] = (i) => h.$emit("close"))
        }, R)
      ]),
      o("div", V, [
        (l(!0), n(_, null, w(e(d), (i, c) => (l(), n("div", {
          class: "p-0",
          key: c
        }, [
          Object.keys(i).length > 0 ? (l(), y(e(I), {
            key: 0,
            class: "cursor-pointer",
            hash: c,
            onClick: (E) => h.$emit("def", c)
          }, null, 8, ["hash", "onClick"])) : D("", !0)
        ]))), 128))
      ])
    ], 4));
  }
}, q = /* @__PURE__ */ z(j, [["__scopeId", "data-v-bb42b76c"]]);
export {
  q as default
};
//# sourceMappingURL=DictWordPage-CIAIKk_t.js.map
