@almadar/ui 2.42.0 → 2.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as React90 from 'react';
2
- import React90__default, { useCallback, createContext, useState, useRef, useEffect, useLayoutEffect, lazy, useContext, useMemo, useId, Suspense, useSyncExternalStore } from 'react';
2
+ import React90__default, { useCallback, createContext, useState, useRef, useEffect, useMemo, useLayoutEffect, lazy, useContext, useId, Suspense, useSyncExternalStore } from 'react';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import * as LucideIcons from 'lucide-react';
@@ -4040,9 +4040,9 @@ var shapeMap = {
4040
4040
  square: "rounded-md"
4041
4041
  };
4042
4042
  var variantMap = {
4043
- primary: "bg-blue-600 text-white border-blue-400 hover:bg-blue-500",
4044
- secondary: "bg-gray-700 text-white border-gray-500 hover:bg-gray-600",
4045
- ghost: "bg-transparent text-white border-white/30 hover:bg-white/10"
4043
+ primary: "bg-blue-600 text-[var(--color-foreground)] border-blue-400 hover:bg-blue-500",
4044
+ secondary: "bg-[var(--color-surface,#374151)] text-[var(--color-foreground)] border-gray-500 hover:bg-gray-600",
4045
+ ghost: "bg-transparent text-[var(--color-foreground)] border-white/30 hover:bg-white/10"
4046
4046
  };
