@almadar/ui 5.65.0 → 5.68.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.
Files changed (42) hide show
  1. package/dist/avl/index.cjs +3259 -1568
  2. package/dist/avl/index.d.cts +10 -2
  3. package/dist/avl/index.d.ts +1 -0
  4. package/dist/avl/index.js +1992 -302
  5. package/dist/components/avl/derive-edit-focus.d.ts +8 -0
  6. package/dist/components/core/organisms/ChatBar.d.ts +31 -0
  7. package/dist/components/core/organisms/SubagentTracePanel.d.ts +50 -0
  8. package/dist/components/core/organisms/index.d.ts +3 -0
  9. package/dist/components/core/organisms/trace-edit-focus.d.ts +14 -0
  10. package/dist/components/game/atoms/ChoiceButton.d.ts +7 -1
  11. package/dist/components/game/molecules/HealthPanel.d.ts +3 -0
  12. package/dist/components/game/molecules/IsometricCanvas.d.ts +1 -1
  13. package/dist/components/game/molecules/PowerupSlots.d.ts +3 -0
  14. package/dist/components/game/molecules/TurnPanel.d.ts +3 -0
  15. package/dist/components/game/molecules/three/index.cjs +6 -6
  16. package/dist/components/game/molecules/three/index.js +6 -6
  17. package/dist/components/game/organisms/BoardgameBoard.d.ts +37 -0
  18. package/dist/components/game/organisms/FishingBoard.d.ts +33 -0
  19. package/dist/components/game/organisms/HolidayRunnerBoard.d.ts +35 -0
  20. package/dist/components/game/organisms/MatchPuzzleBoard.d.ts +37 -0
  21. package/dist/components/game/organisms/MinigolfBoard.d.ts +37 -0
  22. package/dist/components/game/organisms/PinballBoard.d.ts +35 -0
  23. package/dist/components/game/organisms/PirateBoard.d.ts +37 -0
  24. package/dist/components/game/organisms/RacingBoard.d.ts +29 -0
  25. package/dist/components/game/organisms/SokobanBoard.d.ts +37 -0
  26. package/dist/components/game/organisms/SpaceShmupBoard.d.ts +20 -0
  27. package/dist/components/game/organisms/SpaceStationBoard.d.ts +37 -0
  28. package/dist/components/game/organisms/SportsBoard.d.ts +37 -0
  29. package/dist/components/game/organisms/TanksBoard.d.ts +37 -0
  30. package/dist/components/game/organisms/index.d.ts +13 -0
  31. package/dist/components/game/organisms/utils/isometric.d.ts +10 -1
  32. package/dist/components/index.cjs +3096 -1377
  33. package/dist/components/index.js +1970 -266
  34. package/dist/hooks/index.cjs +94 -0
  35. package/dist/hooks/index.d.ts +1 -0
  36. package/dist/hooks/index.js +95 -2
  37. package/dist/hooks/useAgentTrace.d.ts +85 -0
  38. package/dist/providers/index.cjs +3037 -1351
  39. package/dist/providers/index.js +1937 -251
  40. package/dist/runtime/index.cjs +3095 -1409
  41. package/dist/runtime/index.js +1943 -257
  42. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import * as React85 from 'react';
2
- import React85__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
1
+ import * as React86 from 'react';
2
+ import React86__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
3
3
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -48,7 +48,7 @@ import { GLTFLoader as GLTFLoader$1 } from 'three/examples/jsm/loaders/GLTFLoade
48
48
  import { clone } from 'three/examples/jsm/utils/SkeletonUtils';
49
49
  import { Canvas, useLoader, useFrame, useThree } from '@react-three/fiber';
50
50
  import { Billboard, Grid as Grid$1, OrbitControls } from '@react-three/drei';
51
- import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
51
+ import { getPatternDefinition, getComponentForPattern } from '@almadar/patterns';
52
52
 
53
53
  var __defProp = Object.defineProperty;
54
54
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -403,7 +403,7 @@ var init_Box = __esm({
403
403
  fixed: "fixed",
404
404
  sticky: "sticky"
405
405
  };
406
- Box = React85__default.forwardRef(
406
+ Box = React86__default.forwardRef(
407
407
  ({
408
408
  padding,
409
409
  paddingX,
@@ -468,7 +468,7 @@ var init_Box = __esm({
468
468
  onPointerDown?.(e);
469
469
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
470
470
  const isClickable = action || onClick;
471
- return React85__default.createElement(
471
+ return React86__default.createElement(
472
472
  Component2,
473
473
  {
474
474
  ref,
@@ -564,7 +564,7 @@ function loadLib(key, importer) {
564
564
  return p2;
565
565
  }
566
566
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
567
- const Lazy = React85__default.lazy(async () => {
567
+ const Lazy = React86__default.lazy(async () => {
568
568
  const lib = await loadLib(libKey, importer);
569
569
  const Comp = pick(lib);
570
570
  if (!Comp) {
@@ -574,7 +574,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
574
574
  return { default: Comp };
575
575
  });
576
576
  const Wrapped = (props) => /* @__PURE__ */ jsx(
577
- React85__default.Suspense,
577
+ React86__default.Suspense,
578
578
  {
579
579
  fallback: /* @__PURE__ */ jsx(
580
580
  "span",
@@ -1300,7 +1300,7 @@ var init_Icon = __esm({
1300
1300
  const directIcon = typeof icon === "string" ? void 0 : icon;
1301
1301
  const effectiveName = typeof icon === "string" ? icon : name;
1302
1302
  const family = useIconFamily();
1303
- const RenderedComponent = React85__default.useMemo(() => {
1303
+ const RenderedComponent = React86__default.useMemo(() => {
1304
1304
  if (directIcon) return null;
1305
1305
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1306
1306
  }, [directIcon, effectiveName, family]);
@@ -1359,7 +1359,7 @@ function resolveIconProp(value, sizeClass) {
1359
1359
  const IconComp = value;
1360
1360
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1361
1361
  }
1362
- if (React85__default.isValidElement(value)) {
1362
+ if (React86__default.isValidElement(value)) {
1363
1363
  return value;
1364
1364
  }
1365
1365
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -1435,7 +1435,7 @@ var init_Button = __esm({
1435
1435
  md: "h-icon-default w-icon-default",
1436
1436
  lg: "h-icon-default w-icon-default"
1437
1437
  };
1438
- Button = React85__default.forwardRef(
1438
+ Button = React86__default.forwardRef(
1439
1439
  ({
1440
1440
  className,
1441
1441
  variant = "primary",
@@ -1500,7 +1500,7 @@ var Dialog;
1500
1500
  var init_Dialog = __esm({
1501
1501
  "components/core/atoms/Dialog.tsx"() {
1502
1502
  init_cn();
1503
- Dialog = React85__default.forwardRef(
1503
+ Dialog = React86__default.forwardRef(
1504
1504
  ({
1505
1505
  role = "dialog",
1506
1506
  "aria-modal": ariaModal = true,
@@ -2114,7 +2114,7 @@ var init_Badge = __esm({
2114
2114
  md: "px-2.5 py-1 text-sm",
2115
2115
  lg: "px-3 py-1.5 text-base"
2116
2116
  };
2117
- Badge = React85__default.forwardRef(
2117
+ Badge = React86__default.forwardRef(
2118
2118
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
2119
2119
  const iconSizes3 = {
2120
2120
  sm: "h-icon-default w-icon-default",
@@ -2450,7 +2450,7 @@ var init_SvgFlow = __esm({
2450
2450
  width = 100,
2451
2451
  height = 100
2452
2452
  }) => {
2453
- const markerId = React85__default.useMemo(() => {
2453
+ const markerId = React86__default.useMemo(() => {
2454
2454
  flowIdCounter += 1;
2455
2455
  return `almadar-flow-arrow-${flowIdCounter}`;
2456
2456
  }, []);
@@ -3043,7 +3043,7 @@ var init_SvgRing = __esm({
3043
3043
  width = 100,
3044
3044
  height = 100
3045
3045
  }) => {
3046
- const gradientId = React85__default.useMemo(() => {
3046
+ const gradientId = React86__default.useMemo(() => {
3047
3047
  ringIdCounter += 1;
3048
3048
  return `almadar-ring-glow-${ringIdCounter}`;
3049
3049
  }, []);
@@ -3224,7 +3224,7 @@ var init_Input = __esm({
3224
3224
  init_cn();
3225
3225
  init_Icon();
3226
3226
  init_useEventBus();
3227
- Input = React85__default.forwardRef(
3227
+ Input = React86__default.forwardRef(
3228
3228
  ({
3229
3229
  className,
3230
3230
  inputType,
@@ -3384,7 +3384,7 @@ var Label;
3384
3384
  var init_Label = __esm({
3385
3385
  "components/core/atoms/Label.tsx"() {
3386
3386
  init_cn();
3387
- Label = React85__default.forwardRef(
3387
+ Label = React86__default.forwardRef(
3388
3388
  ({ className, required, children, ...props }, ref) => {
3389
3389
  return /* @__PURE__ */ jsxs(
3390
3390
  "label",
@@ -3411,7 +3411,7 @@ var init_Textarea = __esm({
3411
3411
  "components/core/atoms/Textarea.tsx"() {
3412
3412
  init_cn();
3413
3413
  init_useEventBus();
3414
- Textarea = React85__default.forwardRef(
3414
+ Textarea = React86__default.forwardRef(
3415
3415
  ({ className, error, onChange, ...props }, ref) => {
3416
3416
  const eventBus = useEventBus();
3417
3417
  const handleChange = (e) => {
@@ -3650,7 +3650,7 @@ var init_Select = __esm({
3650
3650
  init_cn();
3651
3651
  init_Icon();
3652
3652
  init_useEventBus();
3653
- Select = React85__default.forwardRef(
3653
+ Select = React86__default.forwardRef(
3654
3654
  (props, _ref) => {
3655
3655
  const { multiple, searchable, clearable } = props;
3656
3656
  if (multiple || searchable || clearable) {
@@ -3667,7 +3667,7 @@ var init_Checkbox = __esm({
3667
3667
  "components/core/atoms/Checkbox.tsx"() {
3668
3668
  init_cn();
3669
3669
  init_useEventBus();
3670
- Checkbox = React85__default.forwardRef(
3670
+ Checkbox = React86__default.forwardRef(
3671
3671
  ({ className, label, id, onChange, ...props }, ref) => {
3672
3672
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3673
3673
  const eventBus = useEventBus();
@@ -3721,7 +3721,7 @@ var init_Spinner = __esm({
3721
3721
  md: "h-6 w-6",
3722
3722
  lg: "h-8 w-8"
3723
3723
  };
3724
- Spinner = React85__default.forwardRef(
3724
+ Spinner = React86__default.forwardRef(
3725
3725
  ({ className, size = "md", overlay, ...props }, ref) => {
3726
3726
  if (overlay) {
3727
3727
  return /* @__PURE__ */ jsx(
@@ -3811,7 +3811,7 @@ var init_Card = __esm({
3811
3811
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3812
3812
  "tile-image-first": "p-0 overflow-hidden"
3813
3813
  };
3814
- Card = React85__default.forwardRef(
3814
+ Card = React86__default.forwardRef(
3815
3815
  ({
3816
3816
  className,
3817
3817
  variant = "bordered",
@@ -3859,9 +3859,9 @@ var init_Card = __esm({
3859
3859
  }
3860
3860
  );
3861
3861
  Card.displayName = "Card";
3862
- CardHeader = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3862
+ CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3863
3863
  CardHeader.displayName = "CardHeader";
3864
- CardTitle = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3864
+ CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3865
3865
  "h3",
3866
3866
  {
3867
3867
  ref,
@@ -3874,11 +3874,11 @@ var init_Card = __esm({
3874
3874
  }
3875
3875
  ));
3876
3876
  CardTitle.displayName = "CardTitle";
3877
- CardContent = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3877
+ CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3878
3878
  CardContent.displayName = "CardContent";
3879
3879
  CardBody = CardContent;
3880
3880
  CardBody.displayName = "CardBody";
3881
- CardFooter = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3881
+ CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3882
3882
  "div",
3883
3883
  {
3884
3884
  ref,
@@ -3933,7 +3933,7 @@ var init_FilterPill = __esm({
3933
3933
  md: "w-3.5 h-3.5",
3934
3934
  lg: "w-4 h-4"
3935
3935
  };
3936
- FilterPill = React85__default.forwardRef(
3936
+ FilterPill = React86__default.forwardRef(
3937
3937
  ({
3938
3938
  className,
3939
3939
  variant = "default",
@@ -4062,8 +4062,8 @@ var init_Avatar = __esm({
4062
4062
  actionPayload
4063
4063
  }) => {
4064
4064
  const eventBus = useEventBus();
4065
- const [imgFailed, setImgFailed] = React85__default.useState(false);
4066
- React85__default.useEffect(() => {
4065
+ const [imgFailed, setImgFailed] = React86__default.useState(false);
4066
+ React86__default.useEffect(() => {
4067
4067
  setImgFailed(false);
4068
4068
  }, [src]);
4069
4069
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4448,7 +4448,7 @@ var init_Radio = __esm({
4448
4448
  md: "w-2.5 h-2.5",
4449
4449
  lg: "w-3 h-3"
4450
4450
  };
4451
- Radio = React85__default.forwardRef(
4451
+ Radio = React86__default.forwardRef(
4452
4452
  ({
4453
4453
  label,
4454
4454
  helperText,
@@ -4465,12 +4465,12 @@ var init_Radio = __esm({
4465
4465
  onChange,
4466
4466
  ...props
4467
4467
  }, ref) => {
4468
- const reactId = React85__default.useId();
4468
+ const reactId = React86__default.useId();
4469
4469
  const baseId = id || `radio-${reactId}`;
4470
4470
  const hasError = !!error;
4471
4471
  const eventBus = useEventBus();
4472
- const [selected, setSelected] = React85__default.useState(value);
4473
- React85__default.useEffect(() => {
4472
+ const [selected, setSelected] = React86__default.useState(value);
4473
+ React86__default.useEffect(() => {
4474
4474
  if (value !== void 0) setSelected(value);
4475
4475
  }, [value]);
4476
4476
  const pick = (next, e) => {
@@ -4652,7 +4652,7 @@ var init_Switch = __esm({
4652
4652
  "components/core/atoms/Switch.tsx"() {
4653
4653
  "use client";
4654
4654
  init_cn();
4655
- Switch = React85.forwardRef(
4655
+ Switch = React86.forwardRef(
4656
4656
  ({
4657
4657
  checked,
4658
4658
  defaultChecked = false,
@@ -4663,10 +4663,10 @@ var init_Switch = __esm({
4663
4663
  name,
4664
4664
  className
4665
4665
  }, ref) => {
4666
- const [isChecked, setIsChecked] = React85.useState(
4666
+ const [isChecked, setIsChecked] = React86.useState(
4667
4667
  checked !== void 0 ? checked : defaultChecked
4668
4668
  );
4669
- React85.useEffect(() => {
4669
+ React86.useEffect(() => {
4670
4670
  if (checked !== void 0) {
4671
4671
  setIsChecked(checked);
4672
4672
  }
@@ -5026,7 +5026,7 @@ var Aside;
5026
5026
  var init_Aside = __esm({
5027
5027
  "components/core/atoms/Aside.tsx"() {
5028
5028
  init_cn();
5029
- Aside = React85__default.forwardRef(
5029
+ Aside = React86__default.forwardRef(
5030
5030
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
5031
5031
  );
5032
5032
  Aside.displayName = "Aside";
@@ -5105,9 +5105,9 @@ var init_LawReferenceTooltip = __esm({
5105
5105
  className
5106
5106
  }) => {
5107
5107
  const { t } = useTranslate();
5108
- const [isVisible, setIsVisible] = React85__default.useState(false);
5109
- const timeoutRef = React85__default.useRef(null);
5110
- const triggerRef = React85__default.useRef(null);
5108
+ const [isVisible, setIsVisible] = React86__default.useState(false);
5109
+ const timeoutRef = React86__default.useRef(null);
5110
+ const triggerRef = React86__default.useRef(null);
5111
5111
  const handleMouseEnter = () => {
5112
5112
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5113
5113
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5118,7 +5118,7 @@ var init_LawReferenceTooltip = __esm({
5118
5118
  };
5119
5119
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5120
5120
  const open = isVisible || revealed;
5121
- React85__default.useEffect(() => {
5121
+ React86__default.useEffect(() => {
5122
5122
  return () => {
5123
5123
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5124
5124
  };
@@ -5330,7 +5330,7 @@ var init_StatusDot = __esm({
5330
5330
  md: "w-2.5 h-2.5",
5331
5331
  lg: "w-3 h-3"
5332
5332
  };
5333
- StatusDot = React85__default.forwardRef(
5333
+ StatusDot = React86__default.forwardRef(
5334
5334
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5335
5335
  return /* @__PURE__ */ jsx(
5336
5336
  "span",
@@ -5384,7 +5384,7 @@ var init_TrendIndicator = __esm({
5384
5384
  down: "trending-down",
5385
5385
  flat: "arrow-right"
5386
5386
  };
5387
- TrendIndicator = React85__default.forwardRef(
5387
+ TrendIndicator = React86__default.forwardRef(
5388
5388
  ({
5389
5389
  className,
5390
5390
  value,
@@ -5451,7 +5451,7 @@ var init_RangeSlider = __esm({
5451
5451
  md: "w-4 h-4",
5452
5452
  lg: "w-5 h-5"
5453
5453
  };
5454
- RangeSlider = React85__default.forwardRef(
5454
+ RangeSlider = React86__default.forwardRef(
5455
5455
  ({
5456
5456
  className,
5457
5457
  min = 0,
@@ -5959,7 +5959,7 @@ var init_ContentSection = __esm({
5959
5959
  md: "py-16",
5960
5960
  lg: "py-24"
5961
5961
  };
5962
- ContentSection = React85__default.forwardRef(
5962
+ ContentSection = React86__default.forwardRef(
5963
5963
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5964
5964
  return /* @__PURE__ */ jsx(
5965
5965
  Box,
@@ -6493,7 +6493,7 @@ var init_AnimatedReveal = __esm({
6493
6493
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6494
6494
  "none": {}
6495
6495
  };
6496
- AnimatedReveal = React85__default.forwardRef(
6496
+ AnimatedReveal = React86__default.forwardRef(
6497
6497
  ({
6498
6498
  trigger = "scroll",
6499
6499
  animation = "fade-up",
@@ -6653,7 +6653,7 @@ var init_AnimatedGraphic = __esm({
6653
6653
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6654
6654
  "use client";
6655
6655
  init_cn();
6656
- AnimatedGraphic = React85__default.forwardRef(
6656
+ AnimatedGraphic = React86__default.forwardRef(
6657
6657
  ({
6658
6658
  src,
6659
6659
  svgContent,
@@ -6676,7 +6676,7 @@ var init_AnimatedGraphic = __esm({
6676
6676
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6677
6677
  const resolvedSvg = svgContent ?? fetchedSvg;
6678
6678
  const prevAnimateRef = useRef(animate);
6679
- const setRef = React85__default.useCallback(
6679
+ const setRef = React86__default.useCallback(
6680
6680
  (node) => {
6681
6681
  containerRef.current = node;
6682
6682
  if (typeof ref === "function") ref(node);
@@ -6902,9 +6902,9 @@ function ScoreDisplay({
6902
6902
  ...rest
6903
6903
  }) {
6904
6904
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
6905
- const [displayValue, setDisplayValue] = React85.useState(resolvedValue);
6906
- const [isAnimating, setIsAnimating] = React85.useState(false);
6907
- React85.useEffect(() => {
6905
+ const [displayValue, setDisplayValue] = React86.useState(resolvedValue);
6906
+ const [isAnimating, setIsAnimating] = React86.useState(false);
6907
+ React86.useEffect(() => {
6908
6908
  if (!animated || displayValue === resolvedValue) {
6909
6909
  setDisplayValue(resolvedValue);
6910
6910
  return;
@@ -6987,9 +6987,9 @@ function ControlButton({
6987
6987
  className
6988
6988
  }) {
6989
6989
  const eventBus = useEventBus();
6990
- const [isPressed, setIsPressed] = React85.useState(false);
6990
+ const [isPressed, setIsPressed] = React86.useState(false);
6991
6991
  const actualPressed = pressed ?? isPressed;
6992
- const handlePointerDown = React85.useCallback(
6992
+ const handlePointerDown = React86.useCallback(
6993
6993
  (e) => {
6994
6994
  e.preventDefault();
6995
6995
  if (disabled) return;
@@ -6999,7 +6999,7 @@ function ControlButton({
6999
6999
  },
7000
7000
  [disabled, pressEvent, eventBus, onPress]
7001
7001
  );
7002
- const handlePointerUp = React85.useCallback(
7002
+ const handlePointerUp = React86.useCallback(
7003
7003
  (e) => {
7004
7004
  e.preventDefault();
7005
7005
  if (disabled) return;
@@ -7009,7 +7009,7 @@ function ControlButton({
7009
7009
  },
7010
7010
  [disabled, releaseEvent, eventBus, onRelease]
7011
7011
  );
7012
- const handlePointerLeave = React85.useCallback(
7012
+ const handlePointerLeave = React86.useCallback(
7013
7013
  (e) => {
7014
7014
  if (isPressed) {
7015
7015
  setIsPressed(false);
@@ -7630,8 +7630,8 @@ function XPBar({
7630
7630
  }) {
7631
7631
  const sizes = sizeMap9[size];
7632
7632
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
7633
- const [fillWidth, setFillWidth] = React85.useState(animated ? 0 : percentage);
7634
- React85.useEffect(() => {
7633
+ const [fillWidth, setFillWidth] = React86.useState(animated ? 0 : percentage);
7634
+ React86.useEffect(() => {
7635
7635
  if (!animated) {
7636
7636
  setFillWidth(percentage);
7637
7637
  return;
@@ -7974,6 +7974,8 @@ var init_DialogueBubble = __esm({
7974
7974
  function ChoiceButton({
7975
7975
  text = "Charge forward into the fray",
7976
7976
  index,
7977
+ assetUrl,
7978
+ icon,
7977
7979
  disabled = false,
7978
7980
  selected = false,
7979
7981
  onClick,
@@ -8006,6 +8008,23 @@ function ChoiceButton({
8006
8008
  ]
8007
8009
  }
8008
8010
  ),
8011
+ assetUrl ? /* @__PURE__ */ jsx(
8012
+ "img",
8013
+ {
8014
+ src: assetUrl,
8015
+ alt: "",
8016
+ width: 16,
8017
+ height: 16,
8018
+ style: { imageRendering: "pixelated", objectFit: "contain" },
8019
+ className: "flex-shrink-0"
8020
+ }
8021
+ ) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-sm", children: typeof icon === "string" ? (() => {
8022
+ const I = resolveIcon(icon);
8023
+ return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
8024
+ })() : /* @__PURE__ */ (() => {
8025
+ const I = icon;
8026
+ return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
8027
+ })() }) : null,
8009
8028
  /* @__PURE__ */ jsx("span", { className: "text-sm leading-snug", children: text })
8010
8029
  ]
8011
8030
  }
@@ -8014,6 +8033,7 @@ function ChoiceButton({
8014
8033
  var init_ChoiceButton = __esm({
8015
8034
  "components/game/atoms/ChoiceButton.tsx"() {
8016
8035
  init_cn();
8036
+ init_Icon();
8017
8037
  ChoiceButton.displayName = "ChoiceButton";
8018
8038
  }
8019
8039
  });
@@ -8119,9 +8139,9 @@ function MiniMap({
8119
8139
  viewportRect = DEFAULT_VIEWPORT,
8120
8140
  className
8121
8141
  }) {
8122
- const canvasRef = React85.useRef(null);
8123
- const frameRef = React85.useRef(0);
8124
- React85.useEffect(() => {
8142
+ const canvasRef = React86.useRef(null);
8143
+ const frameRef = React86.useRef(0);
8144
+ React86.useEffect(() => {
8125
8145
  const canvas = canvasRef.current;
8126
8146
  if (!canvas) return;
8127
8147
  const ctx = canvas.getContext("2d");
@@ -8310,7 +8330,7 @@ var init_ErrorBoundary = __esm({
8310
8330
  }
8311
8331
  );
8312
8332
  };
8313
- ErrorBoundary = class extends React85__default.Component {
8333
+ ErrorBoundary = class extends React86__default.Component {
8314
8334
  constructor(props) {
8315
8335
  super(props);
8316
8336
  __publicField(this, "reset", () => {
@@ -9701,8 +9721,8 @@ function ActionButtons({
9701
9721
  disabled
9702
9722
  }) {
9703
9723
  const eventBus = useEventBus();
9704
- const [activeButtons, setActiveButtons] = React85.useState(/* @__PURE__ */ new Set());
9705
- const handlePress = React85.useCallback(
9724
+ const [activeButtons, setActiveButtons] = React86.useState(/* @__PURE__ */ new Set());
9725
+ const handlePress = React86.useCallback(
9706
9726
  (id) => {
9707
9727
  setActiveButtons((prev) => new Set(prev).add(id));
9708
9728
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -9710,7 +9730,7 @@ function ActionButtons({
9710
9730
  },
9711
9731
  [actionEvent, eventBus, onAction]
9712
9732
  );
9713
- const handleRelease = React85.useCallback(
9733
+ const handleRelease = React86.useCallback(
9714
9734
  (id) => {
9715
9735
  setActiveButtons((prev) => {
9716
9736
  const next = new Set(prev);
@@ -11247,6 +11267,11 @@ function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
11247
11267
  const screenY2 = tileY * (scaledFloorHeight * 0.75);
11248
11268
  return { x: screenX2, y: screenY2 };
11249
11269
  }
11270
+ if (layout === "flat") {
11271
+ const screenX2 = tileX * scaledTileWidth + baseOffsetX;
11272
+ const screenY2 = tileY * scaledFloorHeight;
11273
+ return { x: screenX2, y: screenY2 };
11274
+ }
11250
11275
  const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
11251
11276
  const screenY = (tileX + tileY) * (scaledFloorHeight / 2);
11252
11277
  return { x: screenX, y: screenY };
@@ -11259,6 +11284,11 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
11259
11284
  const col = Math.round((screenX - (row & 1) * (scaledTileWidth / 2) - baseOffsetX) / scaledTileWidth);
11260
11285
  return { x: col, y: row };
11261
11286
  }
11287
+ if (layout === "flat") {
11288
+ const col = Math.round((screenX - baseOffsetX) / scaledTileWidth);
11289
+ const row = Math.round(screenY / scaledFloorHeight);
11290
+ return { x: col, y: row };
11291
+ }
11262
11292
  const adjustedX = screenX - baseOffsetX;
11263
11293
  const tileX = (adjustedX / (scaledTileWidth / 2) + screenY / (scaledFloorHeight / 2)) / 2;
11264
11294
  const tileY = (screenY / (scaledFloorHeight / 2) - adjustedX / (scaledTileWidth / 2)) / 2;
@@ -11378,7 +11408,7 @@ function IsometricCanvas({
11378
11408
  );
11379
11409
  const sortedTiles = useMemo(() => {
11380
11410
  const tiles = [...tilesProp];
11381
- if (tileLayout === "hex") {
11411
+ if (tileLayout === "hex" || tileLayout === "flat") {
11382
11412
  tiles.sort((a, b) => a.y !== b.y ? a.y - b.y : a.x - b.x);
11383
11413
  } else {
11384
11414
  tiles.sort((a, b) => {
@@ -11506,7 +11536,8 @@ function IsometricCanvas({
11506
11536
  const minX = Math.min(...allScreenPos.map((p2) => p2.x));
11507
11537
  const maxX = Math.max(...allScreenPos.map((p2) => p2.x + scaledTileWidth));
11508
11538
  const minY = Math.min(...allScreenPos.map((p2) => p2.y));
11509
- const maxY = Math.max(...allScreenPos.map((p2) => p2.y + scaledTileHeight));
11539
+ const tileBottomExtent = tileLayout === "hex" || tileLayout === "flat" ? scaledTileWidth : scaledTileHeight;
11540
+ const maxY = Math.max(...allScreenPos.map((p2) => p2.y + tileBottomExtent));
11510
11541
  const worldW = maxX - minX;
11511
11542
  const worldH = maxY - minY;
11512
11543
  const scaleM = Math.min(mW / worldW, mH / worldH) * 0.9;
@@ -11598,7 +11629,7 @@ function IsometricCanvas({
11598
11629
  const drawW = scaledTileWidth;
11599
11630
  const drawH = scaledTileWidth * (img.naturalHeight / img.naturalWidth);
11600
11631
  const drawX = pos.x;
11601
- const drawY = pos.y + scaledTileHeight - drawH;
11632
+ const drawY = tileLayout === "hex" || tileLayout === "flat" ? pos.y : pos.y + scaledTileHeight - drawH;
11602
11633
  ctx.drawImage(img, drawX, drawY, drawW, drawH);
11603
11634
  }
11604
11635
  } else {
@@ -11665,7 +11696,7 @@ function IsometricCanvas({
11665
11696
  }
11666
11697
  }
11667
11698
  const sortedFeatures = [...features].sort((a, b) => {
11668
- if (tileLayout === "hex") return a.y !== b.y ? a.y - b.y : a.x - b.x;
11699
+ if (tileLayout === "hex" || tileLayout === "flat") return a.y !== b.y ? a.y - b.y : a.x - b.x;
11669
11700
  const depthA = a.x + a.y;
11670
11701
  const depthB = b.x + b.y;
11671
11702
  return depthA !== depthB ? depthA - depthB : a.y - b.y;
@@ -11706,7 +11737,7 @@ function IsometricCanvas({
11706
11737
  }
11707
11738
  const unitsWithPosition = units.filter((u) => !!u.position);
11708
11739
  const sortedUnits = [...unitsWithPosition].sort((a, b) => {
11709
- if (tileLayout === "hex") return a.position.y !== b.position.y ? a.position.y - b.position.y : a.position.x - b.position.x;
11740
+ if (tileLayout === "hex" || tileLayout === "flat") return a.position.y !== b.position.y ? a.position.y - b.position.y : a.position.x - b.position.x;
11710
11741
  const depthA = a.position.x + a.position.y;
11711
11742
  const depthB = b.position.x + b.position.y;
11712
11743
  return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
@@ -13881,7 +13912,7 @@ var init_CodeBlock = __esm({
13881
13912
  };
13882
13913
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
13883
13914
  HIDDEN_LINE_NUMBERS = { display: "none" };
13884
- CodeBlock = React85__default.memo(
13915
+ CodeBlock = React86__default.memo(
13885
13916
  ({
13886
13917
  code: rawCode,
13887
13918
  language = "text",
@@ -14468,7 +14499,7 @@ var init_MarkdownContent = __esm({
14468
14499
  init_Box();
14469
14500
  init_CodeBlock();
14470
14501
  init_cn();
14471
- MarkdownContent = React85__default.memo(
14502
+ MarkdownContent = React86__default.memo(
14472
14503
  ({ content, direction = "ltr", className }) => {
14473
14504
  const { t: _t } = useTranslate();
14474
14505
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -14758,6 +14789,48 @@ var init_BloomQuizBlock = __esm({
14758
14789
  BloomQuizBlock.displayName = "BloomQuizBlock";
14759
14790
  }
14760
14791
  });
14792
+ function BoardgameBoard({
14793
+ tiles,
14794
+ units,
14795
+ features,
14796
+ assetManifest,
14797
+ assetBaseUrl,
14798
+ scale = 0.45,
14799
+ showMinimap = false,
14800
+ enableCamera = true,
14801
+ tileClickEvent,
14802
+ unitClickEvent,
14803
+ isLoading,
14804
+ error,
14805
+ className
14806
+ }) {
14807
+ return /* @__PURE__ */ jsx("div", { className: cn("boardgame-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
14808
+ IsometricCanvas_default,
14809
+ {
14810
+ tileLayout: "flat",
14811
+ tiles,
14812
+ units,
14813
+ features,
14814
+ assetManifest,
14815
+ assetBaseUrl,
14816
+ scale,
14817
+ showMinimap,
14818
+ enableCamera,
14819
+ tileClickEvent,
14820
+ unitClickEvent,
14821
+ isLoading,
14822
+ error
14823
+ }
14824
+ ) });
14825
+ }
14826
+ var init_BoardgameBoard = __esm({
14827
+ "components/game/organisms/BoardgameBoard.tsx"() {
14828
+ "use client";
14829
+ init_cn();
14830
+ init_IsometricCanvas();
14831
+ BoardgameBoard.displayName = "BoardgameBoard";
14832
+ }
14833
+ });
14761
14834
  var MIN_DIAGRAM_WIDTH, ScaledDiagram;
14762
14835
  var init_ScaledDiagram = __esm({
14763
14836
  "components/core/molecules/ScaledDiagram.tsx"() {
@@ -15795,7 +15868,7 @@ var init_StateMachineView = __esm({
15795
15868
  style: { top: title ? 30 : 0 },
15796
15869
  children: [
15797
15870
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
15798
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React85__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15871
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15799
15872
  StateNode,
15800
15873
  {
15801
15874
  state,
@@ -19750,7 +19823,7 @@ function CardHand({
19750
19823
  className
19751
19824
  }) {
19752
19825
  const eventBus = useEventBus();
19753
- const handleClick = React85.useCallback(
19826
+ const handleClick = React86.useCallback(
19754
19827
  (card) => {
19755
19828
  if (card.disabled) return;
19756
19829
  onCardClick?.(card.id);
@@ -21896,6 +21969,215 @@ var init_ChartLegend = __esm({
21896
21969
  ChartLegend.displayName = "ChartLegend";
21897
21970
  }
21898
21971
  });
21972
+
21973
+ // components/core/organisms/trace-edit-focus.ts
21974
+ function asString(v) {
21975
+ return typeof v === "string" ? v : void 0;
21976
+ }
21977
+ function asLevel(v) {
21978
+ if (typeof v === "string" && EDIT_FOCUS_LEVELS.has(v)) {
21979
+ return v;
21980
+ }
21981
+ return "node";
21982
+ }
21983
+ function isEventPayload(v) {
21984
+ return v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v) && !(v instanceof Date);
21985
+ }
21986
+ function parseEditFocus(value) {
21987
+ if (!isEventPayload(value)) return null;
21988
+ const payload = value;
21989
+ const orbital = asString(payload.orbital);
21990
+ if (orbital === void 0 || orbital.length === 0) return null;
21991
+ const focus = {
21992
+ level: asLevel(payload.level),
21993
+ orbital,
21994
+ label: asString(payload.label) ?? orbital
21995
+ };
21996
+ const trait = asString(payload.trait);
21997
+ if (trait !== void 0) focus.trait = trait;
21998
+ const transition = asString(payload.transition);
21999
+ if (transition !== void 0) focus.transition = transition;
22000
+ const state = asString(payload.state);
22001
+ if (state !== void 0) focus.state = state;
22002
+ const slot = asString(payload.slot);
22003
+ if (slot !== void 0) focus.slot = slot;
22004
+ const path = asString(payload.path);
22005
+ if (path !== void 0) focus.path = path;
22006
+ const patternType = asString(payload.patternType);
22007
+ if (patternType !== void 0) focus.patternType = patternType;
22008
+ const entity = asString(payload.entity);
22009
+ if (entity !== void 0) focus.entity = entity;
22010
+ const source = asString(payload.source);
22011
+ if (source !== void 0) focus.source = source;
22012
+ return focus;
22013
+ }
22014
+ var ELEMENT_SELECTED_EVENT, EDIT_FOCUS_LEVELS;
22015
+ var init_trace_edit_focus = __esm({
22016
+ "components/core/organisms/trace-edit-focus.ts"() {
22017
+ ELEMENT_SELECTED_EVENT = "UI:ELEMENT_SELECTED";
22018
+ EDIT_FOCUS_LEVELS = /* @__PURE__ */ new Set([
22019
+ "node",
22020
+ "slot",
22021
+ "field",
22022
+ "effect",
22023
+ "trait",
22024
+ "page",
22025
+ "orbital"
22026
+ ]);
22027
+ }
22028
+ });
22029
+ function getJepaBadgeVariant(probability) {
22030
+ if (probability >= 0.9) return "success";
22031
+ if (probability >= 0.5) return "warning";
22032
+ return "danger";
22033
+ }
22034
+ function ChatBar({
22035
+ status = "idle",
22036
+ activeGate,
22037
+ jepaValidity,
22038
+ placeholder,
22039
+ context,
22040
+ className
22041
+ }) {
22042
+ const { t } = useTranslate();
22043
+ const eventBus = useEventBus();
22044
+ const [inputValue, setInputValue] = useState("");
22045
+ const [focus, setFocus] = useState(null);
22046
+ const clearFocus = useCallback(() => {
22047
+ setFocus(null);
22048
+ eventBus.emit(ELEMENT_SELECTED_EVENT, { focus: null });
22049
+ }, [eventBus]);
22050
+ const handleKeyDown = useCallback((e) => {
22051
+ if (e.key !== "Enter" || e.shiftKey) return;
22052
+ const trimmed = inputValue.trim();
22053
+ if (!trimmed) return;
22054
+ e.preventDefault();
22055
+ eventBus.emit("UI:CHAT_SEND", { message: trimmed });
22056
+ }, [inputValue, eventBus]);
22057
+ useEffect(() => {
22058
+ const unsubSend = eventBus.on("UI:CHAT_SEND", () => {
22059
+ setInputValue("");
22060
+ setFocus(null);
22061
+ });
22062
+ const unsubSelect = eventBus.on(ELEMENT_SELECTED_EVENT, (e) => {
22063
+ setFocus(parseEditFocus(e.payload?.focus));
22064
+ });
22065
+ return () => {
22066
+ unsubSend();
22067
+ unsubSelect();
22068
+ };
22069
+ }, [eventBus]);
22070
+ const trailingAction = status === "error" ? /* @__PURE__ */ jsxs(Button, { variant: "secondary", size: "sm", action: "RETRY_GENERATION", className: "rounded-none flex-shrink-0 h-auto", children: [
22071
+ /* @__PURE__ */ jsx(Icon, { name: "refresh-cw", size: "xs" }),
22072
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: t("openFile.retry") })
22073
+ ] }) : status === "running" ? /* @__PURE__ */ jsxs(Fragment, { children: [
22074
+ /* @__PURE__ */ jsx(
22075
+ Button,
22076
+ {
22077
+ variant: "ghost",
22078
+ size: "sm",
22079
+ action: "PAUSE",
22080
+ title: t("chatBar.pauseTheAgentYouCanEdit"),
22081
+ className: "rounded-none flex-shrink-0 h-auto",
22082
+ children: /* @__PURE__ */ jsx(Icon, { name: "pause", size: "xs" })
22083
+ }
22084
+ ),
22085
+ /* @__PURE__ */ jsx(
22086
+ Button,
22087
+ {
22088
+ variant: "ghost",
22089
+ size: "sm",
22090
+ action: "STOP",
22091
+ title: t("chatBar.cancelGeneration"),
22092
+ className: "rounded-none flex-shrink-0 h-auto border-l border-[var(--color-border)]",
22093
+ children: /* @__PURE__ */ jsx(Icon, { name: "square", size: "xs" })
22094
+ }
22095
+ )
22096
+ ] }) : status === "paused" ? /* @__PURE__ */ jsxs(
22097
+ Button,
22098
+ {
22099
+ variant: "primary",
22100
+ size: "sm",
22101
+ action: "RESUME",
22102
+ title: t("chatBar.resumeTheAgentYourCanvasEdits"),
22103
+ className: "rounded-none flex-shrink-0 h-auto",
22104
+ children: [
22105
+ /* @__PURE__ */ jsx(Icon, { name: "play", size: "xs" }),
22106
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: t("chatBar.resume") })
22107
+ ]
22108
+ }
22109
+ ) : /* @__PURE__ */ jsx(
22110
+ Button,
22111
+ {
22112
+ variant: "primary",
22113
+ size: "sm",
22114
+ action: "CHAT_SEND",
22115
+ actionPayload: { message: inputValue.trim() },
22116
+ disabled: !inputValue.trim(),
22117
+ "aria-label": t("chatBar.sendMessage"),
22118
+ className: "rounded-none flex-shrink-0 h-auto",
22119
+ children: /* @__PURE__ */ jsx(Icon, { name: "send", size: "xs" })
22120
+ }
22121
+ );
22122
+ return /* @__PURE__ */ jsxs(Box, { className: `border-t border-[var(--color-border)] bg-[var(--color-card)] ${className ?? ""}`, children: [
22123
+ focus && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "items-center px-4 pt-2", children: /* @__PURE__ */ jsxs(Badge, { variant: "secondary", size: "sm", className: "flex items-center gap-1 max-w-full", children: [
22124
+ /* @__PURE__ */ jsx(Icon, { name: "mouse-pointer-2", size: "xs" }),
22125
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-inherit truncate", children: [
22126
+ t("chatBar.editing"),
22127
+ ": ",
22128
+ focus.label
22129
+ ] }),
22130
+ /* @__PURE__ */ jsx(
22131
+ Box,
22132
+ {
22133
+ onClick: clearFocus,
22134
+ title: t("chatBar.clearSelection"),
22135
+ className: "cursor-pointer flex items-center ml-1 hover:opacity-70",
22136
+ children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
22137
+ }
22138
+ )
22139
+ ] }) }),
22140
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-4 py-2", children: [
22141
+ context && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "whitespace-nowrap flex-shrink-0", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-inherit", children: context }) }),
22142
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0 flex items-stretch rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-background)] focus-within:border-[var(--color-primary)] overflow-hidden", children: [
22143
+ /* @__PURE__ */ jsx(
22144
+ Textarea,
22145
+ {
22146
+ value: inputValue,
22147
+ placeholder: placeholder ?? t("chatBar.askTheAgentAnything"),
22148
+ onChange: (e) => setInputValue(e.target.value),
22149
+ onKeyDown: handleKeyDown,
22150
+ rows: 1,
22151
+ className: "flex-1 min-w-0 min-h-0 text-sm border-0 rounded-none shadow-none bg-transparent resize-none focus:ring-0"
22152
+ }
22153
+ ),
22154
+ trailingAction
22155
+ ] }),
22156
+ (activeGate || jepaValidity !== void 0) && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
22157
+ activeGate && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "whitespace-nowrap", children: activeGate }),
22158
+ jepaValidity !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: getJepaBadgeVariant(jepaValidity), size: "sm", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-inherit", children: [
22159
+ (jepaValidity * 100).toFixed(1),
22160
+ "%"
22161
+ ] }) })
22162
+ ] })
22163
+ ] })
22164
+ ] });
22165
+ }
22166
+ var init_ChatBar = __esm({
22167
+ "components/core/organisms/ChatBar.tsx"() {
22168
+ "use client";
22169
+ init_Box();
22170
+ init_Stack();
22171
+ init_Typography();
22172
+ init_Button();
22173
+ init_Badge();
22174
+ init_Icon();
22175
+ init_Textarea();
22176
+ init_useEventBus();
22177
+ init_trace_edit_focus();
22178
+ ChatBar.displayName = "ChatBar";
22179
+ }
22180
+ });
21899
22181
  function resolveManifestUrl2(manifest, relative) {
21900
22182
  if (relative == null) return void 0;
21901
22183
  if (/^https?:\/\//.test(relative)) return relative;
@@ -23019,7 +23301,7 @@ function CraftingRecipe({
23019
23301
  className
23020
23302
  }) {
23021
23303
  const eventBus = useEventBus();
23022
- const handleCraft = React85.useCallback(() => {
23304
+ const handleCraft = React86.useCallback(() => {
23023
23305
  onCraft?.();
23024
23306
  if (craftEvent) {
23025
23307
  eventBus.emit(craftEvent, { output: output.label });
@@ -23036,7 +23318,7 @@ function CraftingRecipe({
23036
23318
  children: [
23037
23319
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
23038
23320
  const hasSufficient = ingredient.available >= ingredient.required;
23039
- return /* @__PURE__ */ jsxs(React85.Fragment, { children: [
23321
+ return /* @__PURE__ */ jsxs(React86.Fragment, { children: [
23040
23322
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
23041
23323
  ItemSlot,
23042
23324
  {
@@ -23108,8 +23390,8 @@ function DPad({
23108
23390
  }) {
23109
23391
  const eventBus = useEventBus();
23110
23392
  const sizes = sizeMap15[size];
23111
- const [activeDirections, setActiveDirections] = React85.useState(/* @__PURE__ */ new Set());
23112
- const handlePress = React85.useCallback(
23393
+ const [activeDirections, setActiveDirections] = React86.useState(/* @__PURE__ */ new Set());
23394
+ const handlePress = React86.useCallback(
23113
23395
  (direction) => {
23114
23396
  setActiveDirections((prev) => new Set(prev).add(direction));
23115
23397
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -23117,7 +23399,7 @@ function DPad({
23117
23399
  },
23118
23400
  [directionEvent, eventBus, onDirection]
23119
23401
  );
23120
- const handleRelease = React85.useCallback(
23402
+ const handleRelease = React86.useCallback(
23121
23403
  (direction) => {
23122
23404
  setActiveDirections((prev) => {
23123
23405
  const next = new Set(prev);
@@ -24002,8 +24284,8 @@ var init_Menu = __esm({
24002
24284
  "bottom-end": "bottom-start"
24003
24285
  };
24004
24286
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
24005
- const triggerChild = React85__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
24006
- const triggerElement = React85__default.cloneElement(
24287
+ const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
24288
+ const triggerElement = React86__default.cloneElement(
24007
24289
  triggerChild,
24008
24290
  {
24009
24291
  ref: triggerRef,
@@ -24098,14 +24380,14 @@ function useDataDnd(args) {
24098
24380
  const isZone = Boolean(dragGroup || accepts || sortable);
24099
24381
  const enabled = isZone || Boolean(dndRoot);
24100
24382
  const eventBus = useEventBus();
24101
- const parentRoot = React85__default.useContext(RootCtx);
24383
+ const parentRoot = React86__default.useContext(RootCtx);
24102
24384
  const isRoot = enabled && parentRoot === null;
24103
- const zoneId = React85__default.useId();
24385
+ const zoneId = React86__default.useId();
24104
24386
  const ownGroup = dragGroup ?? accepts ?? zoneId;
24105
- const [optimisticOrders, setOptimisticOrders] = React85__default.useState(() => /* @__PURE__ */ new Map());
24106
- const optimisticOrdersRef = React85__default.useRef(optimisticOrders);
24387
+ const [optimisticOrders, setOptimisticOrders] = React86__default.useState(() => /* @__PURE__ */ new Map());
24388
+ const optimisticOrdersRef = React86__default.useRef(optimisticOrders);
24107
24389
  optimisticOrdersRef.current = optimisticOrders;
24108
- const clearOptimisticOrder = React85__default.useCallback((group) => {
24390
+ const clearOptimisticOrder = React86__default.useCallback((group) => {
24109
24391
  setOptimisticOrders((prev) => {
24110
24392
  if (!prev.has(group)) return prev;
24111
24393
  const next = new Map(prev);
@@ -24130,7 +24412,7 @@ function useDataDnd(args) {
24130
24412
  const raw = it[dndItemIdField];
24131
24413
  return String(raw ?? `__idx_${idx}`);
24132
24414
  }).join("|");
24133
- const itemIds = React85__default.useMemo(
24415
+ const itemIds = React86__default.useMemo(
24134
24416
  () => orderedItems.map((it, idx) => {
24135
24417
  const raw = it[dndItemIdField];
24136
24418
  return raw ?? `__idx_${idx}`;
@@ -24138,7 +24420,7 @@ function useDataDnd(args) {
24138
24420
  [itemIdsSignature]
24139
24421
  );
24140
24422
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
24141
- React85__default.useEffect(() => {
24423
+ React86__default.useEffect(() => {
24142
24424
  const root = isRoot ? null : parentRoot;
24143
24425
  if (root) {
24144
24426
  root.clearOptimisticOrder(ownGroup);
@@ -24146,20 +24428,20 @@ function useDataDnd(args) {
24146
24428
  clearOptimisticOrder(ownGroup);
24147
24429
  }
24148
24430
  }, [itemsContentSig, ownGroup]);
24149
- const zonesRef = React85__default.useRef(/* @__PURE__ */ new Map());
24150
- const registerZone = React85__default.useCallback((zoneId2, meta2) => {
24431
+ const zonesRef = React86__default.useRef(/* @__PURE__ */ new Map());
24432
+ const registerZone = React86__default.useCallback((zoneId2, meta2) => {
24151
24433
  zonesRef.current.set(zoneId2, meta2);
24152
24434
  }, []);
24153
- const unregisterZone = React85__default.useCallback((zoneId2) => {
24435
+ const unregisterZone = React86__default.useCallback((zoneId2) => {
24154
24436
  zonesRef.current.delete(zoneId2);
24155
24437
  }, []);
24156
- const [activeDrag, setActiveDrag] = React85__default.useState(null);
24157
- const [overZoneGroup, setOverZoneGroup] = React85__default.useState(null);
24158
- const meta = React85__default.useMemo(
24438
+ const [activeDrag, setActiveDrag] = React86__default.useState(null);
24439
+ const [overZoneGroup, setOverZoneGroup] = React86__default.useState(null);
24440
+ const meta = React86__default.useMemo(
24159
24441
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
24160
24442
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
24161
24443
  );
24162
- React85__default.useEffect(() => {
24444
+ React86__default.useEffect(() => {
24163
24445
  const target = isRoot ? null : parentRoot;
24164
24446
  if (!target) {
24165
24447
  zonesRef.current.set(zoneId, meta);
@@ -24178,7 +24460,7 @@ function useDataDnd(args) {
24178
24460
  }, [parentRoot, isRoot, zoneId, meta]);
24179
24461
  const sensors = useAlmadarDndSensors(true);
24180
24462
  const collisionDetection = almadarDndCollisionDetection;
24181
- const findZoneByItem = React85__default.useCallback(
24463
+ const findZoneByItem = React86__default.useCallback(
24182
24464
  (id) => {
24183
24465
  for (const z of zonesRef.current.values()) {
24184
24466
  if (z.itemIds.includes(id)) return z;
@@ -24187,7 +24469,7 @@ function useDataDnd(args) {
24187
24469
  },
24188
24470
  []
24189
24471
  );
24190
- React85__default.useCallback(
24472
+ React86__default.useCallback(
24191
24473
  (group) => {
24192
24474
  for (const z of zonesRef.current.values()) {
24193
24475
  if (z.group === group) return z;
@@ -24196,7 +24478,7 @@ function useDataDnd(args) {
24196
24478
  },
24197
24479
  []
24198
24480
  );
24199
- const handleDragEnd = React85__default.useCallback(
24481
+ const handleDragEnd = React86__default.useCallback(
24200
24482
  (event) => {
24201
24483
  const { active, over } = event;
24202
24484
  const activeIdStr = String(active.id);
@@ -24287,8 +24569,8 @@ function useDataDnd(args) {
24287
24569
  },
24288
24570
  [eventBus]
24289
24571
  );
24290
- const sortableData = React85__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
24291
- const SortableItem = React85__default.useCallback(
24572
+ const sortableData = React86__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
24573
+ const SortableItem = React86__default.useCallback(
24292
24574
  ({ id, children }) => {
24293
24575
  const {
24294
24576
  attributes,
@@ -24328,7 +24610,7 @@ function useDataDnd(args) {
24328
24610
  id: droppableId,
24329
24611
  data: sortableData
24330
24612
  });
24331
- const ctx = React85__default.useContext(RootCtx);
24613
+ const ctx = React86__default.useContext(RootCtx);
24332
24614
  const activeDrag2 = ctx?.activeDrag ?? null;
24333
24615
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
24334
24616
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -24343,7 +24625,7 @@ function useDataDnd(args) {
24343
24625
  showForeignPlaceholder,
24344
24626
  ctxAvailable: ctx != null
24345
24627
  });
24346
- React85__default.useEffect(() => {
24628
+ React86__default.useEffect(() => {
24347
24629
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
24348
24630
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
24349
24631
  return /* @__PURE__ */ jsx(
@@ -24357,11 +24639,11 @@ function useDataDnd(args) {
24357
24639
  }
24358
24640
  );
24359
24641
  };
24360
- const rootContextValue = React85__default.useMemo(
24642
+ const rootContextValue = React86__default.useMemo(
24361
24643
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
24362
24644
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
24363
24645
  );
24364
- const handleDragStart = React85__default.useCallback((event) => {
24646
+ const handleDragStart = React86__default.useCallback((event) => {
24365
24647
  const sourceZone = findZoneByItem(event.active.id);
24366
24648
  const rect = event.active.rect.current.initial;
24367
24649
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -24380,7 +24662,7 @@ function useDataDnd(args) {
24380
24662
  isRoot
24381
24663
  });
24382
24664
  }, [findZoneByItem, isRoot, zoneId]);
24383
- const handleDragOver = React85__default.useCallback((event) => {
24665
+ const handleDragOver = React86__default.useCallback((event) => {
24384
24666
  const { active, over } = event;
24385
24667
  const overData = over?.data?.current;
24386
24668
  const overGroup = overData?.dndGroup ?? null;
@@ -24450,7 +24732,7 @@ function useDataDnd(args) {
24450
24732
  return next;
24451
24733
  });
24452
24734
  }, []);
24453
- const handleDragCancel = React85__default.useCallback((event) => {
24735
+ const handleDragCancel = React86__default.useCallback((event) => {
24454
24736
  setActiveDrag(null);
24455
24737
  setOverZoneGroup(null);
24456
24738
  dndLog.warn("dragCancel", {
@@ -24458,12 +24740,12 @@ function useDataDnd(args) {
24458
24740
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
24459
24741
  });
24460
24742
  }, []);
24461
- const handleDragEndWithCleanup = React85__default.useCallback((event) => {
24743
+ const handleDragEndWithCleanup = React86__default.useCallback((event) => {
24462
24744
  handleDragEnd(event);
24463
24745
  setActiveDrag(null);
24464
24746
  setOverZoneGroup(null);
24465
24747
  }, [handleDragEnd]);
24466
- const wrapContainer = React85__default.useCallback(
24748
+ const wrapContainer = React86__default.useCallback(
24467
24749
  (children) => {
24468
24750
  if (!enabled) return children;
24469
24751
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -24517,7 +24799,7 @@ var init_useDataDnd = __esm({
24517
24799
  init_useAlmadarDndCollision();
24518
24800
  init_Box();
24519
24801
  dndLog = createLogger("almadar:ui:dnd");
24520
- RootCtx = React85__default.createContext(null);
24802
+ RootCtx = React86__default.createContext(null);
24521
24803
  }
24522
24804
  });
24523
24805
  function renderIconInput(icon, props) {
@@ -25043,7 +25325,7 @@ function DataList({
25043
25325
  }) {
25044
25326
  const eventBus = useEventBus();
25045
25327
  const { t } = useTranslate();
25046
- const [visibleCount, setVisibleCount] = React85__default.useState(pageSize || Infinity);
25328
+ const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
25047
25329
  const fieldDefs = fields ?? columns ?? [];
25048
25330
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
25049
25331
  const dnd = useDataDnd({
@@ -25062,7 +25344,7 @@ function DataList({
25062
25344
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
25063
25345
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
25064
25346
  const hasRenderProp = typeof children === "function";
25065
- React85__default.useEffect(() => {
25347
+ React86__default.useEffect(() => {
25066
25348
  const renderItemTypeOf = typeof schemaRenderItem;
25067
25349
  const childrenTypeOf = typeof children;
25068
25350
  if (data.length > 0 && !hasRenderProp) {
@@ -25167,7 +25449,7 @@ function DataList({
25167
25449
  const items2 = data.map((item) => item);
25168
25450
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
25169
25451
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
25170
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
25452
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
25171
25453
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
25172
25454
  group.items.map((itemData, index) => {
25173
25455
  const id = itemData.id || `${gi}-${index}`;
@@ -25308,7 +25590,7 @@ function DataList({
25308
25590
  className
25309
25591
  ),
25310
25592
  children: [
25311
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
25593
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
25312
25594
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
25313
25595
  group.items.map(
25314
25596
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -26224,7 +26506,7 @@ var init_Grid = __esm({
26224
26506
  as: Component2 = "div"
26225
26507
  }) => {
26226
26508
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
26227
- return React85__default.createElement(
26509
+ return React86__default.createElement(
26228
26510
  Component2,
26229
26511
  {
26230
26512
  className: cn(
@@ -26420,9 +26702,9 @@ var init_Popover = __esm({
26420
26702
  onMouseLeave: handleClose,
26421
26703
  onPointerDown: tapTriggerProps.onPointerDown
26422
26704
  };
26423
- const childElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26705
+ const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26424
26706
  const childPointerDown = childElement.props.onPointerDown;
26425
- const triggerElement = React85__default.cloneElement(
26707
+ const triggerElement = React86__default.cloneElement(
26426
26708
  childElement,
26427
26709
  {
26428
26710
  ref: triggerRef,
@@ -27024,9 +27306,9 @@ var init_Tooltip = __esm({
27024
27306
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
27025
27307
  };
27026
27308
  }, []);
27027
- const triggerElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27309
+ const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27028
27310
  const childPointerDown = triggerElement.props.onPointerDown;
27029
- const trigger = React85__default.cloneElement(triggerElement, {
27311
+ const trigger = React86__default.cloneElement(triggerElement, {
27030
27312
  ref: triggerRef,
27031
27313
  onMouseEnter: handleMouseEnter,
27032
27314
  onMouseLeave: handleMouseLeave,
@@ -27116,7 +27398,7 @@ var init_WizardProgress = __esm({
27116
27398
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
27117
27399
  const isActive = index === currentStep;
27118
27400
  const isCompleted = index < currentStep;
27119
- return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
27401
+ return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
27120
27402
  /* @__PURE__ */ jsx(
27121
27403
  "button",
27122
27404
  {
@@ -28179,7 +28461,7 @@ function InventoryGrid({
28179
28461
  const eventBus = useEventBus();
28180
28462
  const slotCount = totalSlots ?? items.length;
28181
28463
  const emptySlotCount = Math.max(0, slotCount - items.length);
28182
- const handleSelect = React85.useCallback(
28464
+ const handleSelect = React86.useCallback(
28183
28465
  (id) => {
28184
28466
  onSelect?.(id);
28185
28467
  if (selectEvent) {
@@ -28350,6 +28632,7 @@ function PowerupSlots({
28350
28632
  /* @__PURE__ */ jsx(
28351
28633
  ItemSlot,
28352
28634
  {
28635
+ assetUrl: powerup.assetUrl,
28353
28636
  icon: powerup.icon,
28354
28637
  label: powerup.label,
28355
28638
  rarity: "uncommon",
@@ -28413,31 +28696,31 @@ function GameCanvas2D({
28413
28696
  assetBaseUrl,
28414
28697
  className
28415
28698
  }) {
28416
- const canvasRef = React85.useRef(null);
28417
- const rafRef = React85.useRef(0);
28418
- const frameRef = React85.useRef(0);
28419
- const lastTimeRef = React85.useRef(0);
28420
- const imageCache = React85.useRef(/* @__PURE__ */ new Map());
28699
+ const canvasRef = React86.useRef(null);
28700
+ const rafRef = React86.useRef(0);
28701
+ const frameRef = React86.useRef(0);
28702
+ const lastTimeRef = React86.useRef(0);
28703
+ const imageCache = React86.useRef(/* @__PURE__ */ new Map());
28421
28704
  const emit = useEmitEvent();
28422
- const onDrawRef = React85.useRef(onDraw);
28705
+ const onDrawRef = React86.useRef(onDraw);
28423
28706
  onDrawRef.current = onDraw;
28424
- const onTickRef = React85.useRef(onTick);
28707
+ const onTickRef = React86.useRef(onTick);
28425
28708
  onTickRef.current = onTick;
28426
- const tickEventRef = React85.useRef(tickEvent);
28709
+ const tickEventRef = React86.useRef(tickEvent);
28427
28710
  tickEventRef.current = tickEvent;
28428
- const drawEventRef = React85.useRef(drawEvent);
28711
+ const drawEventRef = React86.useRef(drawEvent);
28429
28712
  drawEventRef.current = drawEvent;
28430
- const emitRef = React85.useRef(emit);
28713
+ const emitRef = React86.useRef(emit);
28431
28714
  emitRef.current = emit;
28432
- const assetBaseUrlRef = React85.useRef(assetBaseUrl);
28715
+ const assetBaseUrlRef = React86.useRef(assetBaseUrl);
28433
28716
  assetBaseUrlRef.current = assetBaseUrl;
28434
- const backgroundImageRef = React85.useRef(backgroundImage);
28717
+ const backgroundImageRef = React86.useRef(backgroundImage);
28435
28718
  backgroundImageRef.current = backgroundImage;
28436
- const widthRef = React85.useRef(width);
28719
+ const widthRef = React86.useRef(width);
28437
28720
  widthRef.current = width;
28438
- const heightRef = React85.useRef(height);
28721
+ const heightRef = React86.useRef(height);
28439
28722
  heightRef.current = height;
28440
- const loadImage = React85.useCallback((url) => {
28723
+ const loadImage = React86.useCallback((url) => {
28441
28724
  const base = assetBaseUrlRef.current;
28442
28725
  if (!url.startsWith("http") && !base) return null;
28443
28726
  const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
@@ -28451,7 +28734,7 @@ function GameCanvas2D({
28451
28734
  }
28452
28735
  return null;
28453
28736
  }, []);
28454
- React85.useEffect(() => {
28737
+ React86.useEffect(() => {
28455
28738
  const canvas = canvasRef.current;
28456
28739
  if (!canvas) return;
28457
28740
  const ctx = canvas.getContext("2d");
@@ -28599,13 +28882,26 @@ function HealthPanel({
28599
28882
  )
28600
28883
  }
28601
28884
  ),
28602
- effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsx(
28885
+ effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsxs(
28603
28886
  Badge,
28604
28887
  {
28605
28888
  variant: effectVariantMap[effect.variant ?? "neutral"],
28606
28889
  size: "sm",
28607
- icon: effect.icon,
28608
- children: effect.label
28890
+ icon: effect.assetUrl ? void 0 : effect.icon,
28891
+ children: [
28892
+ effect.assetUrl && /* @__PURE__ */ jsx(
28893
+ "img",
28894
+ {
28895
+ src: effect.assetUrl,
28896
+ alt: "",
28897
+ width: 12,
28898
+ height: 12,
28899
+ style: { imageRendering: "pixelated", objectFit: "contain" },
28900
+ className: "flex-shrink-0 inline-block"
28901
+ }
28902
+ ),
28903
+ effect.label
28904
+ ]
28609
28905
  },
28610
28906
  i
28611
28907
  )) })
@@ -28763,7 +29059,7 @@ function TurnPanel({
28763
29059
  className
28764
29060
  }) {
28765
29061
  const eventBus = useEventBus();
28766
- const handleAction = React85.useCallback(
29062
+ const handleAction = React86.useCallback(
28767
29063
  (event) => {
28768
29064
  if (event) {
28769
29065
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -28788,15 +29084,28 @@ function TurnPanel({
28788
29084
  activeTeam
28789
29085
  }
28790
29086
  ),
28791
- actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */ jsx(
29087
+ actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */ jsxs(
28792
29088
  Button,
28793
29089
  {
28794
29090
  variant: "ghost",
28795
29091
  size: "sm",
28796
29092
  disabled: action.disabled,
28797
- leftIcon: action.icon,
29093
+ leftIcon: action.assetUrl ? void 0 : action.icon,
28798
29094
  onClick: () => handleAction(action.event),
28799
- children: action.label
29095
+ children: [
29096
+ action.assetUrl && /* @__PURE__ */ jsx(
29097
+ "img",
29098
+ {
29099
+ src: action.assetUrl,
29100
+ alt: "",
29101
+ width: 14,
29102
+ height: 14,
29103
+ style: { imageRendering: "pixelated", objectFit: "contain" },
29104
+ className: "flex-shrink-0"
29105
+ }
29106
+ ),
29107
+ action.label
29108
+ ]
28800
29109
  },
28801
29110
  i
28802
29111
  )) })
@@ -28931,7 +29240,7 @@ function UnitCommandBar({
28931
29240
  className
28932
29241
  }) {
28933
29242
  const eventBus = useEventBus();
28934
- const handleCommand = React85.useCallback(
29243
+ const handleCommand = React86.useCallback(
28935
29244
  (event) => {
28936
29245
  if (event) {
28937
29246
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -29482,7 +29791,7 @@ function GameMenu({
29482
29791
  } catch {
29483
29792
  }
29484
29793
  const eventBus = eventBusProp || eventBusFromHook;
29485
- const handleOptionClick = React85.useCallback(
29794
+ const handleOptionClick = React86.useCallback(
29486
29795
  (option) => {
29487
29796
  if (option.event && eventBus) {
29488
29797
  eventBus.emit(`UI:${option.event}`, { option });
@@ -29601,7 +29910,7 @@ function GameOverScreen({
29601
29910
  } catch {
29602
29911
  }
29603
29912
  const eventBus = eventBusProp || eventBusFromHook;
29604
- const handleActionClick = React85.useCallback(
29913
+ const handleActionClick = React86.useCallback(
29605
29914
  (action) => {
29606
29915
  if (action.event && eventBus) {
29607
29916
  eventBus.emit(`UI:${action.event}`, { action });
@@ -30533,13 +30842,13 @@ var init_MapView = __esm({
30533
30842
  shadowSize: [41, 41]
30534
30843
  });
30535
30844
  L.Marker.prototype.options.icon = defaultIcon;
30536
- const { useEffect: useEffect82, useRef: useRef80, useCallback: useCallback125, useState: useState111 } = React85__default;
30845
+ const { useEffect: useEffect83, useRef: useRef80, useCallback: useCallback126, useState: useState113 } = React86__default;
30537
30846
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30538
30847
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30539
30848
  function MapUpdater({ centerLat, centerLng, zoom }) {
30540
30849
  const map = useMap();
30541
30850
  const prevRef = useRef80({ centerLat, centerLng, zoom });
30542
- useEffect82(() => {
30851
+ useEffect83(() => {
30543
30852
  const prev = prevRef.current;
30544
30853
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
30545
30854
  map.setView([centerLat, centerLng], zoom);
@@ -30550,7 +30859,7 @@ var init_MapView = __esm({
30550
30859
  }
30551
30860
  function MapClickHandler({ onMapClick }) {
30552
30861
  const map = useMap();
30553
- useEffect82(() => {
30862
+ useEffect83(() => {
30554
30863
  if (!onMapClick) return;
30555
30864
  const handler = (e) => {
30556
30865
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -30578,8 +30887,8 @@ var init_MapView = __esm({
30578
30887
  showAttribution = true
30579
30888
  }) {
30580
30889
  const eventBus = useEventBus3();
30581
- const [clickedPosition, setClickedPosition] = useState111(null);
30582
- const handleMapClick = useCallback125((lat, lng) => {
30890
+ const [clickedPosition, setClickedPosition] = useState113(null);
30891
+ const handleMapClick = useCallback126((lat, lng) => {
30583
30892
  if (showClickedPin) {
30584
30893
  setClickedPosition({ lat, lng });
30585
30894
  }
@@ -30588,7 +30897,7 @@ var init_MapView = __esm({
30588
30897
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
30589
30898
  }
30590
30899
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
30591
- const handleMarkerClick = useCallback125((marker) => {
30900
+ const handleMarkerClick = useCallback126((marker) => {
30592
30901
  onMarkerClick?.(marker);
30593
30902
  if (markerClickEvent) {
30594
30903
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -31439,8 +31748,8 @@ function TableView({
31439
31748
  }) {
31440
31749
  const eventBus = useEventBus();
31441
31750
  const { t } = useTranslate();
31442
- const [visibleCount, setVisibleCount] = React85__default.useState(pageSize > 0 ? pageSize : Infinity);
31443
- const [localSelected, setLocalSelected] = React85__default.useState(/* @__PURE__ */ new Set());
31751
+ const [visibleCount, setVisibleCount] = React86__default.useState(pageSize > 0 ? pageSize : Infinity);
31752
+ const [localSelected, setLocalSelected] = React86__default.useState(/* @__PURE__ */ new Set());
31444
31753
  const colDefs = columns ?? fields ?? [];
31445
31754
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31446
31755
  const dnd = useDataDnd({
@@ -31635,12 +31944,12 @@ function TableView({
31635
31944
  ]
31636
31945
  }
31637
31946
  );
31638
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React85__default.Fragment, { children: rowInner }, id);
31947
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React86__default.Fragment, { children: rowInner }, id);
31639
31948
  };
31640
31949
  const items = data.map((row) => row);
31641
31950
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
31642
31951
  let runningIndex = 0;
31643
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
31952
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
31644
31953
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
31645
31954
  group.items.map((row) => renderRow(row, runningIndex++))
31646
31955
  ] }, gi)) });
@@ -32997,7 +33306,7 @@ var init_StepFlow = __esm({
32997
33306
  className
32998
33307
  }) => {
32999
33308
  if (orientation === "vertical") {
33000
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React85__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33309
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
33001
33310
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
33002
33311
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33003
33312
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -33008,7 +33317,7 @@ var init_StepFlow = __esm({
33008
33317
  ] })
33009
33318
  ] }) }, index)) });
33010
33319
  }
33011
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
33320
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
33012
33321
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
33013
33322
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
33014
33323
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -33993,7 +34302,7 @@ var init_LikertScale = __esm({
33993
34302
  md: "text-base",
33994
34303
  lg: "text-lg"
33995
34304
  };
33996
- LikertScale = React85__default.forwardRef(
34305
+ LikertScale = React86__default.forwardRef(
33997
34306
  ({
33998
34307
  question,
33999
34308
  options = DEFAULT_LIKERT_OPTIONS,
@@ -34005,7 +34314,7 @@ var init_LikertScale = __esm({
34005
34314
  variant = "radios",
34006
34315
  className
34007
34316
  }, ref) => {
34008
- const groupId = React85__default.useId();
34317
+ const groupId = React86__default.useId();
34009
34318
  const eventBus = useEventBus();
34010
34319
  const handleSelect = useCallback(
34011
34320
  (next) => {
@@ -36287,7 +36596,7 @@ var init_DocBreadcrumb = __esm({
36287
36596
  "aria-label": t("aria.breadcrumb"),
36288
36597
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
36289
36598
  const isLast = idx === items.length - 1;
36290
- return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
36599
+ return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
36291
36600
  idx > 0 && /* @__PURE__ */ jsx(
36292
36601
  Icon,
36293
36602
  {
@@ -37156,7 +37465,7 @@ var init_MiniStateMachine = __esm({
37156
37465
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
37157
37466
  const tc = transitionCounts[s.name] ?? 0;
37158
37467
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
37159
- return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
37468
+ return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37160
37469
  /* @__PURE__ */ jsx(
37161
37470
  AvlState,
37162
37471
  {
@@ -37360,7 +37669,7 @@ var init_PageHeader = __esm({
37360
37669
  info: "bg-info/10 text-info"
37361
37670
  };
37362
37671
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
37363
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
37672
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37364
37673
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
37365
37674
  crumb.href ? /* @__PURE__ */ jsx(
37366
37675
  "a",
@@ -38089,7 +38398,7 @@ var init_WizardContainer = __esm({
38089
38398
  const isCompleted = index < currentStep;
38090
38399
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
38091
38400
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
38092
- return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
38401
+ return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
38093
38402
  /* @__PURE__ */ jsx(
38094
38403
  Button,
38095
38404
  {
@@ -40649,7 +40958,7 @@ var init_DetailPanel = __esm({
40649
40958
  }
40650
40959
  });
40651
40960
  function extractTitle(children) {
40652
- if (!React85__default.isValidElement(children)) return void 0;
40961
+ if (!React86__default.isValidElement(children)) return void 0;
40653
40962
  const props = children.props;
40654
40963
  if (typeof props.title === "string") {
40655
40964
  return props.title;
@@ -40704,7 +41013,7 @@ function LinearView({
40704
41013
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
40705
41014
  const isDone = i < currentIdx;
40706
41015
  const isCurrent = i === currentIdx;
40707
- return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
41016
+ return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
40708
41017
  i > 0 && /* @__PURE__ */ jsx(
40709
41018
  Typography,
40710
41019
  {
@@ -41473,6 +41782,42 @@ var init_FeatureGridOrganism = __esm({
41473
41782
  FeatureGridOrganism.displayName = "FeatureGridOrganism";
41474
41783
  }
41475
41784
  });
41785
+ function FishingBoard({
41786
+ backgroundImage,
41787
+ assetBaseUrl,
41788
+ scale = 1,
41789
+ showMinimap = false,
41790
+ enableCamera = true,
41791
+ width = 800,
41792
+ height = 600,
41793
+ isLoading,
41794
+ error,
41795
+ className
41796
+ }) {
41797
+ return /* @__PURE__ */ jsxs("div", { className: cn("fishing-board relative w-full h-full", className), children: [
41798
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: "Loading\u2026" }) }),
41799
+ error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-red-400 text-sm", children: error.message }) }),
41800
+ /* @__PURE__ */ jsx(
41801
+ GameCanvas2D,
41802
+ {
41803
+ width,
41804
+ height,
41805
+ backgroundImage: backgroundImage ?? "",
41806
+ assetBaseUrl,
41807
+ fps: 60,
41808
+ className: "w-full h-full"
41809
+ }
41810
+ )
41811
+ ] });
41812
+ }
41813
+ var init_FishingBoard = __esm({
41814
+ "components/game/organisms/FishingBoard.tsx"() {
41815
+ "use client";
41816
+ init_cn();
41817
+ init_GameCanvas2D();
41818
+ FishingBoard.displayName = "FishingBoard";
41819
+ }
41820
+ });
41476
41821
  function toSharedContext2(formCtx) {
41477
41822
  return createMinimalContext(
41478
41823
  {
@@ -41654,12 +41999,12 @@ var init_Form = __esm({
41654
41999
  const isSchemaEntity = isOrbitalEntitySchema(entity);
41655
42000
  const resolvedEntity = isSchemaEntity ? entity : void 0;
41656
42001
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
41657
- const normalizedInitialData = React85__default.useMemo(() => {
42002
+ const normalizedInitialData = React86__default.useMemo(() => {
41658
42003
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
41659
42004
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
41660
42005
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
41661
42006
  }, [entity, initialData]);
41662
- const entityDerivedFields = React85__default.useMemo(() => {
42007
+ const entityDerivedFields = React86__default.useMemo(() => {
41663
42008
  if (fields && fields.length > 0) return void 0;
41664
42009
  if (!resolvedEntity) return void 0;
41665
42010
  return resolvedEntity.fields.map(
@@ -41679,16 +42024,16 @@ var init_Form = __esm({
41679
42024
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
41680
42025
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
41681
42026
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
41682
- const [formData, setFormData] = React85__default.useState(
42027
+ const [formData, setFormData] = React86__default.useState(
41683
42028
  normalizedInitialData
41684
42029
  );
41685
- const [collapsedSections, setCollapsedSections] = React85__default.useState(
42030
+ const [collapsedSections, setCollapsedSections] = React86__default.useState(
41686
42031
  /* @__PURE__ */ new Set()
41687
42032
  );
41688
- const [submitError, setSubmitError] = React85__default.useState(null);
41689
- const formRef = React85__default.useRef(null);
42033
+ const [submitError, setSubmitError] = React86__default.useState(null);
42034
+ const formRef = React86__default.useRef(null);
41690
42035
  const formMode = props.mode;
41691
- const mountedRef = React85__default.useRef(false);
42036
+ const mountedRef = React86__default.useRef(false);
41692
42037
  if (!mountedRef.current) {
41693
42038
  mountedRef.current = true;
41694
42039
  debug("forms", "mount", {
@@ -41701,7 +42046,7 @@ var init_Form = __esm({
41701
42046
  });
41702
42047
  }
41703
42048
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
41704
- const evalContext = React85__default.useMemo(
42049
+ const evalContext = React86__default.useMemo(
41705
42050
  () => ({
41706
42051
  formValues: formData,
41707
42052
  globalVariables: externalContext?.globalVariables ?? {},
@@ -41710,7 +42055,7 @@ var init_Form = __esm({
41710
42055
  }),
41711
42056
  [formData, externalContext]
41712
42057
  );
41713
- React85__default.useEffect(() => {
42058
+ React86__default.useEffect(() => {
41714
42059
  debug("forms", "initialData-sync", {
41715
42060
  mode: formMode,
41716
42061
  normalizedInitialData,
@@ -41721,7 +42066,7 @@ var init_Form = __esm({
41721
42066
  setFormData(normalizedInitialData);
41722
42067
  }
41723
42068
  }, [normalizedInitialData]);
41724
- const processCalculations = React85__default.useCallback(
42069
+ const processCalculations = React86__default.useCallback(
41725
42070
  (changedFieldId, newFormData) => {
41726
42071
  if (!hiddenCalculations.length) return;
41727
42072
  const context = {
@@ -41746,7 +42091,7 @@ var init_Form = __esm({
41746
42091
  },
41747
42092
  [hiddenCalculations, externalContext, eventBus]
41748
42093
  );
41749
- const checkViolations = React85__default.useCallback(
42094
+ const checkViolations = React86__default.useCallback(
41750
42095
  (changedFieldId, newFormData) => {
41751
42096
  if (!violationTriggers.length) return;
41752
42097
  const context = {
@@ -41784,7 +42129,7 @@ var init_Form = __esm({
41784
42129
  processCalculations(name, newFormData);
41785
42130
  checkViolations(name, newFormData);
41786
42131
  };
41787
- const isFieldVisible = React85__default.useCallback(
42132
+ const isFieldVisible = React86__default.useCallback(
41788
42133
  (fieldName) => {
41789
42134
  const condition = conditionalFields[fieldName];
41790
42135
  if (!condition) return true;
@@ -41792,7 +42137,7 @@ var init_Form = __esm({
41792
42137
  },
41793
42138
  [conditionalFields, evalContext]
41794
42139
  );
41795
- const isSectionVisible = React85__default.useCallback(
42140
+ const isSectionVisible = React86__default.useCallback(
41796
42141
  (section) => {
41797
42142
  if (!section.condition) return true;
41798
42143
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -41868,7 +42213,7 @@ var init_Form = __esm({
41868
42213
  eventBus.emit(`UI:${onCancel}`);
41869
42214
  }
41870
42215
  };
41871
- const renderField = React85__default.useCallback(
42216
+ const renderField = React86__default.useCallback(
41872
42217
  (field) => {
41873
42218
  const fieldName = field.name || field.field;
41874
42219
  if (!fieldName) return null;
@@ -41889,7 +42234,7 @@ var init_Form = __esm({
41889
42234
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
41890
42235
  );
41891
42236
  const effectiveFields = entityDerivedFields ?? fields;
41892
- const normalizedFields = React85__default.useMemo(() => {
42237
+ const normalizedFields = React86__default.useMemo(() => {
41893
42238
  if (!effectiveFields || effectiveFields.length === 0) return [];
41894
42239
  return effectiveFields.map((field) => {
41895
42240
  if (typeof field === "string") {
@@ -41912,7 +42257,7 @@ var init_Form = __esm({
41912
42257
  return field;
41913
42258
  });
41914
42259
  }, [effectiveFields, resolvedEntity]);
41915
- const schemaFields = React85__default.useMemo(() => {
42260
+ const schemaFields = React86__default.useMemo(() => {
41916
42261
  if (normalizedFields.length === 0) return null;
41917
42262
  if (isDebugEnabled()) {
41918
42263
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -41922,7 +42267,7 @@ var init_Form = __esm({
41922
42267
  }
41923
42268
  return normalizedFields.map(renderField).filter(Boolean);
41924
42269
  }, [normalizedFields, renderField, entityName, conditionalFields]);
41925
- const sectionElements = React85__default.useMemo(() => {
42270
+ const sectionElements = React86__default.useMemo(() => {
41926
42271
  if (!sections || sections.length === 0) return null;
41927
42272
  return sections.map((section) => {
41928
42273
  if (!isSectionVisible(section)) {
@@ -43712,9 +44057,9 @@ var init_GameCanvas3D2 = __esm({
43712
44057
  const color = unit.faction === "player" ? 4491519 : unit.faction === "enemy" ? 16729156 : 16777028;
43713
44058
  const hasAtlas = unitAtlasUrl(unit) !== null;
43714
44059
  const initialFrame = hasAtlas ? resolveUnitFrame(unit.id) : null;
43715
- const modelScale = UNIT_BASE_MODEL_SCALE * unitScale;
43716
- const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale;
43717
- const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale;
44060
+ const modelScale = UNIT_BASE_MODEL_SCALE * unitScale * gridConfig.cellSize;
44061
+ const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale * gridConfig.cellSize;
44062
+ const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale * gridConfig.cellSize;
43718
44063
  return /* @__PURE__ */ jsxs(
43719
44064
  "group",
43720
44065
  {
@@ -43761,7 +44106,7 @@ var init_GameCanvas3D2 = __esm({
43761
44106
  /* @__PURE__ */ jsx("meshStandardMaterial", { color })
43762
44107
  ] })
43763
44108
  ] }),
43764
- unit.health !== void 0 && unit.maxHealth !== void 0 && /* @__PURE__ */ jsxs("group", { position: [0, 1.2, 0], children: [
44109
+ unit.health !== void 0 && unit.maxHealth !== void 0 && /* @__PURE__ */ jsxs("group", { position: [0, billboardHeight, 0], children: [
43765
44110
  /* @__PURE__ */ jsxs("mesh", { position: [-0.25, 0, 0], children: [
43766
44111
  /* @__PURE__ */ jsx("planeGeometry", { args: [0.5, 0.05] }),
43767
44112
  /* @__PURE__ */ jsx("meshBasicMaterial", { color: 3355443 })
@@ -43790,7 +44135,7 @@ var init_GameCanvas3D2 = __esm({
43790
44135
  }
43791
44136
  );
43792
44137
  },
43793
- [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale]
44138
+ [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale, gridConfig]
43794
44139
  );
43795
44140
  const DefaultFeatureRenderer = useCallback(
43796
44141
  ({
@@ -43878,7 +44223,7 @@ var init_GameCanvas3D2 = __esm({
43878
44223
  {
43879
44224
  ref: containerRef,
43880
44225
  className: cn("game-canvas-3d relative w-full overflow-hidden", className),
43881
- style: { height: "85vh" },
44226
+ style: { flex: "1 1 0", minHeight: "400px" },
43882
44227
  "data-orientation": orientation,
43883
44228
  "data-camera-mode": cameraMode,
43884
44229
  "data-overlay": overlay,
@@ -44178,13 +44523,39 @@ var init_GameBoard3D = __esm({
44178
44523
  GameBoard3D.displayName = "GameBoard3D";
44179
44524
  }
44180
44525
  });
44181
- var GameShell;
44526
+ function getSlotContentRenderer2() {
44527
+ if (_scr) return _scr;
44528
+ const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
44529
+ _scr = mod.SlotContentRenderer;
44530
+ return _scr;
44531
+ }
44532
+ function resolveDescriptor(value, idPrefix) {
44533
+ if (value === null || value === void 0) return value;
44534
+ if (React86__default.isValidElement(value)) return value;
44535
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
44536
+ if (Array.isArray(value)) {
44537
+ return value.map((item, i) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
44538
+ }
44539
+ if (typeof value === "object") {
44540
+ const rec = value;
44541
+ if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
44542
+ const { type, props: nestedProps, _id, ...flatProps } = rec;
44543
+ const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
44544
+ const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
44545
+ const SCR = getSlotContentRenderer2();
44546
+ return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
44547
+ }
44548
+ }
44549
+ return null;
44550
+ }
44551
+ var _scr, GameShell;
44182
44552
  var init_GameShell = __esm({
44183
44553
  "components/game/templates/GameShell.tsx"() {
44184
44554
  init_cn();
44185
44555
  init_Box();
44186
44556
  init_Stack();
44187
44557
  init_Typography();
44558
+ _scr = null;
44188
44559
  GameShell = ({
44189
44560
  appName = "Game",
44190
44561
  hud,
@@ -44233,7 +44604,7 @@ var init_GameShell = __esm({
44233
44604
  children: appName
44234
44605
  }
44235
44606
  ),
44236
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: hud })
44607
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor(hud, "gs-hud") })
44237
44608
  ]
44238
44609
  }
44239
44610
  ),
@@ -44246,7 +44617,7 @@ var init_GameShell = __esm({
44246
44617
  overflow: "hidden",
44247
44618
  position: "relative"
44248
44619
  },
44249
- children
44620
+ children: resolveDescriptor(children, "gs-children")
44250
44621
  }
44251
44622
  )
44252
44623
  ]
@@ -44256,7 +44627,32 @@ var init_GameShell = __esm({
44256
44627
  GameShell.displayName = "GameShell";
44257
44628
  }
44258
44629
  });
44259
- var GameTemplate;
44630
+ function getSlotContentRenderer3() {
44631
+ if (_scr2) return _scr2;
44632
+ const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
44633
+ _scr2 = mod.SlotContentRenderer;
44634
+ return _scr2;
44635
+ }
44636
+ function resolveDescriptor2(value, idPrefix) {
44637
+ if (value === null || value === void 0) return value;
44638
+ if (React86__default.isValidElement(value)) return value;
44639
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
44640
+ if (Array.isArray(value)) {
44641
+ return value.map((item, i) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
44642
+ }
44643
+ if (typeof value === "object") {
44644
+ const rec = value;
44645
+ if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
44646
+ const { type, props: nestedProps, _id, ...flatProps } = rec;
44647
+ const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
44648
+ const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
44649
+ const SCR = getSlotContentRenderer3();
44650
+ return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
44651
+ }
44652
+ }
44653
+ return null;
44654
+ }
44655
+ var _scr2, GameTemplate;
44260
44656
  var init_GameTemplate = __esm({
44261
44657
  "components/game/templates/GameTemplate.tsx"() {
44262
44658
  init_cn();
@@ -44264,6 +44660,7 @@ var init_GameTemplate = __esm({
44264
44660
  init_Stack();
44265
44661
  init_Typography();
44266
44662
  init_Button();
44663
+ _scr2 = null;
44267
44664
  GameTemplate = ({
44268
44665
  entity,
44269
44666
  title = "Game",
@@ -44331,13 +44728,13 @@ var init_GameTemplate = __esm({
44331
44728
  fullWidth: true,
44332
44729
  className: "flex-1 bg-muted",
44333
44730
  children: [
44334
- children,
44731
+ resolveDescriptor2(children, "gt-children"),
44335
44732
  hud && /* @__PURE__ */ jsx(
44336
44733
  Box,
44337
44734
  {
44338
44735
  position: "absolute",
44339
44736
  className: "top-0 left-0 right-0 pointer-events-none",
44340
- children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
44737
+ children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: resolveDescriptor2(hud, "gt-hud") })
44341
44738
  }
44342
44739
  )
44343
44740
  ]
@@ -44362,7 +44759,7 @@ var init_GameTemplate = __esm({
44362
44759
  children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
44363
44760
  }
44364
44761
  ),
44365
- /* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
44762
+ /* @__PURE__ */ jsx(Box, { padding: "md", children: resolveDescriptor2(debugPanel, "gt-debug") })
44366
44763
  ]
44367
44764
  }
44368
44765
  )
@@ -44574,6 +44971,39 @@ var init_HexStrategyBoard = __esm({
44574
44971
  HexStrategyBoard.displayName = "HexStrategyBoard";
44575
44972
  }
44576
44973
  });
44974
+ function HolidayRunnerBoard({
44975
+ backgroundImage,
44976
+ assetBaseUrl,
44977
+ width = 800,
44978
+ height = 400,
44979
+ fps = 60,
44980
+ isLoading,
44981
+ error,
44982
+ className
44983
+ }) {
44984
+ return /* @__PURE__ */ jsxs("div", { className: cn("holiday-runner-board relative w-full h-full", className), children: [
44985
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/40 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: "Loading\u2026" }) }),
44986
+ error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/60 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-red-400 text-sm", children: error.message }) }),
44987
+ /* @__PURE__ */ jsx(
44988
+ GameCanvas2D,
44989
+ {
44990
+ width,
44991
+ height,
44992
+ fps,
44993
+ backgroundImage: backgroundImage ?? "",
44994
+ assetBaseUrl
44995
+ }
44996
+ )
44997
+ ] });
44998
+ }
44999
+ var init_HolidayRunnerBoard = __esm({
45000
+ "components/game/organisms/HolidayRunnerBoard.tsx"() {
45001
+ "use client";
45002
+ init_cn();
45003
+ init_GameCanvas2D();
45004
+ HolidayRunnerBoard.displayName = "HolidayRunnerBoard";
45005
+ }
45006
+ });
44577
45007
  var LandingPageTemplate;
44578
45008
  var init_LandingPageTemplate = __esm({
44579
45009
  "components/marketing/templates/LandingPageTemplate.tsx"() {
@@ -44909,7 +45339,7 @@ var init_List = __esm({
44909
45339
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
44910
45340
  return [];
44911
45341
  }, [entity]);
44912
- const getItemActions = React85__default.useCallback(
45342
+ const getItemActions = React86__default.useCallback(
44913
45343
  (item) => {
44914
45344
  if (!itemActions) return [];
44915
45345
  if (typeof itemActions === "function") {
@@ -45328,6 +45758,48 @@ var init_MasterDetailLayout = __esm({
45328
45758
  MasterDetailLayout.displayName = "MasterDetailLayout";
45329
45759
  }
45330
45760
  });
45761
+ function MatchPuzzleBoard({
45762
+ tiles,
45763
+ units,
45764
+ features,
45765
+ assetManifest,
45766
+ assetBaseUrl,
45767
+ scale = 0.45,
45768
+ showMinimap = false,
45769
+ enableCamera = false,
45770
+ tileClickEvent,
45771
+ unitClickEvent,
45772
+ isLoading,
45773
+ error,
45774
+ className
45775
+ }) {
45776
+ return /* @__PURE__ */ jsx("div", { className: cn("match-puzzle-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
45777
+ IsometricCanvas_default,
45778
+ {
45779
+ tileLayout: "flat",
45780
+ tiles,
45781
+ units,
45782
+ features,
45783
+ assetManifest,
45784
+ assetBaseUrl,
45785
+ scale,
45786
+ showMinimap,
45787
+ enableCamera,
45788
+ tileClickEvent,
45789
+ unitClickEvent,
45790
+ isLoading,
45791
+ error
45792
+ }
45793
+ ) });
45794
+ }
45795
+ var init_MatchPuzzleBoard = __esm({
45796
+ "components/game/organisms/MatchPuzzleBoard.tsx"() {
45797
+ "use client";
45798
+ init_cn();
45799
+ init_IsometricCanvas();
45800
+ MatchPuzzleBoard.displayName = "MatchPuzzleBoard";
45801
+ }
45802
+ });
45331
45803
  var COLUMN_CLASSES, ASPECT_CLASSES, MediaGallery;
45332
45804
  var init_MediaGallery = __esm({
45333
45805
  "components/core/organisms/MediaGallery.tsx"() {
@@ -45385,7 +45857,7 @@ var init_MediaGallery = __esm({
45385
45857
  [selectable, selectedItems, selectionEvent, eventBus]
45386
45858
  );
45387
45859
  const entityData = Array.isArray(entity) ? entity : [];
45388
- const items = React85__default.useMemo(() => {
45860
+ const items = React86__default.useMemo(() => {
45389
45861
  if (propItems) return propItems;
45390
45862
  if (entityData.length === 0) return [];
45391
45863
  return entityData.map((record, idx) => ({
@@ -45545,8 +46017,50 @@ var init_MediaGallery = __esm({
45545
46017
  MediaGallery.displayName = "MediaGallery";
45546
46018
  }
45547
46019
  });
46020
+ function MinigolfBoard({
46021
+ tiles,
46022
+ units,
46023
+ features,
46024
+ assetManifest,
46025
+ assetBaseUrl,
46026
+ scale = 0.45,
46027
+ showMinimap = true,
46028
+ enableCamera = true,
46029
+ tileClickEvent,
46030
+ unitClickEvent,
46031
+ isLoading,
46032
+ error,
46033
+ className
46034
+ }) {
46035
+ return /* @__PURE__ */ jsx("div", { className: cn("minigolf-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
46036
+ IsometricCanvas_default,
46037
+ {
46038
+ tileLayout: "isometric",
46039
+ tiles,
46040
+ units,
46041
+ features,
46042
+ assetManifest,
46043
+ assetBaseUrl,
46044
+ scale,
46045
+ showMinimap,
46046
+ enableCamera,
46047
+ tileClickEvent,
46048
+ unitClickEvent,
46049
+ isLoading,
46050
+ error
46051
+ }
46052
+ ) });
46053
+ }
46054
+ var init_MinigolfBoard = __esm({
46055
+ "components/game/organisms/MinigolfBoard.tsx"() {
46056
+ "use client";
46057
+ init_cn();
46058
+ init_IsometricCanvas();
46059
+ MinigolfBoard.displayName = "MinigolfBoard";
46060
+ }
46061
+ });
45548
46062
  function extractTitle2(children) {
45549
- if (!React85__default.isValidElement(children)) return void 0;
46063
+ if (!React86__default.isValidElement(children)) return void 0;
45550
46064
  const props = children.props;
45551
46065
  if (typeof props.title === "string") {
45552
46066
  return props.title;
@@ -45762,6 +46276,87 @@ var init_NegotiatorBoard = __esm({
45762
46276
  NegotiatorBoard.displayName = "NegotiatorBoard";
45763
46277
  }
45764
46278
  });
46279
+ function PinballBoard({
46280
+ tiles: _tiles,
46281
+ units: _units,
46282
+ features: _features,
46283
+ assetManifest: _assetManifest,
46284
+ assetBaseUrl,
46285
+ scale = 1,
46286
+ showMinimap: _showMinimap = false,
46287
+ enableCamera: _enableCamera = false,
46288
+ tileClickEvent: _tileClickEvent,
46289
+ unitClickEvent: _unitClickEvent,
46290
+ isLoading,
46291
+ error,
46292
+ className
46293
+ }) {
46294
+ if (isLoading) {
46295
+ return /* @__PURE__ */ jsx("div", { className: cn("pinball-board relative w-full h-full flex items-center justify-center", className), children: /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading..." }) });
46296
+ }
46297
+ if (error) {
46298
+ return /* @__PURE__ */ jsx("div", { className: cn("pinball-board relative w-full h-full flex items-center justify-center", className), children: /* @__PURE__ */ jsx("span", { className: "text-sm text-destructive", children: error.message }) });
46299
+ }
46300
+ return /* @__PURE__ */ jsx("div", { className: cn("pinball-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
46301
+ GameCanvas2D,
46302
+ {
46303
+ width: Math.round(400 * scale),
46304
+ height: Math.round(800 * scale),
46305
+ assetBaseUrl,
46306
+ fps: 60
46307
+ }
46308
+ ) });
46309
+ }
46310
+ var init_PinballBoard = __esm({
46311
+ "components/game/organisms/PinballBoard.tsx"() {
46312
+ "use client";
46313
+ init_cn();
46314
+ init_GameCanvas2D();
46315
+ PinballBoard.displayName = "PinballBoard";
46316
+ }
46317
+ });
46318
+ function PirateBoard({
46319
+ tiles,
46320
+ units,
46321
+ features,
46322
+ assetManifest,
46323
+ assetBaseUrl,
46324
+ scale = 0.45,
46325
+ showMinimap = true,
46326
+ enableCamera = true,
46327
+ tileClickEvent,
46328
+ unitClickEvent,
46329
+ isLoading,
46330
+ error,
46331
+ className
46332
+ }) {
46333
+ return /* @__PURE__ */ jsx("div", { className: cn("pirate-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
46334
+ IsometricCanvas_default,
46335
+ {
46336
+ tileLayout: "flat",
46337
+ tiles,
46338
+ units,
46339
+ features,
46340
+ assetManifest,
46341
+ assetBaseUrl,
46342
+ scale,
46343
+ showMinimap,
46344
+ enableCamera,
46345
+ tileClickEvent,
46346
+ unitClickEvent,
46347
+ isLoading,
46348
+ error
46349
+ }
46350
+ ) });
46351
+ }
46352
+ var init_PirateBoard = __esm({
46353
+ "components/game/organisms/PirateBoard.tsx"() {
46354
+ "use client";
46355
+ init_cn();
46356
+ init_IsometricCanvas();
46357
+ PirateBoard.displayName = "PirateBoard";
46358
+ }
46359
+ });
45765
46360
  function resolveEntity(entity) {
45766
46361
  if (!entity) return {};
45767
46362
  if (Array.isArray(entity)) return entity[0] ?? {};
@@ -46122,6 +46717,37 @@ var init_PricingPageTemplate = __esm({
46122
46717
  PricingPageTemplate.displayName = "PricingPageTemplate";
46123
46718
  }
46124
46719
  });
46720
+ function RacingBoard({
46721
+ backgroundImage,
46722
+ assetBaseUrl,
46723
+ width = 800,
46724
+ height = 600,
46725
+ fps = 60,
46726
+ tickEvent,
46727
+ drawEvent,
46728
+ className
46729
+ }) {
46730
+ return /* @__PURE__ */ jsx("div", { className: cn("racing-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
46731
+ GameCanvas2D,
46732
+ {
46733
+ backgroundImage,
46734
+ assetBaseUrl,
46735
+ width,
46736
+ height,
46737
+ fps,
46738
+ tickEvent: typeof tickEvent === "string" ? tickEvent : void 0,
46739
+ drawEvent: typeof drawEvent === "string" ? drawEvent : void 0
46740
+ }
46741
+ ) });
46742
+ }
46743
+ var init_RacingBoard = __esm({
46744
+ "components/game/organisms/RacingBoard.tsx"() {
46745
+ "use client";
46746
+ init_cn();
46747
+ init_GameCanvas2D();
46748
+ RacingBoard.displayName = "RacingBoard";
46749
+ }
46750
+ });
46125
46751
  function resolveManifestUrl3(manifest, relative) {
46126
46752
  if (relative == null) return void 0;
46127
46753
  if (/^https?:\/\//.test(relative)) return relative;
@@ -46597,7 +47223,7 @@ var init_debugRegistry = __esm({
46597
47223
  }
46598
47224
  });
46599
47225
  function useDebugData() {
46600
- const [data, setData] = React85.useState(() => ({
47226
+ const [data, setData] = React86.useState(() => ({
46601
47227
  traits: [],
46602
47228
  ticks: [],
46603
47229
  guards: [],
@@ -46611,7 +47237,7 @@ function useDebugData() {
46611
47237
  },
46612
47238
  lastUpdate: Date.now()
46613
47239
  }));
46614
- React85.useEffect(() => {
47240
+ React86.useEffect(() => {
46615
47241
  const updateData = () => {
46616
47242
  setData({
46617
47243
  traits: getAllTraits(),
@@ -46720,12 +47346,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
46720
47346
  return positions;
46721
47347
  }
46722
47348
  function WalkMinimap() {
46723
- const [walkStep, setWalkStep] = React85.useState(null);
46724
- const [traits2, setTraits] = React85.useState([]);
46725
- const [coveredEdges, setCoveredEdges] = React85.useState([]);
46726
- const [completedTraits, setCompletedTraits] = React85.useState(/* @__PURE__ */ new Set());
46727
- const prevTraitRef = React85.useRef(null);
46728
- React85.useEffect(() => {
47349
+ const [walkStep, setWalkStep] = React86.useState(null);
47350
+ const [traits2, setTraits] = React86.useState([]);
47351
+ const [coveredEdges, setCoveredEdges] = React86.useState([]);
47352
+ const [completedTraits, setCompletedTraits] = React86.useState(/* @__PURE__ */ new Set());
47353
+ const prevTraitRef = React86.useRef(null);
47354
+ React86.useEffect(() => {
46729
47355
  const interval = setInterval(() => {
46730
47356
  const w = window;
46731
47357
  const step = w.__orbitalWalkStep;
@@ -47161,15 +47787,15 @@ var init_EntitiesTab = __esm({
47161
47787
  });
47162
47788
  function EventFlowTab({ events: events2 }) {
47163
47789
  const { t } = useTranslate();
47164
- const [filter, setFilter] = React85.useState("all");
47165
- const containerRef = React85.useRef(null);
47166
- const [autoScroll, setAutoScroll] = React85.useState(true);
47167
- React85.useEffect(() => {
47790
+ const [filter, setFilter] = React86.useState("all");
47791
+ const containerRef = React86.useRef(null);
47792
+ const [autoScroll, setAutoScroll] = React86.useState(true);
47793
+ React86.useEffect(() => {
47168
47794
  if (autoScroll && containerRef.current) {
47169
47795
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
47170
47796
  }
47171
47797
  }, [events2.length, autoScroll]);
47172
- const filteredEvents = React85.useMemo(() => {
47798
+ const filteredEvents = React86.useMemo(() => {
47173
47799
  if (filter === "all") return events2;
47174
47800
  return events2.filter((e) => e.type === filter);
47175
47801
  }, [events2, filter]);
@@ -47285,7 +47911,7 @@ var init_EventFlowTab = __esm({
47285
47911
  });
47286
47912
  function GuardsPanel({ guards }) {
47287
47913
  const { t } = useTranslate();
47288
- const [filter, setFilter] = React85.useState("all");
47914
+ const [filter, setFilter] = React86.useState("all");
47289
47915
  if (guards.length === 0) {
47290
47916
  return /* @__PURE__ */ jsx(
47291
47917
  EmptyState,
@@ -47298,7 +47924,7 @@ function GuardsPanel({ guards }) {
47298
47924
  }
47299
47925
  const passedCount = guards.filter((g) => g.result).length;
47300
47926
  const failedCount = guards.length - passedCount;
47301
- const filteredGuards = React85.useMemo(() => {
47927
+ const filteredGuards = React86.useMemo(() => {
47302
47928
  if (filter === "all") return guards;
47303
47929
  if (filter === "passed") return guards.filter((g) => g.result);
47304
47930
  return guards.filter((g) => !g.result);
@@ -47461,10 +48087,10 @@ function EffectBadge({ effect }) {
47461
48087
  }
47462
48088
  function TransitionTimeline({ transitions }) {
47463
48089
  const { t } = useTranslate();
47464
- const containerRef = React85.useRef(null);
47465
- const [autoScroll, setAutoScroll] = React85.useState(true);
47466
- const [expandedId, setExpandedId] = React85.useState(null);
47467
- React85.useEffect(() => {
48090
+ const containerRef = React86.useRef(null);
48091
+ const [autoScroll, setAutoScroll] = React86.useState(true);
48092
+ const [expandedId, setExpandedId] = React86.useState(null);
48093
+ React86.useEffect(() => {
47468
48094
  if (autoScroll && containerRef.current) {
47469
48095
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
47470
48096
  }
@@ -47744,9 +48370,9 @@ function getAllEvents(traits2) {
47744
48370
  function EventDispatcherTab({ traits: traits2, schema }) {
47745
48371
  const eventBus = useEventBus();
47746
48372
  const { t } = useTranslate();
47747
- const [log13, setLog] = React85.useState([]);
47748
- const prevStatesRef = React85.useRef(/* @__PURE__ */ new Map());
47749
- React85.useEffect(() => {
48373
+ const [log13, setLog] = React86.useState([]);
48374
+ const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
48375
+ React86.useEffect(() => {
47750
48376
  for (const trait of traits2) {
47751
48377
  const prev = prevStatesRef.current.get(trait.id);
47752
48378
  if (prev && prev !== trait.currentState) {
@@ -47915,10 +48541,10 @@ function VerifyModePanel({
47915
48541
  localCount
47916
48542
  }) {
47917
48543
  const { t } = useTranslate();
47918
- const [expanded, setExpanded] = React85.useState(true);
47919
- const scrollRef = React85.useRef(null);
47920
- const prevCountRef = React85.useRef(0);
47921
- React85.useEffect(() => {
48544
+ const [expanded, setExpanded] = React86.useState(true);
48545
+ const scrollRef = React86.useRef(null);
48546
+ const prevCountRef = React86.useRef(0);
48547
+ React86.useEffect(() => {
47922
48548
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
47923
48549
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
47924
48550
  }
@@ -47975,10 +48601,10 @@ function RuntimeDebugger({
47975
48601
  schema
47976
48602
  }) {
47977
48603
  const { t } = useTranslate();
47978
- const [isCollapsed, setIsCollapsed] = React85.useState(mode === "verify" ? true : defaultCollapsed);
47979
- const [isVisible, setIsVisible] = React85.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
48604
+ const [isCollapsed, setIsCollapsed] = React86.useState(mode === "verify" ? true : defaultCollapsed);
48605
+ const [isVisible, setIsVisible] = React86.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
47980
48606
  const debugData = useDebugData();
47981
- React85.useEffect(() => {
48607
+ React86.useEffect(() => {
47982
48608
  if (mode === "inline") return;
47983
48609
  return onDebugToggle((enabled) => {
47984
48610
  setIsVisible(enabled);
@@ -47987,7 +48613,7 @@ function RuntimeDebugger({
47987
48613
  }
47988
48614
  });
47989
48615
  }, [mode]);
47990
- React85.useEffect(() => {
48616
+ React86.useEffect(() => {
47991
48617
  if (mode === "inline") return;
47992
48618
  const handleKeyDown = (e) => {
47993
48619
  if (e.key === "`" && isVisible) {
@@ -48547,7 +49173,7 @@ function SequenceBar({
48547
49173
  onSlotRemove(index);
48548
49174
  }, [onSlotRemove, playing]);
48549
49175
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
48550
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
49176
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
48551
49177
  i > 0 && /* @__PURE__ */ jsx(
48552
49178
  Typography,
48553
49179
  {
@@ -49308,6 +49934,123 @@ var init_SimulatorBoard = __esm({
49308
49934
  SimulatorBoard.displayName = "SimulatorBoard";
49309
49935
  }
49310
49936
  });
49937
+ function SokobanBoard({
49938
+ tiles,
49939
+ units,
49940
+ features,
49941
+ assetManifest,
49942
+ assetBaseUrl,
49943
+ scale = 0.45,
49944
+ showMinimap = false,
49945
+ enableCamera = false,
49946
+ tileClickEvent,
49947
+ unitClickEvent,
49948
+ isLoading,
49949
+ error,
49950
+ className
49951
+ }) {
49952
+ return /* @__PURE__ */ jsx("div", { className: cn("sokoban-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
49953
+ IsometricCanvas_default,
49954
+ {
49955
+ tileLayout: "flat",
49956
+ tiles,
49957
+ units,
49958
+ features,
49959
+ assetManifest,
49960
+ assetBaseUrl,
49961
+ scale,
49962
+ showMinimap,
49963
+ enableCamera,
49964
+ tileClickEvent,
49965
+ unitClickEvent,
49966
+ isLoading,
49967
+ error
49968
+ }
49969
+ ) });
49970
+ }
49971
+ var init_SokobanBoard = __esm({
49972
+ "components/game/organisms/SokobanBoard.tsx"() {
49973
+ "use client";
49974
+ init_cn();
49975
+ init_IsometricCanvas();
49976
+ SokobanBoard.displayName = "SokobanBoard";
49977
+ }
49978
+ });
49979
+ function SpaceShmupBoard({
49980
+ backgroundImage,
49981
+ assetBaseUrl,
49982
+ width = 800,
49983
+ height = 600,
49984
+ fps = 60,
49985
+ isLoading,
49986
+ error,
49987
+ className
49988
+ }) {
49989
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-shmup-board relative w-full h-full", className), children: [
49990
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/60 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: "Loading\u2026" }) }),
49991
+ error && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-red-900/60 z-10", children: /* @__PURE__ */ jsx("span", { className: "text-white text-sm", children: error.message }) }),
49992
+ /* @__PURE__ */ jsx(
49993
+ GameCanvas2D,
49994
+ {
49995
+ backgroundImage,
49996
+ assetBaseUrl,
49997
+ width,
49998
+ height,
49999
+ fps
50000
+ }
50001
+ )
50002
+ ] });
50003
+ }
50004
+ var init_SpaceShmupBoard = __esm({
50005
+ "components/game/organisms/SpaceShmupBoard.tsx"() {
50006
+ "use client";
50007
+ init_cn();
50008
+ init_GameCanvas2D();
50009
+ SpaceShmupBoard.displayName = "SpaceShmupBoard";
50010
+ }
50011
+ });
50012
+ function SpaceStationBoard({
50013
+ tiles,
50014
+ units,
50015
+ features,
50016
+ assetManifest,
50017
+ assetBaseUrl,
50018
+ scale = 0.45,
50019
+ showMinimap = true,
50020
+ enableCamera = true,
50021
+ tileClickEvent,
50022
+ unitClickEvent,
50023
+ isLoading,
50024
+ error,
50025
+ className
50026
+ }) {
50027
+ return /* @__PURE__ */ jsx("div", { className: cn("space-station-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
50028
+ IsometricCanvas_default,
50029
+ {
50030
+ tileLayout: "isometric",
50031
+ tiles,
50032
+ units,
50033
+ features,
50034
+ assetManifest,
50035
+ assetBaseUrl,
50036
+ scale,
50037
+ showMinimap,
50038
+ enableCamera,
50039
+ tileClickEvent,
50040
+ unitClickEvent,
50041
+ isLoading,
50042
+ error
50043
+ }
50044
+ ) });
50045
+ }
50046
+ var init_SpaceStationBoard = __esm({
50047
+ "components/game/organisms/SpaceStationBoard.tsx"() {
50048
+ "use client";
50049
+ init_cn();
50050
+ init_IsometricCanvas();
50051
+ SpaceStationBoard.displayName = "SpaceStationBoard";
50052
+ }
50053
+ });
49311
50054
  var SplitPane;
49312
50055
  var init_SplitPane = __esm({
49313
50056
  "components/core/organisms/layout/SplitPane.tsx"() {
@@ -49401,6 +50144,48 @@ var init_SplitPane = __esm({
49401
50144
  SplitPane.displayName = "SplitPane";
49402
50145
  }
49403
50146
  });
50147
+ function SportsBoard({
50148
+ tiles,
50149
+ units,
50150
+ features,
50151
+ assetManifest,
50152
+ assetBaseUrl,
50153
+ scale = 0.45,
50154
+ showMinimap = false,
50155
+ enableCamera = true,
50156
+ tileClickEvent,
50157
+ unitClickEvent,
50158
+ isLoading,
50159
+ error,
50160
+ className
50161
+ }) {
50162
+ return /* @__PURE__ */ jsx("div", { className: cn("sports-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
50163
+ IsometricCanvas_default,
50164
+ {
50165
+ tileLayout: "flat",
50166
+ tiles,
50167
+ units,
50168
+ features,
50169
+ assetManifest,
50170
+ assetBaseUrl,
50171
+ scale,
50172
+ showMinimap,
50173
+ enableCamera,
50174
+ tileClickEvent,
50175
+ unitClickEvent,
50176
+ isLoading,
50177
+ error
50178
+ }
50179
+ ) });
50180
+ }
50181
+ var init_SportsBoard = __esm({
50182
+ "components/game/organisms/SportsBoard.tsx"() {
50183
+ "use client";
50184
+ init_cn();
50185
+ init_IsometricCanvas();
50186
+ SportsBoard.displayName = "SportsBoard";
50187
+ }
50188
+ });
49404
50189
  var StatCard;
49405
50190
  var init_StatCard = __esm({
49406
50191
  "components/core/organisms/StatCard.tsx"() {
@@ -49439,7 +50224,7 @@ var init_StatCard = __esm({
49439
50224
  const labelToUse = propLabel ?? propTitle;
49440
50225
  const eventBus = useEventBus();
49441
50226
  const { t } = useTranslate();
49442
- const handleActionClick = React85__default.useCallback(() => {
50227
+ const handleActionClick = React86__default.useCallback(() => {
49443
50228
  if (action?.event) {
49444
50229
  eventBus.emit(`UI:${action.event}`, {});
49445
50230
  }
@@ -49450,7 +50235,7 @@ var init_StatCard = __esm({
49450
50235
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
49451
50236
  const isLoading = externalLoading ?? false;
49452
50237
  const error = externalError;
49453
- const computeMetricValue = React85__default.useCallback(
50238
+ const computeMetricValue = React86__default.useCallback(
49454
50239
  (metric, items) => {
49455
50240
  if (metric.value !== void 0) {
49456
50241
  return metric.value;
@@ -49489,7 +50274,7 @@ var init_StatCard = __esm({
49489
50274
  },
49490
50275
  []
49491
50276
  );
49492
- const schemaStats = React85__default.useMemo(() => {
50277
+ const schemaStats = React86__default.useMemo(() => {
49493
50278
  if (!metrics || metrics.length === 0) return null;
49494
50279
  return metrics.map((metric) => ({
49495
50280
  label: metric.label,
@@ -49497,7 +50282,7 @@ var init_StatCard = __esm({
49497
50282
  format: metric.format
49498
50283
  }));
49499
50284
  }, [metrics, data, computeMetricValue]);
49500
- const calculatedTrend = React85__default.useMemo(() => {
50285
+ const calculatedTrend = React86__default.useMemo(() => {
49501
50286
  if (manualTrend !== void 0) return manualTrend;
49502
50287
  if (previousValue === void 0 || currentValue === void 0)
49503
50288
  return void 0;
@@ -50246,6 +51031,832 @@ var init_StepFlowOrganism = __esm({
50246
51031
  StepFlowOrganism.displayName = "StepFlowOrganism";
50247
51032
  }
50248
51033
  });
51034
+
51035
+ // components/core/molecules/markdown/index.ts
51036
+ var init_markdown = __esm({
51037
+ "components/core/molecules/markdown/index.ts"() {
51038
+ init_MarkdownContent();
51039
+ init_CodeBlock();
51040
+ }
51041
+ });
51042
+ function groupByOrbital(subagents) {
51043
+ const map = /* @__PURE__ */ new Map();
51044
+ for (const sub of subagents) {
51045
+ const key = sub.orbitalName ?? "(unattached)";
51046
+ const arr = map.get(key) ?? [];
51047
+ arr.push(sub);
51048
+ map.set(key, arr);
51049
+ }
51050
+ return map;
51051
+ }
51052
+ function statusIconName(status) {
51053
+ switch (status) {
51054
+ case "running":
51055
+ return "loader";
51056
+ case "complete":
51057
+ return "check";
51058
+ case "error":
51059
+ return "x";
51060
+ default:
51061
+ return "circle";
51062
+ }
51063
+ }
51064
+ function lastMessage(sub) {
51065
+ if (sub.messages.length === 0) return void 0;
51066
+ return sub.messages[sub.messages.length - 1].message;
51067
+ }
51068
+ function formatHHMMSS(ts) {
51069
+ const d = new Date(ts);
51070
+ const hh = String(d.getHours()).padStart(2, "0");
51071
+ const mm = String(d.getMinutes()).padStart(2, "0");
51072
+ const ss = String(d.getSeconds()).padStart(2, "0");
51073
+ return `${hh}:${mm}:${ss}`;
51074
+ }
51075
+ function compactJson(value) {
51076
+ if (value === void 0 || value === null) return "";
51077
+ if (typeof value === "string") return value;
51078
+ try {
51079
+ const json = JSON.stringify(value);
51080
+ if (json.length <= 240) return json;
51081
+ return json.slice(0, 239) + "\u2026";
51082
+ } catch {
51083
+ return String(value);
51084
+ }
51085
+ }
51086
+ function tryPrettyJson(s) {
51087
+ try {
51088
+ return JSON.stringify(JSON.parse(s), null, 2);
51089
+ } catch {
51090
+ return null;
51091
+ }
51092
+ }
51093
+ function summarizeArgs(args) {
51094
+ const keys = Object.keys(args);
51095
+ if (keys.length === 0) return "";
51096
+ return keys.slice(0, 3).join(", ") + (keys.length > 3 ? ", \u2026" : "");
51097
+ }
51098
+ function previewText(text, max = 120) {
51099
+ if (!text) return "";
51100
+ return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
51101
+ }
51102
+ function coordinatorToActivityItems(activities) {
51103
+ return activities.flatMap((a) => {
51104
+ switch (a.type) {
51105
+ case "tool_call":
51106
+ return [{
51107
+ type: "tool_call",
51108
+ tool: a.tool,
51109
+ args: a.args,
51110
+ timestamp: a.timestamp
51111
+ }];
51112
+ case "tool_result":
51113
+ return [{
51114
+ type: "tool_result",
51115
+ tool: a.tool,
51116
+ result: a.result,
51117
+ success: a.success,
51118
+ timestamp: a.timestamp
51119
+ }];
51120
+ case "message":
51121
+ return [{
51122
+ type: "message",
51123
+ role: a.role,
51124
+ content: a.content,
51125
+ timestamp: a.timestamp
51126
+ }];
51127
+ case "error":
51128
+ return [{
51129
+ type: "message",
51130
+ role: "system",
51131
+ content: `Error: ${a.message}`,
51132
+ timestamp: a.timestamp
51133
+ }];
51134
+ case "coordinator_decision":
51135
+ case "plan_committed":
51136
+ case "pending_question":
51137
+ case "clarification_question":
51138
+ return [];
51139
+ case "file_operation":
51140
+ return [{
51141
+ type: "file_operation",
51142
+ operation: a.operation,
51143
+ path: a.path,
51144
+ success: a.success,
51145
+ timestamp: a.timestamp
51146
+ }];
51147
+ case "schema_diff":
51148
+ return [{
51149
+ type: "schema_diff",
51150
+ filePath: a.filePath,
51151
+ hunks: a.hunks,
51152
+ timestamp: a.timestamp
51153
+ }];
51154
+ }
51155
+ });
51156
+ }
51157
+ function pluckCoordinatorState(activities) {
51158
+ let decision = null;
51159
+ let plan = null;
51160
+ const pendingQuestions = [];
51161
+ for (const a of activities) {
51162
+ if (a.type === "coordinator_decision") decision = a;
51163
+ else if (a.type === "plan_committed") plan = a;
51164
+ else if (a.type === "pending_question") pendingQuestions.push(a);
51165
+ }
51166
+ return { decision, plan, pendingQuestions };
51167
+ }
51168
+ function subagentMessagesToActivities(messages) {
51169
+ return messages.map((m) => {
51170
+ if (m.tool) {
51171
+ return {
51172
+ type: "tool_call",
51173
+ tool: m.tool,
51174
+ args: { preview: m.message },
51175
+ timestamp: m.timestamp
51176
+ };
51177
+ }
51178
+ return {
51179
+ type: "message",
51180
+ role: "system",
51181
+ content: m.message,
51182
+ timestamp: m.timestamp
51183
+ };
51184
+ });
51185
+ }
51186
+ function buildTimelineItems(messages, activities, subagents) {
51187
+ const items = [];
51188
+ if (messages) {
51189
+ messages.forEach((m, i) => items.push({ source: "message", data: m, index: i }));
51190
+ }
51191
+ if (activities) {
51192
+ activities.forEach((a) => items.push({ source: "activity", data: a }));
51193
+ }
51194
+ subagents.forEach((s) => items.push({ source: "subagent", data: s }));
51195
+ return items;
51196
+ }
51197
+ function timelineItemIcon(item) {
51198
+ switch (item.source) {
51199
+ case "message": {
51200
+ const m = item.data;
51201
+ if (m.role === "tool") return { name: "terminal", color: "text-[var(--color-primary)]" };
51202
+ if (m.reasoningContent) return { name: "sparkles", color: "text-[var(--color-primary)]" };
51203
+ if (m.role === "user") return { name: "user", color: "text-[var(--color-primary)]" };
51204
+ return { name: "message-square", color: "text-[var(--color-muted-foreground)]" };
51205
+ }
51206
+ case "activity": {
51207
+ const a = item.data;
51208
+ switch (a.type) {
51209
+ case "tool_call":
51210
+ return { name: "terminal", color: "text-[var(--color-primary)]" };
51211
+ case "tool_result":
51212
+ return { name: a.success !== false ? "check" : "x", color: a.success !== false ? "text-[var(--color-success)]" : "text-[var(--color-danger)]" };
51213
+ case "error":
51214
+ return { name: "alert-triangle", color: "text-[var(--color-danger)]" };
51215
+ case "file_operation":
51216
+ return { name: "file", color: "text-[var(--color-muted-foreground)]" };
51217
+ case "schema_diff":
51218
+ return { name: "git-commit", color: "text-[var(--color-muted-foreground)]" };
51219
+ default:
51220
+ return { name: "info", color: "text-[var(--color-muted-foreground)]" };
51221
+ }
51222
+ }
51223
+ case "subagent":
51224
+ return { name: "bot", color: "text-[var(--color-primary)]" };
51225
+ }
51226
+ }
51227
+ function timelineItemLabel(item) {
51228
+ switch (item.source) {
51229
+ case "message": {
51230
+ const m = item.data;
51231
+ if (m.role === "tool") return "tool";
51232
+ if (m.reasoningContent) return "thinking";
51233
+ return m.role;
51234
+ }
51235
+ case "activity":
51236
+ return item.data.type;
51237
+ case "subagent":
51238
+ return "subagent";
51239
+ }
51240
+ }
51241
+ function timelineItemPreview(item) {
51242
+ switch (item.source) {
51243
+ case "message": {
51244
+ const m = item.data;
51245
+ if (m.role === "tool") return `${m.toolName ?? "tool"} \u2192 ${m.toolCallId?.slice(0, 8) ?? ""}`;
51246
+ if (m.reasoningContent) return previewText(m.reasoningContent, 120);
51247
+ return previewText(m.content, 120);
51248
+ }
51249
+ case "activity": {
51250
+ const a = item.data;
51251
+ switch (a.type) {
51252
+ case "tool_call":
51253
+ return `${a.tool}(${summarizeArgs(a.args)})`;
51254
+ case "tool_result":
51255
+ return `${a.tool}: ${compactJson(a.result)}`;
51256
+ case "message":
51257
+ return previewText(a.content, 120);
51258
+ case "error":
51259
+ return previewText(a.message, 120);
51260
+ case "file_operation":
51261
+ return `${a.operation} ${a.path}`;
51262
+ case "schema_diff":
51263
+ return `diff ${a.filePath}`;
51264
+ default:
51265
+ return String(a.type);
51266
+ }
51267
+ }
51268
+ case "subagent":
51269
+ return `${item.data.name} \xB7 ${item.data.task}`;
51270
+ }
51271
+ }
51272
+ function timelineItemTimeLabel(item) {
51273
+ if (item.source === "activity") return formatHHMMSS(item.data.timestamp);
51274
+ if (item.source === "subagent") {
51275
+ const ts = item.data.messages[0]?.timestamp;
51276
+ return ts !== void 0 ? formatHHMMSS(ts) : void 0;
51277
+ }
51278
+ return void 0;
51279
+ }
51280
+ function TraceDetailContent({ item }) {
51281
+ const { t } = useTranslate();
51282
+ switch (item.source) {
51283
+ case "message": {
51284
+ const m = item.data;
51285
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51286
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "items-center", children: /* @__PURE__ */ jsx(Badge, { variant: roleBadgeVariant[m.role], className: "text-[10px] uppercase", children: m.role }) }),
51287
+ typeof m.reasoningContent === "string" && m.reasoningContent.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
51288
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.reasoning") }),
51289
+ /* @__PURE__ */ jsx(MarkdownContent, { content: m.reasoningContent })
51290
+ ] }),
51291
+ m.content.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
51292
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.content") }),
51293
+ m.role === "tool" ? (() => {
51294
+ const pretty = tryPrettyJson(m.content);
51295
+ return pretty !== null ? /* @__PURE__ */ jsx(CodeBlock, { code: pretty, language: "json", maxHeight: "24rem" }) : /* @__PURE__ */ jsx(Typography, { variant: "body", className: "whitespace-pre-wrap font-mono text-[11px]", children: m.content });
51296
+ })() : /* @__PURE__ */ jsx(MarkdownContent, { content: m.content })
51297
+ ] }),
51298
+ Array.isArray(m.toolCalls) && m.toolCalls.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
51299
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.toolCalls") }),
51300
+ /* @__PURE__ */ jsx(
51301
+ Accordion,
51302
+ {
51303
+ multiple: true,
51304
+ items: m.toolCalls.map((tc, i) => ({
51305
+ id: `tc-detail-${i}`,
51306
+ title: `${tc.name}(${summarizeArgs(tc.args)})`,
51307
+ content: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(tc.args, null, 2), language: "json", maxHeight: "24rem" })
51308
+ }))
51309
+ }
51310
+ )
51311
+ ] })
51312
+ ] });
51313
+ }
51314
+ case "activity": {
51315
+ const a = item.data;
51316
+ switch (a.type) {
51317
+ case "tool_call":
51318
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51319
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51320
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: "tool_call" }),
51321
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
51322
+ ] }),
51323
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.tool }),
51324
+ /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(a.args, null, 2), language: "json", maxHeight: "60vh" })
51325
+ ] });
51326
+ case "tool_result":
51327
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51328
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51329
+ /* @__PURE__ */ jsx(Badge, { variant: a.success !== false ? "default" : "warning", className: "text-[10px]", children: a.success !== false ? "success" : "fail" }),
51330
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
51331
+ ] }),
51332
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.tool }),
51333
+ /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(a.result, null, 2), language: "json", maxHeight: "60vh" })
51334
+ ] });
51335
+ case "message":
51336
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51337
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51338
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: a.role }),
51339
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
51340
+ ] }),
51341
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "whitespace-pre-wrap", children: a.content })
51342
+ ] });
51343
+ case "error":
51344
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51345
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51346
+ /* @__PURE__ */ jsx(Badge, { variant: "warning", className: "text-[10px]", children: "error" }),
51347
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
51348
+ ] }),
51349
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "whitespace-pre-wrap text-[var(--color-danger)]", children: a.message })
51350
+ ] });
51351
+ case "file_operation":
51352
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51353
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51354
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: "file" }),
51355
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
51356
+ ] }),
51357
+ /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
51358
+ a.operation,
51359
+ " ",
51360
+ a.path
51361
+ ] })
51362
+ ] });
51363
+ case "schema_diff":
51364
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51365
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51366
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: "diff" }),
51367
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
51368
+ ] }),
51369
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.filePath })
51370
+ ] });
51371
+ default:
51372
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51373
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) }),
51374
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: String(a.type) })
51375
+ ] });
51376
+ }
51377
+ }
51378
+ case "subagent": {
51379
+ const s = item.data;
51380
+ const activities = subagentMessagesToActivities(s.messages);
51381
+ const ts = s.messages[0]?.timestamp;
51382
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
51383
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51384
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: s.role }),
51385
+ ts !== void 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(ts) })
51386
+ ] }),
51387
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: s.name }),
51388
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", children: s.task }),
51389
+ activities.length > 0 && /* @__PURE__ */ jsx(Box, { className: "border-t border-[var(--color-border)] pt-2", children: /* @__PURE__ */ jsx(InlineActivityStream, { activities, autoScroll: false }) })
51390
+ ] });
51391
+ }
51392
+ }
51393
+ }
51394
+ var InlineActivityRow, InlineActivityStream, CoordinatorCard, SubagentRow, OrbitalGroup, SubagentRichCard, roleBadgeVariant, ChatMessageRow, CoordinatorConversation, SubagentTracePanel;
51395
+ var init_SubagentTracePanel = __esm({
51396
+ "components/core/organisms/SubagentTracePanel.tsx"() {
51397
+ "use client";
51398
+ init_Box();
51399
+ init_Stack();
51400
+ init_Typography();
51401
+ init_Badge();
51402
+ init_Icon();
51403
+ init_Button();
51404
+ init_Modal();
51405
+ init_Accordion();
51406
+ init_markdown();
51407
+ InlineActivityRow = ({ activity }) => {
51408
+ const time = formatHHMMSS(activity.timestamp);
51409
+ const baseRow = "items-start px-3 py-1 hover:bg-[var(--color-surface)]";
51410
+ if (activity.type === "tool_call") {
51411
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
51412
+ /* @__PURE__ */ jsx(Icon, { name: "terminal", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-primary)]" }),
51413
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] font-mono break-all whitespace-pre-wrap", children: [
51414
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", weight: "semibold", className: "text-[11px] font-mono", children: activity.tool }),
51415
+ activity.args !== void 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", variant: "caption", color: "muted", className: "text-[11px] font-mono", children: [
51416
+ " ",
51417
+ compactJson(activity.args)
51418
+ ] })
51419
+ ] }),
51420
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
51421
+ ] });
51422
+ }
51423
+ if (activity.type === "tool_result") {
51424
+ const success = activity.success !== false;
51425
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
51426
+ /* @__PURE__ */ jsx(
51427
+ Icon,
51428
+ {
51429
+ name: success ? "check" : "x",
51430
+ size: "xs",
51431
+ className: `mt-0.5 flex-shrink-0 ${success ? "text-[var(--color-success)]" : "text-[var(--color-danger)]"}`
51432
+ }
51433
+ ),
51434
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] font-mono break-all whitespace-pre-wrap", children: [
51435
+ /* @__PURE__ */ jsxs(Typography, { as: "span", variant: "caption", color: "muted", className: "text-[11px] font-mono", children: [
51436
+ activity.tool,
51437
+ ":",
51438
+ " "
51439
+ ] }),
51440
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", className: "text-[11px] font-mono", children: compactJson(activity.result) })
51441
+ ] }),
51442
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
51443
+ ] });
51444
+ }
51445
+ if (activity.type === "message") {
51446
+ const role = activity.role;
51447
+ const iconName = role === "user" ? "user" : role === "system" ? "info" : "sparkles";
51448
+ const roleColor = role === "user" ? "text-[var(--color-primary)]" : role === "system" ? "text-[var(--color-muted-foreground)]" : "text-[var(--color-foreground)]";
51449
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
51450
+ /* @__PURE__ */ jsx(Icon, { name: iconName, size: "xs", className: `mt-0.5 flex-shrink-0 ${roleColor}` }),
51451
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] whitespace-pre-wrap break-words", children: activity.content }),
51452
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
51453
+ ] });
51454
+ }
51455
+ if (activity.type === "error") {
51456
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
51457
+ /* @__PURE__ */ jsx(Icon, { name: "alert-triangle", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-danger)]" }),
51458
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] text-[var(--color-danger)] whitespace-pre-wrap break-words", children: activity.message }),
51459
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
51460
+ ] });
51461
+ }
51462
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
51463
+ /* @__PURE__ */ jsx(Icon, { name: "file", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-muted-foreground)]" }),
51464
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "flex-1 min-w-0 text-[11px] font-mono break-all", children: [
51465
+ "[",
51466
+ activity.type,
51467
+ "] ",
51468
+ compactJson(activity)
51469
+ ] }),
51470
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
51471
+ ] });
51472
+ };
51473
+ InlineActivityStream = ({ activities, autoScroll = true, className }) => {
51474
+ const endRef = React86__default.useRef(null);
51475
+ React86__default.useEffect(() => {
51476
+ if (!autoScroll) return;
51477
+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
51478
+ }, [activities.length, autoScroll]);
51479
+ return /* @__PURE__ */ jsxs(Box, { className, children: [
51480
+ activities.map((a, i) => /* @__PURE__ */ jsx(InlineActivityRow, { activity: a }, `${a.timestamp}-${i}`)),
51481
+ /* @__PURE__ */ jsx(Box, { ref: endRef })
51482
+ ] });
51483
+ };
51484
+ CoordinatorCard = ({ snapshot, className }) => {
51485
+ const { t } = useTranslate();
51486
+ const { decision, plan, pendingQuestions } = snapshot;
51487
+ if (!decision && !plan && pendingQuestions.length === 0) return null;
51488
+ return /* @__PURE__ */ jsxs(
51489
+ Box,
51490
+ {
51491
+ className: `px-3 py-2 border-b border-[var(--color-border)] bg-[var(--color-muted)]/30 ${className ?? ""}`,
51492
+ children: [
51493
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-2", children: [
51494
+ /* @__PURE__ */ jsx(Icon, { name: "compass", size: "xs" }),
51495
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") })
51496
+ ] }),
51497
+ decision && /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "mb-2", children: [
51498
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51499
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide", children: t("subagentTrace.organism") }),
51500
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: decision.organism }),
51501
+ decision.priorOrganism && decision.priorOrganism !== decision.organism && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.wasOrganism", { organism: decision.priorOrganism }) })
51502
+ ] }),
51503
+ decision.reason && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[11px] mt-0.5", children: decision.reason })
51504
+ ] }),
51505
+ plan && plan.orbitals.length > 0 && /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "mb-2", children: [
51506
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide mb-0.5", children: plan.orbitals.length === 1 ? t("subagentTrace.planOrbital", { count: plan.orbitals.length }) : t("subagentTrace.planOrbitals", { count: plan.orbitals.length }) }),
51507
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: plan.orbitals.map((o) => /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: o }, o)) })
51508
+ ] }),
51509
+ pendingQuestions.length > 0 && /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
51510
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide mb-0.5", children: pendingQuestions.length === 1 ? t("subagentTrace.pendingQuestion", { count: pendingQuestions.length }) : t("subagentTrace.pendingQuestions", { count: pendingQuestions.length }) }),
51511
+ pendingQuestions.map((q) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-start", children: [
51512
+ /* @__PURE__ */ jsx(Icon, { name: "help-circle", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-warning)]" }),
51513
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[11px] flex-1 min-w-0", children: [
51514
+ q.question,
51515
+ q.orbitalName && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px] ml-1", children: [
51516
+ "(",
51517
+ q.orbitalName,
51518
+ ")"
51519
+ ] })
51520
+ ] })
51521
+ ] }, q.questionId))
51522
+ ] })
51523
+ ]
51524
+ }
51525
+ );
51526
+ };
51527
+ SubagentRow = ({ subagent }) => {
51528
+ const recent = lastMessage(subagent);
51529
+ return /* @__PURE__ */ jsxs(
51530
+ HStack,
51531
+ {
51532
+ gap: "sm",
51533
+ className: "items-start px-3 py-2 border-b border-[var(--color-border)]",
51534
+ children: [
51535
+ /* @__PURE__ */ jsx(Box, { className: "pt-0.5", children: /* @__PURE__ */ jsx(Icon, { name: statusIconName(subagent.status), size: "xs" }) }),
51536
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0", children: [
51537
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
51538
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-medium truncate", children: subagent.name }),
51539
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: subagent.role })
51540
+ ] }),
51541
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "truncate", children: recent ?? subagent.task })
51542
+ ] })
51543
+ ]
51544
+ }
51545
+ );
51546
+ };
51547
+ OrbitalGroup = ({ orbitalName, subagents }) => {
51548
+ const { t } = useTranslate();
51549
+ const runningCount = subagents.filter((s) => s.status === "running").length;
51550
+ const completeCount = subagents.filter((s) => s.status === "complete").length;
51551
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "border-b border-[var(--color-border)]", children: [
51552
+ /* @__PURE__ */ jsxs(
51553
+ HStack,
51554
+ {
51555
+ gap: "sm",
51556
+ className: "items-center px-3 py-2 bg-[var(--color-surface)] border-b border-[var(--color-border)]",
51557
+ children: [
51558
+ /* @__PURE__ */ jsx(Icon, { name: "circle", size: "xs" }),
51559
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1 truncate", children: orbitalName }),
51560
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: runningCount > 0 ? t("subagentTrace.countRunning", { count: runningCount }) : t("subagentTrace.countDone", { count: completeCount }) })
51561
+ ]
51562
+ }
51563
+ ),
51564
+ subagents.map((sub) => /* @__PURE__ */ jsx(SubagentRow, { subagent: sub }, sub.id))
51565
+ ] });
51566
+ };
51567
+ SubagentRichCard = ({ subagent }) => {
51568
+ const { t } = useTranslate();
51569
+ const activities = React86__default.useMemo(
51570
+ () => subagentMessagesToActivities(subagent.messages),
51571
+ [subagent.messages]
51572
+ );
51573
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "border-b border-[var(--color-border)] p-3", children: [
51574
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center mb-2", children: [
51575
+ /* @__PURE__ */ jsx(
51576
+ Box,
51577
+ {
51578
+ style: {
51579
+ width: 8,
51580
+ height: 8,
51581
+ borderRadius: "50%",
51582
+ flexShrink: 0,
51583
+ backgroundColor: subagent.status === "complete" ? "var(--color-success)" : subagent.status === "error" ? "var(--color-error)" : "var(--color-primary)",
51584
+ ...subagent.status === "running" ? { animation: "pulse 1.5s infinite" } : {}
51585
+ }
51586
+ }
51587
+ ),
51588
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1 truncate", children: subagent.name }),
51589
+ /* @__PURE__ */ jsx(Badge, { variant: subagent.role === "deterministic" ? "default" : subagent.role === "llm" ? "info" : "warning", children: subagent.role }),
51590
+ subagent.durationMs !== void 0 && subagent.durationMs > 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subagent.durationMs < 1e3 ? `${subagent.durationMs}ms` : `${(subagent.durationMs / 1e3).toFixed(1)}s` })
51591
+ ] }),
51592
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-2", children: subagent.task }),
51593
+ activities.length > 0 ? /* @__PURE__ */ jsx(Box, { className: "max-h-64 overflow-y-auto border-t border-[var(--color-border)]", children: /* @__PURE__ */ jsx(InlineActivityStream, { activities, autoScroll: true }) }) : /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "italic text-[10px]", children: subagent.status === "complete" ? t("subagentTrace.noConversationLog") : t("subagentTrace.waitingForProcessData") })
51594
+ ] });
51595
+ };
51596
+ roleBadgeVariant = {
51597
+ system: "neutral",
51598
+ user: "info",
51599
+ assistant: "default",
51600
+ tool: "warning"
51601
+ };
51602
+ ChatMessageRow = ({ message, index }) => {
51603
+ const { t } = useTranslate();
51604
+ const { role, content, toolCalls, reasoningContent, toolCallId, toolName } = message;
51605
+ if (role === "tool") {
51606
+ const pretty = tryPrettyJson(content);
51607
+ const title = `${toolName ?? "tool"} \u2192${toolCallId ? ` ${toolCallId.slice(0, 8)}` : ""}`;
51608
+ const body = pretty !== null ? /* @__PURE__ */ jsx(CodeBlock, { code: pretty, language: "json", maxHeight: "24rem" }) : /* @__PURE__ */ jsx(Typography, { variant: "body", className: "whitespace-pre-wrap font-mono text-[11px]", children: content });
51609
+ const items = [{ id: `tool-${index}`, title, content: body }];
51610
+ return /* @__PURE__ */ jsx(Box, { className: "px-3 py-2 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx(Accordion, { items }) });
51611
+ }
51612
+ const hasReasoning = typeof reasoningContent === "string" && reasoningContent.length > 0;
51613
+ const hasToolCalls = Array.isArray(toolCalls) && toolCalls.length > 0;
51614
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "px-3 py-2 border-b border-[var(--color-border)]", children: [
51615
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51616
+ /* @__PURE__ */ jsx(Badge, { variant: roleBadgeVariant[role], className: "text-[10px] uppercase", children: role }),
51617
+ hasReasoning && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: [
51618
+ "\xB7 ",
51619
+ t("subagentTrace.thinking")
51620
+ ] }),
51621
+ hasToolCalls && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: [
51622
+ "\xB7 ",
51623
+ toolCalls.length === 1 ? t("subagentTrace.toolCallCount", { count: toolCalls.length }) : t("subagentTrace.toolCallCountPlural", { count: toolCalls.length })
51624
+ ] })
51625
+ ] }),
51626
+ hasReasoning && /* @__PURE__ */ jsx(Accordion, { items: [{
51627
+ id: `reasoning-${index}`,
51628
+ title: t("subagentTrace.reasoning"),
51629
+ content: /* @__PURE__ */ jsx(MarkdownContent, { content: reasoningContent })
51630
+ }] }),
51631
+ content.length > 0 && /* @__PURE__ */ jsx(MarkdownContent, { content }),
51632
+ hasToolCalls && /* @__PURE__ */ jsx(
51633
+ Accordion,
51634
+ {
51635
+ multiple: true,
51636
+ items: toolCalls.map((tc, i) => ({
51637
+ id: `tc-${index}-${i}`,
51638
+ title: `${tc.name}(${summarizeArgs(tc.args)})`,
51639
+ content: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(tc.args, null, 2), language: "json", maxHeight: "24rem" })
51640
+ }))
51641
+ }
51642
+ )
51643
+ ] });
51644
+ };
51645
+ CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
51646
+ const endRef = React86__default.useRef(null);
51647
+ React86__default.useEffect(() => {
51648
+ if (!autoScroll) return;
51649
+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
51650
+ }, [messages.length, autoScroll]);
51651
+ return /* @__PURE__ */ jsxs(Box, { className, children: [
51652
+ messages.map((m, i) => /* @__PURE__ */ jsx(ChatMessageRow, { message: m, index: i }, `msg-${i}`)),
51653
+ /* @__PURE__ */ jsx(Box, { ref: endRef })
51654
+ ] });
51655
+ };
51656
+ SubagentTracePanel = ({
51657
+ subagents,
51658
+ focusedOrbital,
51659
+ disclosureLevel,
51660
+ open,
51661
+ onClose,
51662
+ className,
51663
+ mode = "overlay",
51664
+ coordinatorActivities,
51665
+ coordinatorMessages
51666
+ }) => {
51667
+ const { t } = useTranslate();
51668
+ const [selectedItem, setSelectedItem] = useState(null);
51669
+ const densityLabel = (rich) => rich ? t("subagentTrace.densityRich") : t("subagentTrace.densityCompact");
51670
+ if (mode === "overlay" && !open) return null;
51671
+ const isTabMode = mode === "tab";
51672
+ const isRichMode = isTabMode || disclosureLevel >= 3;
51673
+ if (isTabMode) {
51674
+ const timelineItems = buildTimelineItems(coordinatorMessages, coordinatorActivities, subagents);
51675
+ const hasData = timelineItems.length > 0;
51676
+ return /* @__PURE__ */ jsxs(Box, { className: `h-full w-full bg-[var(--color-card)] overflow-hidden flex flex-col ${className ?? ""}`, children: [
51677
+ /* @__PURE__ */ jsxs(
51678
+ HStack,
51679
+ {
51680
+ gap: "sm",
51681
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
51682
+ children: [
51683
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
51684
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1", children: t("subagentTrace.trace") }),
51685
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
51686
+ ]
51687
+ }
51688
+ ),
51689
+ !hasData && /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-4", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "text-center", children: t("subagentTrace.noAgentActivity") }) }),
51690
+ hasData && /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx(VStack, { gap: "none", children: timelineItems.map((item, i) => {
51691
+ const { name: iconName, color: iconColor } = timelineItemIcon(item);
51692
+ const isLast = i === timelineItems.length - 1;
51693
+ return /* @__PURE__ */ jsxs(
51694
+ Box,
51695
+ {
51696
+ className: "flex items-start px-3 py-2 border-b border-[var(--color-border)] hover:bg-[var(--color-muted)]/30 transition-colors duration-fast cursor-pointer",
51697
+ onClick: () => setSelectedItem(item),
51698
+ children: [
51699
+ /* @__PURE__ */ jsxs(Box, { className: "flex flex-col items-center mr-3 mt-0.5", style: { width: 20 }, children: [
51700
+ /* @__PURE__ */ jsx(
51701
+ Box,
51702
+ {
51703
+ className: "rounded-full flex-shrink-0",
51704
+ style: {
51705
+ width: 8,
51706
+ height: 8,
51707
+ backgroundColor: "var(--color-primary)"
51708
+ }
51709
+ }
51710
+ ),
51711
+ !isLast && /* @__PURE__ */ jsx(
51712
+ Box,
51713
+ {
51714
+ className: "flex-1",
51715
+ style: {
51716
+ width: 2,
51717
+ backgroundColor: "var(--color-border)",
51718
+ marginTop: 4,
51719
+ minHeight: 24
51720
+ }
51721
+ }
51722
+ )
51723
+ ] }),
51724
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
51725
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
51726
+ /* @__PURE__ */ jsx(Icon, { name: iconName, size: "xs", className: `flex-shrink-0 ${iconColor}` }),
51727
+ timelineItemTimeLabel(item) && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: timelineItemTimeLabel(item) }),
51728
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: timelineItemLabel(item) })
51729
+ ] }),
51730
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-start", children: [
51731
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "flex-1 min-w-0 line-clamp-2", children: timelineItemPreview(item) }),
51732
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "flex-shrink-0 mt-0", onClick: (e) => {
51733
+ e.stopPropagation();
51734
+ setSelectedItem(item);
51735
+ }, children: /* @__PURE__ */ jsx(Icon, { name: "maximize-2", size: "xs" }) })
51736
+ ] })
51737
+ ] })
51738
+ ]
51739
+ },
51740
+ `${item.source}-${i}`
51741
+ );
51742
+ }) }) }),
51743
+ /* @__PURE__ */ jsx(
51744
+ Modal,
51745
+ {
51746
+ isOpen: selectedItem !== null,
51747
+ onClose: () => setSelectedItem(null),
51748
+ title: selectedItem ? `${timelineItemLabel(selectedItem)}${timelineItemTimeLabel(selectedItem) ? ` \xB7 ${timelineItemTimeLabel(selectedItem)}` : ""}` : "",
51749
+ size: "lg",
51750
+ children: selectedItem && /* @__PURE__ */ jsx(TraceDetailContent, { item: selectedItem })
51751
+ }
51752
+ )
51753
+ ] });
51754
+ }
51755
+ const filtered = focusedOrbital ? subagents.filter((s) => s.orbitalName === focusedOrbital) : subagents;
51756
+ const wrapperClass = isRichMode ? `absolute inset-x-3 bottom-3 sm:inset-x-auto sm:top-3 sm:right-3 sm:bottom-3 w-full sm:w-[28rem] max-w-[calc(100vw-1.5rem)] max-h-[60vh] sm:max-h-none bg-[var(--color-card)] border border-[var(--color-border)] rounded-md shadow-lg overflow-hidden flex flex-col ${className ?? ""}` : `absolute inset-x-3 bottom-3 sm:inset-x-auto sm:top-3 sm:right-3 sm:bottom-3 w-full sm:w-80 max-w-[calc(100vw-1.5rem)] max-h-[60vh] sm:max-h-none bg-[var(--color-card)] border border-[var(--color-border)] rounded-md shadow-lg overflow-hidden flex flex-col ${className ?? ""}`;
51757
+ const wrapperStyle = { zIndex: 20 };
51758
+ const hasCoordinatorData = coordinatorMessages && coordinatorMessages.length > 0 || coordinatorActivities && coordinatorActivities.length > 0;
51759
+ if (filtered.length === 0 && !hasCoordinatorData) {
51760
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
51761
+ /* @__PURE__ */ jsxs(
51762
+ HStack,
51763
+ {
51764
+ gap: "sm",
51765
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
51766
+ children: [
51767
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
51768
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1", children: t("subagentTrace.subagents") }),
51769
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
51770
+ ]
51771
+ }
51772
+ ),
51773
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-4", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-center", children: focusedOrbital ? t("subagentTrace.noSubagentsForOrbital", { orbital: focusedOrbital }) : t("subagentTrace.noSubagentsActive") }) })
51774
+ ] });
51775
+ }
51776
+ if (focusedOrbital) {
51777
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
51778
+ /* @__PURE__ */ jsxs(
51779
+ HStack,
51780
+ {
51781
+ gap: "sm",
51782
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
51783
+ children: [
51784
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
51785
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0", children: [
51786
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold truncate", children: focusedOrbital }),
51787
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
51788
+ filtered.length === 1 ? t("subagentTrace.subagentCount", { count: filtered.length }) : t("subagentTrace.subagentCountPlural", { count: filtered.length }),
51789
+ " \xB7 ",
51790
+ densityLabel(isRichMode)
51791
+ ] })
51792
+ ] }),
51793
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
51794
+ ]
51795
+ }
51796
+ ),
51797
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: filtered.map((sub) => isRichMode ? /* @__PURE__ */ jsx(SubagentRichCard, { subagent: sub }, sub.id) : /* @__PURE__ */ jsx(SubagentRow, { subagent: sub }, sub.id)) })
51798
+ ] });
51799
+ }
51800
+ const grouped = groupByOrbital(filtered);
51801
+ const coordinatorSnapshot = pluckCoordinatorState(coordinatorActivities ?? []);
51802
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
51803
+ /* @__PURE__ */ jsxs(
51804
+ HStack,
51805
+ {
51806
+ gap: "sm",
51807
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
51808
+ children: [
51809
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
51810
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold flex-1", children: [
51811
+ t("subagentTrace.subagentsWithCount", { count: filtered.length }),
51812
+ " \xB7 ",
51813
+ densityLabel(isRichMode)
51814
+ ] }),
51815
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
51816
+ ]
51817
+ }
51818
+ ),
51819
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 overflow-y-auto", children: [
51820
+ !focusedOrbital && isRichMode && /* @__PURE__ */ jsx(CoordinatorCard, { snapshot: coordinatorSnapshot }),
51821
+ coordinatorMessages && coordinatorMessages.length > 0 ? /* @__PURE__ */ jsxs(Box, { className: "border-b border-[var(--color-border)]", children: [
51822
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center px-3 py-1.5 bg-[var(--color-card)] border-b border-[var(--color-border)]", children: [
51823
+ /* @__PURE__ */ jsx(Box, { style: { width: 6, height: 6, borderRadius: "50%", backgroundColor: "var(--color-primary)", flexShrink: 0 } }),
51824
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") }),
51825
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.messagesCount", { count: coordinatorMessages.length }) })
51826
+ ] }),
51827
+ /* @__PURE__ */ jsx(Box, { className: "max-h-[36rem] overflow-y-auto", children: /* @__PURE__ */ jsx(CoordinatorConversation, { messages: coordinatorMessages, autoScroll: true }) })
51828
+ ] }) : coordinatorActivities && coordinatorActivities.length > 0 && (() => {
51829
+ const filteredCoordinator = coordinatorActivities;
51830
+ if (filteredCoordinator.length === 0) return null;
51831
+ return /* @__PURE__ */ jsxs(Box, { className: "border-b border-[var(--color-border)]", children: [
51832
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center px-3 py-1.5 bg-[var(--color-card)] border-b border-[var(--color-border)]", children: [
51833
+ /* @__PURE__ */ jsx(Box, { style: { width: 6, height: 6, borderRadius: "50%", backgroundColor: "var(--color-primary)", flexShrink: 0 } }),
51834
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") }),
51835
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.eventsCount", { count: filteredCoordinator.length }) })
51836
+ ] }),
51837
+ /* @__PURE__ */ jsx(Box, { className: "max-h-60 overflow-y-auto", children: /* @__PURE__ */ jsx(
51838
+ InlineActivityStream,
51839
+ {
51840
+ activities: coordinatorToActivityItems(filteredCoordinator),
51841
+ autoScroll: true
51842
+ }
51843
+ ) })
51844
+ ] });
51845
+ })(),
51846
+ isRichMode ? filtered.map((sub) => /* @__PURE__ */ jsx(SubagentRichCard, { subagent: sub }, sub.id)) : Array.from(grouped.entries()).map(([orbitalName, subs]) => /* @__PURE__ */ jsx(
51847
+ OrbitalGroup,
51848
+ {
51849
+ orbitalName,
51850
+ subagents: subs
51851
+ },
51852
+ orbitalName
51853
+ ))
51854
+ ] })
51855
+ ] });
51856
+ };
51857
+ SubagentTracePanel.displayName = "SubagentTracePanel";
51858
+ }
51859
+ });
50249
51860
  var TabbedContainer;
50250
51861
  var init_TabbedContainer = __esm({
50251
51862
  "components/core/organisms/layout/TabbedContainer.tsx"() {
@@ -50360,6 +51971,48 @@ var init_TabbedContainer = __esm({
50360
51971
  TabbedContainer.displayName = "TabbedContainer";
50361
51972
  }
50362
51973
  });
51974
+ function TanksBoard({
51975
+ tiles,
51976
+ units,
51977
+ features,
51978
+ assetManifest,
51979
+ assetBaseUrl,
51980
+ scale = 0.45,
51981
+ showMinimap = true,
51982
+ enableCamera = true,
51983
+ tileClickEvent,
51984
+ unitClickEvent,
51985
+ isLoading,
51986
+ error,
51987
+ className
51988
+ }) {
51989
+ return /* @__PURE__ */ jsx("div", { className: cn("tanks-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
51990
+ IsometricCanvas_default,
51991
+ {
51992
+ tileLayout: "flat",
51993
+ tiles,
51994
+ units,
51995
+ features,
51996
+ assetManifest,
51997
+ assetBaseUrl,
51998
+ scale,
51999
+ showMinimap,
52000
+ enableCamera,
52001
+ tileClickEvent,
52002
+ unitClickEvent,
52003
+ isLoading,
52004
+ error
52005
+ }
52006
+ ) });
52007
+ }
52008
+ var init_TanksBoard = __esm({
52009
+ "components/game/organisms/TanksBoard.tsx"() {
52010
+ "use client";
52011
+ init_cn();
52012
+ init_IsometricCanvas();
52013
+ TanksBoard.displayName = "TanksBoard";
52014
+ }
52015
+ });
50363
52016
  var TeamOrganism;
50364
52017
  var init_TeamOrganism = __esm({
50365
52018
  "components/marketing/organisms/TeamOrganism.tsx"() {
@@ -50463,7 +52116,7 @@ var init_Timeline = __esm({
50463
52116
  }) => {
50464
52117
  const { t } = useTranslate();
50465
52118
  const entityData = Array.isArray(entity) ? entity : [];
50466
- const items = React85__default.useMemo(() => {
52119
+ const items = React86__default.useMemo(() => {
50467
52120
  if (propItems) return propItems;
50468
52121
  if (entityData.length === 0) return [];
50469
52122
  return entityData.map((record, idx) => {
@@ -50570,7 +52223,7 @@ var init_Timeline = __esm({
50570
52223
  }
50571
52224
  });
50572
52225
  function extractToastProps(children) {
50573
- if (!React85__default.isValidElement(children)) {
52226
+ if (!React86__default.isValidElement(children)) {
50574
52227
  if (typeof children === "string") {
50575
52228
  return { message: children };
50576
52229
  }
@@ -50608,7 +52261,7 @@ var init_ToastSlot = __esm({
50608
52261
  eventBus.emit("UI:CLOSE");
50609
52262
  };
50610
52263
  if (!isVisible) return null;
50611
- const isCustomContent = React85__default.isValidElement(children) && !message;
52264
+ const isCustomContent = React86__default.isValidElement(children) && !message;
50612
52265
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
50613
52266
  Toast,
50614
52267
  {
@@ -52224,7 +53877,7 @@ var init_WorldMapTemplate = __esm({
52224
53877
  }
52225
53878
  });
52226
53879
  function lazyThree(name, loader) {
52227
- const Lazy = React85__default.lazy(
53880
+ const Lazy = React86__default.lazy(
52228
53881
  () => loader().then((m) => {
52229
53882
  const Resolved = m[name];
52230
53883
  if (!Resolved) {
@@ -52236,13 +53889,13 @@ function lazyThree(name, loader) {
52236
53889
  })
52237
53890
  );
52238
53891
  function ThreeWrapper(props) {
52239
- return React85__default.createElement(
53892
+ return React86__default.createElement(
52240
53893
  ThreeBoundary,
52241
53894
  { name },
52242
- React85__default.createElement(
52243
- React85__default.Suspense,
53895
+ React86__default.createElement(
53896
+ React86__default.Suspense,
52244
53897
  { fallback: null },
52245
- React85__default.createElement(Lazy, props)
53898
+ React86__default.createElement(Lazy, props)
52246
53899
  )
52247
53900
  );
52248
53901
  }
@@ -52272,6 +53925,7 @@ var init_component_registry_generated = __esm({
52272
53925
  init_BattleTemplate();
52273
53926
  init_BehaviorView();
52274
53927
  init_BloomQuizBlock();
53928
+ init_BoardgameBoard();
52275
53929
  init_BookChapterView();
52276
53930
  init_BookCoverPage();
52277
53931
  init_BookNavBar();
@@ -52298,6 +53952,7 @@ var init_component_registry_generated = __esm({
52298
53952
  init_Center();
52299
53953
  init_Chart();
52300
53954
  init_ChartLegend();
53955
+ init_ChatBar();
52301
53956
  init_Checkbox();
52302
53957
  init_ChoiceButton();
52303
53958
  init_CityBuilderBoard();
@@ -52355,6 +54010,7 @@ var init_component_registry_generated = __esm({
52355
54010
  init_FileTree();
52356
54011
  init_FilterGroup();
52357
54012
  init_FilterPill();
54013
+ init_FishingBoard();
52358
54014
  init_Flex();
52359
54015
  init_FlipCard();
52360
54016
  init_FlipContainer();
@@ -52384,6 +54040,7 @@ var init_component_registry_generated = __esm({
52384
54040
  init_HeroOrganism();
52385
54041
  init_HeroSection();
52386
54042
  init_HexStrategyBoard();
54043
+ init_HolidayRunnerBoard();
52387
54044
  init_Icon();
52388
54045
  init_InfiniteScrollSentinel();
52389
54046
  init_Input();
@@ -52406,11 +54063,13 @@ var init_component_registry_generated = __esm({
52406
54063
  init_MarketingFooter();
52407
54064
  init_MasterDetail();
52408
54065
  init_MasterDetailLayout();
54066
+ init_MatchPuzzleBoard();
52409
54067
  init_MatrixQuestion();
52410
54068
  init_MediaGallery();
52411
54069
  init_Menu();
52412
54070
  init_Meter();
52413
54071
  init_MiniMap();
54072
+ init_MinigolfBoard();
52414
54073
  init_Modal();
52415
54074
  init_ModalSlot();
52416
54075
  init_ModuleCard();
@@ -52423,6 +54082,8 @@ var init_component_registry_generated = __esm({
52423
54082
  init_PageHeader();
52424
54083
  init_Pagination();
52425
54084
  init_PatternTile();
54085
+ init_PinballBoard();
54086
+ init_PirateBoard();
52426
54087
  init_PlatformerBoard();
52427
54088
  init_PlatformerCanvas();
52428
54089
  init_PlatformerTemplate();
@@ -52440,6 +54101,7 @@ var init_component_registry_generated = __esm({
52440
54101
  init_QrScanner();
52441
54102
  init_QuestTracker();
52442
54103
  init_QuizBlock();
54104
+ init_RacingBoard();
52443
54105
  init_Radio();
52444
54106
  init_RangeSlider();
52445
54107
  init_ReflectionBlock();
@@ -52473,12 +54135,16 @@ var init_component_registry_generated = __esm({
52473
54135
  init_SimulatorBoard();
52474
54136
  init_Skeleton();
52475
54137
  init_SocialProof();
54138
+ init_SokobanBoard();
52476
54139
  init_SortableList();
54140
+ init_SpaceShmupBoard();
54141
+ init_SpaceStationBoard();
52477
54142
  init_Sparkline();
52478
54143
  init_Spinner();
52479
54144
  init_Split();
52480
54145
  init_SplitPane();
52481
54146
  init_SplitSection();
54147
+ init_SportsBoard();
52482
54148
  init_Sprite();
52483
54149
  init_StarRating();
52484
54150
  init_StatBadge();
@@ -52493,6 +54159,7 @@ var init_component_registry_generated = __esm({
52493
54159
  init_StatusEffect();
52494
54160
  init_StepFlow();
52495
54161
  init_StepFlowOrganism();
54162
+ init_SubagentTracePanel();
52496
54163
  init_SvgBranch();
52497
54164
  init_SvgConnection();
52498
54165
  init_SvgFlow();
@@ -52512,6 +54179,7 @@ var init_component_registry_generated = __esm({
52512
54179
  init_Tabs();
52513
54180
  init_TagCloud();
52514
54181
  init_TagInput();
54182
+ init_TanksBoard();
52515
54183
  init_TeamCard();
52516
54184
  init_TeamOrganism();
52517
54185
  init_TextHighlight();
@@ -52550,7 +54218,7 @@ var init_component_registry_generated = __esm({
52550
54218
  init_WorldMapBoard();
52551
54219
  init_WorldMapTemplate();
52552
54220
  init_XPBar();
52553
- ThreeBoundary = class extends React85__default.Component {
54221
+ ThreeBoundary = class extends React86__default.Component {
52554
54222
  constructor() {
52555
54223
  super(...arguments);
52556
54224
  __publicField(this, "state", { failed: false });
@@ -52560,7 +54228,7 @@ var init_component_registry_generated = __esm({
52560
54228
  }
52561
54229
  render() {
52562
54230
  if (this.state.failed) {
52563
- return React85__default.createElement(
54231
+ return React86__default.createElement(
52564
54232
  "div",
52565
54233
  {
52566
54234
  "data-testid": "three-unavailable",
@@ -52599,6 +54267,7 @@ var init_component_registry_generated = __esm({
52599
54267
  "BattleTemplate": BattleTemplate,
52600
54268
  "BehaviorView": BehaviorView,
52601
54269
  "BloomQuizBlock": BloomQuizBlock,
54270
+ "BoardgameBoard": BoardgameBoard,
52602
54271
  "BookChapterView": BookChapterView,
52603
54272
  "BookCoverPage": BookCoverPage,
52604
54273
  "BookNavBar": BookNavBar,
@@ -52628,6 +54297,7 @@ var init_component_registry_generated = __esm({
52628
54297
  "Center": Center,
52629
54298
  "Chart": Chart,
52630
54299
  "ChartLegend": ChartLegend,
54300
+ "ChatBar": ChatBar,
52631
54301
  "Checkbox": Checkbox,
52632
54302
  "ChoiceButton": ChoiceButton,
52633
54303
  "CityBuilderBoard": CityBuilderBoard,
@@ -52688,6 +54358,7 @@ var init_component_registry_generated = __esm({
52688
54358
  "FileTree": FileTree,
52689
54359
  "FilterGroup": FilterGroup,
52690
54360
  "FilterPill": FilterPill,
54361
+ "FishingBoard": FishingBoard,
52691
54362
  "Flex": Flex,
52692
54363
  "FlipCard": FlipCard,
52693
54364
  "FlipContainer": FlipContainer,
@@ -52721,6 +54392,7 @@ var init_component_registry_generated = __esm({
52721
54392
  "HeroOrganism": HeroOrganism,
52722
54393
  "HeroSection": HeroSection,
52723
54394
  "HexStrategyBoard": HexStrategyBoard,
54395
+ "HolidayRunnerBoard": HolidayRunnerBoard,
52724
54396
  "Icon": Icon,
52725
54397
  "InfiniteScrollSentinel": InfiniteScrollSentinel,
52726
54398
  "Input": Input,
@@ -52745,11 +54417,13 @@ var init_component_registry_generated = __esm({
52745
54417
  "MarketingFooter": MarketingFooter,
52746
54418
  "MasterDetail": MasterDetail,
52747
54419
  "MasterDetailLayout": MasterDetailLayout,
54420
+ "MatchPuzzleBoard": MatchPuzzleBoard,
52748
54421
  "MatrixQuestion": MatrixQuestion,
52749
54422
  "MediaGallery": MediaGallery,
52750
54423
  "Menu": Menu,
52751
54424
  "Meter": Meter,
52752
54425
  "MiniMap": MiniMap,
54426
+ "MinigolfBoard": MinigolfBoard,
52753
54427
  "Modal": Modal,
52754
54428
  "ModalSlot": ModalSlot,
52755
54429
  "ModuleCard": ModuleCard,
@@ -52762,6 +54436,8 @@ var init_component_registry_generated = __esm({
52762
54436
  "PageHeader": PageHeader,
52763
54437
  "Pagination": Pagination,
52764
54438
  "PatternTile": PatternTile,
54439
+ "PinballBoard": PinballBoard,
54440
+ "PirateBoard": PirateBoard,
52765
54441
  "PlatformerBoard": PlatformerBoard,
52766
54442
  "PlatformerCanvas": PlatformerCanvas,
52767
54443
  "PlatformerTemplate": PlatformerTemplate,
@@ -52779,6 +54455,7 @@ var init_component_registry_generated = __esm({
52779
54455
  "QrScanner": QrScanner,
52780
54456
  "QuestTracker": QuestTracker,
52781
54457
  "QuizBlock": QuizBlock,
54458
+ "RacingBoard": RacingBoard,
52782
54459
  "Radio": Radio,
52783
54460
  "RangeSlider": RangeSlider,
52784
54461
  "ReflectionBlock": ReflectionBlock,
@@ -52812,7 +54489,10 @@ var init_component_registry_generated = __esm({
52812
54489
  "SimulatorBoard": SimulatorBoard,
52813
54490
  "Skeleton": Skeleton,
52814
54491
  "SocialProof": SocialProof,
54492
+ "SokobanBoard": SokobanBoard,
52815
54493
  "SortableList": SortableList,
54494
+ "SpaceShmupBoard": SpaceShmupBoard,
54495
+ "SpaceStationBoard": SpaceStationBoard,
52816
54496
  "Spacer": SpacerPattern,
52817
54497
  "SpacerPattern": SpacerPattern,
52818
54498
  "Sparkline": Sparkline,
@@ -52820,6 +54500,7 @@ var init_component_registry_generated = __esm({
52820
54500
  "Split": Split,
52821
54501
  "SplitPane": SplitPane,
52822
54502
  "SplitSection": SplitSection,
54503
+ "SportsBoard": SportsBoard,
52823
54504
  "Sprite": Sprite,
52824
54505
  "Stack": Stack,
52825
54506
  "StarRating": StarRating,
@@ -52835,6 +54516,7 @@ var init_component_registry_generated = __esm({
52835
54516
  "StatusEffect": StatusEffect,
52836
54517
  "StepFlow": StepFlow,
52837
54518
  "StepFlowOrganism": StepFlowOrganism,
54519
+ "SubagentTracePanel": SubagentTracePanel,
52838
54520
  "SvgBranch": SvgBranch,
52839
54521
  "SvgConnection": SvgConnection,
52840
54522
  "SvgFlow": SvgFlow,
@@ -52854,6 +54536,7 @@ var init_component_registry_generated = __esm({
52854
54536
  "Tabs": Tabs,
52855
54537
  "TagCloud": TagCloud,
52856
54538
  "TagInput": TagInput,
54539
+ "TanksBoard": TanksBoard,
52857
54540
  "TeamCard": TeamCard,
52858
54541
  "TeamOrganism": TeamOrganism,
52859
54542
  "TextHighlight": TextHighlight,
@@ -52911,7 +54594,7 @@ function SuspenseConfigProvider({
52911
54594
  config,
52912
54595
  children
52913
54596
  }) {
52914
- return React85__default.createElement(
54597
+ return React86__default.createElement(
52915
54598
  SuspenseConfigContext.Provider,
52916
54599
  { value: config },
52917
54600
  children
@@ -52922,8 +54605,8 @@ function getSlotFallback(slot, config) {
52922
54605
  const variant = SLOT_SKELETON_MAP[slot] ?? "text";
52923
54606
  return /* @__PURE__ */ jsx(Skeleton, { variant });
52924
54607
  }
52925
- function getComponentForPattern(patternType) {
52926
- const mapping = getComponentForPattern$1(patternType);
54608
+ function getComponentForPattern3(patternType) {
54609
+ const mapping = getComponentForPattern(patternType);
52927
54610
  if (!mapping) {
52928
54611
  return null;
52929
54612
  }
@@ -53401,7 +55084,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
53401
55084
  const key = `${parentId}-${index}-trait:${traitName}`;
53402
55085
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
53403
55086
  }
53404
- return /* @__PURE__ */ jsx(React85__default.Fragment, { children: child }, `${parentId}-${index}`);
55087
+ return /* @__PURE__ */ jsx(React86__default.Fragment, { children: child }, `${parentId}-${index}`);
53405
55088
  }
53406
55089
  if (!child || typeof child !== "object") return null;
53407
55090
  const childId = `${parentId}-${index}`;
@@ -53441,14 +55124,14 @@ function isPatternConfig(value) {
53441
55124
  if (value === null || value === void 0) return false;
53442
55125
  if (typeof value !== "object") return false;
53443
55126
  if (Array.isArray(value)) return false;
53444
- if (React85__default.isValidElement(value)) return false;
55127
+ if (React86__default.isValidElement(value)) return false;
53445
55128
  if (value instanceof Date) return false;
53446
55129
  if (typeof value === "function") return false;
53447
55130
  const record = value;
53448
- return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
55131
+ return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
53449
55132
  }
53450
55133
  function isPlainConfigObject(value) {
53451
- if (React85__default.isValidElement(value)) return false;
55134
+ if (React86__default.isValidElement(value)) return false;
53452
55135
  if (value instanceof Date) return false;
53453
55136
  const proto = Object.getPrototypeOf(value);
53454
55137
  return proto === Object.prototype || proto === null;
@@ -53553,7 +55236,8 @@ function SlotContentRenderer({
53553
55236
  entityDef = schemaCtx.entities.get(linkedEntity);
53554
55237
  }
53555
55238
  }
53556
- const PatternComponent = getComponentForPattern(content.pattern);
55239
+ const orbitalName = schemaCtx && content.sourceTrait !== void 0 ? schemaCtx.orbitalsByTrait.get(content.sourceTrait) : void 0;
55240
+ const PatternComponent = getComponentForPattern3(content.pattern);
53557
55241
  if (PatternComponent) {
53558
55242
  const childrenConfig = content.props.children;
53559
55243
  const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
@@ -53573,7 +55257,7 @@ function SlotContentRenderer({
53573
55257
  for (const slotKey of CONTENT_NODE_SLOTS) {
53574
55258
  const slotVal = restProps[slotKey];
53575
55259
  if (slotVal === void 0 || slotVal === null) continue;
53576
- if (React85__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
55260
+ if (React86__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
53577
55261
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
53578
55262
  nodeSlotOverrides[slotKey] = renderPatternChildren(
53579
55263
  slotVal,
@@ -53651,6 +55335,7 @@ function SlotContentRenderer({
53651
55335
  "data-orb-entity": content.entity,
53652
55336
  "data-orb-path": myPath,
53653
55337
  "data-orb-pattern": content.pattern,
55338
+ "data-orb-orbital": orbitalName,
53654
55339
  children: renderedChildren !== void 0 ? /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren }) : /* @__PURE__ */ jsx(PatternComponent, { ...finalProps })
53655
55340
  }
53656
55341
  );
@@ -53670,6 +55355,7 @@ function SlotContentRenderer({
53670
55355
  "data-orb-entity": content.entity,
53671
55356
  "data-orb-path": patternPath ?? "root",
53672
55357
  "data-orb-pattern": content.pattern,
55358
+ "data-orb-orbital": orbitalName,
53673
55359
  children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
53674
55360
  "Unknown pattern: ",
53675
55361
  content.pattern,