4047
4047
  function ControlButton({
4048
4048
  label,
@@ -4307,11 +4307,11 @@ function TimerDisplay({
4307
4307
  {
4308
4308
  className: cn(
4309
4309
  "inline-flex items-center justify-center rounded-lg",
4310
- "bg-gray-800/80 border border-gray-600 font-mono font-bold tabular-nums",
4310
+ "bg-[var(--color-card)]/80 border border-gray-600 font-mono font-bold tabular-nums",
4311
4311
  sizeMap4[size],
4312
4312
  running && "border-green-500/50",
4313
4313
  isLow && "text-red-400 border-red-500/50 animate-pulse",
4314
- !isLow && "text-white",
4314
+ !isLow && "text-[var(--color-foreground)]",
4315
4315
  className
4316
4316
  ),
4317
4317
  children: formatTime(seconds, format)
@@ -4339,7 +4339,7 @@ function ResourceCounter({
4339
4339
  {
4340
4340
  className: cn(
4341
4341
  "inline-flex items-center rounded-md",
4342
- "bg-gray-800/80 border border-gray-600 font-medium text-white",
4342
+ "bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
4343
4343
  sizes.wrapper,
4344
4344
  className
4345
4345
  ),
@@ -4398,9 +4398,9 @@ function ItemSlot({
4398
4398
  title: label,
4399
4399
  className: cn(
4400
4400
  "relative flex items-center justify-center rounded-lg border-2",
4401
- "bg-gray-800/80 transition-all duration-150",
4401
+ "bg-[var(--color-card)]/80 transition-all duration-150",
4402
4402
  sizeMap6[size],
4403
- empty ? "border-gray-700 bg-gray-900/50" : rarityBorderMap[rarity],
4403
+ empty ? "border-gray-700 bg-[var(--color-card)]/50" : rarityBorderMap[rarity],
4404
4404
  !empty && rarityGlowMap[rarity],
4405
4405
  selected && "ring-2 ring-white ring-offset-1 ring-offset-gray-900",
4406
4406
  isClickable && !empty && "hover:brightness-125 cursor-pointer",
@@ -4416,7 +4416,7 @@ function ItemSlot({
4416
4416
  className: cn(
4417
4417
  "absolute -bottom-1 -right-1 flex items-center justify-center",
4418
4418
  "min-w-[18px] h-[18px] rounded-full px-1",
4419
- "bg-gray-700 border border-gray-500 text-[10px] font-bold text-white"
4419
+ "bg-[var(--color-surface,#374151)] border border-gray-500 text-[10px] font-bold text-[var(--color-foreground)]"
4420
4420
  ),
4421
4421
  children: quantity
4422
4422
  }
@@ -4445,7 +4445,7 @@ function TurnIndicator({
4445
4445
  {
4446
4446
  className: cn(
4447
4447
  "inline-flex items-center rounded-lg",
4448
- "bg-gray-800/80 border border-gray-600 font-medium text-white",
4448
+ "bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
4449
4449
  sizes.wrapper,
4450
4450
  className
4451
4451
  ),
@@ -4481,7 +4481,7 @@ function getComboIntensity(combo) {
4481
4481
  if (combo >= 10) return "text-red-400 animate-pulse";
4482
4482
  if (combo >= 7) return "text-orange-400";
4483
4483
  if (combo >= 4) return "text-yellow-400";
4484
- return "text-white";
4484
+ return "text-[var(--color-foreground)]";
4485
4485
  }
4486
4486
  function getComboScale(combo) {
4487
4487
  if (combo >= 10) return "scale-110";
@@ -4502,7 +4502,7 @@ function ComboCounter({
4502
4502
  {
4503
4503
  className: cn(
4504
4504
  "inline-flex flex-col items-center justify-center",
4505
- "rounded-xl bg-gray-800/80 border border-gray-600 px-3 py-1.5",
4505
+ "rounded-xl bg-[var(--color-card)]/80 border border-gray-600 px-3 py-1.5",
4506
4506
  "transition-transform duration-200",
4507
4507
  getComboScale(combo),
4508
4508
  className
@@ -4703,7 +4703,7 @@ function StatusEffect({
4703
4703
  "span",
4704
4704
  {
4705
4705
  className: cn(
4706
- "absolute flex items-center justify-center rounded-full bg-white text-black font-bold leading-none",
4706
+ "absolute flex items-center justify-center rounded-full bg-[var(--color-card)] text-[var(--color-foreground)] font-bold leading-none",
4707
4707
  sizes.badge
4708
4708
  ),
4709
4709
  children: stacks
@@ -4782,7 +4782,7 @@ function DialogueBubble({
4782
4782
  ) }),
4783
4783
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
4784
4784
  speaker && /* @__PURE__ */ jsx("span", { className: "text-sm font-bold text-yellow-400", children: speaker }),
4785
- /* @__PURE__ */ jsx("span", { className: "text-sm text-white leading-relaxed", children: text })
4785
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-[var(--color-foreground)] leading-relaxed", children: text })
4786
4786
  ] })
4787
4787
  ]
4788
4788
  }
@@ -4806,7 +4806,7 @@ function ChoiceButton({
4806
4806
  className: cn(
4807
4807
  "w-full text-left px-4 py-2.5 rounded-md border transition-all duration-150",
4808
4808
  "flex items-center gap-2",
4809
- selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-white hover:bg-white/10 hover:border-white/30",
4809
+ selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-[var(--color-foreground)] hover:bg-white/10 hover:border-white/30",
4810
4810
  disabled && "opacity-40 cursor-not-allowed hover:bg-white/5 hover:border-white/10",
4811
4811
  className
4812
4812
  ),
@@ -4862,7 +4862,7 @@ function ActionButton({
4862
4862
  disabled: isDisabled,
4863
4863
  onClick,
4864
4864
  className: cn(
4865
- "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-white overflow-hidden transition-colors duration-150",
4865
+ "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-[var(--color-foreground)] overflow-hidden transition-colors duration-150",
4866
4866
  sizes.button,
4867
4867
  variantStyles7[variant],
4868
4868
  isDisabled && "opacity-60 cursor-not-allowed",
@@ -5835,27 +5835,27 @@ function useQuerySingleton(query) {
5835
5835
  store2.listeners.delete(listener);
5836
5836
  };
5837
5837
  }, [store2]);
5838
- const notifyListeners = useCallback(() => {
5838
+ const notifyListeners2 = useCallback(() => {
5839
5839
  store2.listeners.forEach((listener) => listener());
5840
5840
  }, [store2]);
5841
5841
  const setSearch = useCallback((value) => {
5842
5842
  store2.search = value;
5843
- notifyListeners();
5844
- }, [store2, notifyListeners]);
5843
+ notifyListeners2();
5844
+ }, [store2, notifyListeners2]);
5845
5845
  const setFilter = useCallback((key, value) => {
5846
5846
  store2.filters = { ...store2.filters, [key]: value };
5847
- notifyListeners();
5848
- }, [store2, notifyListeners]);
5847
+ notifyListeners2();
5848
+ }, [store2, notifyListeners2]);
5849
5849
  const clearFilters = useCallback(() => {
5850
5850
  store2.filters = {};
5851
5851
  store2.search = "";
5852
- notifyListeners();
5853
- }, [store2, notifyListeners]);
5852
+ notifyListeners2();
5853
+ }, [store2, notifyListeners2]);
5854
5854
  const setSort = useCallback((field, direction) => {
5855
5855
  store2.sortField = field;
5856
5856
  store2.sortDirection = direction;
5857
- notifyListeners();
5858
- }, [store2, notifyListeners]);
5857
+ notifyListeners2();
5858
+ }, [store2, notifyListeners2]);
5859
5859
  return {
5860
5860
  search: store2.search,
5861
5861
  setSearch,
@@ -8612,7 +8612,7 @@ var MarkdownContent = React90__default.memo(
8612
8612
  "th",
8613
8613
  {
8614
8614
  ...props,
8615
- className: "border border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-800 px-4 py-2 text-left font-semibold",
8615
+ className: "border border-gray-300 dark:border-gray-600 bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
8616
8616
  children
8617
8617
  }
8618
8618
  );
@@ -8693,6 +8693,42 @@ var orbStyleOverrides = {
8693
8693
  "orb-op-async": { color: ORB_COLORS.dark.async }
8694
8694
  };
8695
8695
  var orbStyle = { ...dark, ...orbStyleOverrides };
8696
+ function computeFoldRegions(code) {
8697
+ const lines = code.split("\n");
8698
+ const regions = [];
8699
+ const stack = [];
8700
+ for (let i = 0; i < lines.length; i++) {
8701
+ const line = lines[i];
8702
+ let inString = false;
8703
+ for (let j = 0; j < line.length; j++) {
8704
+ const ch = line[j];
8705
+ if (ch === "\\" && inString) {
8706
+ j++;
8707
+ continue;
8708
+ }
8709
+ if (ch === '"') {
8710
+ inString = !inString;
8711
+ continue;
8712
+ }
8713
+ if (inString) continue;
8714
+ if (ch === "{" || ch === "[") {
8715
+ stack.push({ line: i, bracket: ch });
8716
+ } else if (ch === "}" || ch === "]") {
8717
+ const open = stack.pop();
8718
+ if (open && open.line < i) {
8719
+ regions.push({
8720
+ start: open.line,
8721
+ end: i,
8722
+ closeBracket: ch
8723
+ });
8724
+ }
8725
+ }
8726
+ }
8727
+ }
8728
+ return regions.sort((a, b) => a.start - b.start);
8729
+ }
8730
+ var LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
8731
+ var HIDDEN_LINE_NUMBERS = { display: "none" };
8696
8732
  var CodeBlock = React90__default.memo(
8697
8733
  ({
8698
8734
  code: rawCode,
@@ -8700,6 +8736,7 @@ var CodeBlock = React90__default.memo(
8700
8736
  showCopyButton = true,
8701
8737
  showLanguageBadge = true,
8702
8738
  maxHeight = "60vh",
8739
+ foldable: foldableProp,
8703
8740
  className
8704
8741
  }) => {
8705
8742
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
@@ -8708,8 +8745,114 @@ var CodeBlock = React90__default.memo(
8708
8745
  const eventBus = useEventBus();
8709
8746
  const { t: _t } = useTranslate();
8710
8747
  const scrollRef = useRef(null);
8748
+ const codeRef = useRef(null);
8711
8749
  const savedScrollLeftRef = useRef(0);
8712
8750
  const [copied, setCopied] = useState(false);
8751
+ const isFoldable = foldableProp ?? (language === "orb" || language === "json");
8752
+ const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
8753
+ const foldRegions = useMemo(
8754
+ () => isFoldable ? computeFoldRegions(code) : [],
8755
+ [code, isFoldable]
8756
+ );
8757
+ const foldStartMap = useMemo(() => {
8758
+ const m = /* @__PURE__ */ new Map();
8759
+ for (const r of foldRegions) m.set(r.start, r);
8760
+ return m;
8761
+ }, [foldRegions]);
8762
+ const hiddenLines = useMemo(() => {
8763
+ const h = /* @__PURE__ */ new Set();
8764
+ for (const r of foldRegions) {
8765
+ if (!collapsed.has(r.start)) continue;
8766
+ for (let i = r.start + 1; i <= r.end; i++) h.add(i);
8767
+ }
8768
+ return h;
8769
+ }, [foldRegions, collapsed]);
8770
+ const collapsedRef = useRef(collapsed);
8771
+ collapsedRef.current = collapsed;
8772
+ const foldStartMapRef = useRef(foldStartMap);
8773
+ foldStartMapRef.current = foldStartMap;
8774
+ const toggleFold = useCallback((lineNum) => {
8775
+ setCollapsed((prev) => {
8776
+ const next = new Set(prev);
8777
+ if (next.has(lineNum)) next.delete(lineNum);
8778
+ else next.add(lineNum);
8779
+ return next;
8780
+ });
8781
+ }, []);
8782
+ const toggleFoldRef = useRef(toggleFold);
8783
+ toggleFoldRef.current = toggleFold;
8784
+ useEffect(() => {
8785
+ setCollapsed(/* @__PURE__ */ new Set());
8786
+ }, [code]);
8787
+ const highlightedElement = useMemo(
8788
+ () => /* @__PURE__ */ jsx(
8789
+ SyntaxHighlighter,
8790
+ {
8791
+ PreTag: "div",
8792
+ language,
8793
+ style: activeStyle,
8794
+ wrapLines: true,
8795
+ showLineNumbers: true,
8796
+ showInlineLineNumbers: false,
8797
+ lineNumberContainerStyle: HIDDEN_LINE_NUMBERS,
8798
+ lineProps: LINE_PROPS_FN,
8799
+ customStyle: {
8800
+ backgroundColor: "transparent",
8801
+ borderRadius: 0,
8802
+ padding: 0,
8803
+ margin: 0,
8804
+ whiteSpace: "pre",
8805
+ minWidth: "100%"
8806
+ },
8807
+ children: code
8808
+ }
8809
+ ),
8810
+ [code, language, activeStyle]
8811
+ );
8812
+ useLayoutEffect(() => {
8813
+ const container = codeRef.current;
8814
+ if (!container) return;
8815
+ container.querySelectorAll(".fold-toggle, .fold-summary").forEach((el) => el.remove());
8816
+ const lineEls = container.querySelectorAll("[data-line]");
8817
+ if (!isFoldable || foldRegions.length === 0) {
8818
+ lineEls.forEach((el) => {
8819
+ el.style.display = "";
8820
+ el.style.position = "";
8821
+ el.style.paddingLeft = "";
8822
+ });
8823
+ return;
8824
+ }
8825
+ lineEls.forEach((el) => {
8826
+ const num = parseInt(el.getAttribute("data-line") ?? "-1", 10);
8827
+ if (hiddenLines.has(num)) {
8828
+ el.style.display = "none";
8829
+ return;
8830
+ }
8831
+ el.style.display = "";
8832
+ el.style.position = "relative";
8833
+ el.style.paddingLeft = "1.2em";
8834
+ const region = foldStartMap.get(num);
8835
+ if (!region) return;
8836
+ const isCollapsed = collapsed.has(num);
8837
+ const toggle = document.createElement("span");
8838
+ toggle.className = "fold-toggle";
8839
+ toggle.textContent = isCollapsed ? "\u25B6" : "\u25BC";
8840
+ toggle.style.cssText = "position:absolute;left:0;top:0;width:1.2em;text-align:center;cursor:pointer;color:#858585;font-size:10px;user-select:none;line-height:inherit;height:100%";
8841
+ toggle.addEventListener("click", (e) => {
8842
+ e.stopPropagation();
8843
+ toggleFoldRef.current(num);
8844
+ });
8845
+ el.insertBefore(toggle, el.firstChild);
8846
+ if (isCollapsed) {
8847
+ const summary = document.createElement("span");
8848
+ summary.className = "fold-summary";
8849
+ summary.style.cssText = "color:#858585;font-style:italic";
8850
+ const count = region.end - region.start - 1;
8851
+ summary.textContent = ` ... ${count} line${count !== 1 ? "s" : ""} ${region.closeBracket}`;
8852
+ el.appendChild(summary);
8853
+ }
8854
+ });
8855
+ }, [collapsed, hiddenLines, foldStartMap, foldRegions, isFoldable]);
8713
8856
  useLayoutEffect(() => {
8714
8857
  const el = scrollRef.current;
8715
8858
  return () => {
@@ -8740,13 +8883,14 @@ var CodeBlock = React90__default.memo(
8740
8883
  eventBus.emit("UI:COPY_CODE", { language, success: false });
8741
8884
  }
8742
8885
  };
8886
+ const hasHeader = showLanguageBadge || showCopyButton;
8743
8887
  return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, children: [
8744
- (showLanguageBadge || showCopyButton) && /* @__PURE__ */ jsxs(
8888
+ hasHeader && /* @__PURE__ */ jsxs(
8745
8889
  HStack,
8746
8890
  {
8747
8891
  justify: "between",
8748
8892
  align: "center",
8749
- className: "px-3 py-2 bg-gray-800 rounded-t-lg border-b border-gray-700",
8893
+ className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
8750
8894
  children: [
8751
8895
  showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
8752
8896
  showCopyButton && /* @__PURE__ */ jsx(
@@ -8776,31 +8920,14 @@ var CodeBlock = React90__default.memo(
8776
8920
  touchAction: "pan-x pan-y",
8777
8921
  contain: "paint",
8778
8922
  backgroundColor: "#1e1e1e",
8779
- borderRadius: showLanguageBadge || showCopyButton ? "0 0 0.5rem 0.5rem" : "0.5rem",
8780
- padding: "1rem"
8923
+ borderRadius: hasHeader ? "0 0 0.5rem 0.5rem" : "0.5rem"
8781
8924
  },
8782
- children: /* @__PURE__ */ jsx(
8783
- SyntaxHighlighter,
8784
- {
8785
- PreTag: "div",
8786
- language,
8787
- style: activeStyle,
8788
- customStyle: {
8789
- backgroundColor: "transparent",
8790
- borderRadius: 0,
8791
- padding: 0,
8792
- margin: 0,
8793
- whiteSpace: "pre",
8794
- minWidth: "100%"
8795
- },
8796
- children: code
8797
- }
8798
- )
8925
+ children: /* @__PURE__ */ jsx("div", { ref: codeRef, style: { padding: "1rem" }, children: highlightedElement })
8799
8926
  }
8800
8927
  )
8801
8928
  ] });
8802
8929
  },
8803
- (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight
8930
+ (prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable
8804
8931
  );
8805
8932
  CodeBlock.displayName = "CodeBlock";
8806
8933
  var QuizBlock = ({
@@ -9988,7 +10115,7 @@ var sizeMap17 = {
9988
10115
  lg: "text-base px-4 py-2"
9989
10116
  };
9990
10117
  var variantMap2 = {
9991
- default: "bg-gray-800/80 border-gray-700",
10118
+ default: "bg-[var(--color-card)]/80 border-gray-700",
9992
10119
  primary: "bg-blue-900/80 border-blue-700",
9993
10120
  success: "bg-green-900/80 border-green-700",
9994
10121
  warning: "bg-yellow-900/80 border-yellow-700",
@@ -10049,7 +10176,7 @@ function StatBadge({
10049
10176
  animated: true
10050
10177
  }
10051
10178
  ),
10052
- format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-white", children: value })
10179
+ format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-[var(--color-foreground)]", children: value })
10053
10180
  ]
10054
10181
  }
10055
10182
  );
@@ -10392,7 +10519,7 @@ function HealthPanel({
10392
10519
  Box,
10393
10520
  {
10394
10521
  className: cn(
10395
- "rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm",
10522
+ "rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm",
10396
10523
  sizes.padding,
10397
10524
  className
10398
10525
  ),
@@ -10494,7 +10621,7 @@ function ScoreBoard({
10494
10621
  Card,
10495
10622
  {
10496
10623
  className: cn(
10497
- "bg-gray-900/90 border-gray-700 backdrop-blur-sm",
10624
+ "bg-[var(--color-card)]/90 border-gray-700 backdrop-blur-sm",
10498
10625
  className
10499
10626
  ),
10500
10627
  children: /* @__PURE__ */ jsx(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-wrap", children: [
@@ -10593,7 +10720,7 @@ function TurnPanel({
10593
10720
  Box,
10594
10721
  {
10595
10722
  className: cn(
10596
- "flex items-center gap-3 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
10723
+ "flex items-center gap-3 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
10597
10724
  className
10598
10725
  ),
10599
10726
  children: [
@@ -10640,7 +10767,7 @@ function EnemyPlate({
10640
10767
  Box,
10641
10768
  {
10642
10769
  className: cn(
10643
- "inline-flex flex-col gap-1 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
10770
+ "inline-flex flex-col gap-1 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
10644
10771
  "min-w-[120px]",
10645
10772
  className
10646
10773
  ),
@@ -10651,7 +10778,7 @@ function EnemyPlate({
10651
10778
  {
10652
10779
  variant: "caption",
10653
10780
  weight: "bold",
10654
- className: "text-white truncate",
10781
+ className: "text-[var(--color-foreground)] truncate",
10655
10782
  children: name
10656
10783
  }
10657
10784
  ),
@@ -10718,7 +10845,7 @@ function UnitCommandBar({
10718
10845
  Box,
10719
10846
  {
10720
10847
  className: cn(
10721
- "flex items-center gap-1.5 rounded-lg bg-gray-900/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
10848
+ "flex items-center gap-1.5 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
10722
10849
  className
10723
10850
  ),
10724
10851
  children: commands.map((command, i) => /* @__PURE__ */ jsxs(Box, { className: "flex flex-col items-center gap-0.5", children: [
@@ -10945,7 +11072,7 @@ function DialogueBox({
10945
11072
  tabIndex: 0,
10946
11073
  role: "dialog",
10947
11074
  "aria-label": "Dialogue",
10948
- children: /* @__PURE__ */ jsx("div", { className: "mx-4 my-4 bg-gray-900 bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
11075
+ children: /* @__PURE__ */ jsx("div", { className: "mx-4 my-4 bg-[var(--color-card)] bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
10949
11076
  dialogue.portrait && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 p-4 border-r border-gray-700", children: /* @__PURE__ */ jsx(
10950
11077
  "img",
10951
11078
  {
@@ -10957,7 +11084,7 @@ function DialogueBox({
10957
11084
  ) }),
10958
11085
  /* @__PURE__ */ jsxs("div", { className: "flex-1 p-4", children: [
10959
11086
  /* @__PURE__ */ jsx("div", { className: "text-yellow-400 font-bold mb-2", children: dialogue.speaker }),
10960
- /* @__PURE__ */ jsxs("div", { className: "text-white text-lg leading-relaxed min-h-[60px]", children: [
11087
+ /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-lg leading-relaxed min-h-[60px]", children: [
10961
11088
  displayedText,
10962
11089
  isTyping && /* @__PURE__ */ jsx("span", { className: "animate-pulse", children: "\u258C" })
10963
11090
  ] }),
@@ -10967,8 +11094,8 @@ function DialogueBox({
10967
11094
  type: "button",
10968
11095
  className: cn(
10969
11096
  "block w-full text-left px-4 py-2 rounded transition-colors",
10970
- "hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-yellow-400",
10971
- selectedChoice === index ? "bg-gray-700 text-yellow-400" : "bg-gray-800 text-white"
11097
+ "hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-yellow-400",
11098
+ selectedChoice === index ? "bg-[var(--color-surface,#374151)] text-yellow-400" : "bg-[var(--color-card)] text-[var(--color-foreground)]"
10972
11099
  ),
10973
11100
  onClick: (e) => {
10974
11101
  e.stopPropagation();
@@ -11161,7 +11288,7 @@ function InventoryPanel({
11161
11288
  /* @__PURE__ */ jsx(
11162
11289
  "div",
11163
11290
  {
11164
- className: "grid gap-1 bg-gray-900 p-2 rounded-lg border border-gray-700",
11291
+ className: "grid gap-1 bg-[var(--color-card)] p-2 rounded-lg border border-gray-700",
11165
11292
  style: {
11166
11293
  gridTemplateColumns: `repeat(${safeColumns}, ${slotSize}px)`,
11167
11294
  gridTemplateRows: `repeat(${rows}, ${slotSize}px)`
@@ -11172,9 +11299,9 @@ function InventoryPanel({
11172
11299
  type: "button",
11173
11300
  className: cn(
11174
11301
  "relative flex items-center justify-center",
11175
- "bg-gray-800 border rounded transition-colors",
11176
- "hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",
11177
- selectedSlot === index ? "border-yellow-400 bg-gray-700" : "border-gray-600"
11302
+ "bg-[var(--color-card)] border rounded transition-colors",
11303
+ "hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-blue-500",
11304
+ selectedSlot === index ? "border-yellow-400 bg-[var(--color-surface,#374151)]" : "border-gray-600"
11178
11305
  ),
11179
11306
  style: { width: slotSize, height: slotSize },
11180
11307
  onClick: () => handleSlotClick(index),
@@ -11204,14 +11331,14 @@ function InventoryPanel({
11204
11331
  showTooltips && hoveredItem && /* @__PURE__ */ jsxs(
11205
11332
  "div",
11206
11333
  {
11207
- className: "fixed z-50 bg-gray-900 border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
11334
+ className: "fixed z-50 bg-[var(--color-card)] border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
11208
11335
  style: {
11209
11336
  left: tooltipPosition.x,
11210
11337
  top: tooltipPosition.y,
11211
11338
  maxWidth: 200
11212
11339
  },
11213
11340
  children: [
11214
- /* @__PURE__ */ jsx("div", { className: "font-semibold text-white", children: hoveredItem.name || hoveredItem.type }),
11341
+ /* @__PURE__ */ jsx("div", { className: "font-semibold text-[var(--color-foreground)]", children: hoveredItem.name || hoveredItem.type }),
11215
11342
  hoveredItem.description && /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-400 mt-1", children: hoveredItem.description }),
11216
11343
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-500 mt-1", children: [
11217
11344
  "Quantity: ",
@@ -11223,9 +11350,9 @@ function InventoryPanel({
11223
11350
  ] });
11224
11351
  }
11225
11352
  var variantMap3 = {
11226
- primary: "bg-blue-600 hover:bg-blue-500 text-white border-blue-400 shadow-lg shadow-blue-500/25",
11227
- secondary: "bg-gray-700 hover:bg-gray-600 text-white border-gray-500",
11228
- ghost: "bg-transparent hover:bg-white/10 text-white border-white/20"
11353
+ primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400 shadow-lg shadow-blue-500/25",
11354
+ secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
11355
+ ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
11229
11356
  };
11230
11357
  function GameMenu({
11231
11358
  title,
@@ -11282,7 +11409,7 @@ function GameMenu({
11282
11409
  /* @__PURE__ */ jsx(
11283
11410
  "h1",
11284
11411
  {
11285
- className: "text-5xl md:text-7xl font-bold text-white tracking-tight",
11412
+ className: "text-5xl md:text-7xl font-bold text-[var(--color-foreground)] tracking-tight",
11286
11413
  style: {
11287
11414
  textShadow: "0 4px 12px rgba(0,0,0,0.5)"
11288
11415
  },
@@ -11338,9 +11465,9 @@ var variantColors = {
11338
11465
  }
11339
11466
  };
11340
11467
  var buttonVariants = {
11341
- primary: "bg-blue-600 hover:bg-blue-500 text-white border-blue-400",
11342
- secondary: "bg-gray-700 hover:bg-gray-600 text-white border-gray-500",
11343
- ghost: "bg-transparent hover:bg-white/10 text-white border-white/20"
11468
+ primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400",
11469
+ secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
11470
+ ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
11344
11471
  };
11345
11472
  function formatTime3(ms) {
11346
11473
  const seconds = Math.floor(ms / 1e3);
@@ -11421,7 +11548,7 @@ function GameOverScreen({
11421
11548
  }
11422
11549
  return /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
11423
11550
  /* @__PURE__ */ jsx("div", { className: "text-gray-400 text-sm mb-1", children: stat.label }),
11424
- /* @__PURE__ */ jsxs("div", { className: "text-white text-2xl font-bold flex items-center justify-center gap-2", children: [
11551
+ /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-2xl font-bold flex items-center justify-center gap-2", children: [
11425
11552
  stat.icon && /* @__PURE__ */ jsx("span", { children: stat.icon }),
11426
11553
  /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: displayValue })
11427
11554
  ] })
@@ -12615,7 +12742,7 @@ function IsometricCanvas({
12615
12742
  className: cn("relative w-full overflow-hidden rounded-lg", className),
12616
12743
  style: { height: viewportSize.height },
12617
12744
  "data-testid": "game-canvas-empty",
12618
- children: /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-full bg-slate-800 rounded-lg", children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
12745
+ children: /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-full bg-[var(--color-card)] rounded-lg", children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
12619
12746
  /* @__PURE__ */ jsx(Icon, { name: "map", size: "xl" }),
12620
12747
  /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-slate-400", children: t("canvas.emptyMessage") || "No map data loaded" })
12621
12748
  ] }) })
@@ -13691,7 +13818,7 @@ var Lightbox = ({
13691
13818
  className: cn(
13692
13819
  "absolute top-4 right-4 z-10",
13693
13820
  "p-2 rounded-full",
13694
- "text-white bg-black bg-opacity-50",
13821
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
13695
13822
  "hover:bg-opacity-70 transition-opacity",
13696
13823
  "focus:outline-none focus:ring-2 focus:ring-white"
13697
13824
  ),
@@ -13710,7 +13837,7 @@ var Lightbox = ({
13710
13837
  className: cn(
13711
13838
  "absolute left-4 z-10",
13712
13839
  "p-2 rounded-full",
13713
- "text-white bg-black bg-opacity-50",
13840
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
13714
13841
  "hover:bg-opacity-70 transition-opacity",
13715
13842
  "focus:outline-none focus:ring-2 focus:ring-white"
13716
13843
  ),
@@ -13747,7 +13874,7 @@ var Lightbox = ({
13747
13874
  className: cn(
13748
13875
  "absolute right-4 z-10",
13749
13876
  "p-2 rounded-full",
13750
- "text-white bg-black bg-opacity-50",
13877
+ "text-[var(--color-foreground)] bg-[var(--color-card)]",
13751
13878
  "hover:bg-opacity-70 transition-opacity",
13752
13879
  "focus:outline-none focus:ring-2 focus:ring-white"
13753
13880
  ),
@@ -13756,12 +13883,12 @@ var Lightbox = ({
13756
13883
  }
13757
13884
  ),
13758
13885
  /* @__PURE__ */ jsxs("div", { className: "absolute bottom-4 left-0 right-0 text-center", children: [
13759
- showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-white text-sm mb-1", children: [
13886
+ showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxs("div", { className: "text-[var(--color-foreground)] text-sm mb-1", children: [
13760
13887
  index + 1,
13761
13888
  " of ",
13762
13889
  safeImages.length
13763
13890
  ] }),
13764
- currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-white text-sm opacity-80 px-8", children: currentImage.caption })
13891
+ currentImage?.caption && /* @__PURE__ */ jsx("div", { className: "text-[var(--color-foreground)] text-sm opacity-80 px-8", children: currentImage.caption })
13765
13892
  ] })
13766
13893
  ]
13767
13894
  }
@@ -26834,7 +26961,7 @@ function SequencerBoard({
26834
26961
  setPlayState("playing");
26835
26962
  setCurrentStep(0);
26836
26963
  let step = 0;
26837
- const advance2 = () => {
26964
+ const advance = () => {
26838
26965
  step++;
26839
26966
  if (step >= entity.maxSlots) {
26840
26967
  const playerSeq = slots.map((s) => s?.id);
@@ -26865,10 +26992,10 @@ function SequencerBoard({
26865
26992
  }
26866
26993
  } else {
26867
26994
  setCurrentStep(step);
26868
- timerRef.current = setTimeout(advance2, stepDurationMs);
26995
+ timerRef.current = setTimeout(advance, stepDurationMs);
26869
26996
  }
26870
26997
  };
26871
- timerRef.current = setTimeout(advance2, stepDurationMs);
26998
+ timerRef.current = setTimeout(advance, stepDurationMs);
26872
26999
  }, [canPlay, slots, entity.maxSlots, entity.solutions, stepDurationMs, playEvent, completeEvent, emit]);
26873
27000
  const machine = {
26874
27001
  name: entity.title,
@@ -28980,25 +29107,92 @@ function generateCombatMessage(event) {
28980
29107
  var store = /* @__PURE__ */ new Map();
28981
29108
  var storeListeners = /* @__PURE__ */ new Set();
28982
29109
  var watchCallbacks = /* @__PURE__ */ new Map();
28983
- function advance(entityType, data) {
28984
- const prev = store.get(entityType);
28985
- const oldData = prev?.data ?? [];
28986
- store.set(entityType, { data, version: (prev?.version ?? 0) + 1 });
29110
+ function extractId(record) {
29111
+ const r = record;
29112
+ return String(r.id ?? r._id ?? r.key ?? "");
29113
+ }
29114
+ function materialize(snap) {
29115
+ return snap.ids.map((id) => snap.entities.get(id));
29116
+ }
29117
+ function notifyListeners(entityType, prev) {
28987
29118
  for (const listener of storeListeners) {
28988
29119
  listener();
28989
29120
  }
28990
29121
  const cbs = watchCallbacks.get(entityType);
28991
29122
  if (cbs) {
29123
+ const oldData = prev ? materialize(prev) : [];
29124
+ const cur = store.get(entityType);
29125
+ const newData = cur ? materialize(cur) : [];
28992
29126
  for (const cb of cbs) {
28993
29127
  try {
28994
- cb(oldData, data);
29128
+ cb(oldData, newData);
28995
29129
  } catch {
28996
29130
  }
28997
29131
  }
28998
29132
  }
28999
29133
  }
29134
+ function setAll(entityType, records) {
29135
+ const entities2 = /* @__PURE__ */ new Map();
29136
+ const ids = [];
29137
+ for (const r of records) {
29138
+ const rec = r;
29139
+ const id = extractId(rec);
29140
+ if (id) {
29141
+ entities2.set(id, rec);
29142
+ ids.push(id);
29143
+ }
29144
+ }
29145
+ const prev = store.get(entityType);
29146
+ store.set(entityType, { entities: entities2, ids, version: (prev?.version ?? 0) + 1 });
29147
+ notifyListeners(entityType, prev);
29148
+ }
29149
+ function upsertOne(entityType, record) {
29150
+ const id = extractId(record);
29151
+ if (!id) return;
29152
+ const prev = store.get(entityType);
29153
+ const snapshot = prev ? { entities: new Map(prev.entities), ids: [...prev.ids], version: prev.version } : { entities: /* @__PURE__ */ new Map(), ids: [], version: 0 };
29154
+ snapshot.entities.set(id, record);
29155
+ if (!snapshot.ids.includes(id)) snapshot.ids.push(id);
29156
+ snapshot.version++;
29157
+ store.set(entityType, snapshot);
29158
+ notifyListeners(entityType, prev);
29159
+ }
29160
+ function addOne(entityType, record) {
29161
+ upsertOne(entityType, record);
29162
+ }
29163
+ function updateOne(entityType, id, changes) {
29164
+ const prev = store.get(entityType);
29165
+ if (!prev?.entities.has(id)) return;
29166
+ const snapshot = {
29167
+ entities: new Map(prev.entities),
29168
+ ids: [...prev.ids],
29169
+ version: prev.version
29170
+ };
29171
+ snapshot.entities.set(id, { ...snapshot.entities.get(id), ...changes });
29172
+ snapshot.version++;
29173
+ store.set(entityType, snapshot);
29174
+ notifyListeners(entityType, prev);
29175
+ }
29176
+ function removeOne(entityType, id) {
29177
+ const prev = store.get(entityType);
29178
+ if (!prev) return;
29179
+ const snapshot = {
29180
+ entities: new Map(prev.entities),
29181
+ ids: prev.ids.filter((i) => i !== id),
29182
+ version: prev.version
29183
+ };
29184
+ snapshot.entities.delete(id);
29185
+ snapshot.version++;
29186
+ store.set(entityType, snapshot);
29187
+ notifyListeners(entityType, prev);
29188
+ }
29000
29189
  function getSnapshot2(entityType) {
29001
- return store.get(entityType)?.data ?? [];
29190
+ const snap = store.get(entityType);
29191
+ if (!snap) return [];
29192
+ return materialize(snap);
29193
+ }
29194
+ function getById(entityType, id) {
29195
+ return store.get(entityType)?.entities.get(id) ?? null;
29002
29196
  }
29003
29197
  function getVersion(entityType) {
29004
29198
  return store.get(entityType)?.version ?? 0;
@@ -29022,10 +29216,20 @@ function useEntityRef(entityType) {
29022
29216
  }, [entityType]);
29023
29217
  return useSyncExternalStore(subscribeToStore, getSnapshotStable, () => []);
29024
29218
  }
29025
- createContext({
29026
- advance,
29027
- getSnapshot: getSnapshot2
29028
- });
29219
+ var contextValue = {
29220
+ setAll,
29221
+ upsertOne,
29222
+ addOne,
29223
+ updateOne,
29224
+ removeOne,
29225
+ getSnapshot: getSnapshot2,
29226
+ getById
29227
+ };
29228
+ createContext(contextValue);
29229
+ var EntitySchemaContext = createContext(null);
29230
+ function useEntitySchemaOptional() {
29231
+ return useContext(EntitySchemaContext);
29232
+ }
29029
29233
  var ClientEffectConfigContext = createContext(null);
29030
29234
  ClientEffectConfigContext.Provider;
29031
29235
 
@@ -29552,11 +29756,11 @@ var AuthLayout = ({
29552
29756
  children: [
29553
29757
  /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
29554
29758
  /* @__PURE__ */ jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-3", children: [
29555
- logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
29759
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsx(
29556
29760
  Typography,
29557
29761
  {
29558
29762
  variant: "body1",
29559
- className: "text-white font-bold text-lg",
29763
+ className: "text-[var(--color-foreground)] font-bold text-lg",
29560
29764
  children: appName.charAt(0).toUpperCase()
29561
29765
  }
29562
29766
  ) }),
@@ -29564,7 +29768,7 @@ var AuthLayout = ({
29564
29768
  Typography,
29565
29769
  {
29566
29770
  variant: "body1",
29567
- className: "text-2xl font-bold text-white",
29771
+ className: "text-2xl font-bold text-[var(--color-foreground)]",
29568
29772
  children: appName
29569
29773
  }
29570
29774
  )
@@ -29574,7 +29778,7 @@ var AuthLayout = ({
29574
29778
  Typography,
29575
29779
  {
29576
29780
  variant: "h1",
29577
- className: "text-4xl font-bold text-white leading-tight",
29781
+ className: "text-4xl font-bold text-[var(--color-foreground)] leading-tight",
29578
29782
  children: [
29579
29783
  "Welcome to ",
29580
29784
  appName
@@ -29585,27 +29789,27 @@ var AuthLayout = ({
29585
29789
  Typography,
29586
29790
  {
29587
29791
  variant: "body1",
29588
- className: "text-lg text-white/80 max-w-md",
29792
+ className: "text-lg text-[var(--color-foreground)]/80 max-w-md",
29589
29793
  children: "Sign in to access your dashboard and manage your account."
29590
29794
  }
29591
29795
  ),
29592
- /* @__PURE__ */ jsxs(Box, { className: "mt-12 p-6 bg-white/10 rounded-xl backdrop-blur", children: [
29796
+ /* @__PURE__ */ jsxs(Box, { className: "mt-12 p-6 bg-[var(--color-card)]/10 rounded-xl backdrop-blur", children: [
29593
29797
  /* @__PURE__ */ jsx(
29594
29798
  Typography,
29595
29799
  {
29596
29800
  variant: "body1",
29597
- className: "text-white/90 italic",
29801
+ className: "text-[var(--color-foreground)]/90 italic",
29598
29802
  children: '"This platform has transformed how we work. Highly recommended!"'
29599
29803
  }
29600
29804
  ),
29601
29805
  /* @__PURE__ */ jsxs(HStack, { className: "mt-4", gap: "sm", align: "center", children: [
29602
- /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-white/20 rounded-full" }),
29806
+ /* @__PURE__ */ jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-full" }),
29603
29807
  /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
29604
29808
  /* @__PURE__ */ jsx(
29605
29809
  Typography,
29606
29810
  {
29607
29811
  variant: "body1",
29608
- className: "text-white font-medium",
29812
+ className: "text-[var(--color-foreground)] font-medium",
29609
29813
  children: "Jane Doe"
29610
29814
  }
29611
29815
  ),
@@ -29613,7 +29817,7 @@ var AuthLayout = ({
29613
29817
  Typography,
29614
29818
  {
29615
29819
  variant: "body1",
29616
- className: "text-white/60 text-sm",
29820
+ className: "text-[var(--color-foreground)]/60 text-sm",
29617
29821
  children: "CEO, Example Co."
29618
29822
  }
29619
29823
  )
@@ -29621,8 +29825,8 @@ var AuthLayout = ({
29621
29825
  ] })
29622
29826
  ] })
29623
29827
  ] }) }),
29624
- /* @__PURE__ */ jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-white/5 rounded-full" }),
29625
- /* @__PURE__ */ jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-white/5 rounded-full" })
29828
+ /* @__PURE__ */ jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-[var(--color-card)]/5 rounded-full" }),
29829
+ /* @__PURE__ */ jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-[var(--color-card)]/5 rounded-full" })
29626
29830
  ]
29627
29831
  }
29628
29832
  ),
@@ -29639,7 +29843,7 @@ var AuthLayout = ({
29639
29843
  Typography,
29640
29844
  {
29641
29845
  variant: "body1",
29642
- className: "text-white font-bold text-xl",
29846
+ className: "text-[var(--color-foreground)] font-bold text-xl",
29643
29847
  children: appName.charAt(0).toUpperCase()
29644
29848
  }
29645
29849
  ) }),
@@ -32142,6 +32346,254 @@ function onDebugToggle(listener) {
32142
32346
  listeners5.add(listener);
32143
32347
  return () => listeners5.delete(listener);
32144
32348
  }
32349
+ function layoutGraph(states, transitions, initialState, width, height) {
32350
+ if (states.length === 0) return [];
32351
+ const layers = /* @__PURE__ */ new Map();
32352
+ const queue = [initialState];
32353
+ layers.set(initialState, 0);
32354
+ while (queue.length > 0) {
32355
+ const current = queue.shift();
32356
+ const layer = layers.get(current);
32357
+ for (const tr of transitions) {
32358
+ if (tr.from === current && !layers.has(tr.to)) {
32359
+ layers.set(tr.to, layer + 1);
32360
+ queue.push(tr.to);
32361
+ }
32362
+ }
32363
+ }
32364
+ for (const s of states) {
32365
+ if (!layers.has(s)) layers.set(s, layers.size > 0 ? Math.max(...layers.values()) + 1 : 0);
32366
+ }
32367
+ const layerGroups = /* @__PURE__ */ new Map();
32368
+ for (const [state, layer] of layers) {
32369
+ const group = layerGroups.get(layer) ?? [];
32370
+ group.push(state);
32371
+ layerGroups.set(layer, group);
32372
+ }
32373
+ const maxLayer = Math.max(...layerGroups.keys(), 0);
32374
+ const padX = 24;
32375
+ const padY = 20;
32376
+ const usableW = width - padX * 2;
32377
+ const usableH = height - padY * 2;
32378
+ const positions = [];
32379
+ for (const [layer, group] of layerGroups) {
32380
+ const y = maxLayer === 0 ? usableH / 2 + padY : padY + layer / maxLayer * usableH;
32381
+ for (let i = 0; i < group.length; i++) {
32382
+ const x = group.length === 1 ? width / 2 : padX + i / (group.length - 1) * usableW;
32383
+ positions.push({ x, y, state: group[i] });
32384
+ }
32385
+ }
32386
+ return positions;
32387
+ }
32388
+ function WalkMinimap() {
32389
+ const [walkStep, setWalkStep] = React90.useState(null);
32390
+ const [traits2, setTraits] = React90.useState([]);
32391
+ const [coveredEdges, setCoveredEdges] = React90.useState([]);
32392
+ const [completedTraits, setCompletedTraits] = React90.useState(/* @__PURE__ */ new Set());
32393
+ const prevTraitRef = React90.useRef(null);
32394
+ React90.useEffect(() => {
32395
+ const interval = setInterval(() => {
32396
+ const w = window;
32397
+ const step = w.__orbitalWalkStep;
32398
+ const traitConfigs = w.__orbitalWalkTraits;
32399
+ const edges = w.__orbitalCoveredEdges;
32400
+ if (step) setWalkStep(step);
32401
+ if (traitConfigs) setTraits(traitConfigs);
32402
+ if (edges) setCoveredEdges(edges);
32403
+ if (step && prevTraitRef.current && prevTraitRef.current !== step.traitName) {
32404
+ setCompletedTraits((prev) => new Set(prev).add(prevTraitRef.current));
32405
+ }
32406
+ if (step) prevTraitRef.current = step.traitName;
32407
+ }, 250);
32408
+ return () => clearInterval(interval);
32409
+ }, []);
32410
+ if (!walkStep || traits2.length === 0) return null;
32411
+ const activeTrait = traits2.find((t) => t.name === walkStep.traitName);
32412
+ const engineCount = coveredEdges.filter((e) => e.phase === "engine").length;
32413
+ const domCount = coveredEdges.filter((e) => e.phase === "dom").length;
32414
+ const totalTransitions = traits2.reduce((sum, t) => sum + t.transitions.length, 0);
32415
+ const activeEdgeKeys = new Set(
32416
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => `${e.from}+${e.event}->${e.to}`)
32417
+ );
32418
+ const activeEdgePhases = new Map(
32419
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => [`${e.from}+${e.event}->${e.to}`, e.phase])
32420
+ );
32421
+ const currentEdgeKey = `${walkStep.from}+${walkStep.event}->${walkStep.to}`;
32422
+ const graphW = 260;
32423
+ const graphH = 120;
32424
+ const nodeR = 10;
32425
+ const positions = activeTrait ? layoutGraph(activeTrait.states, activeTrait.transitions, activeTrait.initialState, graphW, graphH) : [];
32426
+ const posMap = new Map(positions.map((p2) => [p2.state, p2]));
32427
+ const visitedStates = new Set(
32428
+ coveredEdges.filter((e) => e.trait === walkStep.traitName).flatMap((e) => [e.from, e.to])
32429
+ );
32430
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "w-64 flex-shrink-0 border-l border-border bg-[var(--color-card)] overflow-hidden", children: [
32431
+ /* @__PURE__ */ jsx(Box, { className: "px-2 py-1.5 border-b border-border overflow-x-auto", children: /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-nowrap", children: traits2.map((t) => {
32432
+ const isDone = completedTraits.has(t.name);
32433
+ const isActive = t.name === walkStep.traitName;
32434
+ const variant = isDone ? "success" : isActive ? "info" : "neutral";
32435
+ const shortName = t.name.replace(/^[A-Z][a-z]+/, "");
32436
+ return /* @__PURE__ */ jsxs(
32437
+ Badge,
32438
+ {
32439
+ variant,
32440
+ size: "sm",
32441
+ className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
32442
+ children: [
32443
+ isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
32444
+ " ",
32445
+ shortName || t.name
32446
+ ]
32447
+ },
32448
+ t.name
32449
+ );
32450
+ }) }) }),
32451
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-1 py-1", children: activeTrait && /* @__PURE__ */ jsxs("svg", { width: graphW, height: graphH, viewBox: `0 0 ${graphW} ${graphH}`, children: [
32452
+ /* @__PURE__ */ jsxs("defs", { children: [
32453
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#888" }) }),
32454
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-green", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#22c55e" }) }),
32455
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-cyan", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#06b6d4" }) }),
32456
+ /* @__PURE__ */ jsx("marker", { id: "mm-arrow-yellow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#eab308" }) })
32457
+ ] }),
32458
+ activeTrait.transitions.map((tr, i) => {
32459
+ const fromPos = posMap.get(tr.from);
32460
+ const toPos = posMap.get(tr.to);
32461
+ if (!fromPos || !toPos) return null;
32462
+ const key = `${tr.from}+${tr.event}->${tr.to}`;
32463
+ const isCurrent = key === currentEdgeKey && !walkStep.isRepositioning;
32464
+ const isCovered = activeEdgeKeys.has(key);
32465
+ const phase = activeEdgePhases.get(key);
32466
+ let stroke = "#555";
32467
+ let markerEnd = "url(#mm-arrow)";
32468
+ let strokeWidth = 1;
32469
+ let opacity = 0.4;
32470
+ if (isCurrent) {
32471
+ stroke = "#eab308";
32472
+ markerEnd = "url(#mm-arrow-yellow)";
32473
+ strokeWidth = 2.5;
32474
+ opacity = 1;
32475
+ } else if (isCovered && phase === "dom") {
32476
+ stroke = "#06b6d4";
32477
+ markerEnd = "url(#mm-arrow-cyan)";
32478
+ strokeWidth = 1.5;
32479
+ opacity = 0.9;
32480
+ } else if (isCovered) {
32481
+ stroke = "#22c55e";
32482
+ markerEnd = "url(#mm-arrow-green)";
32483
+ strokeWidth = 1.5;
32484
+ opacity = 0.9;
32485
+ }
32486
+ if (tr.from === tr.to) {
32487
+ const cx = fromPos.x;
32488
+ const cy = fromPos.y - nodeR - 8;
32489
+ return /* @__PURE__ */ jsxs("g", { children: [
32490
+ /* @__PURE__ */ jsx(
32491
+ "path",
32492
+ {
32493
+ d: `M${cx - 5},${fromPos.y - nodeR} C${cx - 18},${cy - 14} ${cx + 18},${cy - 14} ${cx + 5},${fromPos.y - nodeR}`,
32494
+ fill: "none",
32495
+ stroke,
32496
+ strokeWidth,
32497
+ opacity,
32498
+ markerEnd
32499
+ }
32500
+ ),
32501
+ /* @__PURE__ */ jsx("text", { x: cx, y: cy - 12, textAnchor: "middle", fontSize: "7", fill: stroke, opacity, children: tr.event.length > 10 ? tr.event.slice(0, 8) + ".." : tr.event })
32502
+ ] }, `e-${i}`);
32503
+ }
32504
+ const dx = toPos.x - fromPos.x;
32505
+ const dy = toPos.y - fromPos.y;
32506
+ const len = Math.sqrt(dx * dx + dy * dy) || 1;
32507
+ const nx = -dy / len;
32508
+ const ny = dx / len;
32509
+ const hasReverse = activeTrait.transitions.some(
32510
+ (t2) => t2.from === tr.to && t2.to === tr.from
32511
+ );
32512
+ const offset = hasReverse ? 4 : 0;
32513
+ const x1 = fromPos.x + dx / len * nodeR + nx * offset;
32514
+ const y1 = fromPos.y + dy / len * nodeR + ny * offset;
32515
+ const x2 = toPos.x - dx / len * (nodeR + 6) + nx * offset;
32516
+ const y2 = toPos.y - dy / len * (nodeR + 6) + ny * offset;
32517
+ const mx = (x1 + x2) / 2 + nx * 8;
32518
+ const my = (y1 + y2) / 2 + ny * 8;
32519
+ return /* @__PURE__ */ jsxs("g", { children: [
32520
+ /* @__PURE__ */ jsx(
32521
+ "line",
32522
+ {
32523
+ x1,
32524
+ y1,
32525
+ x2,
32526
+ y2,
32527
+ stroke,
32528
+ strokeWidth,
32529
+ opacity,
32530
+ markerEnd,
32531
+ children: isCurrent && /* @__PURE__ */ jsx("animate", { attributeName: "opacity", values: "1;0.4;1", dur: "0.8s", repeatCount: "indefinite" })
32532
+ }
32533
+ ),
32534
+ /* @__PURE__ */ jsx("text", { x: mx, y: my, textAnchor: "middle", fontSize: "7", fill: stroke, opacity: Math.min(opacity + 0.2, 1), children: tr.event.length > 12 ? tr.event.slice(0, 10) + ".." : tr.event })
32535
+ ] }, `e-${i}`);
32536
+ }),
32537
+ positions.map((pos) => {
32538
+ const isCurrentState = pos.state === walkStep.from || pos.state === walkStep.to;
32539
+ const isVisited = visitedStates.has(pos.state);
32540
+ const isInitial = pos.state === activeTrait.initialState;
32541
+ let fill = "#333";
32542
+ let strokeColor = "#555";
32543
+ let sw = 1;
32544
+ if (isCurrentState) {
32545
+ fill = "#1e40af";
32546
+ strokeColor = "#3b82f6";
32547
+ sw = 2;
32548
+ } else if (isVisited) {
32549
+ fill = "#166534";
32550
+ strokeColor = "#22c55e";
32551
+ sw = 1.5;
32552
+ }
32553
+ return /* @__PURE__ */ jsxs("g", { children: [
32554
+ isInitial && /* @__PURE__ */ jsx("circle", { cx: pos.x, cy: pos.y, r: nodeR + 3, fill: "none", stroke: "#3b82f6", strokeWidth: 1, opacity: 0.4 }),
32555
+ /* @__PURE__ */ jsx(
32556
+ "circle",
32557
+ {
32558
+ cx: pos.x,
32559
+ cy: pos.y,
32560
+ r: nodeR,
32561
+ fill,
32562
+ stroke: strokeColor,
32563
+ strokeWidth: sw,
32564
+ children: isCurrentState && /* @__PURE__ */ jsx("animate", { attributeName: "r", values: `${nodeR};${nodeR + 2};${nodeR}`, dur: "1s", repeatCount: "indefinite" })
32565
+ }
32566
+ ),
32567
+ /* @__PURE__ */ jsx(
32568
+ "text",
32569
+ {
32570
+ x: pos.x,
32571
+ y: pos.y + nodeR + 10,
32572
+ textAnchor: "middle",
32573
+ fontSize: "8",
32574
+ fill: "#aaa",
32575
+ children: pos.state.length > 10 ? pos.state.slice(0, 8) + ".." : pos.state
32576
+ }
32577
+ )
32578
+ ] }, pos.state);
32579
+ })
32580
+ ] }) }),
32581
+ /* @__PURE__ */ jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
32582
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-green-500", children: [
32583
+ "Engine: ",
32584
+ engineCount,
32585
+ "/",
32586
+ totalTransitions
32587
+ ] }),
32588
+ domCount > 0 && /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-cyan-500", children: [
32589
+ "DOM: ",
32590
+ domCount
32591
+ ] }),
32592
+ /* @__PURE__ */ jsx(Badge, { variant: walkStep.phase === "engine" ? "info" : "warning", size: "sm", className: "text-[9px]", children: walkStep.phase === "engine" ? "Engine" : "DOM" })
32593
+ ] }) })
32594
+ ] });
32595
+ }
32596
+ WalkMinimap.displayName = "WalkMinimap";
32145
32597
  function TraitsTab({ traits: traits2 }) {
32146
32598
  if (traits2.length === 0) {
32147
32599
  return /* @__PURE__ */ jsx(
@@ -32965,25 +33417,25 @@ function EventDispatcherTab({ traits: traits2, schema }) {
32965
33417
  EventDispatcherTab.displayName = "EventDispatcherTab";
32966
33418
  function ServerResponseRow({ sr }) {
32967
33419
  const entityEntries = Object.entries(sr.dataEntities);
32968
- return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-700/50 py-0.5 text-[10px] font-mono", children: [
33420
+ return /* @__PURE__ */ jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-[10px] font-mono", children: [
32969
33421
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
32970
- /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-400" : "text-red-400", children: [
33422
+ /* @__PURE__ */ jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
32971
33423
  sr.success ? "\u2713" : "\u2717",
32972
33424
  " server"
32973
33425
  ] }),
32974
- /* @__PURE__ */ jsx("span", { className: "text-purple-300", children: sr.orbitalName }),
32975
- sr.clientEffects > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-purple-900/50 text-purple-300", children: [
33426
+ /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
33427
+ sr.clientEffects > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: [
32976
33428
  sr.clientEffects,
32977
33429
  " clientEffect",
32978
33430
  sr.clientEffects !== 1 ? "s" : ""
32979
33431
  ] }),
32980
- sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-900/50 text-blue-300", children: [
33432
+ sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
32981
33433
  "emit: ",
32982
33434
  sr.emittedEvents.join(", ")
32983
33435
  ] }),
32984
- sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-900/50 text-red-400 truncate max-w-[300px]", children: sr.error })
33436
+ sr.error && /* @__PURE__ */ jsx("span", { className: "px-1 rounded bg-red-500/15 text-red-600 dark:text-red-400 truncate max-w-[300px]", children: sr.error })
32985
33437
  ] }),
32986
- entityEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-gray-800 text-gray-300", children: [
33438
+ entityEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxs("span", { className: "px-1 rounded bg-[var(--color-card)] text-foreground", children: [
32987
33439
  name,
32988
33440
  ": ",
32989
33441
  count,
@@ -32996,24 +33448,24 @@ function TransitionRow({ trace }) {
32996
33448
  const isServerEntry = !!trace.serverResponse && trace.traitName.startsWith("server:");
32997
33449
  const hasFailedEffects = trace.effects.some((e) => e.status === "failed");
32998
33450
  if (isServerEntry && trace.serverResponse) {
32999
- return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-gray-800 last:border-0", children: [
33451
+ return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
33000
33452
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
33001
33453
  /* @__PURE__ */ jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
33002
33454
  /* @__PURE__ */ jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
33003
- /* @__PURE__ */ jsx("span", { className: "text-purple-400 flex-shrink-0", children: "server response" })
33455
+ /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: "server response" })
33004
33456
  ] }),
33005
33457
  /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
33006
33458
  ] });
33007
33459
  }
33008
- return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-gray-800 last:border-0", children: [
33460
+ return /* @__PURE__ */ jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
33009
33461
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
33010
33462
  /* @__PURE__ */ jsx("span", { className: cn(
33011
33463
  "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
33012
33464
  hasFailedEffects ? "bg-red-500" : "bg-green-500"
33013
33465
  ) }),
33014
33466
  /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
33015
- /* @__PURE__ */ jsx("span", { className: "text-gray-300 flex-shrink-0", children: trace.traitName }),
33016
- /* @__PURE__ */ jsxs("span", { className: "text-gray-400 flex-shrink-0", children: [
33467
+ /* @__PURE__ */ jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
33468
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground/70 flex-shrink-0", children: [
33017
33469
  trace.from,
33018
33470
  " ",
33019
33471
  "\u2192",
@@ -33023,12 +33475,12 @@ function TransitionRow({ trace }) {
33023
33475
  ] }),
33024
33476
  trace.effects.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 ml-6 mt-0.5", children: trace.effects.map((eff, i) => /* @__PURE__ */ jsxs("span", { className: cn(
33025
33477
  "px-1 rounded text-[10px]",
33026
- eff.status === "executed" ? "bg-green-900/50 text-green-400" : eff.status === "failed" ? "bg-red-900/50 text-red-400" : "bg-yellow-900/50 text-yellow-400"
33478
+ eff.status === "executed" ? "bg-green-500/15 text-green-600 dark:text-green-400" : eff.status === "failed" ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-yellow-500/15 text-yellow-600 dark:text-yellow-400"
33027
33479
  ), children: [
33028
33480
  eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
33029
33481
  " ",
33030
33482
  eff.type,
33031
- eff.args.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-gray-500 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
33483
+ eff.args.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground/50 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
33032
33484
  ] }, i)) }),
33033
33485
  trace.serverResponse && /* @__PURE__ */ jsx(ServerResponseRow, { sr: trace.serverResponse })
33034
33486
  ] });
@@ -33043,15 +33495,6 @@ function VerifyModePanel({
33043
33495
  }) {
33044
33496
  const scrollRef = React90.useRef(null);
33045
33497
  const prevCountRef = React90.useRef(0);
33046
- const [walkStep, setWalkStep] = React90.useState(null);
33047
- React90.useEffect(() => {
33048
- const interval = setInterval(() => {
33049
- const w = window;
33050
- const step = w.__orbitalWalkStep;
33051
- if (step) setWalkStep(step);
33052
- }, 300);
33053
- return () => clearInterval(interval);
33054
- }, []);
33055
33498
  React90.useEffect(() => {
33056
33499
  if (transitions.length > prevCountRef.current && scrollRef.current) {
33057
33500
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
@@ -33064,49 +33507,28 @@ function VerifyModePanel({
33064
33507
  {
33065
33508
  className: cn(
33066
33509
  "runtime-debugger runtime-debugger--verify",
33067
- "flex flex-col bg-gray-900 text-white border-t-2 border-cyan-500",
33510
+ "flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
33068
33511
  hudBottom ? "" : "fixed bottom-0 left-0 right-0",
33069
33512
  className
33070
33513
  ),
33071
33514
  "data-testid": "debugger-verify",
33072
33515
  style: { height: "25vh", zIndex: hudBottom ? void 0 : 40 },
33073
33516
  children: [
33074
- /* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-gray-700 flex-shrink-0", children: [
33517
+ /* @__PURE__ */ jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-border flex-shrink-0", children: [
33075
33518
  /* @__PURE__ */ jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? `${failedChecks} fail` : "OK" }),
33076
- /* @__PURE__ */ jsxs("span", { className: "text-gray-400", children: [
33519
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground/70", children: [
33077
33520
  localCount,
33078
33521
  " local"
33079
33522
  ] }),
33080
- /* @__PURE__ */ jsxs("span", { className: "text-purple-400", children: [
33523
+ /* @__PURE__ */ jsxs("span", { className: "text-purple-600 dark:text-purple-400", children: [
33081
33524
  serverCount,
33082
33525
  " server"
33083
33526
  ] }),
33084
- traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-400 truncate max-w-[400px]", children: traitStates })
33527
+ traitStates && /* @__PURE__ */ jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates })
33085
33528
  ] }),
33086
33529
  /* @__PURE__ */ jsxs("div", { className: "flex-1 flex overflow-hidden", children: [
33087
- /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-gray-500 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsx(TransitionRow, { trace }, trace.id)) }) }) }),
33088
- walkStep && /* @__PURE__ */ jsxs("div", { className: "w-56 flex-shrink-0 border-l border-gray-700 px-2 py-1 text-xs font-mono overflow-y-auto", children: [
33089
- /* @__PURE__ */ jsxs("div", { className: "text-cyan-400 font-bold mb-1", children: [
33090
- "Walk Step ",
33091
- walkStep.stepIndex,
33092
- "/",
33093
- walkStep.stepTotal
33094
- ] }),
33095
- /* @__PURE__ */ jsx("div", { className: "text-gray-300 mb-1", children: walkStep.traitName }),
33096
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 mb-1", children: [
33097
- /* @__PURE__ */ jsx("span", { className: "text-yellow-300", children: walkStep.from }),
33098
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "--" }),
33099
- /* @__PURE__ */ jsx("span", { className: "text-green-300", children: walkStep.event }),
33100
- /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: "-->" }),
33101
- /* @__PURE__ */ jsx("span", { className: "text-yellow-300", children: walkStep.to })
33102
- ] }),
33103
- walkStep.guardCase && /* @__PURE__ */ jsxs("div", { className: walkStep.guardCase === "pass" ? "text-green-400" : "text-red-400", children: [
33104
- "guard: ",
33105
- walkStep.guardCase
33106
- ] }),
33107
- walkStep.isRepositioning && /* @__PURE__ */ jsx("div", { className: "text-gray-500 italic", children: "repositioning" }),
33108
- /* @__PURE__ */ jsx("div", { className: walkStep.accepted ? "text-green-400 mt-1" : "text-red-400 mt-1", children: walkStep.accepted ? "\u2713 accepted" : "\u2717 rejected" })
33109
- ] })
33530
+ /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-foreground/50 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsx(TransitionRow, { trace }, trace.id)) }) }) }),
33531
+ /* @__PURE__ */ jsx(WalkMinimap, {})
33110
33532
  ] })
33111
33533
  ]
33112
33534
  }
@@ -33331,7 +33753,7 @@ function RuntimeDebugger({
33331
33753
  className: "runtime-debugger__tabs"
33332
33754
  }
33333
33755
  ) }),
33334
- /* @__PURE__ */ jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
33756
+ /* @__PURE__ */ jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-foreground/50", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
33335
33757
  ] })
33336
33758
  }
33337
33759
  );
@@ -34042,6 +34464,62 @@ function getComponentForPattern(patternType) {
34042
34464
  if (!name) return null;
34043
34465
  return COMPONENT_REGISTRY[name] ?? null;
34044
34466
  }
34467
+ var FORM_PATTERNS = /* @__PURE__ */ new Set([
34468
+ "form",
34469
+ "form-section",
34470
+ "inline-edit-form",
34471
+ "wizard-step"
34472
+ ]);
34473
+ function enrichFormFields(fields, entityDef) {
34474
+ const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
34475
+ return fields.map((field) => {
34476
+ if (typeof field === "string") {
34477
+ const entityField = fieldMap.get(field);
34478
+ if (entityField) {
34479
+ const enriched = {
34480
+ name: field,
34481
+ label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
34482
+ type: entityField.type,
34483
+ required: entityField.required
34484
+ };
34485
+ if (entityField.values && entityField.values.length > 0) {
34486
+ enriched.values = entityField.values;
34487
+ } else if (entityField.enumValues && entityField.enumValues.length > 0) {
34488
+ enriched.values = entityField.enumValues;
34489
+ }
34490
+ if (entityField.relation) {
34491
+ enriched.relation = entityField.relation;
34492
+ }
34493
+ return enriched;
34494
+ }
34495
+ return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
34496
+ }
34497
+ if (field && typeof field === "object" && !Array.isArray(field)) {
34498
+ const obj = field;
34499
+ const fieldName = obj.name ?? obj.field;
34500
+ if (!fieldName) return field;
34501
+ if (obj.type || obj.inputType) return field;
34502
+ const entityField = fieldMap.get(fieldName);
34503
+ if (!entityField) return field;
34504
+ const enriched = { ...obj, type: entityField.type };
34505
+ if (entityField.required && !("required" in obj)) {
34506
+ enriched.required = true;
34507
+ }
34508
+ if (!obj.values && !obj.options) {
34509
+ if (entityField.values && entityField.values.length > 0) {
34510
+ enriched.values = entityField.values;
34511
+ } else if (entityField.enumValues && entityField.enumValues.length > 0) {
34512
+ enriched.values = entityField.enumValues;
34513
+ }
34514
+ }
34515
+ if (!obj.relation && entityField.relation) {
34516
+ enriched.relation = entityField.relation;
34517
+ }
34518
+ return enriched;
34519
+ }
34520
+ return field;
34521
+ });
34522
+ }
34045
34523
  var PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
34046
34524
  "stack",
34047
34525
  "vstack",
@@ -34417,13 +34895,14 @@ function getToastPosition(position) {
34417
34895
  return "top-4 right-4";
34418
34896
  }
34419
34897
  }
34420
- function renderPatternChildren(children, onDismiss, parentId = "root") {
34898
+ function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root") {
34421
34899
  if (!children || !Array.isArray(children) || children.length === 0) {
34422
34900
  return null;
34423
34901
  }
34424
34902
  return children.map((child, index) => {
34425
34903
  if (!child || typeof child !== "object") return null;
34426
34904
  const childId = `${parentId}-${index}`;
34905
+ const childPath = parentPath === "root" ? `root.children.${index}` : `${parentPath}.children.${index}`;
34427
34906
  const childContent = {
34428
34907
  id: childId,
34429
34908
  pattern: child.type,
@@ -34435,7 +34914,8 @@ function renderPatternChildren(children, onDismiss, parentId = "root") {
34435
34914
  SlotContentRenderer,
34436
34915
  {
34437
34916
  content: childContent,
34438
- onDismiss
34917
+ onDismiss,
34918
+ patternPath: childPath
34439
34919
  },
34440
34920
  childId
34441
34921
  );
@@ -34467,16 +34947,20 @@ function renderPatternProps(props, onDismiss) {
34467
34947
  }
34468
34948
  function SlotContentRenderer({
34469
34949
  content,
34470
- onDismiss
34950
+ onDismiss,
34951
+ patternPath
34471
34952
  }) {
34472
34953
  const entityProp = content.props.entity;
34473
34954
  const entityType = typeof entityProp === "string" ? entityProp : "";
34474
34955
  const storeData = useEntityRef(entityType);
34956
+ const schemaCtx = useEntitySchemaOptional();
34957
+ const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
34475
34958
  const PatternComponent = getComponentForPattern(content.pattern);
34476
34959
  if (PatternComponent) {
34477
34960
  const childrenConfig = content.props.children;
34478
34961
  const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
34479
- const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id) : void 0;
34962
+ const myPath = patternPath ?? "root";
34963
+ const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
34480
34964
  const { children: _childrenConfig, ...restProps } = content.props;
34481
34965
  const renderedProps = renderPatternProps(restProps, onDismiss);
34482
34966
  let finalProps;
@@ -34492,6 +34976,14 @@ function SlotContentRenderer({
34492
34976
  } else {
34493
34977
  finalProps = renderedProps;
34494
34978
  }
34979
+ const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
34980
+ if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
34981
+ finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
34982
+ if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
34983
+ finalProps.initialData = storeData[0];
34984
+ }
34985
+ }
34986
+ const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
34495
34987
  return /* @__PURE__ */ jsx(
34496
34988
  Box,
34497
34989
  {
@@ -34500,6 +34992,9 @@ function SlotContentRenderer({
34500
34992
  "data-id": content.id,
34501
34993
  "data-node-id": content.nodeId,
34502
34994
  "data-source-trait": content.sourceTrait,
34995
+ "data-pattern-path": myPath,
34996
+ "data-pattern-type": content.pattern,
34997
+ "data-accepts-children": acceptsChildren ? "true" : void 0,
34503
34998
  children: /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren })
34504
34999
  }
34505
35000
  );
@@ -37174,6 +37669,98 @@ function usePinchZoom(options = {}) {
37174
37669
  resetZoom
37175
37670
  };
37176
37671
  }
37672
+ var ALMADAR_DND_MIME = "application/x-almadar-dnd";
37673
+ function useDraggable({ payload, disabled = false }) {
37674
+ const [isDragging, setIsDragging] = useState(false);
37675
+ const eventBus = useEventBus();
37676
+ const handleDragStart = useCallback(
37677
+ (e) => {
37678
+ if (disabled) {
37679
+ e.preventDefault();
37680
+ return;
37681
+ }
37682
+ e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
37683
+ e.dataTransfer.effectAllowed = "copy";
37684
+ setIsDragging(true);
37685
+ eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
37686
+ },
37687
+ [disabled, payload, eventBus]
37688
+ );
37689
+ const handleDragEnd = useCallback(
37690
+ (e) => {
37691
+ setIsDragging(false);
37692
+ eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
37693
+ },
37694
+ [payload, eventBus]
37695
+ );
37696
+ const dragProps = useMemo(
37697
+ () => ({
37698
+ draggable: !disabled,
37699
+ onDragStart: handleDragStart,
37700
+ onDragEnd: handleDragEnd,
37701
+ "aria-grabbed": isDragging
37702
+ }),
37703
+ [disabled, handleDragStart, handleDragEnd, isDragging]
37704
+ );
37705
+ return { dragProps, isDragging };
37706
+ }
37707
+ function parsePayload(e) {
37708
+ try {
37709
+ const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
37710
+ if (!raw) return null;
37711
+ const parsed = JSON.parse(raw);
37712
+ if (typeof parsed.kind !== "string" || !parsed.data) return null;
37713
+ return parsed;
37714
+ } catch {
37715
+ return null;
37716
+ }
37717
+ }
37718
+ function hasAlmadarPayload(e) {
37719
+ return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
37720
+ }
37721
+ function useDropZone({ accepts, onDrop, disabled = false }) {
37722
+ const [isOver, setIsOver] = useState(false);
37723
+ const eventBus = useEventBus();
37724
+ const handleDragOver = useCallback(
37725
+ (e) => {
37726
+ if (disabled) return;
37727
+ if (!hasAlmadarPayload(e)) return;
37728
+ e.preventDefault();
37729
+ e.dataTransfer.dropEffect = "copy";
37730
+ setIsOver(true);
37731
+ },
37732
+ [disabled]
37733
+ );
37734
+ const handleDragLeave = useCallback(
37735
+ (e) => {
37736
+ setIsOver(false);
37737
+ },
37738
+ []
37739
+ );
37740
+ const handleDrop = useCallback(
37741
+ (e) => {
37742
+ e.preventDefault();
37743
+ setIsOver(false);
37744
+ if (disabled) return;
37745
+ const payload = parsePayload(e);
37746
+ if (!payload) return;
37747
+ if (!accepts.includes(payload.kind)) return;
37748
+ const position = { x: e.clientX, y: e.clientY };
37749
+ onDrop(payload, position);
37750
+ eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
37751
+ },
37752
+ [disabled, accepts, onDrop, eventBus]
37753
+ );
37754
+ const dropProps = useMemo(
37755
+ () => ({
37756
+ onDragOver: handleDragOver,
37757
+ onDragLeave: handleDragLeave,
37758
+ onDrop: handleDrop
37759
+ }),
37760
+ [handleDragOver, handleDragLeave, handleDrop]
37761
+ );
37762
+ return { dropProps, isOver };
37763
+ }
37177
37764
  var API_BASE = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "http://localhost:3000";
37178
37765
  function getUserId() {
37179
37766
  return localStorage.getItem("userId") || "anonymous";
@@ -37250,4 +37837,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
37250
37837
  });
37251
37838
  }
37252
37839
 
37253
- export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, CodeBlock, CodeExample, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, DialogueBox, DialogueBubble, Divider, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ENTITY_EVENTS, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDataProvider, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LineChart, List, LoadingState, MapView, MarkdownContent, MarketingStatCard, MasterDetail, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, Table, Tabs, TagCloud, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, ViolationAlert, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, clearEntities, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createTranslate, createUnitAnimationState, drawSprite, entityDataKeys, generateCombatMessage, getAllEntities, getByType, getCurrentFrame, getEntity, getSingleton, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseQueryBinding, pendulum, projectileMotion, removeEntity, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, spawnEntity, springOscillator, tickAnimationState, transitionAnimation, updateEntity, updateSingleton, useAgentChat, useAuthContext, useBattleState, useCamera, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useDragReorder, useEmitEvent, useEntities, useEntitiesByType, useEntity, useEntity2 as useEntityById, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntityMutations, useEntitySuspense, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, useOrbitalMutations, usePhysics, usePhysics2D, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useSpriteAnimations, useSwipeGesture, useTranslate, useUIEvents, useUISlotManager, useUpdateEntity, useValidation };
37840
+ export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, CodeBlock, CodeExample, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, DialogueBox, DialogueBubble, Divider, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ENTITY_EVENTS, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDataProvider, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LineChart, List, LoadingState, MapView, MarkdownContent, MarketingStatCard, MasterDetail, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, Table, Tabs, TagCloud, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, ViolationAlert, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, clearEntities, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createTranslate, createUnitAnimationState, drawSprite, entityDataKeys, generateCombatMessage, getAllEntities, getByType, getCurrentFrame, getEntity, getSingleton, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseQueryBinding, pendulum, projectileMotion, removeEntity, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, spawnEntity, springOscillator, tickAnimationState, transitionAnimation, updateEntity, updateSingleton, useAgentChat, useAuthContext, useBattleState, useCamera, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEntities, useEntitiesByType, useEntity, useEntity2 as useEntityById, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntityMutations, useEntitySuspense, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, useOrbitalMutations, usePhysics, usePhysics2D, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useSpriteAnimations, useSwipeGesture, useTranslate, useUIEvents, useUISlotManager, useUpdateEntity, useValidation };